nrf5/hal/pwm: Adding more configuration options to the PWM peripheral wrapper. Possibility to set pulse with manually, and also mode. The mode indicates whether duty cycle is low and then goes high, or if it is high and then go low. Added new type to describe the two modes.
This commit is contained in:
parent
2d7f39855b
commit
4d56f2a76d
@ -65,11 +65,22 @@ typedef enum {
|
||||
HAL_PWM_FREQ_125khz
|
||||
} hal_pwm_freq_t;
|
||||
|
||||
/**
|
||||
* @brief PWM mode type definition
|
||||
*/
|
||||
typedef enum {
|
||||
HAL_PWM_MODE_LOW_HIGH = 0,
|
||||
HAL_PWM_MODE_HIGH_LOW
|
||||
} hal_pwm_mode_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8_t pwm_pin;
|
||||
hal_pwm_freq_t freq;
|
||||
uint8_t duty;
|
||||
uint16_t pulse_width;
|
||||
uint16_t period;
|
||||
hal_pwm_mode_t mode;
|
||||
} hal_pwm_init_t;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user