See IPC RPMessage for more details.
Data Structures | |
struct | RPMessage_Object |
Opaque RPMessage object used with the RPMessage APIs. More... | |
struct | RPMessage_CreateParams |
Parameters passed to RPMessage_construct. More... | |
struct | RPMessage_Params |
Parameters passed to RPMessage_init, these are generated via SysCfg. More... | |
Functions | |
void | RPMessage_Params_init (RPMessage_Params *params) |
Set default values to RPMessage_Params. More... | |
void | RPMessage_CreateParams_init (RPMessage_CreateParams *params) |
Set default values to RPMessage_CreateParams. More... | |
int32_t | RPMessage_init (const RPMessage_Params *params) |
Initialize RPMessage module. More... | |
void | RPMessage_deInit (void) |
De-Initialize RPMessage module. More... | |
int32_t | RPMessage_waitForLinuxReady (uint32_t timeout) |
Wait for linux side RPMessage to be ready. More... | |
void | RPMessage_controlEndPtCallback (RPMessage_ControlEndPtCallback controlEndPtCallback, void *controlEndPtCallbackArgs) |
Callback to call when a control message is received on a control end point. More... | |
int32_t | RPMessage_construct (RPMessage_Object *obj, const RPMessage_CreateParams *createParams) |
Create a RPMessage object to receive messages at a specified end-point. More... | |
void | RPMessage_destruct (RPMessage_Object *obj) |
Delete a previously created RPMessage object. More... | |
void | RPMessage_unblock (RPMessage_Object *obj) |
Unblocks RPMessage_recv, for the input object, if it is blocked waiting on messages and users want to exit that task. More... | |
uint16_t | RPMessage_getLocalEndPt (const RPMessage_Object *obj) |
Return local end point of a RPMessage_Object. More... | |
int32_t | RPMessage_announce (uint16_t remoteProcId, uint16_t localEndPt, const char *name) |
Announce a local end point at which a service is created to a remote core. More... | |
int32_t | RPMessage_send (void *data, uint16_t dataLen, uint16_t remoteCoreId, uint16_t remoteEndPt, uint16_t localEndPt, uint32_t timeout) |
Send a message to a remote core at a specified remote end point. More... | |
int32_t | RPMessage_recv (RPMessage_Object *obj, void *data, uint16_t *dataLen, uint16_t *remoteCoreId, uint16_t *remoteEndPt, uint32_t timeout) |
Blocking API to wait till a message is received from any CPU at the specified local end point. More... | |
Typedefs | |
typedef void(* | RPMessage_RecvCallback) (RPMessage_Object *obj, void *arg, void *data, uint16_t dataLen, int32_t crcStatus, uint16_t remoteCoreId, uint16_t remoteEndPt) |
Callback that is invoked when a message is received from any CPU at the specified local end point. More... | |
typedef void(* | RPMessage_RecvNotifyCallback) (RPMessage_Object *obj, void *arg) |
Callback that is invoked when a message is received from any CPU at the specified local end point. More... | |
typedef void(* | RPMessage_ControlEndPtCallback) (void *arg, uint16_t remoteCoreId, uint16_t remoteEndPt, const char *remoteServiceName) |
Callback that is invoked when a annoucement message is received on the control end point. More... | |
typedef int32_t(* | RPMessage_CrcHookFxn) (uint8_t *data, uint16_t dataLen, uint8_t crcSize, void *crc) |
This is the CRC Hook function to be defined in application for CRC Calculation. More... | |
Macros | |
#define | RPMESSAGE_MAX_LOCAL_ENDPT (64U) |
Users can create RPMessage_Object with local end value in the range of 0 .. RPMESSAGE_MAX_LOCAL_ENDPT - 1. More... | |
#define | RPMESSAGE_VRING_ADDR_INVALID (0xFFFFFFFFU) |
Value to indicate if vring ID is valid or NOT. More... | |
#define | RPMESSAGE_VRING_SIZE(numBuf, bufSize) (((numBuf)*(uint16_t)((bufSize)+32U))+32U) |
Returns the size needed for each VRING. More... | |
#define | RPMESSAGE_OBJECT_SIZE_MAX (192U) |
Size of RPMessage_Object. More... | |
#define | RPMESSAGE_CRC_SIZE (2U) |
CRC size in bytes for IPC RPMsg. More... | |
#define RPMESSAGE_MAX_LOCAL_ENDPT (64U) |
Users can create RPMessage_Object with local end value in the range of 0 .. RPMESSAGE_MAX_LOCAL_ENDPT - 1.
This limit is put to allow fast indexing of end point object to recevied messages and the value is kept small to save memory space
#define RPMESSAGE_VRING_ADDR_INVALID (0xFFFFFFFFU) |
Value to indicate if vring ID is valid or NOT.
When a core does not participate in IPC RPMessage set the vring ID in RPMessage_Params to this value
#define RPMESSAGE_VRING_SIZE | ( | numBuf, | |
bufSize | |||
) | (((numBuf)*(uint16_t)((bufSize)+32U))+32U) |
Returns the size needed for each VRING.
This is approximate size that is >= to actual required size. Approximate size is returned to allow compile time macro for size calculation. Actual required size is calculated in the internal run-time function RPMessage_vringGetSize
. However this can be ignored by end users. During initialization, a assert is used to check if user provided size is >= actual required size.
numBuf | [in] Number of buffer in the VRING |
bufSize | [in] Size of each buffer, in units of bytes |
#define RPMESSAGE_OBJECT_SIZE_MAX (192U) |
Size of RPMessage_Object.
#define RPMESSAGE_CRC_SIZE (2U) |
CRC size in bytes for IPC RPMsg.
typedef void(* RPMessage_RecvCallback) (RPMessage_Object *obj, void *arg, void *data, uint16_t dataLen, int32_t crcStatus, uint16_t remoteCoreId, uint16_t remoteEndPt) |
Callback that is invoked when a message is received from any CPU at the specified local end point.
The callback can be optionally registered during RPMessage_construct
obj | [in] RPMessage end point object created with RPMessage_construct |
arg | [in] Arguments specified by user during RPMessage_construct |
data | [in] Pointer to message |
dataLen | [in] Length of message |
crcStatus | [in] CRC Check status. SystemP_SUCCESS on success, else SystemP_FAILURE. |
remoteCoreId | [in] Core ID of sender |
remoteEndPt | [in] End point of sender |
typedef void(* RPMessage_RecvNotifyCallback) (RPMessage_Object *obj, void *arg) |
Callback that is invoked when a message is received from any CPU at the specified local end point.
The callback can be optionally registered during RPMessage_construct
obj | [in] RPMessage end point object created with RPMessage_construct |
arg | [in] Arguments specified by user during RPMessage_construct |
typedef void(* RPMessage_ControlEndPtCallback) (void *arg, uint16_t remoteCoreId, uint16_t remoteEndPt, const char *remoteServiceName) |
Callback that is invoked when a annoucement message is received on the control end point.
The callback can be optionally registered during RPMessage_init
arg | [in] Arguments specified by user during RPMessage_init |
remoteCoreId | [in] Core ID of sender |
remoteEndPt | [in] End point of sender that has annoucned the service over the control end point |
remoteServiceName | [in] Name of the remote service that is annoucned |
typedef int32_t(* RPMessage_CrcHookFxn) (uint8_t *data, uint16_t dataLen, uint8_t crcSize, void *crc) |
This is the CRC Hook function to be defined in application for CRC Calculation.
data | [in] Pointer to data. |
dataLen | [in] Length of message in bytes. |
crcSize | [in] Size of CRC to be calculated in bytes. |
crc | [out] Pointer to the calculated CRC value. |
void RPMessage_Params_init | ( | RPMessage_Params * | params | ) |
Set default values to RPMessage_Params.
params | [out] default intialized structure |
void RPMessage_CreateParams_init | ( | RPMessage_CreateParams * | params | ) |
Set default values to RPMessage_CreateParams.
params | [out] default intialized structure |
int32_t RPMessage_init | ( | const RPMessage_Params * | params | ) |
Initialize RPMessage module.
params | [in] Initialization parameters |
void RPMessage_deInit | ( | void | ) |
De-Initialize RPMessage module.
int32_t RPMessage_waitForLinuxReady | ( | uint32_t | timeout | ) |
Wait for linux side RPMessage to be ready.
Messages should not be sent to Linux, if enabled, until this function return success.
timeout | [in] Timeout in units of system ticks |
void RPMessage_controlEndPtCallback | ( | RPMessage_ControlEndPtCallback | controlEndPtCallback, |
void * | controlEndPtCallbackArgs | ||
) |
Callback to call when a control message is received on a control end point.
controlEndPtCallback | [in] User callback to invoke |
controlEndPtCallbackArgs | [in] Arguments pass to the user control end point callback |
int32_t RPMessage_construct | ( | RPMessage_Object * | obj, |
const RPMessage_CreateParams * | createParams | ||
) |
Create a RPMessage object to receive messages at a specified end-point.
ANY
is not supported obj | [out] Created object |
createParams | [in] parameters |
void RPMessage_destruct | ( | RPMessage_Object * | obj | ) |
Delete a previously created RPMessage object.
obj | [in] object |
void RPMessage_unblock | ( | RPMessage_Object * | obj | ) |
Unblocks RPMessage_recv, for the input object, if it is blocked waiting on messages and users want to exit that task.
obj | [in] object |
uint16_t RPMessage_getLocalEndPt | ( | const RPMessage_Object * | obj | ) |
Return local end point of a RPMessage_Object.
The value will be same as that was used to create the object earlier.
obj | [in] object |
int32_t RPMessage_announce | ( | uint16_t | remoteProcId, |
uint16_t | localEndPt, | ||
const char * | name | ||
) |
Announce a local end point at which a service
is created to a remote core.
ALL
option remoteProcId | [in] The remote core to annouce to. |
localEndPt | [in] Local end point of the service that is being announced |
name | [in] Name of the service that is being announced |
int32_t RPMessage_send | ( | void * | data, |
uint16_t | dataLen, | ||
uint16_t | remoteCoreId, | ||
uint16_t | remoteEndPt, | ||
uint16_t | localEndPt, | ||
uint32_t | timeout | ||
) |
Send a message to a remote core at a specified remote end point.
dataLen
MUST be <= RPMessage_Params::vringMsgSize - 16 bytes for internal header remoteEndPt
timeout
ticks for a free buffer to be available.data | [in] Pointer to message data to send |
dataLen | [in] size of message data to send |
remoteCoreId | [in] Remote core ID to whom the message is being sent |
remoteEndPt | [in] Remote core end point ID to which the message is being sent |
localEndPt | [in] Local end point that is sending the message |
timeout | [in] Amount of time to wait, in units of system ticks |
int32_t RPMessage_recv | ( | RPMessage_Object * | obj, |
void * | data, | ||
uint16_t * | dataLen, | ||
uint16_t * | remoteCoreId, | ||
uint16_t * | remoteEndPt, | ||
uint32_t | timeout | ||
) |
Blocking API to wait till a message is received from any CPU at the specified local end point.
dataLen
when passed by user contains the user message buffer size, i.e size of buffer pointer to by 'data`. If received message size exceeds *dataLen then it is truncated. If received message size is <= *dataLen then all received bytes are copied to data
and *dataLen indicates the size of valid bytes in data
obj | [in] RPMessage end point object created with RPMessage_construct |
data | [in] Pointer to received message contents |
dataLen | [in] Length of user message buffer, in bytes [out] Size of received message, in bytes |
remoteCoreId | [out] Core ID of sender |
remoteEndPt | [out] End point of sender |
timeout | [in] Time in system ticks to block for a message receive |