|
|
|
@ -46,6 +46,20 @@ typedef enum {
|
|
|
|
|
onePulse
|
|
|
|
|
} timerMode_t;
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* Output compare modes.
|
|
|
|
|
*/
|
|
|
|
|
typedef enum {
|
|
|
|
|
frozen, /*!< Pin update is **de-activated** even when a compare match happens */
|
|
|
|
|
high_on_match, /*!< Pin goes **high** when a compare match occurs */
|
|
|
|
|
low_on_match, /*!< Pin goes **low** when a compare match occurs */
|
|
|
|
|
toggle, /*!< Pin **toggles** when a compare match occurs */
|
|
|
|
|
inactive_force_high, /*!< Pin if forced **high** */
|
|
|
|
|
inactive_force_low, /*!< Pin if forced **low** */
|
|
|
|
|
pwm_normal, /*!< Standart PWM mode */
|
|
|
|
|
pwm_inverted /*!< Inverted PWM mode */
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* Reset the timer to its default state.
|
|
|
|
|
*/
|
|
|
|
@ -69,7 +83,15 @@ void timerClearUpdateInterrupt(timerNo_t timer);
|
|
|
|
|
void timerClearCounter(timerNo_t timer);
|
|
|
|
|
|
|
|
|
|
/* Second stage configuration */
|
|
|
|
|
void timerInit(timerNo_t timer, uint32_t prescaler, uint32_t period, timerCountDirection_t direction, timerMode_t mode);
|
|
|
|
|
void timerInitCounter( timerNo_t timer,
|
|
|
|
|
uint32_t prescaler,
|
|
|
|
|
uint32_t period,
|
|
|
|
|
timerCountDirection_t direction);
|
|
|
|
|
|
|
|
|
|
void timerInitPwm( timerNo_t timer,
|
|
|
|
|
uint32_t prescaler,
|
|
|
|
|
uint32_t period,
|
|
|
|
|
timerCountDirection_t direction);
|
|
|
|
|
|
|
|
|
|
void timerSetHz(timerNo_t timer, uint16_t hz);
|
|
|
|
|
void timerSetMs(timerNo_t timer, uint16_t ms);
|
|
|
|
|