MCUXpresso SDK API Reference Manual  Rev 2.16.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
IMU_Adapter

Overview

Data Structures

struct  IMU_Hdr_t
 IMU message header structure. More...
 
struct  IMU_Msg_t
 IMU message structure. More...
 
struct  IMU_Msg_Wrapper_long_t
 IMU message wrapper 1. More...
 
struct  IMU_Msg_Wrapper_short_t
 IMU message wrapper 2. More...
 
struct  rpmsg_std_hdr
 Common header for all rpmsg messages. More...
 
struct  rpmsg_std_msg
 Common message structure. More...
 
struct  hal_rpmsg_state_t
 rpmsg state structure. More...
 
struct  hal_rpmsg_ept_buf_t
 rpmsg ept buf structure. More...
 
struct  IMU_WLAN_TXQ_CTRL_st
 IMU WLAN Tx buffer control structure. More...
 
struct  RPMSG_TXQ_CTRL_st
 RPMSG Tx buffer control structure. More...
 
struct  hal_imu_handle_t
 imu handle structure. More...
 

Macros

#define IRQ_IMU_CPU13   WL_MCI_WAKEUP0_IRQn
 IRQ index should come from board level definition. More...
 
#define IMU_PAYLOAD_SIZE   (8U)
 IMU message payload size. More...
 
#define IS_WLAN_TXBQ_EMPTY(q)   ((q)->writeIndex == (q)->readIndex)
 Checks whether a tx buffer queue is empty.
 
#define IS_WLAN_TXBQ_FULL(q)
 Checks whether a tx buffer queue is full.
 
#define INCR_WLAN_TXBQ_WR_INDEX(q, n)
 Increments write pointer.
 
#define INCR_WLAN_TXBQ_RD_INDEX(q, n)
 Increments read pointer.
 
#define IS_RPMSG_TXBQ13_EMPTY(q)   ((q)->writeIndex == (q)->readIndex)
 Checks whether a tx buffer queue is empty.
 
#define IS_RPMSG_TXBQ13_FULL(q)
 Checks whether a tx buffer queue is full.
 
#define INCR_RPMSG_TXBQ13_WR_INDEX(q, n)
 Increments write pointer.
 
#define INCR_RPMSG_TXBQ13_RD_INDEX(q, n)
 Increments read pointer.
 

Typedefs

typedef void(* imu_irq_callback_t )(void)
 IMU interrupt callback.
 

Enumerations

enum  imu_init_state_t
 IMU initialization state. More...
 
enum  imu_msg_type_t
 RPMSG type. More...
 
enum  imu_ctrl_msg_subtype_t
 RPMSG control message subtype. More...
 

Functions

hal_rpmsg_status_t HAL_ImuAddWlanTxPacket (uint8_t imuLink, uint8_t *txBuf, uint32_t length)
 Add wlan Tx packet for sending multiple Tx packets within one message. More...
 
hal_rpmsg_status_t HAL_ImuAddWlanTxPacketExt (uint8_t imuLink, uint8_t *txBuf, uint32_t length, void(*cb)(void *destAddr, void *srcAddr, uint32_t len))
 Add wlan Tx packet for sending multiple Tx packets within one message. More...
 
hal_rpmsg_status_t HAL_ImuInstallCallback (uint8_t imuLink, imu_callback_t callback, uint8_t type)
 Install wlan callback. More...
 
hal_rpmsg_status_t HAL_ImuInstallIrqCallback (uint8_t imuLink, imu_irq_callback_t callback)
 Install imu interrupt callback. More...
 
hal_rpmsg_status_t HAL_ImuSendCommand (uint8_t imuLink, uint8_t *cmdBuf, uint32_t length)
 Send wlan command packet. More...
 
hal_rpmsg_status_t HAL_ImuSendTxData (uint8_t imuLink, uint8_t *txBuf, uint32_t length)
 Add wlan Tx packet for sending one Tx packet within one message. More...
 
hal_rpmsg_status_t HAL_ImuSendMultiTxData (uint8_t imuLink)
 Send multiple Tx packets within one message. More...
 
hal_rpmsg_status_t HAL_ImuLinkIsUp (uint8_t imuLink)
 Check if IMU link is up. More...
 
hal_rpmsg_status_t HAL_ImuInit (imu_link_t link)
 Start IMU link. More...
 
