Added new pwmIsChannelEnabledI() API to the PWM driver, implemented in the STM32 driver.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5554 35acf78f-673a-0410-8e92-d51de3d6d3f4
master
gdisirio 2013-04-07 07:57:43 +00:00
parent 3adcb46879
commit d009502eb4
3 changed files with 27 additions and 0 deletions

View File

@ -211,6 +211,18 @@ typedef void (*pwmcallback_t)(PWMDriver *pwmp);
*/ */
#define pwmDisableChannelI(pwmp, channel) \ #define pwmDisableChannelI(pwmp, channel) \
pwm_lld_disable_channel(pwmp, channel) pwm_lld_disable_channel(pwmp, channel)
/**
* @brief Returns a PWM channel status.
* @pre The PWM unit must have been activated using @p pwmStart().
*
* @param[in] pwmp pointer to a @p PWMDriver object
* @param[in] channel PWM channel identifier (0...PWM_CHANNELS-1)
*
* @iclass
*/
#define pwmIsChannelEnabledI(pwmp, channel) \
pwm_lld_is_channel_enabled(pwmp, channel)
/** @} */ /** @} */
/*===========================================================================*/ /*===========================================================================*/

View File

@ -406,6 +406,19 @@ struct PWMDriver {
#define pwm_lld_change_period(pwmp, period) \ #define pwm_lld_change_period(pwmp, period) \
((pwmp)->tim->ARR = (uint16_t)((period) - 1)) ((pwmp)->tim->ARR = (uint16_t)((period) - 1))
/**
* @brief Returns a PWM channel status.
* @pre The PWM unit must have been activated using @p pwmStart().
*
* @param[in] pwmp pointer to a @p PWMDriver object
* @param[in] channel PWM channel identifier (0...PWM_CHANNELS-1)
*
* @notapi
*/
#define pwm_lld_is_channel_enabled(pwmp, channel) \
((pwmp->tim->CCR[channel] == 0) && \
((pwmp->tim->DIER & (2 << channel)) == 0))
/*===========================================================================*/ /*===========================================================================*/
/* External declarations. */ /* External declarations. */
/*===========================================================================*/ /*===========================================================================*/

View File

@ -138,6 +138,8 @@
(backported to 2.4.3). (backported to 2.4.3).
- FIX: Fixed wrong SPI path in platform_f105_f107.mk (bug 3598151). - FIX: Fixed wrong SPI path in platform_f105_f107.mk (bug 3598151).
- FIX: Fixed PHY powerdown issues not fixed (bug 3596911). - FIX: Fixed PHY powerdown issues not fixed (bug 3596911).
- NEW: Added new pwmIsChannelEnabledI() API to the PWM driver, implemented
in the STM32 driver.
- NEW: Added support for timers 6, 7, 9, 11, 12, 14 to the STM32 GPT driver. - NEW: Added support for timers 6, 7, 9, 11, 12, 14 to the STM32 GPT driver.
- NEW: Added support for timer 9 to the STM32 PWM driver. - NEW: Added support for timer 9 to the STM32 PWM driver.
- NEW: Relicensed parts of the distribution tree under the Apache 2.0 - NEW: Relicensed parts of the distribution tree under the Apache 2.0