git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1424 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2009-12-15 22:23:25 +00:00
parent 6716159ba1
commit ba37ee4f4b
2 changed files with 13 additions and 19 deletions

View File

@ -38,22 +38,12 @@ typedef enum {
PWM_READY = 2, /**< @brief Ready. */ PWM_READY = 2, /**< @brief Ready. */
} pwmstate_t; } 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. * @brief PWM logic mode.
*/ */
typedef enum { typedef enum {
PWM_ACTIVE_LOW = 0, /**< @brief Idle is logic level 1. */ PWM_ACTIVE_HIGH = 0, /**< @brief Idle is logic level 0. */
PWM_ACTIVE_HIGH = 1 /**< @brief Idle is logic level 0. */ PWM_ACTIVE_LOW = 1 /**< @brief Idle is logic level 1. */
} pwmmode_t; } pwmmode_t;
/** /**
@ -61,7 +51,7 @@ typedef enum {
* *
* @param[in] active current channel output state * @param[in] active current channel output state
*/ */
typedef void (*pwmcallback_t)(bool_t active); typedef void (*pwmcallback_t)(void);
#include "pwm_lld.h" #include "pwm_lld.h"

View File

@ -78,7 +78,13 @@ typedef uint16_t pwmcnt_t;
* @note It could be empty on some architectures. * @note It could be empty on some architectures.
*/ */
typedef struct { 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; } PWMConfig;
/** /**
@ -91,11 +97,9 @@ typedef struct {
*/ */
pwmmode_t pcc_mode; pwmmode_t pcc_mode;
/** /**
* @brief Channel callback edges. * @brief Channel callback pointer.
*/ * @details This callback is invoked on the channel compare event. If set to
pwmedge_t pcc_edge; * @p NULL then the callback is disabled.
/**
* @brief Channel callback pointer.
*/ */
pwmcallback_t pcc_callback; pwmcallback_t pcc_callback;
/* End of the mandatory fields.*/ /* End of the mandatory fields.*/