MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Mailbox

Overview

The MCUXpresso SDK provides a peripheral driver for the Mailbox module of MCUXpresso SDK devices.

The mailbox driver API provide:

Typical use case

Example of code on primary core, which cause interrupt on secondary core by writing to mailbox register.

Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/mailbox

Example of code on secondary core to handle interrupt from primary core.

Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/mailbox

Example of code to get/set mutex.

Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/mailbox

Files

file  fsl_mailbox.h
 

Enumerations

enum  mailbox_cpu_id_t
 CPU ID.
 

Functions

static void MAILBOX_SetValue (MAILBOX_Type *base, mailbox_cpu_id_t cpu_id, uint32_t mboxData)
 Set data value in the mailbox based on the CPU ID. More...
 
static uint32_t MAILBOX_GetValue (MAILBOX_Type *base, mailbox_cpu_id_t cpu_id)
 Get data in the mailbox based on the CPU ID. More...
 
static void MAILBOX_SetValueBits (MAILBOX_Type *base, mailbox_cpu_id_t cpu_id, uint32_t mboxSetBits)
 Set data bits in the mailbox based on the CPU ID. More...
 
static void MAILBOX_ClearValueBits (MAILBOX_Type *base, mailbox_cpu_id_t cpu_id, uint32_t mboxClrBits)
 Clear data bits in the mailbox based on the CPU ID. More...
 
static uint32_t MAILBOX_GetMutex (MAILBOX_Type *base)
 Get MUTEX state and lock mutex. More...
 
static void MAILBOX_SetMutex (MAILBOX_Type *base)
 Set MUTEX state. More...
 

Driver version

#define FSL_MAILBOX_DRIVER_VERSION   (MAKE_VERSION(2, 1, 0))
 MAILBOX driver version 2.1.0. More...
 

MAILBOX initialization

static void MAILBOX_Init (MAILBOX_Type *base)
 Initializes the MAILBOX module. More...
 
static void MAILBOX_Deinit (MAILBOX_Type *base)
 De-initializes the MAILBOX module. More...
 

Macro Definition Documentation

#define FSL_MAILBOX_DRIVER_VERSION   (MAKE_VERSION(2, 1, 0))

Function Documentation

static void MAILBOX_Init ( MAILBOX_Type *  base)
inlinestatic

This function enables the MAILBOX clock only.

Parameters
baseMAILBOX peripheral base address.
static void MAILBOX_Deinit ( MAILBOX_Type *  base)
inlinestatic

This function disables the MAILBOX clock only.

Parameters
baseMAILBOX peripheral base address.
static void MAILBOX_SetValue ( MAILBOX_Type *  base,
mailbox_cpu_id_t  cpu_id,
uint32_t  mboxData 
)
inlinestatic
Parameters
baseMAILBOX peripheral base address.
cpu_idCPU id, kMAILBOX_CM0Plus or kMAILBOX_CM4 for LPC5410x and LPC5411x devices, kMAILBOX_CM33_Core0 or kMAILBOX_CM33_Core1 for LPC55S69 devices.
mboxDataData to send in the mailbox.
Note
Sets a data value to send via the MAILBOX to the other core.
static uint32_t MAILBOX_GetValue ( MAILBOX_Type *  base,
mailbox_cpu_id_t  cpu_id 
)
inlinestatic
Parameters
baseMAILBOX peripheral base address.
cpu_idCPU id, kMAILBOX_CM0Plus or kMAILBOX_CM4 for LPC5410x and LPC5411x devices, kMAILBOX_CM33_Core0 or kMAILBOX_CM33_Core1 for LPC55S69 devices.
Returns
Current mailbox data.
static void MAILBOX_SetValueBits ( MAILBOX_Type *  base,
mailbox_cpu_id_t  cpu_id,
uint32_t  mboxSetBits 
)
inlinestatic
Parameters
baseMAILBOX peripheral base address.
cpu_idCPU id, kMAILBOX_CM0Plus or kMAILBOX_CM4 for LPC5410x and LPC5411x devices, kMAILBOX_CM33_Core0 or kMAILBOX_CM33_Core1 for LPC55S69 devices.
mboxSetBitsData bits to set in the mailbox.
Note
Sets data bits to send via the MAILBOX to the other core. A value of 0 will do nothing. Only sets bits selected with a 1 in it's bit position.
static void MAILBOX_ClearValueBits ( MAILBOX_Type *  base,
mailbox_cpu_id_t  cpu_id,
uint32_t  mboxClrBits 
)
inlinestatic
Parameters
baseMAILBOX peripheral base address.
cpu_idCPU id, kMAILBOX_CM0Plus or kMAILBOX_CM4 for LPC5410x and LPC5411x devices, kMAILBOX_CM33_Core0 or kMAILBOX_CM33_Core1 for LPC55S69 devices.
mboxClrBitsData bits to clear in the mailbox.
Note
Clear data bits to send via the MAILBOX to the other core. A value of 0 will do nothing. Only clears bits selected with a 1 in it's bit position.
static uint32_t MAILBOX_GetMutex ( MAILBOX_Type *  base)
inlinestatic
Parameters
baseMAILBOX peripheral base address.
Returns
See note
Note
Returns '1' if the mutex was taken or '0' if another resources has the mutex locked. Once a mutex is taken, it can be returned with the MAILBOX_SetMutex() function.
static void MAILBOX_SetMutex ( MAILBOX_Type *  base)
inlinestatic
Parameters
baseMAILBOX peripheral base address.
Note
Sets mutex state to '1' and allows other resources to get the mutex.