aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/hal/include/pwm.h16
-rw-r--r--os/hal/platforms/STM32/pwm_lld.h16
2 files changed, 13 insertions, 19 deletions
diff --git a/os/hal/include/pwm.h b/os/hal/include/pwm.h
index 5ca0083b8..55e890ea4 100644
--- a/os/hal/include/pwm.h
+++ b/os/hal/include/pwm.h
@@ -39,21 +39,11 @@ typedef enum {
} pwmstate_t;
/**
- * @brief PWM edge for callbacks.
- */
-typedef enum {
- PWM_NONE = 0, /**< @brief No callback. */
- PWM_TO_ACTIVE_EDGE = 1, /**< @brief Enable on idle->active. */
- PWM_TO_IDLE_EDGE = 2, /**< @brief Enable on active->idle. */
- PWM_BOTH_EDGES = 3 /**< @brief Enable on both edges. */
-} pwmedge_t;
-
-/**
* @brief PWM logic mode.
*/
typedef enum {
- PWM_ACTIVE_LOW = 0, /**< @brief Idle is logic level 1. */
- PWM_ACTIVE_HIGH = 1 /**< @brief Idle is logic level 0. */
+ PWM_ACTIVE_HIGH = 0, /**< @brief Idle is logic level 0. */
+ PWM_ACTIVE_LOW = 1 /**< @brief Idle is logic level 1. */
} pwmmode_t;
/**
@@ -61,7 +51,7 @@ typedef enum {
*
* @param[in] active current channel output state
*/
-typedef void (*pwmcallback_t)(bool_t active);
+typedef void (*pwmcallback_t)(void);
#include "pwm_lld.h"
diff --git a/os/hal/platforms/STM32/pwm_lld.h b/os/hal/platforms/STM32/pwm_lld.h
index 4ce073aad..879012451 100644
--- a/os/hal/platforms/STM32/pwm_lld.h
+++ b/os/hal/platforms/STM32/pwm_lld.h
@@ -78,7 +78,13 @@ typedef uint16_t pwmcnt_t;
* @note It could be empty on some architectures.
*/
typedef struct {
-
+ /**
+ * @brief Periodic callback pointer.
+ * @details This callback is invoked on PWM counter reset. If set to
+ * @p NULL then the callback is disabled.
+ */
+ pwmcallback_t pc_callback;
+ /* End of the mandatory fields.*/
} PWMConfig;
/**
@@ -91,11 +97,9 @@ typedef struct {
*/
pwmmode_t pcc_mode;
/**
- * @brief Channel callback edges.
- */
- pwmedge_t pcc_edge;
- /**
- * @brief Channel callback pointer.
+ * @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.*/