PDK API Guide for J721E
|
This is IPC's top level include for applications
Files | |
file | ipc.h |
IPC Low Level Driver API/interface data types file. | |
Data Structures | |
struct | Ipc_InitPrms |
IPC initialization parameters. More... | |
struct | RPMessage_Params |
Parameter structure for creating RPMessage endpoints. More... | |
Functions | |
void | IpcInitPrms_init (uint32_t instId, Ipc_InitPrms *initPrms) |
Initialize IPC init params. More... | |
int32_t | Ipc_init (Ipc_InitPrms *cfg) |
Initialize IPC module. More... | |
int32_t | Ipc_deinit (void) |
De Initialize IPC module. More... | |
uint32_t | RPMessage_getMessageBufferSize (void) |
Returns Message Buffer Size. More... | |
uint32_t | RPMessage_getObjMemRequired (void) |
Returns local memory for RPMessage Object. More... | |
int32_t | RPMessage_init (RPMessage_Params *params) |
Initialize RPMessage Module. More... | |
int32_t | RPMessage_lateInit (uint32_t proc) |
Add a proc to RPMessage Module. More... | |
void | RPMessage_deInit (void) |
Tear down the RPMessage Module. The module API should not be used after this is called. More... | |
int32_t | RPMessageParams_init (RPMessage_Params *params) |
Initialize an RPMessage_Params structure to default values. More... | |
RPMessage_Handle | RPMessage_create (RPMessage_Params *params, uint32_t *endPt) |
Create a endpoint instance for receiving. More... | |
int32_t | RPMessage_setCallback (RPMessage_Handle handle, RPMessage_Callback cb, void *arg) |
Sets callback. More... | |
int32_t | RPMessage_recv (RPMessage_Handle handle, void *data, uint16_t *len, uint32_t *rplyEndPt, uint32_t *fromProcId, uint32_t timeout) |
Receives a message from an endpoint instance. More... | |
int32_t | RPMessage_recvNb (RPMessage_Handle handle, void *data, uint16_t *len, uint32_t *rplyEndPt, uint32_t *fromProcId) |
A non blocking API to receive message. More... | |
int32_t | RPMessage_send (RPMessage_Handle handle, uint32_t dstProc, uint32_t dstEndPt, uint32_t srcEndPt, void *data, uint16_t len) |
Sends data to a remote processor. More... | |
int32_t | RPMessage_delete (RPMessage_Handle *handlePtr) |
Delete an endpoint instance. More... | |
void | RPMessage_unblock (RPMessage_Handle handle) |
Unblocks an RPMessage_recv() More... | |
int32_t | RPMessage_getRemoteEndPt (uint32_t selfProcId, const char *name, uint32_t *remoteProcId, uint32_t *remoteEndPt, uint32_t timeout) |
Wait for an endpoint to become available on another processor. More... | |
int32_t | RPMessage_getRemoteEndPtToken (uint32_t selfProcId, const char *name, uint32_t *remoteProcId, uint32_t *remoteEndPt, uint32_t timeout, uint32_t token) |
void | RPMessage_unblockGetRemoteEndPt (uint32_t token) |
Unblocks an RPMessage_getRemoteEndPtToken() call. More... | |
int32_t | RPMessage_announce (uint32_t remoteProcId, uint32_t endPt, const char *name) |
Annouce the name of an endpoint and that it is ready to to receive messages. More... | |
void | Ipc_newMessageIsr (uint32_t srcProcId) |
New Message Interrupt Handler. More... | |
void | Ipc_mailboxEnableNewMsgInt (uint16_t selfId, uint16_t remoteProcId) |
API Mailbox Enable new MSG interrupt for a given remote processor. More... | |
void | Ipc_mailboxDisableNewMsgInt (uint16_t selfId, uint16_t remoteProcId) |
API Mailbox Disable new MSG interrupt for a given remote processor. More... | |
Typedefs | |
typedef struct RPMessage_Object_s * | RPMessage_Handle |
RPMessage_Handle type. More... | |
typedef void(* | RPMessage_Callback) (RPMessage_Handle handle, void *arg, void *data, uint16_t len, uint32_t src) |
RPMessage_Callback. More... | |
typedef struct RPMessage_Object_s* RPMessage_Handle |
RPMessage_Handle type.
typedef void(* RPMessage_Callback) (RPMessage_Handle handle, void *arg, void *data, uint16_t len, uint32_t src) |
RPMessage_Callback.
RPMessage_Handle | [IN] |
arg | [IN] void* arguments to function |
data | [IN] data pointer |
len | [IN] length of data |
src | [IN] source |
void IpcInitPrms_init | ( | uint32_t | instId, |
Ipc_InitPrms * | initPrms | ||
) |
Initialize IPC init params.
Can be called to initialize the #Ipc_InitPrms to the default values.
instId | [IN] Ipc_InstanceId. Only 1 instance is supported in this implementation. The value shall be 0 |
initPrms | [IN] Pointer to param structure to be initialized. When building for tirtos environment, it will be filled with tirtos-compatible definitions. When using the ipc_baremetal implementation, it will be filled with baremetal definitions. |
int32_t Ipc_init | ( | Ipc_InitPrms * | cfg | ) |
Initialize IPC module.
Very first API to be invoked to initialize internal data structure and utilities required.
cfg | [IN] Initialization parameters. May be NULL in order to use the module default implementation. May be non-NULL in order to use user-specified implementation. |
int32_t Ipc_deinit | ( | void | ) |
uint32_t RPMessage_getMessageBufferSize | ( | void | ) |
Returns Message Buffer Size.
uint32_t RPMessage_getObjMemRequired | ( | void | ) |
Returns local memory for RPMessage Object.
int32_t RPMessage_init | ( | RPMessage_Params * | params | ) |
Initialize RPMessage Module.
Can be called from Main or Task context. Must be called before calling any other RPMessage function;
params | [IN] Address of the RPMessage_Params structure used to create the RPMessage |
int32_t RPMessage_lateInit | ( | uint32_t | proc | ) |
void RPMessage_deInit | ( | void | ) |
Tear down the RPMessage Module. The module API should not be used after this is called.
int32_t RPMessageParams_init | ( | RPMessage_Params * | params | ) |
Initialize an RPMessage_Params structure to default values.
This function must be called before on a RPMessage_Params before passing it to RPMessage_create().
params | [IN] Address of the RPMessage_Params structure to be initialized. |
RPMessage_Handle RPMessage_create | ( | RPMessage_Params * | params, |
uint32_t * | endPt | ||
) |
Create a endpoint instance for receiving.
The returned handle is to an object containing a queue for receiving messages from the transport, and a 32 bit endpoint ID unique to this local processor.
params | [IN] RPMessage_Params Address of an initialized RPMessage_Params structure or NULL will use defaults. |
endPt | [OUT] Endpoint ID for this side of the connection. |
int32_t RPMessage_setCallback | ( | RPMessage_Handle | handle, |
RPMessage_Callback | cb, | ||
void * | arg | ||
) |
Sets callback.
Sets the callback function and function arguments, so that it does not need to wai for semaphore.
handle | [IN] An RPMessage_handle |
cb | [IN] RPMessage_Callback Callback function. |
arg | [IN] Arguments of the callback function |
int32_t RPMessage_recv | ( | RPMessage_Handle | handle, |
void * | data, | ||
uint16_t * | len, | ||
uint32_t * | rplyEndPt, | ||
uint32_t * | fromProcId, | ||
uint32_t | timeout | ||
) |
Receives a message from an endpoint instance.
This function returns a status. It also copies data to the client. If no message is available, it blocks on the semaphore object until the semaphore is signaled or a timeout occurs. The semaphore is signaled, when Message_send is called to deliver a message to this endpoint. If a timeout occurs, len is set to zero and the status is RPMessage_E_TIMEOUT. If a timeout of zero is specified, the function returns immediately and if no message is available, the len is set to zero and the status is RPMessage_E_TIMEOUT. RPMessage_E_UNBLOCKED status is returned, if RPMessage_unblock() is called on the RPMessage handle. When a message is retrieved, the message data is copied into the memory location of the data pointer, and RPMessage_S_SUCCESS status is returned.
handle | [IN] An RPMessage_handle |
data | [OUT] Pointer to the client's data buffer. |
len | [OUT] Amount of data received. |
rplyEndPt | [OUT] Endpoint of source (for replies). |
fromProcId | [OUT] ProcId of source (for replies). |
timeout | [IN] Maximum duration to wait for a message in microseconds. |
RPMessage_send RPMessage_unblock
int32_t RPMessage_recvNb | ( | RPMessage_Handle | handle, |
void * | data, | ||
uint16_t * | len, | ||
uint32_t * | rplyEndPt, | ||
uint32_t * | fromProcId | ||
) |
A non blocking API to receive message.
This function check if there any received messages, if found the received message is copied into buffer provided by the caller. The caller will have to allocate sufficient buffer to account for the reception of the largest message. Configured while creating the driver.
handle | [IN] An RPMessage_handle |
data | [OUT] Pointer to the buffer, allocted by the caller |
len | [OUT] Size of the received buffer, in bytes |
rplyEndPt | [OUT] Endpoint of source (for replies) |
fromProcId | [OUT] ProcId of source (for replies) |
int32_t RPMessage_send | ( | RPMessage_Handle | handle, |
uint32_t | dstProc, | ||
uint32_t | dstEndPt, | ||
uint32_t | srcEndPt, | ||
void * | data, | ||
uint16_t | len | ||
) |
int32_t RPMessage_delete | ( | RPMessage_Handle * | handlePtr | ) |
void RPMessage_unblock | ( | RPMessage_Handle | handle | ) |
Unblocks an RPMessage_recv()
Unblocks a reader thread that is blocked on a RPMessage_recv. The RPMessage_recv call will return with status IPC_E_UNBLOCKED indicating that it returned due to a RPMessage_unblock rather than by a timeout or receiving a message.
Restrictions:
[in] | handle | RPMessage handle |
int32_t RPMessage_getRemoteEndPt | ( | uint32_t | selfProcId, |
const char * | name, | ||
uint32_t * | remoteProcId, | ||
uint32_t * | remoteEndPt, | ||
uint32_t | timeout | ||
) |
Wait for an endpoint to become available on another processor.
Block the current task until the specified processor announces the named endpoint. The name is a string that identifies the service that is offered on the endpoint. This allows an application to both wait for the remote processor to signal that it is ready to communicate and to lookup services by name. The procId can be that of a specific processor or PRMessage_ANY to wait for any processor to announce the named endpoint. Suitable values for timeout are the same as for the ti.sysbios.knl.Semaphore module.
selfProcId | [IN] Remote processor ID |
name | [IN] Name of the endpoint |
remoteProcId | [OUT] Remote processor ID |
remoteEndPt | [OUT] Remote endpoint ID |
timeout | [IN] Timeout value (in system ticks) |
int32_t RPMessage_getRemoteEndPtToken | ( | uint32_t | selfProcId, |
const char * | name, | ||
uint32_t * | remoteProcId, | ||
uint32_t * | remoteEndPt, | ||
uint32_t | timeout, | ||
uint32_t | token | ||
) |
void RPMessage_unblockGetRemoteEndPt | ( | uint32_t | token | ) |
Unblocks an RPMessage_getRemoteEndPtToken() call.
Unblocks a thread that is blocked on a RPMessage_getRemoteEndPtToken. The RPMessage_getRemoteEndPtToken call will return with status an invalid remoteProcId and remoteEndPt (RPMESSAGE_ANY) indicating that it returned due to a RPMessage_unblockGetRemoteEndPt rather than by a timeout or receiving the requested remote endpoint.
[in] | token | Token passed when calling RPMessage_getRemoteEndPtToken |
int32_t RPMessage_announce | ( | uint32_t | remoteProcId, |
uint32_t | endPt, | ||
const char * | name | ||
) |
Annouce the name of an endpoint and that it is ready to to receive messages.
Announcing an endpoint to other processesors acheives two goals. First it signals that the endpoint is ready to recieve, and second, the endpoint is offering the named service. Announcements can be sent to all remote processors by using RPMessage_ALL for remoteProcId, otherwise only the specified processor recieves the announcement. The name may not be an empty string or NULL. The value of endPt should have been returned by a prior call to RPMessage_create().
remoteProcId | [IN] RPMessage_Params The remote processor to receive the announcement |
endPt | [IN] Endpoint ID to announce |
name | [IN] Name of the service on the endpoint |
void Ipc_newMessageIsr | ( | uint32_t | srcProcId | ) |
New Message Interrupt Handler.
When built for baremetal applications, the IPC driver do not register interrupt handler to handle interrupts from mailbox. It's expected that user of this driver shall invoke this function, on reception of interrupt from the mailbox associated with remote processor
srcProcId | [IN] The remote processor ID |
void Ipc_mailboxEnableNewMsgInt | ( | uint16_t | selfId, |
uint16_t | remoteProcId | ||
) |
API Mailbox Enable new MSG interrupt for a given remote processor.
selfId | Self Processor Identifier |
remoteProcId | Remote Processor ID |
void Ipc_mailboxDisableNewMsgInt | ( | uint16_t | selfId, |
uint16_t | remoteProcId | ||
) |
API Mailbox Disable new MSG interrupt for a given remote processor.
selfId | Self Processor Identifier |
remoteProcId | Remote Processor ID |