From a8863f265d188eb769257788beba012f672c909d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 17 Dec 2009 15:40:32 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1426 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/pwm_lld.h | 51 +++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 29 deletions(-) (limited to 'os/hal/platforms/STM32/pwm_lld.h') 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 @@ -73,6 +73,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. @@ -93,11 +115,6 @@ typedef struct { * @brief TIM ARR (auto-reload) register initialization data. */ 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. @@ -105,24 +122,6 @@ typedef struct { uint16_t pc_cr2; } 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. */ @@ -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); -- cgit v1.2.3