MCUXpresso SDK API Reference Manual
Rev 2.12.1
NXP Semiconductors
|
Data Structures | |
struct | hal_rpmsg_config_t |
The configure structure of RPMSG adapter. More... | |
Macros | |
#define | HAL_RPMSG_SELECT_ROLE (1U) |
RPMSG Msaster/Remote role definition (0 - Master, 1 - Remote) | |
#define | HAL_RPMSG_HANDLE_SIZE (52U) |
RPMSG handle size definition. | |
#define | RPMSG_HANDLE_DEFINE(name) uint32_t name[((HAL_RPMSG_HANDLE_SIZE + sizeof(uint32_t) - 1U) / sizeof(uint32_t))] |
Defines the rpmsg handle. More... | |
Typedefs | |
typedef void * | hal_rpmsg_handle_t |
The handle of RPMSG adapter. | |
typedef hal_rpmsg_return_status_t(* | rpmsg_rx_callback_t )(void *param, uint8_t *data, uint32_t len) |
The callback function of RPMSG adapter. More... | |
Enumerations | |
enum | hal_rpmsg_status_t |
RPMSG status. | |
enum | hal_rpmsg_return_status_t |
RPMSG return status. | |
Functions | |
hal_rpmsg_status_t | HAL_RpmsgMcmgrInit (void) |
Initializes the RPMSG adapter module for dual core communication. More... | |
hal_rpmsg_status_t | HAL_RpmsgInit (hal_rpmsg_handle_t handle, hal_rpmsg_config_t *config) |
Initializes the RPMSG adapter for RPMSG channel configure. More... | |
hal_rpmsg_status_t | HAL_RpmsgDeinit (hal_rpmsg_handle_t handle) |
DeInitilizate the RPMSG adapter module. More... | |
hal_rpmsg_status_t | HAL_RpmsgSend (hal_rpmsg_handle_t handle, uint8_t *data, uint32_t length) |
Send data to another RPMSG module. More... | |
void * | HAL_RpmsgAllocTxBuffer (hal_rpmsg_handle_t handle, uint32_t size) |
Allocates the tx buffer for message payload. More... | |
hal_rpmsg_status_t | HAL_RpmsgNoCopySend (hal_rpmsg_handle_t handle, uint8_t *data, uint32_t length) |
Send data with NoCopy to another RPMSG module. More... | |
hal_rpmsg_status_t | HAL_RpmsgFreeRxBuffer (hal_rpmsg_handle_t handle, uint8_t *data) |
Releases the rx buffer for future reuse in vring. More... | |
hal_rpmsg_status_t | HAL_RpmsgInstallRxCallback (hal_rpmsg_handle_t handle, rpmsg_rx_callback_t callback, void *param) |
Install RPMSG rx callback. More... | |
hal_rpmsg_status_t | HAL_RpmsgEnterLowpower (hal_rpmsg_handle_t handle) |
Prepares to enter low power consumption. More... | |
hal_rpmsg_status_t | HAL_RpmsgExitLowpower (hal_rpmsg_handle_t handle) |
Prepares to exit low power consumption. More... | |
struct hal_rpmsg_config_t |
#define RPMSG_HANDLE_DEFINE | ( | name | ) | uint32_t name[((HAL_RPMSG_HANDLE_SIZE + sizeof(uint32_t) - 1U) / sizeof(uint32_t))] |
This macro is used to define a 4 byte aligned rpmsg handle. Then use "(hal_rpmsg_handle_t)name" to get the rpmsg handle.
The macro should be global and could be optional. You could also define rpmsg handle by yourself.
This is an example,
name | The name string of the rpmsg handle. |
typedef hal_rpmsg_return_status_t(* rpmsg_rx_callback_t)(void *param, uint8_t *data, uint32_t len) |
hal_rpmsg_status_t HAL_RpmsgMcmgrInit | ( | void | ) |
kStatus_HAL_RpmsgSuccess | RPMSG module initialize succeed. |
hal_rpmsg_status_t HAL_RpmsgInit | ( | hal_rpmsg_handle_t | handle, |
hal_rpmsg_config_t * | config | ||
) |
handle | Pointer to point to a memory space of size HAL_RPMSG_HANDLE_SIZE allocated by the caller. The handle should be 4 byte aligned, because unaligned access doesn't be supported on some devices. You can define the handle in the following two ways: RPMSG_HANDLE_DEFINE(handle); or uint32_t handle[((HAL_RPMSG_HANDLE_SIZE + sizeof(uint32_t) - 1U) / sizeof(uint32_t))]; |
config | Used for config local/remote endpoint addr. |
kStatus_HAL_RpmsgSuccess | RPMSG module initialize succeed. |
hal_rpmsg_status_t HAL_RpmsgDeinit | ( | hal_rpmsg_handle_t | handle | ) |
handle | RPMSG handle pointer. |
kStatus_HAL_RpmsgSuccess | RPMSG module deinitialize succeed. |
hal_rpmsg_status_t HAL_RpmsgSend | ( | hal_rpmsg_handle_t | handle, |
uint8_t * | data, | ||
uint32_t | length | ||
) |
This function will send a specified length of data to another core by RPMSG.
handle | RPMSG handle pointer. |
data | Pointer to where the send data from. |
length | The send data length. |
kStatus_HAL_RpmsgSuccess | RPMSG send data succeed. |
void* HAL_RpmsgAllocTxBuffer | ( | hal_rpmsg_handle_t | handle, |
uint32_t | size | ||
) |
This API can only be called at process context to get the tx buffer in vring. By this way, the application can directly put its message into the vring tx buffer without copy from an application buffer. It is the application responsibility to correctly fill the allocated tx buffer by data and passing correct parameters to the rpmsg_lite_send_nocopy() function to perform data no-copy-send mechanism.
handle | RPMSG handle pointer. |
size | The send data length. |
The | tx buffer address on success and RL_NULL on failure. |
hal_rpmsg_status_t HAL_RpmsgNoCopySend | ( | hal_rpmsg_handle_t | handle, |
uint8_t * | data, | ||
uint32_t | length | ||
) |
This function will send a specified length of data to another core by RPMSG. This function sends txbuf of length len to the remote dst address, and uses ept->addr as the source address. The application has to take the responsibility for:
After the HAL_RpmsgNoCopySend() function is issued the tx buffer is no more owned by the sending task and must not be touched anymore unless the HAL_RpmsgNoCopySend() function fails and returns an error.
handle | RPMSG handle pointer. |
data | Pointer to where the send data from. |
length | The send data length. |
kStatus_HAL_RpmsgSuccess | RPMSG send data succeed. |
hal_rpmsg_status_t HAL_RpmsgFreeRxBuffer | ( | hal_rpmsg_handle_t | handle, |
uint8_t * | data | ||
) |
This API can be called at process context when the message in rx buffer is processed.
handle | RPMSG handle pointer. |
data | Pointer to where the received data from perr. |
hal_rpmsg_status_t HAL_RpmsgInstallRxCallback | ( | hal_rpmsg_handle_t | handle, |
rpmsg_rx_callback_t | callback, | ||
void * | param | ||
) |
handle | RPMSG handle pointer. |
kStatus_HAL_RpmsgSuccess | RPMSG install rx callback succeed. |
hal_rpmsg_status_t HAL_RpmsgEnterLowpower | ( | hal_rpmsg_handle_t | handle | ) |
This function is used to prepare to enter low power consumption.
handle | RPMSG handle pointer. |
kStatus_HAL_RpmsgSuccess | Successful operation. |
kStatus_HAL_RpmsgError | An error occurred. |
hal_rpmsg_status_t HAL_RpmsgExitLowpower | ( | hal_rpmsg_handle_t | handle | ) |
This function is used to restore from low power consumption.
handle | RPMSG handle pointer. |
kStatus_HAL_RpmsgSuccess | Successful operation. |
kStatus_HAL_RpmsgError | An error occurred. |