|
@@ -110,6 +110,25 @@ static void print_src_fixed_pdo(BaseSequentialStream *chp, uint32_t pdo)
|
110
|
110
|
chprintf(chp, "\ti: %d.%02d A\r\n", PD_PDI_A(tmp), PD_PDI_CA(tmp));
|
111
|
111
|
}
|
112
|
112
|
|
|
113
|
+static void print_src_pps_apdo(BaseSequentialStream *chp, uint32_t pdo)
|
|
114
|
+{
|
|
115
|
+ int tmp;
|
|
116
|
+
|
|
117
|
+ chprintf(chp, "pps\r\n");
|
|
118
|
+
|
|
119
|
+ /* Minimum voltage */
|
|
120
|
+ tmp = (pdo & PD_APDO_SRC_PPS_MIN_VOLTAGE) >> PD_APDO_SRC_PPS_MIN_VOLTAGE_SHIFT;
|
|
121
|
+ chprintf(chp, "\tvmin: %d.%02d V\r\n", PD_PAV_V(tmp), PD_PAV_CV(tmp));
|
|
122
|
+
|
|
123
|
+ /* Maximum voltage */
|
|
124
|
+ tmp = (pdo & PD_APDO_SRC_PPS_MAX_VOLTAGE) >> PD_APDO_SRC_PPS_MAX_VOLTAGE_SHIFT;
|
|
125
|
+ chprintf(chp, "\tvmax: %d.%02d V\r\n", PD_PAV_V(tmp), PD_PAV_CV(tmp));
|
|
126
|
+
|
|
127
|
+ /* Maximum current */
|
|
128
|
+ tmp = (pdo & PD_APDO_SRC_PPS_CURRENT) >> PD_APDO_SRC_PPS_CURRENT_SHIFT;
|
|
129
|
+ chprintf(chp, "\ti: %d.%02d A\r\n", PD_PAI_A(tmp), PD_PAI_CA(tmp));
|
|
130
|
+}
|
|
131
|
+
|
113
|
132
|
static void print_src_pdo(BaseSequentialStream *chp, uint32_t pdo, uint8_t index)
|
114
|
133
|
{
|
115
|
134
|
/* If we have a positive index, print a label for the PDO */
|
|
@@ -120,6 +139,9 @@ static void print_src_pdo(BaseSequentialStream *chp, uint32_t pdo, uint8_t index
|
120
|
139
|
/* Select the appropriate method for printing the PDO itself */
|
121
|
140
|
if ((pdo & PD_PDO_TYPE) == PD_PDO_TYPE_FIXED) {
|
122
|
141
|
print_src_fixed_pdo(chp, pdo);
|
|
142
|
+ } else if ((pdo & PD_PDO_TYPE) == PD_PDO_TYPE_AUGMENTED
|
|
143
|
+ && (pdo & PD_APDO_TYPE) == PD_APDO_TYPE_PPS) {
|
|
144
|
+ print_src_pps_apdo(chp, pdo);
|
123
|
145
|
} else {
|
124
|
146
|
/* Unknown PDO, just print it as hex */
|
125
|
147
|
chprintf(chp, "%08X\r\n", pdo);
|