NXP DAL  v05.02.00
Bus Abstraction Layer (BAL)

Data Structures

struct  phbalReg_Type_t
 BAL type structure. More...
 

Functions

phStatus_t phbalReg_Init (void *pDataParams, uint16_t wSizeOfDataParams)
 Initialize the BAL. More...
 
phStatus_t phbalReg_Exchange (void *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint16_t wTxLength, uint16_t wRxBufSize, uint8_t *pRxBuffer, uint16_t *pRxLength)
 Perform data Transmit/Receive/Exchange on the bus. More...
 
phStatus_t phbalReg_SetConfig (void *pDataParams, uint16_t wConfig, uint16_t wValue)
 Set configuration parameter. More...
 
phStatus_t phbalReg_GetConfig (void *pDataParams, uint16_t wConfig, uint16_t *pValue)
 Get configuration parameter. More...
 

Generic BAL configuration parameters

#define PHBAL_REG_CONFIG_WRITE_TIMEOUT_MS   0x0000U
 Configure transmission timeout in milliseconds. More...
 
#define PHBAL_REG_CONFIG_READ_TIMEOUT_MS   0x0001U
 Configure reception timeout in milliseconds. More...
 

BAL types

#define PHBAL_REG_TYPE_SPI   0x0001U
 SPI communication channel. More...
 
#define PHBAL_REG_TYPE_I2C   0x0002U
 I2C communication channel. More...
 
#define PHBAL_REG_TYPE_SERIAL_WIN   0x0003U
 SerialWin communication channel. More...
 
#define PHBAL_REG_TYPE_KERNEL_SPI   0x0004U
 Linux kernel space SPI communication channel. More...
 
#define PHBAL_REG_TYPE_USER_SPI   0x0005U
 Linux user space SPI communication channel. More...
 

Detailed Description

Macro Definition Documentation

§ PHBAL_REG_CONFIG_WRITE_TIMEOUT_MS

#define PHBAL_REG_CONFIG_WRITE_TIMEOUT_MS   0x0000U

Configure transmission timeout in milliseconds.

§ PHBAL_REG_CONFIG_READ_TIMEOUT_MS

#define PHBAL_REG_CONFIG_READ_TIMEOUT_MS   0x0001U

Configure reception timeout in milliseconds.

§ PHBAL_REG_TYPE_SPI

#define PHBAL_REG_TYPE_SPI   0x0001U

SPI communication channel.

§ PHBAL_REG_TYPE_I2C

#define PHBAL_REG_TYPE_I2C   0x0002U

I2C communication channel.

§ PHBAL_REG_TYPE_SERIAL_WIN

#define PHBAL_REG_TYPE_SERIAL_WIN   0x0003U

SerialWin communication channel.

§ PHBAL_REG_TYPE_KERNEL_SPI

#define PHBAL_REG_TYPE_KERNEL_SPI   0x0004U

Linux kernel space SPI communication channel.

§ PHBAL_REG_TYPE_USER_SPI

#define PHBAL_REG_TYPE_USER_SPI   0x0005U

Linux user space SPI communication channel.

Function Documentation

§ phbalReg_Init()

phStatus_t phbalReg_Init ( void *  pDataParams,
uint16_t  wSizeOfDataParams 
)

Initialize the BAL.

Returns
Status code
Return values
PH_DRIVER_SUCCESSOperation successful.
PH_DRIVER_ERRORParameter structure size is invalid.
Parameters
[in]pDataParamsPointer to this layer's parameter structure phbalReg_Type_t.
[in]wSizeOfDataParamsSize of this layer's parameter structure.

§ phbalReg_Exchange()

phStatus_t phbalReg_Exchange ( void *  pDataParams,
uint16_t  wOption,
uint8_t *  pTxBuffer,
uint16_t  wTxLength,
uint16_t  wRxBufSize,
uint8_t *  pRxBuffer,
uint16_t *  pRxLength 
)

Perform data Transmit/Receive/Exchange on the bus.

This API is used for command exchange between front-end CLIF and HOST. SPI : This API will also perform required flow control for particular front-end (Hardware specific).

Returns
Status code
Return values
PH_DRIVER_SUCCESSOperation successful.
PH_DRIVER_ERRORwOption is invalid or Response is too big for either given receive buffer or internal buffer.
PH_DRIVER_TIMEOUTNo response received within given time frame.
PH_DRIVER_FAILURECommunication error.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wOptionOption parameter, for future use.
[in]pTxBufferData to transmit.
[in]wTxLengthNumber of bytes to transmit, if 0 Tx is not performed.
[in]wRxBufSizeSize of receive buffer / Number of bytes to receive (depending on implementation). If 0 Rx is not performed.
[out]pRxBufferReceived data.
[out]pRxLengthNumber of received data bytes.

§ phbalReg_SetConfig()

phStatus_t phbalReg_SetConfig ( void *  pDataParams,
uint16_t  wConfig,
uint16_t  wValue 
)

Set configuration parameter.

Returns
Status code
Return values
PH_DRIVER_SUCCESSOperation successful.
PH_DRIVER_ERRORParameter/Configuration is not supported or invalid.
PH_DRIVER_FAILURECommunication error.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wConfigConfiguration identifier, for future use.
[in]wValueConfiguration value.

§ phbalReg_GetConfig()

phStatus_t phbalReg_GetConfig ( void *  pDataParams,
uint16_t  wConfig,
uint16_t *  pValue 
)

Get configuration parameter.

Returns
Status code
Return values
PH_DRIVER_SUCCESSOperation successful.
PH_DRIVER_ERRORConfiguration is not supported or invalid.
PH_DRIVER_FAILURECommunication error.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wConfigConfiguration identifier, for future use.
[out]pValueConfiguration value.