struct PowerData

Defined at line 41 of file ../../src/devices/power/drivers/fusb302/usb-pd-message-objects.h

Precursor for all PDO (Power Data Object) types.

Conceptually, the PDO in the USB PD spec is a sum type (like std::variant).

Values have 32 bits, and the top 2 bits are used as the type discriminant.

`PowerData` contains the logic for encoding and decoding the discriminant.

This high-level representation is defined in the introduction of usbpd3.1

usbpd3.1 6.4.1 "Capabilities Message". Subtypes are defined in the

subsections of usbpd3.1 6.4.1.2 "Source_Capabilities Message" and of 6.4.1.3

"Sink Capabilities Message"

Public Members

uint32_t bits

Public Methods

usb_pd::PowerData & set_supply_type (PowerSupplyType val)

Discriminant for PDO (Powey Data Object) types.

Defined at line 46 of file ../../src/devices/power/drivers/fusb302/usb-pd-message-objects.h

PowerSupplyType supply_type ()

Discriminant for PDO (Powey Data Object) types.

Defined at line 46 of file ../../src/devices/power/drivers/fusb302/usb-pd-message-objects.h

void PowerData (uint32_t bits)

Support explicit casting from uint32_t.

Defined at line 49 of file ../../src/devices/power/drivers/fusb302/usb-pd-message-objects.h

void PowerData (const PowerData & )

Value type, copying is allowed.

Defined at line 52 of file ../../src/devices/power/drivers/fusb302/usb-pd-message-objects.h

PowerData & operator= (const PowerData & )

Defined at line 53 of file ../../src/devices/power/drivers/fusb302/usb-pd-message-objects.h

void ~PowerData ()

Trivially destructible.

Defined at line 56 of file ../../src/devices/power/drivers/fusb302/usb-pd-message-objects.h

uint32_t operator unsigned int ()

Support explicit casting to uint32_t.

Defined at line 59 of file ../../src/devices/power/drivers/fusb302/usb-pd-message-objects.h

bool operator== (const PowerData & other)

In C++20, equality comparison can be defaulted.

Defined at line 62 of file ../../src/devices/power/drivers/fusb302/usb-pd-message-objects.h

bool operator!= (const PowerData & other)

Defined at line 63 of file ../../src/devices/power/drivers/fusb302/usb-pd-message-objects.h