My Project
Loading...
Searching...
No Matches
I2C Private Macros

Macros

#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)
 

Detailed Description

Macro Definition Documentation

◆ I2C_CHECK_FLAG

#define I2C_CHECK_FLAG (   __ISR__,
  __FLAG__ 
)
Value:
((((__ISR__) & ((__FLAG__) & I2C_FLAG_MASK)) == \
((__FLAG__) & I2C_FLAG_MASK)) ? SET : RESET)
@ RESET
Definition: stm32f3xx.h:165
@ SET
Definition: stm32f3xx.h:166
#define I2C_FLAG_MASK
Check whether the specified I2C flag is set or not.
Definition: stm32f3xx_hal_i2c.h:545

◆ I2C_CHECK_IT_SOURCE

#define I2C_CHECK_IT_SOURCE (   __CR1__,
  __IT__ 
)    ((((__CR1__) & (__IT__)) == (__IT__)) ? SET : RESET)

◆ I2C_GENERATE_START

#define I2C_GENERATE_START (   __ADDMODE__,
  __ADDRESS__ 
)
Value:
(((__ADDMODE__) == I2C_ADDRESSINGMODE_7BIT) ? \
(uint32_t)((((uint32_t)(__ADDRESS__) & (I2C_CR2_SADD)) | \
(~I2C_CR2_RD_WRN)) : \
(uint32_t)((((uint32_t)(__ADDRESS__) & (I2C_CR2_SADD)) | \
#define I2C_ADDRESSINGMODE_7BIT
Definition: stm32f3xx_hal_i2c.h:322
#define I2C_CR2_SADD
Definition: stm32f303xe.h:10381
#define I2C_CR2_RD_WRN
Definition: stm32f303xe.h:10384
#define I2C_CR2_ADD10
Definition: stm32f303xe.h:10387
#define I2C_CR2_START
Definition: stm32f303xe.h:10393
#define I2C_CR2_AUTOEND
Definition: stm32f303xe.h:10408

◆ I2C_GET_ADDR_MATCH

#define I2C_GET_ADDR_MATCH (   __HANDLE__)
Value:
((uint16_t)(((__HANDLE__)->Instance->ISR & I2C_ISR_ADDCODE) \
>> 16U))
#define I2C_ISR_ADDCODE
Definition: stm32f303xe.h:10542

◆ I2C_GET_DIR

#define I2C_GET_DIR (   __HANDLE__)
Value:
((uint8_t)(((__HANDLE__)->Instance->ISR & I2C_ISR_DIR) \
>> 16U))
#define I2C_ISR_DIR
Definition: stm32f303xe.h:10539

◆ I2C_GET_OWN_ADDRESS1

#define I2C_GET_OWN_ADDRESS1 (   __HANDLE__)    ((uint16_t)((__HANDLE__)->Instance->OAR1 & I2C_OAR1_OA1))

◆ I2C_GET_OWN_ADDRESS2

#define I2C_GET_OWN_ADDRESS2 (   __HANDLE__)    ((uint16_t)((__HANDLE__)->Instance->OAR2 & I2C_OAR2_OA2))

◆ I2C_GET_STOP_MODE

#define I2C_GET_STOP_MODE (   __HANDLE__)    ((__HANDLE__)->Instance->CR2 & I2C_CR2_AUTOEND)

◆ I2C_MEM_ADD_LSB

#define I2C_MEM_ADD_LSB (   __ADDRESS__)    ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)(0x00FFU))))

◆ I2C_MEM_ADD_MSB

#define I2C_MEM_ADD_MSB (   __ADDRESS__)
Value:
((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & \
(uint16_t)(0xFF00U))) >> 8U)))

◆ I2C_RESET_CR2

#define I2C_RESET_CR2 (   __HANDLE__)
Value:
((__HANDLE__)->Instance->CR2 &= \
(uint32_t)~((uint32_t)(I2C_CR2_SADD | I2C_CR2_HEAD10R | \
#define I2C_CR2_RELOAD
Definition: stm32f303xe.h:10405
#define I2C_CR2_NBYTES
Definition: stm32f303xe.h:10402
#define I2C_CR2_HEAD10R
Definition: stm32f303xe.h:10390

◆ IS_I2C_ADDRESSING_MODE

#define IS_I2C_ADDRESSING_MODE (   MODE)
Value:
(((MODE) == I2C_ADDRESSINGMODE_7BIT) || \
#define I2C_ADDRESSINGMODE_10BIT
Definition: stm32f3xx_hal_i2c.h:323

◆ IS_I2C_DUAL_ADDRESS

#define IS_I2C_DUAL_ADDRESS (   ADDRESS)
Value:
(((ADDRESS) == I2C_DUALADDRESS_DISABLE) || \
((ADDRESS) == I2C_DUALADDRESS_ENABLE))
#define I2C_DUALADDRESS_DISABLE
Definition: stm32f3xx_hal_i2c.h:331
#define I2C_DUALADDRESS_ENABLE
Definition: stm32f3xx_hal_i2c.h:332

◆ IS_I2C_GENERAL_CALL

#define IS_I2C_GENERAL_CALL (   CALL)
Value:
(((CALL) == I2C_GENERALCALL_DISABLE) || \
#define I2C_GENERALCALL_DISABLE
Definition: stm32f3xx_hal_i2c.h:355
#define I2C_GENERALCALL_ENABLE
Definition: stm32f3xx_hal_i2c.h:356

◆ IS_I2C_MEMADD_SIZE

#define IS_I2C_MEMADD_SIZE (   SIZE)
Value:
(((SIZE) == I2C_MEMADD_SIZE_8BIT) || \
((SIZE) == I2C_MEMADD_SIZE_16BIT))
#define I2C_MEMADD_SIZE_8BIT
Definition: stm32f3xx_hal_i2c.h:373
#define I2C_MEMADD_SIZE_16BIT
Definition: stm32f3xx_hal_i2c.h:374

◆ IS_I2C_NO_STRETCH

#define IS_I2C_NO_STRETCH (   STRETCH)
Value:
(((STRETCH) == I2C_NOSTRETCH_DISABLE) || \
((STRETCH) == I2C_NOSTRETCH_ENABLE))
#define I2C_NOSTRETCH_DISABLE
Definition: stm32f3xx_hal_i2c.h:364
#define I2C_NOSTRETCH_ENABLE
Definition: stm32f3xx_hal_i2c.h:365

◆ IS_I2C_OWN_ADDRESS1

#define IS_I2C_OWN_ADDRESS1 (   ADDRESS1)    ((ADDRESS1) <= 0x000003FFU)

◆ IS_I2C_OWN_ADDRESS2

#define IS_I2C_OWN_ADDRESS2 (   ADDRESS2)    ((ADDRESS2) <= (uint16_t)0x00FFU)

◆ IS_I2C_OWN_ADDRESS2_MASK

#define IS_I2C_OWN_ADDRESS2_MASK (   MASK)
Value:
(((MASK) == I2C_OA2_NOMASK) || \
((MASK) == I2C_OA2_MASK01) || \
((MASK) == I2C_OA2_MASK02) || \
((MASK) == I2C_OA2_MASK03) || \
((MASK) == I2C_OA2_MASK04) || \
((MASK) == I2C_OA2_MASK05) || \
((MASK) == I2C_OA2_MASK06) || \
((MASK) == I2C_OA2_MASK07))
#define I2C_OA2_MASK02
Definition: stm32f3xx_hal_i2c.h:342
#define I2C_OA2_NOMASK
Definition: stm32f3xx_hal_i2c.h:340
#define I2C_OA2_MASK04
Definition: stm32f3xx_hal_i2c.h:344
#define I2C_OA2_MASK07
Definition: stm32f3xx_hal_i2c.h:347
#define I2C_OA2_MASK06
Definition: stm32f3xx_hal_i2c.h:346
#define I2C_OA2_MASK03
Definition: stm32f3xx_hal_i2c.h:343
#define I2C_OA2_MASK01
Definition: stm32f3xx_hal_i2c.h:341
#define I2C_OA2_MASK05
Definition: stm32f3xx_hal_i2c.h:345

◆ IS_I2C_TRANSFER_OPTIONS_REQUEST

#define IS_I2C_TRANSFER_OPTIONS_REQUEST (   REQUEST)
Value:
(((REQUEST) == I2C_FIRST_FRAME) || \
((REQUEST) == I2C_FIRST_AND_NEXT_FRAME) || \
((REQUEST) == I2C_NEXT_FRAME) || \
((REQUEST) == I2C_FIRST_AND_LAST_FRAME) || \
((REQUEST) == I2C_LAST_FRAME) || \
((REQUEST) == I2C_LAST_FRAME_NO_STOP) || \
IS_I2C_TRANSFER_OTHER_OPTIONS_REQUEST(REQUEST))
#define I2C_FIRST_AND_NEXT_FRAME
Definition: stm32f3xx_hal_i2c.h:304
#define I2C_FIRST_AND_LAST_FRAME
Definition: stm32f3xx_hal_i2c.h:306
#define I2C_NEXT_FRAME
Definition: stm32f3xx_hal_i2c.h:305
#define I2C_FIRST_FRAME
Definition: stm32f3xx_hal_i2c.h:303
#define I2C_LAST_FRAME_NO_STOP
Definition: stm32f3xx_hal_i2c.h:308
#define I2C_LAST_FRAME
Definition: stm32f3xx_hal_i2c.h:307

◆ IS_I2C_TRANSFER_OTHER_OPTIONS_REQUEST

#define IS_I2C_TRANSFER_OTHER_OPTIONS_REQUEST (   REQUEST)
Value:
(((REQUEST) == I2C_OTHER_FRAME) || \
((REQUEST) == I2C_OTHER_AND_LAST_FRAME))
#define I2C_OTHER_AND_LAST_FRAME
Definition: stm32f3xx_hal_i2c.h:314
#define I2C_OTHER_FRAME
Definition: stm32f3xx_hal_i2c.h:313

◆ IS_TRANSFER_MODE

#define IS_TRANSFER_MODE (   MODE)
Value:
(((MODE) == I2C_RELOAD_MODE) || \
((MODE) == I2C_AUTOEND_MODE) || \
((MODE) == I2C_SOFTEND_MODE))
#define I2C_SOFTEND_MODE
Definition: stm32f3xx_hal_i2c.h:393
#define I2C_RELOAD_MODE
Definition: stm32f3xx_hal_i2c.h:391
#define I2C_AUTOEND_MODE
Definition: stm32f3xx_hal_i2c.h:392

◆ IS_TRANSFER_REQUEST

#define IS_TRANSFER_REQUEST (   REQUEST)
Value:
(((REQUEST) == I2C_GENERATE_STOP) || \
((REQUEST) == I2C_GENERATE_START_READ) || \
((REQUEST) == I2C_GENERATE_START_WRITE) || \
((REQUEST) == I2C_NO_STARTSTOP))
#define I2C_GENERATE_START_READ
Definition: stm32f3xx_hal_i2c.h:403
#define I2C_GENERATE_START_WRITE
Definition: stm32f3xx_hal_i2c.h:404
#define I2C_NO_STARTSTOP
Definition: stm32f3xx_hal_i2c.h:401
#define I2C_GENERATE_STOP
Definition: stm32f3xx_hal_i2c.h:402