diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2015-12-01 13:49:15 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-12-04 01:20:33 -0800 |
commit | 99c186b70109f387639acb6d8df5a37423d8f4bb (patch) | |
tree | 21aef832a98994790e4e892687636c47726a8ae5 /include/pwm.h | |
parent | 743a9ea7cd39dffc4f1dc104803f767ba774372b (diff) | |
download | chrome-ec-99c186b70109f387639acb6d8df5a37423d8f4bb.tar.gz |
stm32: pwm: Allow configuration of pwm frequency + complementary outputs
Allow boards to customize both the PWM frequency / period and the
enabling of complementary output signals.
BUG=chrome-os-partner:48044
TEST=Manual with snoball w/ subsequent commit. Run `pwm <ch> 50` for
each channel, verify with `adc` that each PD output voltage is
approximately VBUCK / 2.
BRANCH=None
Change-Id: I61cbb4a5b656f41ec7cec59339f5247902256295
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/315141
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/pwm.h')
-rw-r--r-- | include/pwm.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/pwm.h b/include/pwm.h index 66610b9240..39835012e9 100644 --- a/include/pwm.h +++ b/include/pwm.h @@ -35,16 +35,21 @@ int pwm_get_duty(enum pwm_channel ch); /** * PWM output signal is inverted, so 100% duty means always low */ -#define PWM_CONFIG_ACTIVE_LOW (1 << 0) +#define PWM_CONFIG_ACTIVE_LOW (1 << 0) /** * PWM channel has a fan controller with a tach input and can auto-adjust * its duty cycle to produce a given fan RPM. */ -#define PWM_CONFIG_HAS_RPM_MODE (1 << 1) +#define PWM_CONFIG_HAS_RPM_MODE (1 << 1) /** * PWM clock select alternate source. The actual clock and alternate * source are chip dependent. */ -#define PWM_CONFIG_ALT_CLOCK (1 << 2) +#define PWM_CONFIG_ALT_CLOCK (1 << 2) +/** + * PWM channel has a complementary output signal which should be enabled in + * addition to the primary output. + */ +#define PWM_CONFIG_COMPLEMENTARY_OUTPUT (1 << 3) #endif /* __CROS_EC_PWM_H */ |