Add support for led driver in PHY.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2025-09-01 21:27:15 +02:00
parent 365567d12b
commit da44fd21d4
2 changed files with 27 additions and 1 deletions

View File

@@ -70,6 +70,11 @@ int phy_serialize_data(const phy_data_t *phy, uint8_t *data, uint16_t *len) {
*p++ = 1;
*p++ = phy->enabled_usb_itf;
}
if (phy->led_driver_present) {
*p++ = PHY_LED_DRIVER;
*p++ = 1;
*p++ = phy->led_driver;
}
*len = p - data;
return PICOKEY_OK;
@@ -141,6 +146,12 @@ int phy_unserialize_data(const uint8_t *data, uint16_t len, phy_data_t *phy) {
phy->enabled_usb_itf_present = true;
}
break;
case PHY_LED_DRIVER:
if (tlen == 1) {
phy->led_driver = *p++;
phy->led_driver_present = true;
}
break;
default:
p += tlen;
break;