The MCUXpresso SDK provides a peripheral driver for the Mailbox module of MCUXpresso SDK devices.
The mailbox driver API provide:
- init/deinit: MAILBOX_Init()/MAILBOX_Deinit()
- read/write from/to mailbox register: MAILBOX_SetValue()/MAILBOX_GetValue()
- set/clear mailbox register bits: MAILBOX_SetValueBits()/MAILBOX_ClearValueBits()
- get/set mutex: MAILBOX_GetMutex()/MAILBOX_SetMutex()
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 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.