Contains all macro definitions and function prototypes support for i2cn firmware library on A31L12x. More...
Go to the source code of this file.
Data Structures | |
struct | I2Cn_M_SETUP_Type |
struct | I2Cn_S_SETUP_Type |
Enumerations | |
enum | I2Cn_TRANSFER_OPT_Type { I2Cn_TRANSFER_POLLING = 0, I2Cn_TRANSFER_INTERRUPT } |
Functions | |
HAL_Status_Type | HAL_I2C_Init (I2Cn_Type *I2Cx, uint32_t clockrate) |
Initialize the I2Cn peripheral with the specified parameters. More... | |
HAL_Status_Type | HAL_I2C_DeInit (I2Cn_Type *I2Cx) |
Deinitialize the I2Cn peripheral registers to their default reset values. More... | |
HAL_Status_Type | HAL_I2C_ConfigInterrupt (I2Cn_Type *I2Cx, Bool NewState) |
Enable/Disable interrupt for I2C peripheral. More... | |
HAL_Status_Type | HAL_I2C_Slave_SetAddress1 (I2Cn_Type *I2Cx, uint8_t SlaveAddr_7bit, uint8_t GeneralCallState) |
Set Own slave address in I2C peripheral corresponding to parameter specified in OwnSlaveAddrConfigStruct. More... | |
HAL_Status_Type | HAL_I2C_Slave_SetAddress2 (I2Cn_Type *I2Cx, uint8_t SlaveAddr_7bit, uint8_t GeneralCallState) |
Set Own slave address in I2C peripheral corresponding to parameter specified in OwnSlaveAddrConfigStruct. More... | |
uint32_t | HAL_I2C_Master_GetState (I2Cn_Type *I2Cx) |
Get Status of Master Transfer. More... | |
uint32_t | HAL_I2C_Slave_GetState (I2Cn_Type *I2Cx) |
Get Status of Slave Transfer. More... | |
HAL_Status_Type | HAL_I2C_Master_IRQHandler_IT (I2Cn_Type *I2Cx) |
General Master Interrupt handler for I2C peripheral. More... | |
HAL_Status_Type | HAL_I2C_Slave_IRQHandler_IT (I2Cn_Type *I2Cx) |
General Slave Interrupt handler for I2C peripheral. More... | |
Status | HAL_I2C_MasterTransferData (I2Cn_Type *I2Cx, I2Cn_M_SETUP_Type *TransferCfg, I2Cn_TRANSFER_OPT_Type Opt) |
Transmit and Receive data in master mode. More... | |
Status | HAL_I2C_SlaveTransferData (I2Cn_Type *I2Cx, I2Cn_S_SETUP_Type *TransferCfg, I2Cn_TRANSFER_OPT_Type Opt) |
Receive and Transmit data in slave mode. More... | |
Status | HAL_I2C_Master_Transmit (I2Cn_Type *I2Cx, I2Cn_M_SETUP_Type *TransferCfg, I2Cn_TRANSFER_OPT_Type Opt) |
Transmit an array of bytes in Master mode. More... | |
Status | HAL_I2C_Master_Receive (I2Cn_Type *I2Cx, I2Cn_M_SETUP_Type *TransferCfg, I2Cn_TRANSFER_OPT_Type Opt) |
Receive an array of bytes in Master mode. More... | |
Status | HAL_I2C_Slave_Receive (I2Cn_Type *I2Cx, I2Cn_S_SETUP_Type *TransferCfg, I2Cn_TRANSFER_OPT_Type Opt) |
Receive an array of bytes in Slave mode. More... | |
Status | HAL_I2C_MasterTransferData_DMA (I2Cn_Type *I2Cx, I2Cn_M_SETUP_Type *TransferCfg, I2Cn_TRANSFER_OPT_Type Opt, DMACn_Type *TxDMACx, DMACn_Type *RxDMACx) |
Transmit and Receive data in master mode by DMA. More... | |
Status | HAL_I2C_SlaveTransferData_DMA (I2Cn_Type *I2Cx, I2Cn_S_SETUP_Type *TransferCfg, I2Cn_TRANSFER_OPT_Type Opt, DMACn_Type *TxDMACx, DMACn_Type *RxDMACx) |
Receive and Transmit data in slave mode by DMA. More... | |
Status | HAL_I2C_MasterTransmit_DMA (I2Cn_Type *I2Cx, I2Cn_M_SETUP_Type *TransferCfg, I2Cn_TRANSFER_OPT_Type Opt, DMACn_Type *TxDMACx, DMACn_Type *RxDMACx) |
Transmit an array of bytes in Master mode by DMA. More... | |
Status | HAL_I2C_SlaveReceive_DMA (I2Cn_Type *I2Cx, I2Cn_S_SETUP_Type *TransferCfg, I2Cn_TRANSFER_OPT_Type Opt, DMACn_Type *TxDMACx, DMACn_Type *RxDMACx) |
Receive an array of bytes in Slave mode by DMA. More... | |
Contains all macro definitions and function prototypes support for i2cn firmware library on A31L12x.
Copyright(C) 2019, ABOV Semiconductor All rights reserved.
ABOV Disclaimer
IMPORTANT NOTICE ? PLEASE READ CAREFULLY ABOV Semiconductor ("ABOV") reserves the right to make changes, corrections, enhancements, modifications, and improvements to ABOV products and/or to this document at any time without notice. ABOV does not give warranties as to the accuracy or completeness of the information included herein. Purchasers should obtain the latest relevant information of ABOV products before placing orders. Purchasers are entirely responsible for the choice, selection, and use of ABOV products and ABOV assumes no liability for application assistance or the design of purchasers' products. No license, express or implied, to any intellectual property rights is granted by ABOV herein. ABOV disclaims all express and implied warranties and shall not be responsible or liable for any injuries or damages related to use of ABOV products in such unauthorized applications. ABOV and the ABOV logo are trademarks of ABOV. All other product or service names are the property of their respective owners. Information in this document supersedes and replaces the information previously supplied in any former versions of this document. 2020 ABOV Semiconductor All rights reserved
Definition in file A31L12x_hal_i2cn.h.
Transfer option type definitions
Enumerator | |
---|---|
I2Cn_TRANSFER_POLLING | Transfer in polling mode |
I2Cn_TRANSFER_INTERRUPT | Transfer in interrupt mode |
Definition at line 69 of file A31L12x_hal_i2cn.h.
HAL_Status_Type HAL_I2C_ConfigInterrupt | ( | I2Cn_Type * | I2Cx, |
Bool | NewState | ||
) |
Enable/Disable interrupt for I2C peripheral.
[in] | I2Cx | Pointer to the target I2C
|
[in] | NewState | Next State of Interrupt Operation
|
Definition at line 366 of file A31L12x_hal_i2cn.c.
References HAL_ERROR, and HAL_OK.
Referenced by HAL_I2C_Master_IRQHandler_IT(), HAL_I2C_MasterTransferData(), HAL_I2C_Slave_IRQHandler_IT(), and HAL_I2C_SlaveTransferData().
HAL_Status_Type HAL_I2C_DeInit | ( | I2Cn_Type * | I2Cx | ) |
Deinitialize the I2Cn peripheral registers to their default reset values.
[in] | I2Cx | Pointer to the target I2C
|
Definition at line 318 of file A31L12x_hal_i2cn.c.
HAL_Status_Type HAL_I2C_Init | ( | I2Cn_Type * | I2Cx, |
uint32_t | clockrate | ||
) |
Initialize the I2Cn peripheral with the specified parameters.
[in] | I2Cx | Pointer to the target I2C
|
[in] | clockrate | Target Clock Rate (Hz) |
Definition at line 259 of file A31L12x_hal_i2cn.c.
References HAL_ERROR, HAL_OK, and HAL_SCU_Peripheral_SetReset2().
uint32_t HAL_I2C_Master_GetState | ( | I2Cn_Type * | I2Cx | ) |
Get Status of Master Transfer.
[in] | I2Cx | Pointer to the target I2C
|
Definition at line 485 of file A31L12x_hal_i2cn.c.
References FALSE, I2Cn_getNum(), and I2Cn_MasterComplete.
HAL_Status_Type HAL_I2C_Master_IRQHandler_IT | ( | I2Cn_Type * | I2Cx | ) |
General Master Interrupt handler for I2C peripheral.
[in] | I2Cx | Pointer to the target I2C
|
Definition at line 522 of file A31L12x_hal_i2cn.c.
References FALSE, HAL_ERROR, HAL_I2C_ConfigInterrupt(), HAL_OK, i2cdat, I2Cn_getNum(), I2Cn_MasterComplete, I2Cn_M_SETUP_Type::rx_count, I2Cn_M_SETUP_Type::rx_data, I2Cn_M_SETUP_Type::rx_length, I2Cn_M_SETUP_Type::sl_addr7bit, TRUE, I2Cn_M_SETUP_Type::tx_count, I2Cn_M_SETUP_Type::tx_data, and I2Cn_M_SETUP_Type::tx_length.
Status HAL_I2C_Master_Receive | ( | I2Cn_Type * | I2Cx, |
I2Cn_M_SETUP_Type * | TransferCfg, | ||
I2Cn_TRANSFER_OPT_Type | Opt | ||
) |
Receive an array of bytes in Master mode.
[in] | I2Cx | Pointer to the target I2C
|
[in] | TransferCfg | Pointer to a I2Cn_M_SETUP_Type structure that contains specified information about the configuration for master transfer. |
[in] | Opt | I2Cn_TRANSFER_OPT_Type type that selected for interrupt or polling mode. |
Definition at line 1078 of file A31L12x_hal_i2cn.c.
References HAL_I2C_MasterTransferData(), I2Cn_M_SETUP_Type::rx_count, I2Cn_M_SETUP_Type::tx_count, I2Cn_M_SETUP_Type::tx_data, and I2Cn_M_SETUP_Type::tx_length.
Status HAL_I2C_Master_Transmit | ( | I2Cn_Type * | I2Cx, |
I2Cn_M_SETUP_Type * | TransferCfg, | ||
I2Cn_TRANSFER_OPT_Type | Opt | ||
) |
Transmit an array of bytes in Master mode.
[in] | I2Cx | Pointer to the target I2C
|
[in] | TransferCfg | Pointer to a I2Cn_M_SETUP_Type structure that contains specified information about the configuration for master transfer. |
[in] | Opt | I2Cn_TRANSFER_OPT_Type type that selected for interrupt or polling mode. |
Definition at line 1055 of file A31L12x_hal_i2cn.c.
References HAL_I2C_MasterTransferData(), I2Cn_M_SETUP_Type::rx_count, I2Cn_M_SETUP_Type::rx_data, I2Cn_M_SETUP_Type::rx_length, and I2Cn_M_SETUP_Type::tx_count.
Status HAL_I2C_MasterTransferData | ( | I2Cn_Type * | I2Cx, |
I2Cn_M_SETUP_Type * | TransferCfg, | ||
I2Cn_TRANSFER_OPT_Type | Opt | ||
) |
Transmit and Receive data in master mode.
[in] | I2Cx | Pointer to the target I2C
|
[in] | TransferCfg | Pointer to a I2Cn_M_SETUP_Type structure that contains specified information about the configuration for master transfer. |
[in] | Opt | I2Cn_TRANSFER_OPT_Type type that selected for interrupt or polling mode. |
Definition at line 741 of file A31L12x_hal_i2cn.c.
References I2Cn_CFG_Type::dir, ERROR, FALSE, HAL_I2C_ConfigInterrupt(), i2cdat, I2Cn_getNum(), I2Cn_MasterComplete, I2Cn_MWait(), I2Cn_TRANSFER_INTERRUPT, I2Cn_TRANSFER_POLLING, I2Cn_M_SETUP_Type::rx_count, I2Cn_M_SETUP_Type::rx_data, I2Cn_M_SETUP_Type::rx_length, I2Cn_M_SETUP_Type::sl_addr7bit, SUCCESS, TRUE, I2Cn_M_SETUP_Type::tx_count, I2Cn_M_SETUP_Type::tx_data, I2Cn_M_SETUP_Type::tx_length, and I2Cn_CFG_Type::txrx_setup_master.
Referenced by HAL_I2C_Master_Receive(), and HAL_I2C_Master_Transmit().
Status HAL_I2C_MasterTransferData_DMA | ( | I2Cn_Type * | I2Cx, |
I2Cn_M_SETUP_Type * | TransferCfg, | ||
I2Cn_TRANSFER_OPT_Type | Opt, | ||
DMACn_Type * | TxDMACx, | ||
DMACn_Type * | RxDMACx | ||
) |
Transmit and Receive data in master mode by DMA.
[in] | I2Cx | Pointer to the target I2C
|
[in] | TransferCfg | Pointer to a I2Cn_M_SETUP_Type structure that contains specified information about the configuration for master transfer. |
[in] | Opt | I2Cn_TRANSFER_OPT_Type type that selected for interrupt or polling mode. |
[in] | TxDMACx | Pointer to the target DMAC for Tx
|
[in] | RxDMACx | Pointer to the target DMAC for Rx
|
On the master Tx: "SnDA" by S/W + Transmit(N) by DMA + "CSnSP" by S/W On the master Rx: Up to "rSnDA" by S/W + Receive (N-1) by DMA + Receive(1+NACK) and "CSnSP" by S/W
Definition at line 1132 of file A31L12x_hal_i2cn.c.
References ERROR, HAL_DMAC_Setup(), I2Cn_MWait(), I2Cn_TRANSFER_POLLING, I2Cn_M_SETUP_Type::rx_count, I2Cn_M_SETUP_Type::rx_data, I2Cn_M_SETUP_Type::rx_length, I2Cn_M_SETUP_Type::sl_addr7bit, SUCCESS, I2Cn_M_SETUP_Type::tx_count, I2Cn_M_SETUP_Type::tx_data, and I2Cn_M_SETUP_Type::tx_length.
Referenced by HAL_I2C_MasterTransmit_DMA().
Status HAL_I2C_MasterTransmit_DMA | ( | I2Cn_Type * | I2Cx, |
I2Cn_M_SETUP_Type * | TransferCfg, | ||
I2Cn_TRANSFER_OPT_Type | Opt, | ||
DMACn_Type * | TxDMACx, | ||
DMACn_Type * | RxDMACx | ||
) |
Transmit an array of bytes in Master mode by DMA.
[in] | I2Cx | Pointer to the target I2C
|
[in] | TransferCfg | Pointer to a I2Cn_M_SETUP_Type structure that contains specified information about the configuration for master transfer. |
[in] | Opt | I2Cn_TRANSFER_OPT_Type type that selected for interrupt or polling mode. |
[in] | TxDMACx | Pointer to the target DMAC for Tx
|
[in] | RxDMACx | Pointer to the target DMAC for Rx
|
Definition at line 1485 of file A31L12x_hal_i2cn.c.
References HAL_I2C_MasterTransferData_DMA(), I2Cn_M_SETUP_Type::rx_count, I2Cn_M_SETUP_Type::rx_data, I2Cn_M_SETUP_Type::rx_length, and I2Cn_M_SETUP_Type::tx_count.
uint32_t HAL_I2C_Slave_GetState | ( | I2Cn_Type * | I2Cx | ) |
Get Status of Slave Transfer.
[in] | I2Cx | Pointer to the target I2C
|
Definition at line 504 of file A31L12x_hal_i2cn.c.
References FALSE, I2Cn_getNum(), and I2Cn_SlaveComplete.
HAL_Status_Type HAL_I2C_Slave_IRQHandler_IT | ( | I2Cn_Type * | I2Cx | ) |
General Slave Interrupt handler for I2C peripheral.
[in] | I2Cx | Pointer to the target I2C
|
Definition at line 671 of file A31L12x_hal_i2cn.c.
References FALSE, HAL_ERROR, HAL_I2C_ConfigInterrupt(), HAL_OK, i2cdat, I2Cn_getNum(), I2Cn_SlaveComplete, I2Cn_S_SETUP_Type::rx_count, I2Cn_S_SETUP_Type::rx_data, I2Cn_S_SETUP_Type::rx_length, TRUE, I2Cn_S_SETUP_Type::tx_count, I2Cn_S_SETUP_Type::tx_data, and I2Cn_S_SETUP_Type::tx_length.
Status HAL_I2C_Slave_Receive | ( | I2Cn_Type * | I2Cx, |
I2Cn_S_SETUP_Type * | TransferCfg, | ||
I2Cn_TRANSFER_OPT_Type | Opt | ||
) |
Receive an array of bytes in Slave mode.
[in] | I2Cx | Pointer to the target I2C
|
[in] | TransferCfg | Pointer to a I2Cn_S_SETUP_Type structure that contains specified information about the configuration for slave transfer. |
[in] | Opt | I2Cn_TRANSFER_OPT_Type type that selected for interrupt or polling mode. |
Definition at line 1101 of file A31L12x_hal_i2cn.c.
References HAL_I2C_SlaveTransferData(), I2Cn_S_SETUP_Type::rx_count, I2Cn_S_SETUP_Type::tx_count, I2Cn_S_SETUP_Type::tx_data, and I2Cn_S_SETUP_Type::tx_length.
HAL_Status_Type HAL_I2C_Slave_SetAddress1 | ( | I2Cn_Type * | I2Cx, |
uint8_t | SlaveAddr_7bit, | ||
uint8_t | GeneralCallState | ||
) |
Set Own slave address in I2C peripheral corresponding to parameter specified in OwnSlaveAddrConfigStruct.
[in] | I2Cx | Pointer to the target I2C
|
[in] | SlaveAddr_7bit | own slave address |
[in] | GeneralCallState |
|
Definition at line 439 of file A31L12x_hal_i2cn.c.
HAL_Status_Type HAL_I2C_Slave_SetAddress2 | ( | I2Cn_Type * | I2Cx, |
uint8_t | SlaveAddr_7bit, | ||
uint8_t | GeneralCallState | ||
) |
Set Own slave address in I2C peripheral corresponding to parameter specified in OwnSlaveAddrConfigStruct.
[in] | I2Cx | Pointer to the target I2C
|
[in] | SlaveAddr_7bit | own slave address |
[in] | GeneralCallState |
|
Definition at line 464 of file A31L12x_hal_i2cn.c.
Status HAL_I2C_SlaveReceive_DMA | ( | I2Cn_Type * | I2Cx, |
I2Cn_S_SETUP_Type * | TransferCfg, | ||
I2Cn_TRANSFER_OPT_Type | Opt, | ||
DMACn_Type * | TxDMACx, | ||
DMACn_Type * | RxDMACx | ||
) |
Receive an array of bytes in Slave mode by DMA.
[in] | I2Cx | Pointer to the target I2C
|
[in] | TransferCfg | Pointer to a I2Cn_S_SETUP_Type structure that contains specified information about the configuration for slave transfer. |
[in] | Opt | I2Cn_TRANSFER_OPT_Type type that selected for interrupt or polling mode. |
[in] | TxDMACx | Pointer to the target DMAC for Tx
|
[in] | RxDMACx | Pointer to the target DMAC for Rx
|
Definition at line 1514 of file A31L12x_hal_i2cn.c.
References HAL_I2C_SlaveTransferData_DMA(), I2Cn_S_SETUP_Type::rx_count, I2Cn_S_SETUP_Type::tx_count, I2Cn_S_SETUP_Type::tx_data, and I2Cn_S_SETUP_Type::tx_length.
Status HAL_I2C_SlaveTransferData | ( | I2Cn_Type * | I2Cx, |
I2Cn_S_SETUP_Type * | TransferCfg, | ||
I2Cn_TRANSFER_OPT_Type | Opt | ||
) |
Receive and Transmit data in slave mode.
[in] | I2Cx | Pointer to the target I2C
|
[in] | TransferCfg | Pointer to a I2Cn_S_SETUP_Type structure that contains specified information about the configuration for master transfer. |
[in] | Opt | I2Cn_TRANSFER_OPT_Type type that selected for interrupt or polling mode. |
Definition at line 971 of file A31L12x_hal_i2cn.c.
References I2Cn_CFG_Type::dir, ERROR, FALSE, HAL_I2C_ConfigInterrupt(), i2cdat, I2Cn_getNum(), I2Cn_SlaveComplete, I2Cn_SWait(), I2Cn_TRANSFER_INTERRUPT, I2Cn_TRANSFER_POLLING, I2Cn_S_SETUP_Type::rx_count, I2Cn_S_SETUP_Type::rx_data, I2Cn_S_SETUP_Type::rx_length, SUCCESS, TRUE, I2Cn_S_SETUP_Type::tx_count, I2Cn_S_SETUP_Type::tx_data, I2Cn_S_SETUP_Type::tx_length, and I2Cn_CFG_Type::txrx_setup_slave.
Referenced by HAL_I2C_Slave_Receive().
Status HAL_I2C_SlaveTransferData_DMA | ( | I2Cn_Type * | I2Cx, |
I2Cn_S_SETUP_Type * | TransferCfg, | ||
I2Cn_TRANSFER_OPT_Type | Opt, | ||
DMACn_Type * | TxDMACx, | ||
DMACn_Type * | RxDMACx | ||
) |
Receive and Transmit data in slave mode by DMA.
[in] | I2Cx | Pointer to the target I2C
|
[in] | TransferCfg | Pointer to a I2Cn_S_SETUP_Type structure that contains specified information about the configuration for master transfer. |
[in] | Opt | I2Cn_TRANSFER_OPT_Type type that selected for interrupt or polling mode. |
[in] | TxDMACx | Pointer to the target DMAC for Tx
|
[in] | RxDMACx | Pointer to the target DMAC for Rx
|
On the slave Tx: Up to "rSnDA" by S/W + Transmit (N) by DMA + "CS" by S/W On the slave Rx: "SnDA" by S/W + Receive(N) by DMA + "CS" by S/W
Definition at line 1396 of file A31L12x_hal_i2cn.c.
References ERROR, HAL_DMAC_Setup(), I2Cn_SWait(), I2Cn_TRANSFER_POLLING, I2Cn_S_SETUP_Type::rx_count, I2Cn_S_SETUP_Type::rx_data, I2Cn_S_SETUP_Type::rx_length, SUCCESS, I2Cn_S_SETUP_Type::tx_count, I2Cn_S_SETUP_Type::tx_data, and I2Cn_S_SETUP_Type::tx_length.
Referenced by HAL_I2C_SlaveReceive_DMA().