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:
Glenn Ruben Bakke 2017-04-18 20:53:55 +02:00
parent 2d7f39855b
commit 4d56f2a76d

View File

@ -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;
/**