nRF5 SDK v13.0.0
Modules | Data Structures | Macros | Functions

Module for generating a changing pulse-width modulated output signal that is used to smoothly blink LEDs. More...

Modules

 

Data Structures

struct  led_sb_init_params_t
 Structure holding the initialization parameters. More...
 

Macros

#define LED_SB_INIT_DEFAULT_PARAMS(mask)
 LED softblink default configuration. More...
 

Functions

ret_code_t led_softblink_init (led_sb_init_params_t const *p_init_params)
 Function for initializing LED softblink. More...
 
ret_code_t led_softblink_start (uint32_t leds_pin_bit_mask)
 Function for starting to blink LEDs. More...
 
ret_code_t led_softblink_stop (void)
 Function for stopping to blink LEDs. More...
 
void led_softblink_off_time_set (uint32_t off_time_ticks)
 Function for setting the off time. More...
 
void led_softblink_on_time_set (uint32_t on_time_ticks)
 Function for setting the on time. More...
 
ret_code_t led_softblink_uninit (void)
 Function for uninitializing LED softblink. More...
 

Default settings

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
 

Detailed Description

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.

Macro Definition Documentation

#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 Documentation

ret_code_t led_softblink_init ( led_sb_init_params_t const *  p_init_params)

Function for initializing LED softblink.

Parameters
[in]p_init_paramsPointer 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_ticksOff 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_ticksOn 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_maskBit mask containing the pins for the LEDs to be blinked.
Returns
Values returned by app_timer_start.
ret_code_t led_softblink_stop ( void  )

Function for stopping to blink LEDs.

Returns
Values returned by app_timer_stop.
ret_code_t led_softblink_uninit ( void  )

Function for uninitializing LED softblink.

Return values
NRF_SUCCESSIf LED softblink was uninitialized successfully.

Documentation feedback | Developer Zone | Subscribe | Updated