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
static void MAILBOX_Init |
( |
MAILBOX_Type * |
base | ) |
|
|
inlinestatic |
This function enables the MAILBOX clock only.
- Parameters
-
base | MAILBOX peripheral base address. |
static void MAILBOX_Deinit |
( |
MAILBOX_Type * |
base | ) |
|
|
inlinestatic |
This function disables the MAILBOX clock only.
- Parameters
-
base | MAILBOX peripheral base address. |
static void MAILBOX_SetValue |
( |
MAILBOX_Type * |
base, |
|
|
mailbox_cpu_id_t |
cpu_id, |
|
|
uint32_t |
mboxData |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | MAILBOX peripheral base address. |
cpu_id | CPU id, kMAILBOX_CM0Plus or kMAILBOX_CM4 for LPC5410x and LPC5411x devices, kMAILBOX_CM33_Core0 or kMAILBOX_CM33_Core1 for LPC55S69 devices. |
mboxData | Data 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
-
base | MAILBOX peripheral base address. |
cpu_id | CPU 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
-
base | MAILBOX peripheral base address. |
cpu_id | CPU id, kMAILBOX_CM0Plus or kMAILBOX_CM4 for LPC5410x and LPC5411x devices, kMAILBOX_CM33_Core0 or kMAILBOX_CM33_Core1 for LPC55S69 devices. |
mboxSetBits | Data 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
-
base | MAILBOX peripheral base address. |
cpu_id | CPU id, kMAILBOX_CM0Plus or kMAILBOX_CM4 for LPC5410x and LPC5411x devices, kMAILBOX_CM33_Core0 or kMAILBOX_CM33_Core1 for LPC55S69 devices. |
mboxClrBits | Data 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
-
base | MAILBOX 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
-
base | MAILBOX peripheral base address. |
- Note
- Sets mutex state to '1' and allows other resources to get the mutex.