app_driver.cpp
Board driver glue for the ESP32 Matter port: button input, WS2812 lock-status LED, and the…
Overview
Board driver glue for the ESP32 Matter port: button input, WS2812 lock-status LED, and the Matter attribute-update hook wired into the app's driver layer.
depends on app_priv.h lock_led.h
API
Fesp_err_t app_driver_attribute_update(app_driver_handle_t driver_handle, uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val)
Attribute-update hook for the app driver. Currently a stub: always returns ESP_OK without applying val to the given endpoint/cluster/attribute.
Fapp_driver_handle_t app_driver_button_init()
Initialize the board's buttons via the BSP button driver and return a handle to the first button. Caller must treat the returned handle as opaque; only one button (index 0) is exposed even if BSP_BUTTON_NUM is larger.
Fesp_err_t app_driver_led_init()
Initialize the single-pixel WS2812 lock status LED over RMT. On failure, logs the error, leaves the internal LED handle NULL (so app_driver_led_lock_state becomes a silent no-op), and returns the led_strip_new_rmt_device error code. On success, clears the LED and returns that call's result.
Fvoid app_driver_led_lock_state(bool locked, bool aliro)
Set the lock status LED color to reflect lock and Aliro state. No-op if app_driver_led_init failed or was never called. Looks up the RGB color for the given (locked, aliro) combination and pushes it to the single pixel.