diff options
author | David Hendricks <dhendrix@chromium.org> | 2012-06-25 13:51:46 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-07-02 15:26:02 -0700 |
commit | 1bedd55970387fd019c5a6fd368b1576606e8563 (patch) | |
tree | e5ecb8d1d60d90ad1a87adcb3f0232294fd9ad73 /include | |
parent | bb27b96f13541f8df5fd8c210a619705c2c24d26 (diff) | |
download | chrome-ec-1bedd55970387fd019c5a6fd368b1576606e8563.tar.gz |
Daisy/Snow: Drive power LED with PWM
This drives the power LED for Snow (PB3) using TIM2 in PWM mode.
Since timer setup and manipulation is STM32-specific, the power LED
logic moved to to chip/stm32/power_led.c.
This also adds a "powerled" console command for testing.
Signed-off-by: David Hendricks <dhendrix@chromium.org>
BUG=chrome-os-partner:10647
TEST=Tested on Snow with powerled command, compiled for Daisy
Change-Id: I5a7dc20d201ea058767e3e76d54e7c8567a3b83c
Reviewed-on: https://gerrit.chromium.org/gerrit/26267
Commit-Ready: David Hendricks <dhendrix@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Tested-by: David Hendricks <dhendrix@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/power_led.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/power_led.h b/include/power_led.h index 9c8fa49f86..9301a5fdf5 100644 --- a/include/power_led.h +++ b/include/power_led.h @@ -18,7 +18,17 @@ enum powerled_color { POWERLED_COLOR_COUNT /* Number of colors, not a color itself */ }; +enum powerled_state { + POWERLED_STATE_OFF, + POWERLED_STATE_ON, + POWERLED_STATE_SUSPEND, + POWERLED_STATE_COUNT +}; + /* Set the power adapter LED to the specified color. */ int powerled_set(enum powerled_color color); +/* Set the power LED according to the specified state. */ +void powerled_set_state(enum powerled_state state); + #endif /* __CROS_EC_POWER_LED_H */ |