Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
USB Power Delivery Power Data Objects

Macros for building USB Power Delivery Power Data Objects (PDOs). More...

Macros

#define PDO_FIXED(mv, ma, flags)
 Build a Fixed Supply PDO.
#define VSAFE5V   5000
 vSafe5V, the default 5V supply, in millivolts
#define PDO_BATT(min_mv, max_mv, max_mw)
 Build a Battery Supply PDO.
#define PDO_VAR(min_mv, max_mv, max_ma)
 Build a Variable Supply (non-Battery) PDO.
#define PDO_PPS_APDO(min_mv, max_mv, max_ma)
 Build a Programmable Power Supply (PPS) Augmented PDO.

Fixed Supply PDO capability flags

#define PDO_FIXED_DUAL_ROLE   (1 << 29)
 Power role swap supported.
#define PDO_FIXED_SUSPEND   (1 << 28)
 USB Suspend supported (Source).
#define PDO_FIXED_HIGHER_CAP   (1 << 28)
 Requires more than vSafe5V (Sink).
#define PDO_FIXED_EXTPOWER   (1 << 27)
 Externally powered.
#define PDO_FIXED_USB_COMM   (1 << 26)
 USB communications capable.
#define PDO_FIXED_DATA_SWAP   (1 << 25)
 Data role swap supported.

Detailed Description

Macros for building USB Power Delivery Power Data Objects (PDOs).

Helper macros used to build the 32-bit Power Data Objects (PDOs) exchanged during USB Power Delivery Source/Sink capability negotiation, as defined by the USB Power Delivery specification. They are primarily intended to be used from devicetree to describe the capabilities of a USB-C port, for example:

source-pdos = <PDO_FIXED(5000, 100, PDO_FIXED_DUAL_ROLE)>;

Macro Definition Documentation

◆ PDO_BATT

#define PDO_BATT ( min_mv,
max_mv,
max_mw )

#include <zephyr/dt-bindings/usb-c/pd.h>

Value:
(PDO_TYPE(PDO_TYPE_BATT) | PDO_BATT_MIN_VOLT(min_mv) | \
PDO_BATT_MAX_VOLT(max_mv) | PDO_BATT_MAX_POWER(max_mw))

Build a Battery Supply PDO.

Parameters
min_mvMinimum voltage in millivolts
max_mvMaximum voltage in millivolts
max_mwMaximum power in milliwatts
Returns
32-bit Battery Supply PDO

◆ PDO_FIXED

#define PDO_FIXED ( mv,
ma,
flags )

#include <zephyr/dt-bindings/usb-c/pd.h>

Value:
(PDO_TYPE(PDO_TYPE_FIXED) | (flags) | \
PDO_FIXED_VOLT(mv) | PDO_FIXED_CURR(ma))
flags
Definition parser.h:97

Build a Fixed Supply PDO.

Parameters
mvOutput voltage in millivolts
maMaximum output current in milliamps
flagsBitwise OR of the PDO_FIXED_* capability flags
Returns
32-bit Fixed Supply PDO

◆ PDO_FIXED_DATA_SWAP

#define PDO_FIXED_DATA_SWAP   (1 << 25)

#include <zephyr/dt-bindings/usb-c/pd.h>

Data role swap supported.

◆ PDO_FIXED_DUAL_ROLE

#define PDO_FIXED_DUAL_ROLE   (1 << 29)

#include <zephyr/dt-bindings/usb-c/pd.h>

Power role swap supported.

◆ PDO_FIXED_EXTPOWER

#define PDO_FIXED_EXTPOWER   (1 << 27)

#include <zephyr/dt-bindings/usb-c/pd.h>

Externally powered.

◆ PDO_FIXED_HIGHER_CAP

#define PDO_FIXED_HIGHER_CAP   (1 << 28)

#include <zephyr/dt-bindings/usb-c/pd.h>

Requires more than vSafe5V (Sink).

◆ PDO_FIXED_SUSPEND

#define PDO_FIXED_SUSPEND   (1 << 28)

#include <zephyr/dt-bindings/usb-c/pd.h>

USB Suspend supported (Source).

◆ PDO_FIXED_USB_COMM

#define PDO_FIXED_USB_COMM   (1 << 26)

#include <zephyr/dt-bindings/usb-c/pd.h>

USB communications capable.

◆ PDO_PPS_APDO

#define PDO_PPS_APDO ( min_mv,
max_mv,
max_ma )

#include <zephyr/dt-bindings/usb-c/pd.h>

Value:
(PDO_TYPE(PDO_TYPE_APDO) | PDO_APDO_TYPE(APDO_TYPE_PPS) | \
PDO_PPS_APDO_MIN_VOLT(min_mv) | PDO_PPS_APDO_MAX_VOLT(max_mv) | \
PDO_PPS_APDO_MAX_CURR(max_ma))

Build a Programmable Power Supply (PPS) Augmented PDO.

Parameters
min_mvMinimum voltage in millivolts
max_mvMaximum voltage in millivolts
max_maMaximum current in milliamps
Returns
32-bit PPS APDO

◆ PDO_VAR

#define PDO_VAR ( min_mv,
max_mv,
max_ma )

#include <zephyr/dt-bindings/usb-c/pd.h>

Value:
(PDO_TYPE(PDO_TYPE_VAR) | PDO_VAR_MIN_VOLT(min_mv) | \
PDO_VAR_MAX_VOLT(max_mv) | PDO_VAR_MAX_CURR(max_ma))

Build a Variable Supply (non-Battery) PDO.

Parameters
min_mvMinimum voltage in millivolts
max_mvMaximum voltage in millivolts
max_maMaximum current in milliamps
Returns
32-bit Variable Supply PDO

◆ VSAFE5V

#define VSAFE5V   5000

#include <zephyr/dt-bindings/usb-c/pd.h>

vSafe5V, the default 5V supply, in millivolts