LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
LPC8xx Multi-Rate Timer example

Detailed Description

Example description
The MRT example demonstrates using the Multi-Rate Timer API functions. This example configures the MRT using the GetIdleChannel function to initialize a timer channel. If a timer channel is not available because all channels are in-use, the RED LED is illuminated. Otherwise, a timer channel is configured as a one-shot timer with a pseudo-random value. Every pass through the MRT Interrupt Handler toggles a LED, while another LED is toggled on every SysTick.

Special connection requirements
There are no special connection requirements for this example.

Build procedures:
LPC8xx example quickstart for IAR EWARM
LPC8xx example quickstart for Keil uVision4
LPC8xx example quickstart for Code Red Xpresso

Supported boards and board setup:
NXP Xpresso LPC812 board

Submitting LPCOpen issues:
Community support for LPCOpen

Macros

#define TICKRATE_HZ   (10) /* 10 ticks per second */
 
#define RNG_MULTI   (69069)
 
#define NO_LO_BITS(x)   (x >> 8)
 

Functions

static uint32_t RAND (void)
 
void SysTick_Handler (void)
 Handle interrupt from SysTick timer.
 
void MRT_IRQHandler (void)
 Handle interrupt from MRT.
 
int main (void)
 MRT example main function.
 

Variables

static uint32_t rng = 1234UL
 

Macro Definition Documentation

#define NO_LO_BITS (   x)    (x >> 8)

Definition at line 67 of file mrt.c.

#define RNG_MULTI   (69069)

Definition at line 66 of file mrt.c.

#define TICKRATE_HZ   (10) /* 10 ticks per second */

Definition at line 65 of file mrt.c.

Function Documentation

int main ( void  )

MRT example main function.

Main program body.

Returns
Status (This function will not return)

defined(CHIP_LPC175X_6X)

Definition at line 142 of file mrt.c.

void MRT_IRQHandler ( void  )

Handle interrupt from MRT.

Returns
Nothing

Definition at line 104 of file mrt.c.

static uint32_t RAND ( void  )
static

Definition at line 80 of file mrt.c.

void SysTick_Handler ( void  )

Handle interrupt from SysTick timer.

SysTick 1mS tick handler.

Returns
Nothing

Definition at line 94 of file mrt.c.

Variable Documentation

uint32_t rng = 1234UL
static

Definition at line 69 of file mrt.c.