aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/STM32/pwm_lld.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-12-11 15:55:45 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-12-11 15:55:45 +0000
commit59cd37eacb17e1ccb9b640fdbe172fd91a45f331 (patch)
tree07225624c34a975902a3d0f7865b0366752666eb /os/hal/platforms/STM32/pwm_lld.h
parentf2c5dc67eab392655278f2d34b31190dbf94bac1 (diff)
downloadChibiOS-59cd37eacb17e1ccb9b640fdbe172fd91a45f331.tar.gz
ChibiOS-59cd37eacb17e1ccb9b640fdbe172fd91a45f331.tar.bz2
ChibiOS-59cd37eacb17e1ccb9b640fdbe172fd91a45f331.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1415 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/pwm_lld.h')
-rw-r--r--os/hal/platforms/STM32/pwm_lld.h35
1 files changed, 32 insertions, 3 deletions
diff --git a/os/hal/platforms/STM32/pwm_lld.h b/os/hal/platforms/STM32/pwm_lld.h
index df332e322..92119a74c 100644
--- a/os/hal/platforms/STM32/pwm_lld.h
+++ b/os/hal/platforms/STM32/pwm_lld.h
@@ -33,15 +33,30 @@
/* Driver constants. */
/*===========================================================================*/
+/**
+ * @brief Number of PWM channels per PWM driver.
+ */
+#define PWM_CHANNELS 4
+
/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/
/**
- * @brief Number of PWM channels per PWM driver.
+ * @brief PWM1 driver enable switch.
+ * @details If set to @p TRUE the support for PWM1 is included.
+ * @note The default is @p TRUE.
*/
-#if !defined(PWM_CHANNELS) || defined(__DOXYGEN__)
-#define PWM_CHANNELS 1
+#if !defined(USE_STM32_PWM1) || defined(__DOXYGEN__)
+#define USE_STM32_PWM1 TRUE
+#endif
+
+/**
+ * @brief PWM1 interrupt priority level setting.
+ * @note @p BASEPRI_KERNEL >= @p STM32_PWM1_IRQ_PRIORITY > @p PRIORITY_PENDSV.
+ */
+#if !defined(STM32_PWM1_IRQ_PRIORITY) || defined(__DOXYGEN__)
+#define STM32_PWM1_IRQ_PRIORITY 0x80
#endif
/*===========================================================================*/
@@ -79,12 +94,25 @@ typedef struct {
*/
const PWMConfig *pd_config;
/* End of the mandatory fields.*/
+ /**
+ * @brief Bit mask of the enabled channels.
+ */
+ uint32_t pd_enabled_channels;
+ /**
+ * @brief Callback pointers.
+ */
+ pwmcallback_t pd_callbacks[PWM_CHANNELS];
} PWMDriver;
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
+/** @cond never*/
+#if defined(USE_STM32_PWM1)
+extern PWMDriver PWMD1;
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -101,6 +129,7 @@ extern "C" {
#ifdef __cplusplus
}
#endif
+/** @endcond*/
#endif /* CH_HAL_USE_PWM */