|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
USB-PD 16-bit message header wrapper. More...
#include <UsbPdDefs.hpp>
Public Member Functions | |
| Header ()=default | |
| Construct an empty header. | |
| Header (uint16_t v) | |
| Construct a header from a raw value. | |
| uint8_t | msgType () const |
| Return the USB-PD message type field. | |
| bool | dataRoleDfp () const |
| Return true when the data role field is DFP. | |
| uint8_t | specRev () const |
| Return the USB-PD specification revision field. | |
| bool | powerRoleSource () const |
| Return true when the power role field is Source. | |
| uint8_t | msgId () const |
| Return the USB-PD message ID field. | |
| uint8_t | objCount () const |
| Return the number of 32-bit data objects in this message. | |
| bool | extended () const |
| Return true when the extended message bit is set. | |
| void | setMsgType (uint8_t v) |
| Set the USB-PD message type field. | |
| void | setDataRoleDfp (bool dfp) |
| Set the data role field. | |
| void | setSpecRev (uint8_t r) |
| Set the USB-PD specification revision field. | |
| void | setPowerRoleSource (bool src) |
| Set the power role field. | |
| void | setMsgId (uint8_t id) |
| Set the USB-PD message ID field. | |
| void | setObjCount (uint8_t n) |
| Set the number of 32-bit data objects. | |
| void | setExtended (bool ex) |
| Set or clear the extended message bit. | |
Public Attributes | |
| uint16_t | raw = 0 |
| Raw 16-bit header value in little-endian host order. | |
USB-PD 16-bit message header wrapper.
Definition at line 91 of file UsbPdDefs.hpp.
|
default |
Construct an empty header.
|
inlineexplicit |
Construct a header from a raw value.
| v | Raw 16-bit header value. |
Definition at line 102 of file UsbPdDefs.hpp.
|
inline |
Return true when the data role field is DFP.
Definition at line 111 of file UsbPdDefs.hpp.
References raw.
|
inline |
Return true when the extended message bit is set.
Definition at line 141 of file UsbPdDefs.hpp.
References raw.
|
inline |
|
inline |
Return the USB-PD message type field.
Definition at line 105 of file UsbPdDefs.hpp.
References raw.
Referenced by AXP517PdNegotiator::handleIrq(), and AXP517PdNegotiator::parseSourceCaps().
|
inline |
Return the number of 32-bit data objects in this message.
Definition at line 135 of file UsbPdDefs.hpp.
References raw.
Referenced by AXP517PdNegotiator::handleIrq(), and AXP517PdNegotiator::parseSourceCaps().
|
inline |
Return true when the power role field is Source.
Definition at line 123 of file UsbPdDefs.hpp.
References raw.
|
inline |
|
inline |
Set or clear the extended message bit.
Definition at line 183 of file UsbPdDefs.hpp.
References raw.
Referenced by usbpd::buildControlHeader(), and usbpd::buildDataHeader().
|
inline |
|
inline |
|
inline |
Set the number of 32-bit data objects.
Definition at line 177 of file UsbPdDefs.hpp.
References raw.
|
inline |
|
inline |
Set the USB-PD specification revision field.
Definition at line 159 of file UsbPdDefs.hpp.
References raw.
|
inline |
Return the USB-PD specification revision field.
Definition at line 117 of file UsbPdDefs.hpp.
References raw.
| uint16_t usbpd::Header::raw = 0 |
Raw 16-bit header value in little-endian host order.
Definition at line 93 of file UsbPdDefs.hpp.
Referenced by dataRoleDfp(), extended(), msgId(), msgType(), objCount(), powerRoleSource(), setDataRoleDfp(), setExtended(), setMsgId(), setMsgType(), setObjCount(), setPowerRoleSource(), setSpecRev(), and specRev().