aboutsummaryrefslogtreecommitdiff
path: root/include/libopencm3
diff options
context:
space:
mode:
authorPiotr Esden-Tempski2011-01-28 15:11:52 -0800
committerPiotr Esden-Tempski2011-01-28 15:11:52 -0800
commita1bd228c87d1b73f6cfecf000eec0a8765a11b01 (patch)
tree22dbeb035df8b1d8709f061190bbcf15eac76d49 /include/libopencm3
parent5975750e5e22ffb047303a1e1e7700012e09e18c (diff)
Replaced OC mode selection with an enum, makes it simpler to use.
Diffstat (limited to 'include/libopencm3')
-rw-r--r--include/libopencm3/stm32/timer.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/libopencm3/stm32/timer.h b/include/libopencm3/stm32/timer.h
index 603a97c..1cd5d0e 100644
--- a/include/libopencm3/stm32/timer.h
+++ b/include/libopencm3/stm32/timer.h
@@ -828,7 +828,7 @@
/* --- TIMx convenience defines -------------------------------------------- */
-/* Capture Compare channel designators */
+/* Output Compare channel designators */
enum tim_oc_id {
TIM_OC1=0,
TIM_OC1N,
@@ -839,6 +839,18 @@ enum tim_oc_id {
TIM_OC4,
};
+/* Output Compare mode designators */
+enum tim_oc_mode {
+ TIM_OCM_FROZEN,
+ TIM_OCM_ACTIVE,
+ TIM_OCM_INACTIVE,
+ TIM_OCM_TOGGLE,
+ TIM_OCM_FORCE_LOW,
+ TIM_OCM_FORCE_HIGH,
+ TIM_OCM_PWM1,
+ TIM_OCM_PWM2,
+};
+
/* --- TIM functions ------------------------------------------------------- */
void timer_set_mode(u32 timer_peripheral, u8 clock_div,
u8 alignment, u8 direction);
@@ -872,7 +884,7 @@ void timer_enable_oc_clear(u32 timer_peripheral, enum tim_oc_id oc_id);
void timer_disable_oc_clear(u32 timer_peripheral, enum tim_oc_id oc_id);
void timer_set_oc_fast_mode(u32 timer_peripheral, enum tim_oc_id oc_id);
void timer_set_oc_slow_mode(u32 timer_peripheral, enum tim_oc_id oc_id);
-void timer_set_oc_mode(u32 timer_peripheral, enum tim_oc_id oc_id, u32 mode);
+void timer_set_oc_mode(u32 timer_peripheral, enum tim_oc_id oc_id, enum tim_oc_mode oc_mode);
void timer_enable_oc_preload(u32 timer_peripheral, enum tim_oc_id oc_id);
void timer_disable_oc_preload(u32 timer_peripheral, enum tim_oc_id oc_id);
void timer_set_oc_polarity_high(u32 timer_peripheral, enum tim_oc_id oc_id);