RTEMS 6.1-rc5
|
Header file of I2C HAL module. More...
Go to the source code of this file.
Data Structures | |
struct | I2C_InitTypeDef |
struct | __I2C_HandleTypeDef |
Macros | |
#define | HAL_I2C_ERROR_NONE (0x00000000U) |
#define | HAL_I2C_ERROR_BERR (0x00000001U) |
#define | HAL_I2C_ERROR_ARLO (0x00000002U) |
#define | HAL_I2C_ERROR_AF (0x00000004U) |
#define | HAL_I2C_ERROR_OVR (0x00000008U) |
#define | HAL_I2C_ERROR_DMA (0x00000010U) |
#define | HAL_I2C_ERROR_TIMEOUT (0x00000020U) |
#define | HAL_I2C_ERROR_SIZE (0x00000040U) |
#define | HAL_I2C_ERROR_DMA_PARAM (0x00000080U) |
#define | HAL_I2C_ERROR_INVALID_PARAM (0x00000200U) |
#define | I2C_FIRST_FRAME ((uint32_t)I2C_SOFTEND_MODE) |
#define | I2C_FIRST_AND_NEXT_FRAME ((uint32_t)(I2C_RELOAD_MODE | I2C_SOFTEND_MODE)) |
#define | I2C_NEXT_FRAME ((uint32_t)(I2C_RELOAD_MODE | I2C_SOFTEND_MODE)) |
#define | I2C_FIRST_AND_LAST_FRAME ((uint32_t)I2C_AUTOEND_MODE) |
#define | I2C_LAST_FRAME ((uint32_t)I2C_AUTOEND_MODE) |
#define | I2C_LAST_FRAME_NO_STOP ((uint32_t)I2C_SOFTEND_MODE) |
#define | I2C_OTHER_FRAME (0x000000AAU) |
#define | I2C_OTHER_AND_LAST_FRAME (0x0000AA00U) |
#define | I2C_ADDRESSINGMODE_7BIT (0x00000001U) |
#define | I2C_ADDRESSINGMODE_10BIT (0x00000002U) |
#define | I2C_DUALADDRESS_DISABLE (0x00000000U) |
#define | I2C_DUALADDRESS_ENABLE I2C_OAR2_OA2EN |
#define | I2C_OA2_NOMASK ((uint8_t)0x00U) |
#define | I2C_OA2_MASK01 ((uint8_t)0x01U) |
#define | I2C_OA2_MASK02 ((uint8_t)0x02U) |
#define | I2C_OA2_MASK03 ((uint8_t)0x03U) |
#define | I2C_OA2_MASK04 ((uint8_t)0x04U) |
#define | I2C_OA2_MASK05 ((uint8_t)0x05U) |
#define | I2C_OA2_MASK06 ((uint8_t)0x06U) |
#define | I2C_OA2_MASK07 ((uint8_t)0x07U) |
#define | I2C_GENERALCALL_DISABLE (0x00000000U) |
#define | I2C_GENERALCALL_ENABLE I2C_CR1_GCEN |
#define | I2C_NOSTRETCH_DISABLE (0x00000000U) |
#define | I2C_NOSTRETCH_ENABLE I2C_CR1_NOSTRETCH |
#define | I2C_MEMADD_SIZE_8BIT (0x00000001U) |
#define | I2C_MEMADD_SIZE_16BIT (0x00000002U) |
#define | I2C_DIRECTION_TRANSMIT (0x00000000U) |
#define | I2C_DIRECTION_RECEIVE (0x00000001U) |
#define | I2C_RELOAD_MODE I2C_CR2_RELOAD |
#define | I2C_AUTOEND_MODE I2C_CR2_AUTOEND |
#define | I2C_SOFTEND_MODE (0x00000000U) |
#define | I2C_NO_STARTSTOP (0x00000000U) |
#define | I2C_GENERATE_STOP (uint32_t)(0x80000000U | I2C_CR2_STOP) |
#define | I2C_GENERATE_START_READ (uint32_t)(0x80000000U | I2C_CR2_START | I2C_CR2_RD_WRN) |
#define | I2C_GENERATE_START_WRITE (uint32_t)(0x80000000U | I2C_CR2_START) |
#define | I2C_IT_ERRI I2C_CR1_ERRIE |
#define | I2C_IT_TCI I2C_CR1_TCIE |
#define | I2C_IT_STOPI I2C_CR1_STOPIE |
#define | I2C_IT_NACKI I2C_CR1_NACKIE |
#define | I2C_IT_ADDRI I2C_CR1_ADDRIE |
#define | I2C_IT_RXI I2C_CR1_RXIE |
#define | I2C_IT_TXI I2C_CR1_TXIE |
#define | I2C_FLAG_TXE I2C_ISR_TXE |
#define | I2C_FLAG_TXIS I2C_ISR_TXIS |
#define | I2C_FLAG_RXNE I2C_ISR_RXNE |
#define | I2C_FLAG_ADDR I2C_ISR_ADDR |
#define | I2C_FLAG_AF I2C_ISR_NACKF |
#define | I2C_FLAG_STOPF I2C_ISR_STOPF |
#define | I2C_FLAG_TC I2C_ISR_TC |
#define | I2C_FLAG_TCR I2C_ISR_TCR |
#define | I2C_FLAG_BERR I2C_ISR_BERR |
#define | I2C_FLAG_ARLO I2C_ISR_ARLO |
#define | I2C_FLAG_OVR I2C_ISR_OVR |
#define | I2C_FLAG_PECERR I2C_ISR_PECERR |
#define | I2C_FLAG_TIMEOUT I2C_ISR_TIMEOUT |
#define | I2C_FLAG_ALERT I2C_ISR_ALERT |
#define | I2C_FLAG_BUSY I2C_ISR_BUSY |
#define | I2C_FLAG_DIR I2C_ISR_DIR |
#define | __HAL_I2C_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_I2C_STATE_RESET) |
Reset I2C handle state. | |
#define | __HAL_I2C_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR1 |= (__INTERRUPT__)) |
Enable the specified I2C interrupt. | |
#define | __HAL_I2C_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR1 &= (~(__INTERRUPT__))) |
Disable the specified I2C interrupt. | |
#define | __HAL_I2C_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) |
Check whether the specified I2C interrupt source is enabled or not. | |
#define | I2C_FLAG_MASK (0x0001FFFFU) |
Check whether the specified I2C flag is set or not. | |
#define | __HAL_I2C_GET_FLAG(__HANDLE__, __FLAG__) |
#define | __HAL_I2C_CLEAR_FLAG(__HANDLE__, __FLAG__) |
Clear the I2C pending flags which are cleared by writing 1 in a specific bit. | |
#define | __HAL_I2C_ENABLE(__HANDLE__) (SET_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_PE)) |
Enable the specified I2C peripheral. | |
#define | __HAL_I2C_DISABLE(__HANDLE__) (CLEAR_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_PE)) |
Disable the specified I2C peripheral. | |
#define | __HAL_I2C_GENERATE_NACK(__HANDLE__) (SET_BIT((__HANDLE__)->Instance->CR2, I2C_CR2_NACK)) |
Generate a Non-Acknowledge I2C peripheral in Slave mode. | |
#define | IS_I2C_ADDRESSING_MODE(MODE) |
#define | IS_I2C_DUAL_ADDRESS(ADDRESS) |
#define | IS_I2C_OWN_ADDRESS2_MASK(MASK) |
#define | IS_I2C_GENERAL_CALL(CALL) |
#define | IS_I2C_NO_STRETCH(STRETCH) |
#define | IS_I2C_MEMADD_SIZE(SIZE) |
#define | IS_TRANSFER_MODE(MODE) |
#define | IS_TRANSFER_REQUEST(REQUEST) |
#define | IS_I2C_TRANSFER_OPTIONS_REQUEST(REQUEST) |
#define | IS_I2C_TRANSFER_OTHER_OPTIONS_REQUEST(REQUEST) |
#define | I2C_RESET_CR2(__HANDLE__) |
#define | I2C_GET_ADDR_MATCH(__HANDLE__) |
#define | I2C_GET_DIR(__HANDLE__) |
#define | I2C_GET_STOP_MODE(__HANDLE__) ((__HANDLE__)->Instance->CR2 & I2C_CR2_AUTOEND) |
#define | I2C_GET_OWN_ADDRESS1(__HANDLE__) ((uint16_t)((__HANDLE__)->Instance->OAR1 & I2C_OAR1_OA1)) |
#define | I2C_GET_OWN_ADDRESS2(__HANDLE__) ((uint16_t)((__HANDLE__)->Instance->OAR2 & I2C_OAR2_OA2)) |
#define | IS_I2C_OWN_ADDRESS1(ADDRESS1) ((ADDRESS1) <= 0x000003FFU) |
#define | IS_I2C_OWN_ADDRESS2(ADDRESS2) ((ADDRESS2) <= (uint16_t)0x00FFU) |
#define | I2C_MEM_ADD_MSB(__ADDRESS__) |
#define | I2C_MEM_ADD_LSB(__ADDRESS__) ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)(0x00FFU)))) |
#define | I2C_GENERATE_START(__ADDMODE__, __ADDRESS__) |
#define | I2C_CHECK_FLAG(__ISR__, __FLAG__) |
#define | I2C_CHECK_IT_SOURCE(__CR1__, __IT__) ((((__CR1__) & (__IT__)) == (__IT__)) ? SET : RESET) |
Typedefs | |
typedef struct __I2C_HandleTypeDef | I2C_HandleTypeDef |
Enumerations | |
enum | HAL_I2C_StateTypeDef { HAL_I2C_STATE_RESET = 0x00U , HAL_I2C_STATE_READY = 0x20U , HAL_I2C_STATE_BUSY = 0x24U , HAL_I2C_STATE_BUSY_TX = 0x21U , HAL_I2C_STATE_BUSY_RX = 0x22U , HAL_I2C_STATE_LISTEN = 0x28U , HAL_I2C_STATE_BUSY_TX_LISTEN = 0x29U , HAL_I2C_STATE_BUSY_RX_LISTEN = 0x2AU , HAL_I2C_STATE_ABORT = 0x60U } |
enum | HAL_I2C_ModeTypeDef { HAL_I2C_MODE_NONE = 0x00U , HAL_I2C_MODE_MASTER = 0x10U , HAL_I2C_MODE_SLAVE = 0x20U , HAL_I2C_MODE_MEM = 0x40U } |
Functions | |
HAL_StatusTypeDef | HAL_I2C_Init (I2C_HandleTypeDef *hi2c) |
HAL_StatusTypeDef | HAL_I2C_DeInit (I2C_HandleTypeDef *hi2c) |
void | HAL_I2C_MspInit (I2C_HandleTypeDef *hi2c) |
void | HAL_I2C_MspDeInit (I2C_HandleTypeDef *hi2c) |
HAL_StatusTypeDef | HAL_I2C_Master_Transmit (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout) |
HAL_StatusTypeDef | HAL_I2C_Master_Receive (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout) |
HAL_StatusTypeDef | HAL_I2C_Slave_Transmit (I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t Timeout) |
HAL_StatusTypeDef | HAL_I2C_Slave_Receive (I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t Timeout) |
HAL_StatusTypeDef | HAL_I2C_Mem_Write (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout) |
HAL_StatusTypeDef | HAL_I2C_Mem_Read (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout) |
HAL_StatusTypeDef | HAL_I2C_IsDeviceReady (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint32_t Trials, uint32_t Timeout) |
HAL_StatusTypeDef | HAL_I2C_Master_Transmit_IT (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size) |
HAL_StatusTypeDef | HAL_I2C_Master_Receive_IT (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size) |
HAL_StatusTypeDef | HAL_I2C_Slave_Transmit_IT (I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size) |
HAL_StatusTypeDef | HAL_I2C_Slave_Receive_IT (I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size) |
HAL_StatusTypeDef | HAL_I2C_Mem_Write_IT (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size) |
HAL_StatusTypeDef | HAL_I2C_Mem_Read_IT (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size) |
HAL_StatusTypeDef | HAL_I2C_Master_Seq_Transmit_IT (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions) |
HAL_StatusTypeDef | HAL_I2C_Master_Seq_Receive_IT (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions) |
HAL_StatusTypeDef | HAL_I2C_Slave_Seq_Transmit_IT (I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions) |
HAL_StatusTypeDef | HAL_I2C_Slave_Seq_Receive_IT (I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions) |
HAL_StatusTypeDef | HAL_I2C_EnableListen_IT (I2C_HandleTypeDef *hi2c) |
HAL_StatusTypeDef | HAL_I2C_DisableListen_IT (I2C_HandleTypeDef *hi2c) |
HAL_StatusTypeDef | HAL_I2C_Master_Abort_IT (I2C_HandleTypeDef *hi2c, uint16_t DevAddress) |
HAL_StatusTypeDef | HAL_I2C_Master_Transmit_DMA (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size) |
HAL_StatusTypeDef | HAL_I2C_Master_Receive_DMA (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size) |
HAL_StatusTypeDef | HAL_I2C_Slave_Transmit_DMA (I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size) |
HAL_StatusTypeDef | HAL_I2C_Slave_Receive_DMA (I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size) |
HAL_StatusTypeDef | HAL_I2C_Mem_Write_DMA (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size) |
HAL_StatusTypeDef | HAL_I2C_Mem_Read_DMA (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size) |
HAL_StatusTypeDef | HAL_I2C_Master_Seq_Transmit_DMA (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions) |
HAL_StatusTypeDef | HAL_I2C_Master_Seq_Receive_DMA (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions) |
HAL_StatusTypeDef | HAL_I2C_Slave_Seq_Transmit_DMA (I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions) |
HAL_StatusTypeDef | HAL_I2C_Slave_Seq_Receive_DMA (I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions) |
void | HAL_I2C_EV_IRQHandler (I2C_HandleTypeDef *hi2c) |
void | HAL_I2C_ER_IRQHandler (I2C_HandleTypeDef *hi2c) |
void | HAL_I2C_MasterTxCpltCallback (I2C_HandleTypeDef *hi2c) |
void | HAL_I2C_MasterRxCpltCallback (I2C_HandleTypeDef *hi2c) |
void | HAL_I2C_SlaveTxCpltCallback (I2C_HandleTypeDef *hi2c) |
void | HAL_I2C_SlaveRxCpltCallback (I2C_HandleTypeDef *hi2c) |
void | HAL_I2C_AddrCallback (I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode) |
void | HAL_I2C_ListenCpltCallback (I2C_HandleTypeDef *hi2c) |
void | HAL_I2C_MemTxCpltCallback (I2C_HandleTypeDef *hi2c) |
void | HAL_I2C_MemRxCpltCallback (I2C_HandleTypeDef *hi2c) |
void | HAL_I2C_ErrorCallback (I2C_HandleTypeDef *hi2c) |
void | HAL_I2C_AbortCpltCallback (I2C_HandleTypeDef *hi2c) |
HAL_I2C_StateTypeDef | HAL_I2C_GetState (const I2C_HandleTypeDef *hi2c) |
HAL_I2C_ModeTypeDef | HAL_I2C_GetMode (const I2C_HandleTypeDef *hi2c) |
uint32_t | HAL_I2C_GetError (const I2C_HandleTypeDef *hi2c) |
Header file of I2C HAL module.
Copyright (c) 2017 STMicroelectronics. All rights reserved.
This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.