hal_rpmsg_status_t HAL_ImuDeinit (imu_link_t link, uint32_t flag)
 Stop IMU link. More...
 
hal_rpmsg_status_t HAL_ImuReturnAllTxBuf (imu_link_t link)
 Return all tx buffer. More...
 
hal_rpmsg_status_t HAL_ImuReceive (uint8_t imuLink)
 Receive IMU message. More...
 
bool HAL_ImuIsTxBufQueueEmpty (uint8_t imuLink)
 Check if tx buffer queue empty. More...
 
hal_rpmsg_status_t HAL_ImuCreateTaskLock (void)
 Create imu task mutex. More...
 
void HAL_ImuDeleteTaskLock (void)
 Delete imu task mutex. More...
 
hal_rpmsg_status_t HAL_ImuGetTaskLock (void)
 Acquire imu task mutex. More...
 
hal_rpmsg_status_t HAL_ImuPutTaskLock (void)
 Release imu task mutex. More...
 
void HAL_ImuResetWlanTxq (uint8_t imuLink)
 Reset imu readIndex and writeIndex to 0. More...
 

Data Structure Documentation

struct IMU_Hdr_t
struct IMU_Msg_t
struct IMU_Msg_Wrapper_long_t
struct IMU_Msg_Wrapper_short_t
struct rpmsg_std_hdr

Every message sent/received on the rpmsg bus begins with this header.

Data Fields

uint32_t src
 source endpoint address
 
uint32_t dst
 destination endpoint address
 
struct rpmsg_hdr_reserved reserved
 reserved for future use
 
uint16_t len
 length of payload (in bytes)
 
uint16_t flags
 message flags
 
struct rpmsg_std_msg

Contains the header and the payload.

Data Fields

struct rpmsg_std_hdr hdr
 RPMsg message header.
 
uint32_t data
 bytes of message payload data
 
struct hal_rpmsg_state_t
struct hal_rpmsg_ept_buf_t
struct IMU_WLAN_TXQ_CTRL_st
struct RPMSG_TXQ_CTRL_st
struct hal_imu_handle_t

Data Fields

uint8_t imuLink
 Word 0.
 
bool cmd_buffer_available
 Word 1.
 
uint32_t * cmd_buffer
 Word 2.
 
IMU_WLAN_TXQ_CTRL_st wlanTxqCtl
 Word 3.
 
uint32_t imuMsgBuf [IMU_PAYLOAD_SIZE]
 Word 37.
 
LIST_ELEM_st eptList
 Word 45.
 
RPMSG_TXQ_CTRL_st rpmsgTxqCtl
 Word 47.
 
imu_callback_t imuHandler [IMU_MSG_MAX]
 Word 57.
 

Macro Definition Documentation

#define IRQ_IMU_CPU13   WL_MCI_WAKEUP0_IRQn

Remove following definition after RPMSG code integration.

#define IMU_PAYLOAD_SIZE   (8U)

Enumeration Type Documentation

Function Documentation

hal_rpmsg_status_t HAL_ImuAddWlanTxPacket ( uint8_t  imuLink,
uint8_t *  txBuf,
uint32_t  length 
)

This function is used to add a wlan Tx packet for IMU_MSG_MULTI_TX_DATA.

Parameters
imuLinkIMU link ID.
txBufTx buffer to be sent.
lengthLength of Tx data.
Return values
kStatus_HAL_RpmsgSuccessor kStatus_HAL_RpmsgError.
hal_rpmsg_status_t HAL_ImuAddWlanTxPacketExt ( uint8_t  imuLink,
uint8_t *  txBuf,
uint32_t  length,
void(*)(void *destAddr, void *srcAddr, uint32_t len)  cb 
)

This function is used to add a wlan Tx packet with callback function for IMU_MSG_MULTI_TX_DATA.

Parameters
imuLinkIMU link ID.
txBufTx buffer to be sent.
lengthLength of Tx data.
cbCallback function to add packet.
Return values
kStatus_HAL_RpmsgSuccessor kStatus_HAL_RpmsgError.
hal_rpmsg_status_t HAL_ImuInstallCallback ( uint8_t  imuLink,
imu_callback_t  callback,
uint8_t  type 
)

This function is used to imstall wlan callback

