![]() |
RA Flexible Software Package Documentation
Release v6.0.0
|
|
Functions | |
fsp_err_t | R_IPC_Open (ipc_ctrl_t *const p_api_ctrl, ipc_cfg_t const *const p_cfg) |
fsp_err_t | R_IPC_MessageSend (ipc_ctrl_t *const p_api_ctrl, uint32_t message) |
fsp_err_t | R_IPC_EventGenerate (ipc_ctrl_t *const p_api_ctrl, ipc_generate_event_t event) |
fsp_err_t | R_IPC_CallbackSet (ipc_ctrl_t *const p_api_ctrl, void(*p_callback)(ipc_callback_args_t *), void *const p_context, ipc_callback_args_t *const p_callback_memory) |
fsp_err_t | R_IPC_Close (ipc_ctrl_t *const p_api_ctrl) |
Driver for the IPC peripheral on RA MCUs. This module implements the IPC Interface.
The IPC HAL module supports communication across processors via maskable interrupts and one-way message FIFOs.
Configuration | Options | Default | Description |
---|---|---|---|
Parameter Checking |
| Default (BSP) | If selected code for parameter checking is included in the build. |
Configuration | Options | Default | Description |
---|---|---|---|
Name | Name must be a valid C symbol | g_ipc0 | Module name. |
Channel | MCU Specific Options | Select the IPC channel. | |
Callback | Name must be a valid C symbol | NULL | A user callback function must be provided when the IPC interrupt is enabled. It will be called from the interrupt service routine (ISR). |
Interrupt Priority | MCU Specific Options | Select the IPC interrupt priority. An interrupt is only required for receiving messages and events from the opposing core. |
IPC maskable interrupts and FIFOs share the same interrupt so the IPC driver handles configuration of both similarly:
Each IPC channel can set multiple "event" bits in a single maskable interrupt. This should be done through ipc_api_t::eventGenerate.
The following example demonstrates sending a simple message from Core 0 to Core 1 via IPC.
The following example demonstrates triggering an event via maskable interrupt from Core 0 to Core 1.
fsp_err_t R_IPC_Open | ( | ipc_ctrl_t *const | p_api_ctrl, |
ipc_cfg_t const *const | p_cfg | ||
) |
Configures the IPC driver channel based on the input configuration.
Implements ipc_api_t::open.
FSP_SUCCESS | Channel opened successfully. |
FSP_ERR_ASSERTION | Pointer to IPC control block or configuration structure is NULL. |
FSP_ERR_IP_CHANNEL_NOT_PRESENT | The requested channel does not exist on this MCU. |
FSP_ERR_ALREADY_OPEN | Control block has already been opened or channel is being used by another instance. Call close() then open() to reconfigure. |
fsp_err_t R_IPC_MessageSend | ( | ipc_ctrl_t *const | p_api_ctrl, |
uint32_t | message | ||
) |
Sends a message over the configured IPC channel.
Implements ipc_api_t::messageSend.
FSP_SUCCESS | Message written to FIFO successfully. |
FSP_ERR_ASSERTION | A required pointer is NULL. |
FSP_ERR_NOT_OPEN | The control block has not been opened. |
FSP_ERR_INSUFFICIENT_SPACE | IPC channel FIFO is full |
fsp_err_t R_IPC_EventGenerate | ( | ipc_ctrl_t *const | p_api_ctrl, |
ipc_generate_event_t | event | ||
) |
Triggers an interrupt with the specified event bit set over the configured IPC channel.
Implements ipc_api_t::eventGenerate.
FSP_SUCCESS | Event request set successfully. |
FSP_ERR_ASSERTION | A required pointer is NULL. |
FSP_ERR_NOT_OPEN | The control block has not been opened. |
fsp_err_t R_IPC_CallbackSet | ( | ipc_ctrl_t *const | p_api_ctrl, |
void(*)(ipc_callback_args_t *) | p_callback, | ||
void *const | p_context, | ||
ipc_callback_args_t *const | p_callback_memory | ||
) |
Updates the user callback and has option of providing memory for callback structure.
Implements ipc_api_t::callbackSet.
FSP_SUCCESS | Callback updated successfully. |
FSP_ERR_ASSERTION | Pointer to IPC control block or callback is NULL. |
FSP_ERR_NOT_OPEN | The control block has not been opened. |
FSP_ERR_NO_CALLBACK_MEMORY | p_callback is non-secure and p_callback_memory is either secure or NULL. |
fsp_err_t R_IPC_Close | ( | ipc_ctrl_t *const | p_api_ctrl | ) |
Closes the IPC driver.
Implements ipc_api_t::close.
FSP_SUCCESS | Channel successfully closed. |
FSP_ERR_ASSERTION | Pointer to IPC control block is NULL. |
FSP_ERR_NOT_OPEN | The control block has not been opened. |