aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include/pwm.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/include/pwm.h')
-rw-r--r--os/hal/include/pwm.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/os/hal/include/pwm.h b/os/hal/include/pwm.h
index 9b0043a21..562be26bc 100644
--- a/os/hal/include/pwm.h
+++ b/os/hal/include/pwm.h
@@ -78,6 +78,32 @@ typedef void (*pwmcallback_t)(void);
/* Driver macros. */
/*===========================================================================*/
+/**
+ * @brief Enables a PWM channel.
+ * @details Programs (or reprograms) a PWM channel.
+ * @note This function has to be invoked from a lock zone.
+ *
+ * @param[in] pwmp pointer to a @p PWMDriver object
+ * @param[in] channel PWM channel identifier
+ * @param[in] width PWM pulse width as clock pulses number
+ */
+#define pwmEnableChannelI(pwmp, channel, width) { \
+ pwm_lld_enable_channel(pwmp, channel, width); \
+}
+
+/**
+ * @brief Disables a PWM channel.
+ * @details The channel is disabled and its output line returned to the
+ * idle state.
+ * @note This function has to be invoked from a lock zone.
+ *
+ * @param[in] pwmp pointer to a @p PWMDriver object
+ * @param[in] channel PWM channel identifier
+ */
+#define pwmDisableChannelI(pwmp, channel) { \
+ pwm_lld_disable_channel(pwmp, channel); \
+}
+
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/