| #include "led.h" |
| #include "i2c_led_driver.h" |
| |
| #define LED_NUM 2 |
| #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) |
| |
| LED leds[LED_NUM] = { |
| { |
| false, |
| 0, |
| 0x29, |
| LED_DRIVER_TYPE_LP5018, |
| }, |
| { |
| false, |
| 0, |
| 0x2A, |
| LED_DRIVER_TYPE_LP5018, |
| } |
| }; |
| |
| static int leds_inited = 0; |
| |
| static void init_leds() { |
| if (0 == leds_inited) { |
| i2c_led_init(leds, LED_NUM); |
| leds_inited = 1; |
| } |
| |
| return; |
| } |
| |
| void detect_led_driver(int *led_driver_type) { |
| *led_driver_type = LED_DRIVER_TYPE_LP5018; |
| } |
| |
| void cold_boot_show_led_init_boot(int led_driver_type) { |
| if (led_driver_type != LED_DRIVER_TYPE_LP5018) { |
| return; |
| } |
| init_leds(); |
| |
| // See go/vento-schematics for led channel mapping |
| unsigned char led_frame_29[32] = { |
| 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, |
| 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 0x2D, 0x00, 0x00, 0x00, 0x00, 0x2D, |
| 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
| }; |
| |
| i2c_led_show_frame(0, led_frame_29, ARRAY_SIZE(led_frame_29)); |
| } |
| |
| void cold_boot_show_led_done_boot() { |
| // Vento underglow LEDs will stay a constant color and brightness |
| // throughout the bootloader |
| } |
| |