nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

LED control for the HRS example application. More...

Macros

#define PPI_CHAN0_TO_TOGGLE_LED   0
 
#define GPIOTE_CHAN_FOR_LED_TASK   0
 
#define TIMER_PRESCALER   9
 
#define CAPTURE_COMPARE_0_VALUE   0x1E84
 

Functions

static void timer1_init (void)
 Function for Timer1 initialization. More...
 
static void ppi_init (void)
 Function for the PPI initialization. More...
 
static void gpiote_init (void)
 
void led_start (void)
 
void led_stop (void)
 

Detailed Description

Macro Definition Documentation

#define PPI_CHAN0_TO_TOGGLE_LED   0

The PPI Channel that connects CC0 compare event to the GPIOTE Task that toggles the Advertising LED.

#define GPIOTE_CHAN_FOR_LED_TASK   0

The GPIOTE Channel used to perform write operation on the Advertising LED pin.

#define TIMER_PRESCALER   9

Prescaler setting for timer.

#define CAPTURE_COMPARE_0_VALUE   0x1E84

Capture compare value that corresponds to 250 ms.

Function Documentation

static void timer1_init ( void  )
static

This function will initialise Timer 1 peripheral. This timer is used only to generate capture compare events that toggle the advertising LED state.

static void ppi_init ( void  )
static

This function will initialise Programmable Peripheral Interconnect peripheral. It will configure the PPI channels as follows - PPI Channel 0 - Connecting CC0 Compare event to GPIOTE Task to toggle the LED state This configuration will feed a PWM input to the LED thereby making it flash in an interval that is dependent on the TIMER configuration.