LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
LPC43xx Inter Processor Communication(IPC) example

Data Structures

struct  ipcex_msg_t
 

Macros

#define IPCEX_QUEUE_SZ   64
 
#define IPCEX_MAX_IDS   20
 
#define IPCEX_ID_BLINKY   1
 
#define IPCEX_ID_USBHOST   2
 
#define IPCEX_ID_USBDEVICE   3
 
#define IPCEX_ID_LWIP   4
 
#define IPCEX_ID_EMWIN   5
 
#define IPCEX_ID_USER1   10
 
#define IPCEX_ID_USER2   11
 

Functions

int ipcex_register_callback (uint32_t id, void(*func)(uint32_t))
 IPC register callback function pointer.
 
int ipcex_msgPush (uint32_t id, uint32_t data)
 Push data on the queue.
 
static void(* ipcex_callback_lookup [IPCEX_MAX_IDS])(uint32_t)
 
static ipcex_msg_t ipcex_queue [IPCEX_QUEUE_SZ]
 
static void ipcex_dispatch_task (void *loop)
 
void ipcex_tasks (void)
 Dual Core IPC example implementation task.
 
void IPCEX_Init (void)
 IPC Example initialization.
 

Detailed Description

Build procedure: LPCOpen 18xx/43xx build instructions

Submit bug reports for LPCOpen code here.

Macro Definition Documentation

#define IPCEX_ID_BLINKY   1

IPC ID used by BLINKY example

Definition at line 63 of file ipc_example.h.

#define IPCEX_ID_EMWIN   5

IPC ID used by EMWIN example

Definition at line 67 of file ipc_example.h.

#define IPCEX_ID_LWIP   4

IPC ID used by LWIP example

Definition at line 66 of file ipc_example.h.

#define IPCEX_ID_USBDEVICE   3

IPC ID used by USB Device example

Definition at line 65 of file ipc_example.h.

#define IPCEX_ID_USBHOST   2

IPC ID used by USB HOST example

Definition at line 64 of file ipc_example.h.

#define IPCEX_ID_USER1   10

IPC ID that can be used by other user examples

Definition at line 68 of file ipc_example.h.

#define IPCEX_ID_USER2   11

IPC ID that can be used by other user examples

Definition at line 69 of file ipc_example.h.

#define IPCEX_MAX_IDS   20

Maximum number of message IDs that this IPC examples uses

Definition at line 61 of file ipc_example.h.

#define IPCEX_QUEUE_SZ   64

Size of the IPC Queue used by this example implimentation, the current implementation uses same queue size for both M0 and M4, application developer can override it.

Definition at line 55 of file ipc_example.h.

Function Documentation

static void ipcex_dispatch_task ( void *  loop)
static

Definition at line 69 of file ipc_example.c.

void IPCEX_Init ( void  )

IPC Example initialization.

This function initializes the IPC Example implementation. It calls IPC_initMsgQueue() to initialize the IPC queue of the calling core, by allocating and passing a queue array. It will be called by the main() of both core-M0 and core-M4 code for all the dual core examples.

Returns
None

Definition at line 140 of file ipc_example.c.

int ipcex_msgPush ( uint32_t  id,
uint32_t  data 
)

Push data on the queue.

Parameters
id: Task ID of the destination task
data: Data containing the message
Returns
QUEUE_ERROR or QUEUE_FULL on error, QUEUE_INSERT on success

Definition at line 146 of file ipc_example.c.

int ipcex_register_callback ( uint32_t  id,
void(*)(uint32_t func 
)

IPC register callback function pointer.

This function registers a callback function pointer to a message id, whenever a message with id is received the register call-back function will be invoked.

Parameters
id: ID of message to which the callback func be associated
func: pointer to callback function
Returns
0 on failure [given id is greater than IPCEX_MAX_IDS], !0 on success

Definition at line 93 of file ipc_example.c.

void ipcex_tasks ( void  )

Dual Core IPC example implementation task.

This task receives the message from the other core and will call-back the function (if registered via ipcex_register_callback()) corresponding to the received message. This function is called by main().

Returns
None

Definition at line 104 of file ipc_example.c.

Variable Documentation

void(* ipcex_callback_lookup[IPCEX_MAX_IDS])(uint32_t)
static

Definition at line 53 of file ipc_example.c.

ipcex_msg_t ipcex_queue[IPCEX_QUEUE_SZ]
static

Definition at line 56 of file ipc_example.c.