Module for generating a changing pulse-width modulated output signal that is used to smoothly blink LEDs.
More...
|
Default settings for LED softblink.
|
#define | LED_SB_INIT_PARAMS_ACTIVE_HIGH false |
|
#define | LED_SB_INIT_PARAMS_DUTY_CYCLE_MAX 220 |
|
#define | LED_SB_INIT_PARAMS_DUTY_CYCLE_MIN 0 |
|
#define | LED_SB_INIT_PARAMS_DUTY_CYCLE_STEP 5 |
|
#define | LED_SB_INIT_PARAMS_OFF_TIME_TICKS 65536 |
|
#define | LED_SB_INIT_PARAMS_ON_TIME_TICKS 0 |
|
#define | LED_SB_INIT_PARAMS_LEDS_PIN_BM(mask) (mask) |
|
#define | LED_SB_INIT_PARAMS_LEDS_PORT NRF_GPIO |
|
Module for generating a changing pulse-width modulated output signal that is used to smoothly blink LEDs.
This module provides an LED softblink implementation using timers and GPIO.
LED softblink needs one timer. It can use any number of output channels that are available.
Only one instance of LED softblink can run at a time.
#define LED_SB_INIT_DEFAULT_PARAMS |
( |
|
mask | ) |
|
Value:{ \
.active_high = LED_SB_INIT_PARAMS_ACTIVE_HIGH, \
.duty_cycle_max = LED_SB_INIT_PARAMS_DUTY_CYCLE_MAX, \
.duty_cycle_min = LED_SB_INIT_PARAMS_DUTY_CYCLE_MIN, \
.duty_cycle_step = LED_SB_INIT_PARAMS_DUTY_CYCLE_STEP, \
.off_time_ticks = LED_SB_INIT_PARAMS_OFF_TIME_TICKS, \
.on_time_ticks = LED_SB_INIT_PARAMS_ON_TIME_TICKS, \
.leds_pin_bm = LED_SB_INIT_PARAMS_LEDS_PIN_BM(mask), \
.p_leds_port = LED_SB_INIT_PARAMS_LEDS_PORT \
}
LED softblink default configuration.
Function for initializing LED softblink.
- Parameters
-
[in] | p_init_params | Pointer to the initialization structure. |
- Returns
- Values returned by app_timer_create.
void led_softblink_off_time_set |
( |
uint32_t |
off_time_ticks | ) |
|
Function for setting the off time.
This function configures the time that the LEDs will be off between each blink.
- Parameters
-
[in] | off_time_ticks | Off time in ticks. |
void led_softblink_on_time_set |
( |
uint32_t |
on_time_ticks | ) |
|
Function for setting the on time.
This function configures the time that the LEDs will be on between each blink.
- Parameters
-
[in] | on_time_ticks | On time in ticks. |
ret_code_t led_softblink_start |
( |
uint32_t |
leds_pin_bit_mask | ) |
|
Function for starting to blink LEDs.
- Parameters
-
[in] | leds_pin_bit_mask | Bit mask containing the pins for the LEDs to be blinked. |
- Returns
- Values returned by app_timer_start.
Function for stopping to blink LEDs.
- Returns
- Values returned by app_timer_stop.
Function for uninitializing LED softblink.
- Return values
-
NRF_SUCCESS | If LED softblink was uninitialized successfully. |