Contains all functions support for i2cn firmware library on A31G11x. More...
Go to the source code of this file.
Data Structures | |
struct | I2Cn_CFG_Type |
Functions | |
int32_t | I2Cn_getNum (I2Cn_Type *I2Cx) |
Convert from I2C peripheral to number. More... | |
int32_t | I2Cn_MWait (I2Cn_Type *I2Cx) |
wait and return status in master mode More... | |
int32_t | I2Cn_SWait (I2Cn_Type *I2Cx) |
wait and return status in slave mode More... | |
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... | |
Variables | |
static I2Cn_CFG_Type | i2cdat [I2Cn_MAX] |
I2Cn driver data. More... | |
static Bool | I2Cn_MasterComplete [I2Cn_MAX] |
static Bool | I2Cn_SlaveComplete [I2Cn_MAX] |
Contains all functions support for i2cn firmware library on A31G11x.
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 A31G11x_hal_i2cn.c.
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 A31G11x_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 A31G11x_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 A31G11x_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 A31G11x_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 A31G11x_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 A31G11x_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 A31G11x_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 A31G11x_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().
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 A31G11x_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 A31G11x_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 A31G11x_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 A31G11x_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 A31G11x_hal_i2cn.c.
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 A31G11x_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().
int32_t I2Cn_getNum | ( | I2Cn_Type * | I2Cx | ) |
Convert from I2C peripheral to number.
[in] | I2Cx | Pointer to the target I2C
|
Definition at line 94 of file A31G11x_hal_i2cn.c.
Referenced by HAL_I2C_Master_GetState(), HAL_I2C_Master_IRQHandler_IT(), HAL_I2C_MasterTransferData(), HAL_I2C_Slave_GetState(), HAL_I2C_Slave_IRQHandler_IT(), and HAL_I2C_SlaveTransferData().
int32_t I2Cn_MWait | ( | I2Cn_Type * | I2Cx | ) |
wait and return status in master mode
[in] | I2Cx | Pointer to the target I2C
|
Definition at line 127 of file A31G11x_hal_i2cn.c.
Referenced by HAL_I2C_MasterTransferData().
int32_t I2Cn_SWait | ( | I2Cn_Type * | I2Cx | ) |
wait and return status in slave mode
[in] | I2Cx | Pointer to the target I2C
|
Definition at line 192 of file A31G11x_hal_i2cn.c.
Referenced by HAL_I2C_SlaveTransferData().
|
static |
I2Cn driver data.
Definition at line 74 of file A31G11x_hal_i2cn.c.
Referenced by HAL_I2C_Master_IRQHandler_IT(), HAL_I2C_MasterTransferData(), HAL_I2C_Slave_IRQHandler_IT(), and HAL_I2C_SlaveTransferData().
|
static |
Definition at line 75 of file A31G11x_hal_i2cn.c.
Referenced by HAL_I2C_Master_GetState(), HAL_I2C_Master_IRQHandler_IT(), and HAL_I2C_MasterTransferData().
|
static |
Definition at line 76 of file A31G11x_hal_i2cn.c.
Referenced by HAL_I2C_Slave_GetState(), HAL_I2C_Slave_IRQHandler_IT(), and HAL_I2C_SlaveTransferData().