Sifli ipc_queue library interface. More...
Data Structures | |
struct | ipc_queue_cfg_t |
typedef int32_t | ipc_queue_handle_t |
typedef int32_t(* | ipc_queue_rx_ind_t) (ipc_queue_handle_t handle, size_t size) |
ipc_queue_handle_t | ipc_queue_init (ipc_queue_cfg_t *q_cfg) |
int32_t | ipc_queue_get_user_data (ipc_queue_handle_t handle, uint32_t *user_data) |
int32_t | ipc_queue_set_user_data (ipc_queue_handle_t handle, uint32_t user_data) |
int32_t | ipc_queue_open (ipc_queue_handle_t handle) |
bool | ipc_queue_is_open (ipc_queue_handle_t handle) |
int32_t | ipc_queue_close (ipc_queue_handle_t handle) |
int32_t | ipc_queue_deinit (ipc_queue_handle_t handle) |
size_t | ipc_queue_read (ipc_queue_handle_t handle, void *buffer, size_t size) |
size_t | ipc_queue_write (ipc_queue_handle_t handle, const void *buffer, size_t size, uint32_t timeout) |
bool | ipc_queue_check_idle (void) |
bool | ipc_queue_check_idle_rom (void) |
void | ipc_queue_restore_all (void) |
void | ipc_queue_restore_all_rom (void) |
size_t | ipc_queue_get_rx_size (ipc_queue_handle_t handle) |
#define | IPC_QUEUE_INVALID_HANDLE (0) |
Sifli ipc_queue library interface.
#define IPC_QUEUE_INVALID_HANDLE (0) |
Invalid queue handle
typedef int32_t ipc_queue_handle_t |
IPC queue handle type
typedef int32_t(* ipc_queue_rx_ind_t) (ipc_queue_handle_t handle, size_t size) |
IPC queue rx callback type
bool ipc_queue_check_idle | ( | void | ) |
Check whether ipc queue is idle from sender perspective
If all tx_buffer are empty, it's idle, even though rx_buffer is not empty
bool ipc_queue_check_idle_rom | ( | void | ) |
ipc_queue_check_idle ROM implementation placeholder
Weak function, can be replaced by ROM symbol. If not use ROM symbol, it's same as ipc_queue_check_idle.
int32_t ipc_queue_close | ( | ipc_queue_handle_t | handle | ) |
Close the IPC queue
After closing the queue, it cannot receive and send data.
[in] | handle | queue handle |
int32_t ipc_queue_deinit | ( | ipc_queue_handle_t | handle | ) |
Deinitialize the IPC queue
After deinitializatio the queue with same queue id can be intialized again.
[in] | handle | queue handle |
size_t ipc_queue_get_rx_size | ( | ipc_queue_handle_t | handle | ) |
Get available data size in rx buffer
[in] | handle | queue handle |
int32_t ipc_queue_get_user_data | ( | ipc_queue_handle_t | handle, |
uint32_t * | user_data | ||
) |
Get user data
[in] | handle | queue handle |
[in,out] | user_data | user data is saved in the memory pointed by user_data pointer |
ipc_queue_handle_t ipc_queue_init | ( | ipc_queue_cfg_t * | q_cfg | ) |
Initialize one IPC queue according to the q_cfg
A valid queue handle is returned if queue is intialized succesfully. The queue with same queue id cannot be initialized twice.
[in] | q_cfg | queue configuration |
bool ipc_queue_is_open | ( | ipc_queue_handle_t | handle | ) |
Check whether the IPC queue is open
[in] | handle | queue handle |
int32_t ipc_queue_open | ( | ipc_queue_handle_t | handle | ) |
Open the IPC queue
After opened, the queue is ready to receive and send data
[in] | handle | queue handle |
size_t ipc_queue_read | ( | ipc_queue_handle_t | handle, |
void * | buffer, | ||
size_t | size | ||
) |
Read data from IPC queue
Data is read from rx buffer to saved in buffer
[in] | handle | queue handle |
[in] | buffer | point to the buffer to save read data |
[in] | size | size of data to be read |
void ipc_queue_restore_all | ( | void | ) |
Restore IPC queue hardware setting
HW setting may get lost if the power domain is powered off, if the software configuration is present, this function can be used to restore the hw setting after power domain is powered on.
void ipc_queue_restore_all_rom | ( | void | ) |
ipc_queue_restore_all ROM implementation placeholder
Weak function, can be replaced by ROM symbol. If not use ROM symbol, it's same as ipc_queue_restore_all.
int32_t ipc_queue_set_user_data | ( | ipc_queue_handle_t | handle, |
uint32_t | user_data | ||
) |
Set user data
[in] | handle | queue handle |
[in] | user_data | user data |
size_t ipc_queue_write | ( | ipc_queue_handle_t | handle, |
const void * | buffer, | ||
size_t | size, | ||
uint32_t | timeout | ||
) |
Write data to IPC queue and inform the receiver to read
Data is written to tx buffer, interrupt is triggered to inform the receiver. The API is not thread-safe. It should be avoided to write the same queue in different threads.
[in] | handle | queue handle |
[in] | buffer | data buffer |
[in] | size | size of data to be written |
[in] | timeout | time to wait if tx buffer is full, the unit is HAL_GetTick |