Parameters
imuLinkIMU link ID.
callbackCallback to be installed.
typeCallback type.
Return values
kStatus_HAL_RpmsgSuccessor kStatus_HAL_RpmsgError.
hal_rpmsg_status_t HAL_ImuInstallIrqCallback ( uint8_t  imuLink,
imu_irq_callback_t  callback 
)

This function is used to install imu interrupt callback

Parameters
imuLinkIMU link ID.
callbackCallback to be installed.
Return values
kStatus_HAL_RpmsgSuccessor kStatus_HAL_RpmsgError.
hal_rpmsg_status_t HAL_ImuSendCommand ( uint8_t  imuLink,
uint8_t *  cmdBuf,
uint32_t  length 
)

This function is used to send wlan command packet

Parameters
imuLinkIMU link ID.
cmdBufCommand buffer to be sent.
lengthLength of command data.
Return values
kStatus_HAL_RpmsgSuccessor kStatus_HAL_RpmsgError.
hal_rpmsg_status_t HAL_ImuSendTxData ( uint8_t  imuLink,
uint8_t *  txBuf,
uint32_t  length 
)

This function is used to send a wlan Tx packet.

Parameters
imuLinkIMU link ID.
txBufTx buffer to be sent.
lengthLength of Tx data.
Return values
kStatus_HAL_RpmsgSuccessor kStatus_HAL_RpmsgError.
hal_rpmsg_status_t HAL_ImuSendMultiTxData ( uint8_t  imuLink)

This function is used to send multiple wlan Tx packets within one IMU message, which have been added by HAL_ImuAddWlanTxPacket already.

Parameters
imuLinkIMU link ID.
Return values
kStatus_HAL_RpmsgSuccessor kStatus_HAL_RpmsgError.
hal_rpmsg_status_t HAL_ImuLinkIsUp ( uint8_t  imuLink)

This function is used to check if IMU link is up.

Parameters
imuLinkIMU link ID.
Return values
kStatus_HAL_RpmsgSuccessfor IMU link up or kStatus_HAL_RpmsgError for IMU link not up.
hal_rpmsg_status_t HAL_ImuInit ( imu_link_t  link)

This function is used to start specified IMU link.

Parameters
imuLinkIMU link ID.
Return values
kStatus_HAL_RpmsgSuccessor kStatus_HAL_RpmsgError.
hal_rpmsg_status_t HAL_ImuDeinit ( imu_link_t  link,
uint32_t  flag 
)

This function is used to stop specified IMU link.

Parameters
imuLinkIMU link ID.
flagflag with bits to control. flag bit0: control if need send imu msg to fw (imu tx return /imu shutdown) flag bit1: control if need destroy ImuTask and ImuQFlagsRef
Return values
kStatus_HAL_RpmsgSuccessor kStatus_HAL_RpmsgError.
hal_rpmsg_status_t HAL_ImuReturnAllTxBuf ( imu_link_t  link)

This function is used to return all tx buffer to CPU1.

Parameters
imuLinkIMU link ID.
Return values
kStatus_HAL_RpmsgSuccessor kStatus_HAL_RpmsgError.
hal_rpmsg_status_t HAL_ImuReceive ( uint8_t  imuLink)

This function is used to receive and process IMU message

Parameters
imuLinkIMU link ID.
Return values
kStatus_HAL_RpmsgSuccessor kStatus_HAL_RpmsgError.
bool HAL_ImuIsTxBufQueueEmpty ( uint8_t  imuLink)

This function is used to check if tx buffer queue empty

Parameters
imuLinkIMU link ID.
Return values
TRUEor FALSE.
hal_rpmsg_status_t HAL_ImuCreateTaskLock ( void  )

This function creates a imu task mutex.

Return values
kStatus_HAL_RpmsgSuccessor kStatus_HAL_RpmsgError.
void HAL_ImuDeleteTaskLock ( void  )

This function deletes the imu task mutex.

hal_rpmsg_status_t HAL_ImuGetTaskLock ( void  )

This function acquires the imu task mutex. Only one thread can acquire the mutex at any given time.

Return values
kStatus_HAL_RpmsgSuccessor kStatus_HAL_RpmsgError.
hal_rpmsg_status_t HAL_ImuPutTaskLock ( void  )

This function releases the imu task mutex.

Return values
kStatus_HAL_RpmsgSuccessor kStatus_HAL_RpmsgError.
void HAL_ImuResetWlanTxq ( uint8_t  imuLink)

This function reset the imu txq.