74 #define PWM_ERROR (-1)
81 #define PWM_SYS_16MHZ_NO_PRES_MIN 0xFFFF
82 #define PWM_SYS_16MHZ_NO_PRES_MIN_FREQ 244
84 #define PWM_SYS_16MHZ_PRES_MIN 0x00F42400
85 #define PWM_SYS_16MHZ_PRES_MIN_FREQ 1
87 #define PWM_SYS_16MHZ_NO_PRES_MAX 100
88 #define PWM_SYS_16MHZ_NO_PRES_MAX_FREQ 160000
100 #define PWM_TIMER_MIN PWM_TIMER_0
101 #define PWM_TIMER_MAX PWM_TIMER_3
102 #define PWM_SIGNAL_STRAIGHT 1
103 #define PWM_SIGNAL_INVERTED 0
104 #define PWM_OFF_WHEN_STOP 0
105 #define PWM_ON_WHEN_STOP 1
106 #define PWM_GPTIMER_CFG_SPLIT_MODE 0x04
107 #define PWM_DUTY_MAX 100
108 #define PWM_DUTY_MIN 0
109 #define PWM_FREQ_MIN PWM_SYS_16MHZ_PRES_MIN_FREQ
110 #define PWM_FREQ_MAX PWM_SYS_16MHZ_NO_PRES_MAX_FREQ
123 int8_t
pwm_enable(uint32_t freq, uint8_t duty, uint8_t
timer, uint8_t ab);
146 int8_t
pwm_start(uint8_t
timer, uint8_t ab, uint8_t port, uint8_t pin);
156 int8_t
pwm_stop(uint8_t
timer, uint8_t ab, uint8_t port, uint8_t pin, uint8_t state);
int8_t pwm_start(uint8_t timer, uint8_t ab, uint8_t port, uint8_t pin)
Once configured, starts the PWM.
int8_t pwm_stop(uint8_t timer, uint8_t ab, uint8_t port, uint8_t pin, uint8_t state)
Halts the PWM in a given GPT/timer.
int8_t pwm_set_direction(uint8_t timer, uint8_t ab, uint8_t dir)
Sets the PWM duty cycle signal direction (high/low)
Header file with declarations for the I/O Control module.
Header file for the cc2538 System Control driver.
int8_t pwm_enable(uint32_t freq, uint8_t duty, uint8_t timer, uint8_t ab)
Configures the general purpose timer in PWM mode.
int8_t pwm_disable(uint8_t timer, uint8_t ab, uint8_t port, uint8_t pin)
Disables a previously PWM configured GPTn.
int8_t pwm_toggle_direction(uint8_t timer, uint8_t ab)
Toggle the PWM signal direction (inverts the current duty cycle)