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

PPI Example Application main file. More...

Functions

static void ppi_init (void)
 Function for initializing the PPI peripheral.
 
static void timer0_init (void)
 Function for Timer 0 initialization, which will be started and stopped by timer1 and timer2 using PPI.
 
static void timer1_init (void)
 Function for Timer 1 initialization. More...
 
static void timer2_init (void)
 Function for Timer 2 initialization. More...
 
int main (void)
 Function for application main entry.
 

Detailed Description

This file contains the source code for a sample application using PPI to communicate between timers.

example_board_setup_a.jpg
Use board setup A for this example.

Function Documentation

static void timer1_init ( void  )
static

Initializes Timer 1 peripheral, creates event and interrupt every 2 seconds, by configuring CC[0] to timer overflow value, we create events at even number of seconds for example, events are created at 2,4,6 ... seconds. This event can be used to stop Timer 0 with Timer1->Event_Compare[0] triggering Timer 0 TASK_STOP through PPI.

static void timer2_init ( void  )
static

Initializes Timer 2 peripheral, creates event and interrupt every 2 seconds by configuring CC[0] to half of timer overflow value. Events are created at odd number of seconds. For example, events are created at 1,3,5,... seconds. This event can be used to start Timer 0 with Timer2->Event_Compare[0] triggering Timer 0 TASK_START through PPI.