Files
OpenCellular/include/power_led.h
David Hendricks 1bedd55970 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>
2012-07-02 15:26:02 -07:00

35 lines
822 B
C

/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Power LED control for Chrome EC */
#ifndef __CROS_EC_POWER_LED_H
#define __CROS_EC_POWER_LED_H
#include "common.h"
enum powerled_color {
POWERLED_OFF = 0,
POWERLED_RED,
POWERLED_YELLOW,
POWERLED_GREEN,
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 */