Module for generating a low-power pulse-width modulated output signal.
More...
|
Default parameters for the low_power_pwm_config_t structure.
|
#define | LOW_POWER_PWM_CONFIG_ACTIVE_HIGH false |
|
#define | LOW_POWER_PWM_CONFIG_PERIOD UINT8_MAX |
|
#define | LOW_POWER_PWM_CONFIG_PORT NRF_GPIO |
|
#define | LOW_POWER_PWM_CONFIG_BIT_MASK(mask) (mask) |
|
Module for generating a low-power pulse-width modulated output signal.
This module provides a low-power PWM implementation using app_timers and GPIO.
Each low-power PWM instance utilizes one app_timer. This means it runs on RTC and does not require HFCLK to be running. There can be any number of output channels per instance.
#define LOW_POWER_PWM_DEFAULT_CONFIG |
( |
|
mask | ) |
|
Value:{ \
.active_high = LOW_POWER_PWM_CONFIG_ACTIVE_HIGH , \
.period = LOW_POWER_PWM_CONFIG_PERIOD , \
.p_port = LOW_POWER_PWM_CONFIG_PORT, \
.bit_mask = LOW_POWER_PWM_CONFIG_BIT_MASK(mask) \
}
Low-power PWM default configuration.
Function for setting a new high pulse width for a given instance.
This function can be called from the timer handler.
- Parameters
-
[in] | p_pwm_instance | Pointer to the instance to be changed. |
[in] | duty_cycle | New high pulse width. 0 means that the LED is always off. 255 means that it is always on. |
- Return values
-
NRF_SUCCESS | If the function completed successfully. |
NRF_ERROR_INVALID_PARAM | If the function returned an error because of invalid parameters. |
Function for initializing a low-power PWM instance.
- Parameters
-
[in] | p_pwm_instance | Pointer to the instance to be started. |
[in] | p_pwm_config | Pointer to the configuration structure. |
[in] | handler | User function to be called in case of time-out. |
- Returns
- Values returned by app_timer_create.
Function for starting a low-power PWM instance.
- Parameters
-
[in] | p_pwm_instance | Pointer to the instance to be started. |
[in] | leds_pin_bit_mask | Bit mask of pins to be started. |
- Returns
- Values returned by app_timer_start.
Function for stopping a low-power PWM instance.
- Parameters
-
[in] | p_pwm_instance | Pointer to the instance to be stopped. |
- Returns
- Values returned by app_timer_stop.