RA Flexible Software Package Documentation  Release v6.0.0

 
IPC Interface

Detailed Description

Interface for inter-processor communications (IPC).

Summary

The IPC interface provides common APIs for IPC HAL drivers. The IPC interface supports the following features:

Data Structures

struct  ipc_callback_args_t
 
struct  ipc_cfg_t
 
struct  ipc_api_t
 
struct  ipc_instance_t
 

Typedefs

typedef void ipc_ctrl_t
 

Enumerations

enum  ipc_event_t
 
enum  ipc_generate_event_t
 

Data Structure Documentation

◆ ipc_callback_args_t

struct ipc_callback_args_t

IPC Callback parameter definition

Data Fields
uint32_t channel IPC channel.
uint32_t message Received message data.
ipc_event_t event Event code.
void * p_context Context provided to user during callback.

◆ ipc_cfg_t

struct ipc_cfg_t

IPC Configuration

Data Fields

uint32_t channel
 IPC channel.
 
IRQn_Type irq
 
uint8_t ipl
 
void(* p_callback )(ipc_callback_args_t *p_args)
 
void * p_context
 User defined context passed into callback function.
 

Field Documentation

◆ irq

IRQn_Type ipc_cfg_t::irq

IPC IRQ number

Note
Only required if the user wants to receive messages or interrupts over IPC. IRQ should be set to FSP_INVALID_VECTOR when not used.

◆ ipl

uint8_t ipc_cfg_t::ipl

IPC Interrupt priority

Note
Only required if the user wants to receive messages or interrupts over IPC.

◆ p_callback

void(* ipc_cfg_t::p_callback) (ipc_callback_args_t *p_args)

Pointer to callback function

Note
Only required if the user wants to receive messages or interrupts over IPC. p_callback should be set to NULL when not used.

◆ ipc_api_t

struct ipc_api_t

Interface definition for IPC

Data Fields

fsp_err_t(* open )(ipc_ctrl_t *const p_ctrl, ipc_cfg_t const *const p_cfg)
 
fsp_err_t(* messageSend )(ipc_ctrl_t *const p_ctrl, uint32_t message)
 
fsp_err_t(* eventGenerate )(ipc_ctrl_t *const p_ctrl, ipc_generate_event_t event)
 
fsp_err_t(* callbackSet )(ipc_ctrl_t *const p_ctrl, void(*p_callback)(ipc_callback_args_t *), void *const p_context, ipc_callback_args_t *const p_callback_memory)
 
fsp_err_t(* close )(ipc_ctrl_t *const p_ctrl)
 

Field Documentation

◆ open

fsp_err_t(* ipc_api_t::open) (ipc_ctrl_t *const p_ctrl, ipc_cfg_t const *const p_cfg)

Open IPC instance.

Parameters
[in,out]p_ctrlPointer to the IPC control block. Must be declared by user. Value set here.
[in]p_cfgPointer to IPC configuration structure. All elements of this structure must be set by user.

◆ messageSend

fsp_err_t(* ipc_api_t::messageSend) (ipc_ctrl_t *const p_ctrl, uint32_t message)

Send message through the FIFO of the configured IPC channel.

Note
Should only be called from the core on the transmit side of the IPC channel.
Parameters
[in]p_ctrlPointer to the IPC control block.
[in]messageMessage to send.

◆ eventGenerate

fsp_err_t(* ipc_api_t::eventGenerate) (ipc_ctrl_t *const p_ctrl, ipc_generate_event_t event)

Generate event through configured IPC channel interrupt.

Note
Should only be called from the core on the transmit side of the IPC channel.
Parameters
[in]p_ctrlPointer to the IPC control block.
[in]eventEvent to generate interrupt for.

◆ callbackSet

fsp_err_t(* ipc_api_t::callbackSet) (ipc_ctrl_t *const p_ctrl, void(*p_callback)(ipc_callback_args_t *), void *const p_context, ipc_callback_args_t *const p_callback_memory)

Specify callback function and optional context pointer and working memory pointer.

Parameters
[in]p_ctrlPointer to the IPC control block.
[in]p_callbackCallback function
[in]p_contextPointer to send to callback function
[in]p_callback_memoryPointer to volatile memory where callback structure can be allocated. Callback arguments allocated here are only valid during the callback.

◆ close

fsp_err_t(* ipc_api_t::close) (ipc_ctrl_t *const p_ctrl)

Close IPC instance.

Parameters
[in]p_ctrlPointer to the IPC control block.

◆ ipc_instance_t

struct ipc_instance_t

This structure encompasses everything that is needed to use an instance of this interface.

Data Fields
ipc_ctrl_t * p_ctrl Pointer to the control structure for this instance.
ipc_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
ipc_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ ipc_ctrl_t

typedef void ipc_ctrl_t

IPC control block. Allocate an instance specific control block to pass into the IPC API calls.

Enumeration Type Documentation

◆ ipc_event_t

IPC Events

Enumerator
IPC_EVENT_IRQ0 

IRQ Event 0 set.

IPC_EVENT_IRQ1 

IRQ Event 1 set.

IPC_EVENT_IRQ2 

IRQ Event 2 set.

IPC_EVENT_IRQ3 

IRQ Event 3 set.

IPC_EVENT_IRQ4 

IRQ Event 4 set.

IPC_EVENT_IRQ5 

IRQ Event 5 set.

IPC_EVENT_IRQ6 

IRQ Event 6 set.

IPC_EVENT_IRQ7 

IRQ Event 7 set.

IPC_EVENT_MESSAGE_RECEIVED 

Message received over FIFO.

IPC_EVENT_FIFO_ERROR_EMPTY 

A read was attempted on an empty FIFO.

IPC_EVENT_FIFO_ERROR_FULL 

Data couldn't be written to a full FIFO.

◆ ipc_generate_event_t

IPC Generate Events

Enumerator
IPC_GENERATE_EVENT_IRQ0 

Generate IRQ Event 0.

IPC_GENERATE_EVENT_IRQ1 

Generate IRQ Event 1.

IPC_GENERATE_EVENT_IRQ2 

Generate IRQ Event 2.

IPC_GENERATE_EVENT_IRQ3 

Generate IRQ Event 3.

IPC_GENERATE_EVENT_IRQ4 

Generate IRQ Event 4.

IPC_GENERATE_EVENT_IRQ5 

Generate IRQ Event 5.

IPC_GENERATE_EVENT_IRQ6 

Generate IRQ Event 6.

IPC_GENERATE_EVENT_IRQ7 

Generate IRQ Event 7.