PDK API Guide for J721E
MailboxP

Introduction

MailboxP interface

Files

file  MailboxP.h
 Mailbox module for the RTOS Porting Interface.
 

Data Structures

struct  MailboxP_Params
 Basic MailboxP Parameters. More...
 

Functions

void MailboxP_Params_init (MailboxP_Params *params)
 Initialize params structure to default values. More...
 
MailboxP_Handle MailboxP_create (const MailboxP_Params *params)
 Function to create a mailbox. More...
 
MailboxP_Status MailboxP_delete (MailboxP_Handle handle)
 Function to delete a mailbox. More...
 
MailboxP_Status MailboxP_post (MailboxP_Handle handle, void *msg, uint32_t timeout)
 Function to post an message to the mailbox. More...
 
MailboxP_Status MailboxP_pend (MailboxP_Handle handle, void *msg, uint32_t timeout)
 Function to pend on a message for the mailbox. More...
 
int32_t MailboxP_getNumPendingMsgs (MailboxP_Handle handle)
 Function to return the count of the pending messages. More...
 

Typedefs

typedef void * MailboxP_Handle
 Opaque client reference to an instance of a MailboxP. More...
 

Enumerations

enum  MailboxP_Status { MailboxP_OK = 0, MailboxP_FAILURE = (-(int32_t)1), MailboxP_TIMEOUT = (-(int32_t)2) }
 Status codes for MailboxP APIs. More...
 

Macros

#define MailboxP_WAIT_FOREVER   (~((uint32_t)0U))
 Wait forever define. More...
 
#define MailboxP_NO_WAIT   ((uint32_t)0U)
 No wait define. More...
 

Macro Definition Documentation

◆ MailboxP_WAIT_FOREVER

#define MailboxP_WAIT_FOREVER   (~((uint32_t)0U))

Wait forever define.

◆ MailboxP_NO_WAIT

#define MailboxP_NO_WAIT   ((uint32_t)0U)

No wait define.

Typedef Documentation

◆ MailboxP_Handle

typedef void* MailboxP_Handle

Opaque client reference to an instance of a MailboxP.

A MailboxP_Handle returned from the MailboxP_create represents that instance and is used in the other instance based functions

Enumeration Type Documentation

◆ MailboxP_Status

Status codes for MailboxP APIs.

Enumerator
MailboxP_OK 

API completed successfully

MailboxP_FAILURE 

API failed

MailboxP_TIMEOUT 

API failed because of a timeout

Function Documentation

◆ MailboxP_Params_init()

void MailboxP_Params_init ( MailboxP_Params params)

Initialize params structure to default values.

Parameters
paramsPointer to the instance configuration parameters.

◆ MailboxP_create()

MailboxP_Handle MailboxP_create ( const MailboxP_Params params)

Function to create a mailbox.

Parameters
paramsPointer to the instance configuration parameters.
Returns
A MailboxP_Handle on success or a NULL on an error

◆ MailboxP_delete()

MailboxP_Status MailboxP_delete ( MailboxP_Handle  handle)

Function to delete a mailbox.

Parameters
handleA MailboxP_Handle returned from MailboxP_create
Returns
Status of the functions
  • MailboxP_OK: Deleted the mailbox instance
  • MailboxP_FAILURE: Failed to delete the mailbox instance

◆ MailboxP_post()

MailboxP_Status MailboxP_post ( MailboxP_Handle  handle,
void *  msg,
uint32_t  timeout 
)

Function to post an message to the mailbox.

Parameters
handleA MailboxP_Handle returned from MailboxP_create
msgThe message to post
timeoutTimeout (in milliseconds) to wait for post a message to the mailbox.
Returns
Status of the functions
  • MailboxP_OK: Deleted the mailbox instance
  • MailboxP_TIMEOUT: Timed out posting of message
  • MailboxP_FAILURE: Failed to start the mailbox instance

◆ MailboxP_pend()

MailboxP_Status MailboxP_pend ( MailboxP_Handle  handle,
void *  msg,
uint32_t  timeout 
)

Function to pend on a message for the mailbox.

Parameters
handleA MailboxP_Handle returned from MailboxP_create
msgThe message to pend
timeoutTimeout (in milliseconds) to wait for pend on a message to the mailbox.
Returns
Status of the functions
  • MailboxP_OK: Deleted the mailbox instance
  • MailboxP_TIMEOUT: Timed out pending on message
  • MailboxP_FAILURE: Failed to stop the mailbox instance

◆ MailboxP_getNumPendingMsgs()

int32_t MailboxP_getNumPendingMsgs ( MailboxP_Handle  handle)

Function to return the count of the pending messages.

Parameters
handleA MailboxP_Handle returned from MailboxP_create
Returns
The count of the pending messages