summaryrefslogtreecommitdiff
path: root/include/pwm.h
diff options
context:
space:
mode:
authorDavid Schneider <dnschneid@chromium.org>2016-12-01 18:48:44 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-12-05 16:43:18 -0800
commit3d4bb5f64917ab25f3538a8ec8c6410f41f46afd (patch)
treeda4467beb569ebdca757877c01c5d0c99ed3b867 /include/pwm.h
parentf66113247a7fb0f8fcc015a50b85137d1ab044a1 (diff)
downloadchrome-ec-3d4bb5f64917ab25f3538a8ec8c6410f41f46afd.tar.gz
gru: control LEDs by changing frequency
gru has circuitrythat selects the charge LED color based on the frequency of the PWM. By adjusting the PWM frequency instead of just the duty, we gain more control over the brightness of the charge LED. BUG=chrome-os-partner:54155 BRANCH=gru TEST=activate each LED in turn and confirm color and brightness Change-Id: Ie653125a528595c1ec68aea4d02cb70595a1b151 Signed-off-by: David Schneider <dnschneid@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/415517 Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'include/pwm.h')
-rw-r--r--include/pwm.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/pwm.h b/include/pwm.h
index 9c349d1fb6..ee731a597e 100644
--- a/include/pwm.h
+++ b/include/pwm.h
@@ -20,6 +20,12 @@ void pwm_enable(enum pwm_channel ch, int enabled);
int pwm_get_enabled(enum pwm_channel ch);
/**
+ * Set PWM channel frequency (Hz).
+ * PWM will be disabled until the duty is set.
+ */
+void pwm_set_freq(enum pwm_channel ch, uint32_t freq);
+
+/**
* Set PWM channel duty cycle (0-65535).
*/
void pwm_set_raw_duty(enum pwm_channel ch, uint16_t duty);