Added I-Class functions to the PWM driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7676 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
c0589fa3d1
commit
6eb46acf16
|
@ -226,6 +226,58 @@ typedef void (*pwmcallback_t)(PWMDriver *pwmp);
|
|||
*/
|
||||
#define pwmIsChannelEnabledI(pwmp, channel) \
|
||||
((bool)((pwmp)->enabled & (1 << (channel))))
|
||||
|
||||
/**
|
||||
* @brief Enables the periodic activation edge notification.
|
||||
* @pre The PWM unit must have been activated using @p pwmStart().
|
||||
* @note If the notification is already enabled then the call has no effect.
|
||||
*
|
||||
* @param[in] pwmp pointer to a @p PWMDriver object
|
||||
*
|
||||
* @iclass
|
||||
*/
|
||||
#define pwmEnablePeriodicNotificationI(pwmp) \
|
||||
pwm_lld_enable_periodic_notification(pwmp)
|
||||
|
||||
/**
|
||||
* @brief Disables the periodic activation edge notification.
|
||||
* @pre The PWM unit must have been activated using @p pwmStart().
|
||||
* @note If the notification is already disabled then the call has no effect.
|
||||
*
|
||||
* @param[in] pwmp pointer to a @p PWMDriver object
|
||||
*
|
||||
* @iclass
|
||||
*/
|
||||
#define pwmDisablePeriodicNotificationI(pwmp) \
|
||||
pwm_lld_disable_periodic_notification(pwmp)
|
||||
|
||||
/**
|
||||
* @brief Enables a channel de-activation edge notification.
|
||||
* @pre The PWM unit must have been activated using @p pwmStart().
|
||||
* @pre The channel must have been activated using @p pwmEnableChannel().
|
||||
* @note If the notification is already enabled then the call has no effect.
|
||||
*
|
||||
* @param[in] pwmp pointer to a @p PWMDriver object
|
||||
* @param[in] channel PWM channel identifier (0...channels-1)
|
||||
*
|
||||
* @iclass
|
||||
*/
|
||||
#define pwmEnableChannelNotificationI(pwmp, channel) \
|
||||
pwm_lld_enable_channel_notification(pwmp, channel)
|
||||
|
||||
/**
|
||||
* @brief Disables a channel de-activation edge notification.
|
||||
* @pre The PWM unit must have been activated using @p pwmStart().
|
||||
* @pre The channel must have been activated using @p pwmEnableChannel().
|
||||
* @note If the notification is already disabled then the call has no effect.
|
||||
*
|
||||
* @param[in] pwmp pointer to a @p PWMDriver object
|
||||
* @param[in] channel PWM channel identifier (0...channels-1)
|
||||
*
|
||||
* @iclass
|
||||
*/
|
||||
#define pwmDisableChannelNotificationI(pwmp, channel) \
|
||||
pwm_lld_disable_channel_notification(pwmp, channel)
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -223,7 +223,7 @@ void pwmEnablePeriodicNotification(PWMDriver *pwmp) {
|
|||
osalDbgAssert(pwmp->state == PWM_READY, "not ready");
|
||||
osalDbgAssert(pwmp->config->callback != NULL, "undefined periodic callback");
|
||||
|
||||
pwm_lld_enable_periodic_notification(pwmp);
|
||||
pwmEnablePeriodicNotificationI(pwmp);
|
||||
|
||||
osalSysUnlock();
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ void pwmDisablePeriodicNotification(PWMDriver *pwmp) {
|
|||
osalDbgAssert(pwmp->state == PWM_READY, "not ready");
|
||||
osalDbgAssert(pwmp->config->callback != NULL, "undefined periodic callback");
|
||||
|
||||
pwm_lld_disable_periodic_notification(pwmp);
|
||||
pwmDisablePeriodicNotificationI(pwmp);
|
||||
|
||||
osalSysUnlock();
|
||||
}
|
||||
|
@ -274,7 +274,7 @@ void pwmEnableChannelNotification(PWMDriver *pwmp, pwmchannel_t channel) {
|
|||
osalDbgAssert(pwmp->config->channels[channel].callback != NULL,
|
||||
"undefined channel callback");
|
||||
|
||||
pwm_lld_enable_channel_notification(pwmp, channel);
|
||||
pwmEnableChannelNotificationI(pwmp, channel);
|
||||
|
||||
osalSysUnlock();
|
||||
}
|
||||
|
@ -302,7 +302,7 @@ void pwmDisableChannelNotification(PWMDriver *pwmp, pwmchannel_t channel) {
|
|||
osalDbgAssert(pwmp->config->channels[channel].callback != NULL,
|
||||
"undefined channel callback");
|
||||
|
||||
pwm_lld_disable_channel_notification(pwmp, channel);
|
||||
pwmDisableChannelNotificationI(pwmp, channel);
|
||||
|
||||
osalSysUnlock();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue