LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Blinky Standalone Example using Dual Core communication

Functions

static void LED_Event_Task (void *loop)
 
static int blink_delay (void)
 
static void LED_blinkProc (uint32_t val)
 
void blinky_tasks (void)
 Dual core blinky task.
 
void BLINKY_Init (void)
 Dual core Blinky example initialization.
 

Variables

static const uint32_t xDelay = BLINKY_DEFAULT_DELAY
 

Detailed Description

This example blinks LED1 and LED2 at various rates, one of the LED is turned on/off by M4 based on message received from M0. Meanwhile M4 also sends blink message to M0 so that M0 core blinks the other LED. LED1 will blink at the rate of 500ms/blink, LED2 will blink at the rate of 1s/blink.

This example is included by default in all other dual-core examples, hence all the dual-core examples will blink LED1 and LED2.

The following are the default LEDS on various boards

IMPORTANT NOTE:

M0 image boot failure will also cause (by default) LED2 to blink. This should not be confused with the Blinky task blinking the LED. The error blink will be at 20ms or 2s rate, the former rate indicates that the M0 image loader code running on core-M4 could not locate a valid M0 image, whereas the latter rate indicates that a valid M0 image is found but its functionality is mutually exclusive with the functionalities of the image running in core-M4. In case of M0 boot error the blink will stop after 1 minute.

Build procedure: LPCOpen 18xx/43xx build instructions

The following are the dual core examples that can run with Blinky (in the other core)

Submit bug reports for LPCOpen code here.

Function Documentation

static int blink_delay ( void  )
static

Definition at line 134 of file example_blinky.c.

void BLINKY_Init ( void  )

Dual core Blinky example initialization.

This function will register the blink function to the event queue of a Core (M0/M4). Whenever a blink event is received from the other core the registered call-back function will be called-back by the ipcex_task(), This function is called by main() only when EXAMPLE_BLINKY is defined. In all the dual core examples EXAMPLE_BLINKY is defined by default.

Returns
None

Definition at line 232 of file example_blinky.c.

void blinky_tasks ( void  )

Dual core blinky task.

Calling this function calls the blinky task in which will blink the LEDs. When no OS is specified this will be repeatedly called from dual core main() or once if any OS is defined, only when EXAMPLE_BLINKY is defined. In all the dual core examples EXAMPLE_BLINKY is defined by default.

Returns
None

Definition at line 225 of file example_blinky.c.

static void LED_blinkProc ( uint32_t  val)
static

Definition at line 155 of file example_blinky.c.

static void LED_Event_Task ( void *  loop)
static

Definition at line 164 of file example_blinky.c.

Variable Documentation

const uint32_t xDelay = BLINKY_DEFAULT_DELAY
static

Definition at line 98 of file example_blinky.c.