diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-12-17 15:40:32 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-12-17 15:40:32 +0000 |
commit | a8863f265d188eb769257788beba012f672c909d (patch) | |
tree | 8976b8ec80f7641cea5a8183a818dcd400effc31 /os/hal/platforms/STM32/pwm_lld.h | |
parent | 494cd0f0953d131bb31dcda508abfbd4eaef9899 (diff) | |
download | ChibiOS-a8863f265d188eb769257788beba012f672c909d.tar.gz ChibiOS-a8863f265d188eb769257788beba012f672c909d.tar.bz2 ChibiOS-a8863f265d188eb769257788beba012f672c909d.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1426 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/pwm_lld.h')
-rw-r--r-- | os/hal/platforms/STM32/pwm_lld.h | 51 |
1 files changed, 22 insertions, 29 deletions
diff --git a/os/hal/platforms/STM32/pwm_lld.h b/os/hal/platforms/STM32/pwm_lld.h index a48a93619..d44c1fdbf 100644 --- a/os/hal/platforms/STM32/pwm_lld.h +++ b/os/hal/platforms/STM32/pwm_lld.h @@ -74,6 +74,24 @@ typedef uint8_t pwmchannel_t; typedef uint16_t pwmcnt_t;
/**
+ * @brief PWM driver channel configuration structure.
+ * @note It could be empty on some architectures.
+ */
+typedef struct {
+ /**
+ * @brief Channel active logic level.
+ */
+ pwmmode_t pcc_mode;
+ /**
+ * @brief Channel callback pointer.
+ * @details This callback is invoked on the channel compare event. If set to
+ * @p NULL then the callback is disabled.
+ */
+ pwmcallback_t pcc_callback;
+ /* End of the mandatory fields.*/
+} PWMChannelConfig;
+
+/**
* @brief PWM driver configuration structure.
* @note It could be empty on some architectures.
*/
@@ -84,6 +102,10 @@ typedef struct { * @p NULL then the callback is disabled.
*/
pwmcallback_t pc_callback;
+ /**
+ * @brief Channels configurations.
+ */
+ PWMChannelConfig pc_channels[PWM_CHANNELS];
/* End of the mandatory fields.*/
/**
* @brief TIM PSC (pre-scaler) register initialization data.
@@ -94,11 +116,6 @@ typedef struct { */
uint16_t pc_arr;
/**
- * @brief TIM CR1 register initialization data.
- * @note The value of this field should normally be equal to zero.
- */
- uint16_t pc_cr1;
- /**
* @brief TIM CR2 register initialization data.
* @note The value of this field should normally be equal to zero.
*/
@@ -106,24 +123,6 @@ typedef struct { } PWMConfig;
/**
- * @brief PWM driver channel configuration structure.
- * @note It could be empty on some architectures.
- */
-typedef struct {
- /**
- * @brief Channel idle logic level. - */
- pwmmode_t pcc_mode;
- /**
- * @brief Channel callback pointer.
- * @details This callback is invoked on the channel compare event. If set to
- * @p NULL then the callback is disabled. - */
- pwmcallback_t pcc_callback;
- /* End of the mandatory fields.*/
-} PWMChannelConfig;
-
-/**
* @brief Structure representing a PWM driver.
*/
typedef struct {
@@ -135,10 +134,6 @@ typedef struct { * @brief Current driver configuration data.
*/
const PWMConfig *pd_config;
- /**
- * @brief Current channel configurations. - */
- const PWMChannelConfig *pd_channel_configs[PWM_CHANNELS];
/* End of the mandatory fields.*/
/**
* @brief Bit mask of the enabled channels. @@ -165,8 +160,6 @@ extern "C" { void pwm_lld_init(void);
void pwm_lld_start(PWMDriver *pwmp);
void pwm_lld_stop(PWMDriver *pwmp);
- bool_t pwm_lld_is_enabled(PWMDriver *pwmp, pwmchannel_t channel);
- void pwm_lld_setup_channel(PWMDriver *pwmp, pwmchannel_t channel);
void pwm_lld_enable_channel(PWMDriver *pwmp,
pwmchannel_t channel,
pwmcnt_t width);
|