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

PWM Example Application main file. More...

Macros

#define PWM_OUTPUT_PIN_NUMBER   (LED0)
 
#define MAX_SAMPLE_LEVELS   (256UL)
 
#define TIMER_PRESCALERS   6U
 

Functions

static __INLINE uint32_t next_sample_get (void)
 Function for getting the next sample. More...
 
void TIMER2_IRQHandler (void)
 Function for handling timer 2 peripheral interrupts. More...
 
static void timer2_init (void)
 Function for initializing the Timer 2 peripheral.
 
static void gpiote_init (void)
 Function for initializing the GPIO Tasks/Events peripheral.
 
static void ppi_init (void)
 Function for initializing the Programmable Peripheral Interconnect peripheral.
 
int main (void)
 Function for application main entry.
 

Detailed Description

This file contains the source code for a sample application using PWM.

example_board_setup_a.jpg
Use board setup A for this example.

Macro Definition Documentation

#define PWM_OUTPUT_PIN_NUMBER   (LED0)

Pin number for PWM output.

#define MAX_SAMPLE_LEVELS   (256UL)

Maximum number of sample levels.

#define TIMER_PRESCALERS   6U

Prescaler setting for timer.

Function Documentation

static __INLINE uint32_t next_sample_get ( void  )
static
Returns
sample_value computed sample.
void TIMER2_IRQHandler ( void  )

< Keeps track of which CC register to be used.