Modules | Macros
Collaboration diagram for I2C Private Macros:

Modules

 I2C Private macros to check input parameters
 

Macros

#define I2C_10BIT_ADDRESS(__ADDRESS__)   ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)0x00FF)))
 
#define I2C_10BIT_ADDRESS(__ADDRESS__)   ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)0x00FF)))
 
#define I2C_10BIT_ADDRESS(__ADDRESS__)   ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)0x00FF)))
 
#define I2C_10BIT_HEADER_READ(__ADDRESS__)   ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)(0x00F1))))
 
#define I2C_10BIT_HEADER_READ(__ADDRESS__)   ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)(0x00F1))))
 
#define I2C_10BIT_HEADER_READ(__ADDRESS__)   ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)(0x00F1))))
 
#define I2C_10BIT_HEADER_WRITE(__ADDRESS__)   ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)0x00F0)))
 
#define I2C_10BIT_HEADER_WRITE(__ADDRESS__)   ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)0x00F0)))
 
#define I2C_10BIT_HEADER_WRITE(__ADDRESS__)   ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)0x00F0)))
 
#define I2C_7BIT_ADD_READ(__ADDRESS__)   ((uint8_t)((__ADDRESS__) | I2C_OAR1_ADD0))
 
#define I2C_7BIT_ADD_READ(__ADDRESS__)   ((uint8_t)((__ADDRESS__) | I2C_OAR1_ADD0))
 
#define I2C_7BIT_ADD_READ(__ADDRESS__)   ((uint8_t)((__ADDRESS__) | I2C_OAR1_ADD0))
 
#define I2C_7BIT_ADD_WRITE(__ADDRESS__)   ((uint8_t)((__ADDRESS__) & (uint8_t)(~I2C_OAR1_ADD0)))
 
#define I2C_7BIT_ADD_WRITE(__ADDRESS__)   ((uint8_t)((__ADDRESS__) & (uint8_t)(~I2C_OAR1_ADD0)))
 
#define I2C_7BIT_ADD_WRITE(__ADDRESS__)   ((uint8_t)((__ADDRESS__) & (uint8_t)(~I2C_OAR1_ADD0)))
 
#define I2C_CCR_CALCULATION(__PCLK__, __SPEED__, __COEFF__)   (((((__PCLK__) - 1U)/((__SPEED__) * (__COEFF__))) + 1U) & I2C_CCR_CCR)
 
#define I2C_CCR_CALCULATION(__PCLK__, __SPEED__, __COEFF__)   (((((__PCLK__) - 1U)/((__SPEED__) * (__COEFF__))) + 1U) & I2C_CCR_CCR)
 
#define I2C_CCR_CALCULATION(__PCLK__, __SPEED__, __COEFF__)   (((((__PCLK__) - 1U)/((__SPEED__) * (__COEFF__))) + 1U) & I2C_CCR_CCR)
 
#define I2C_FREQRANGE(__PCLK__)   ((__PCLK__)/1000000U)
 
#define I2C_FREQRANGE(__PCLK__)   ((__PCLK__)/1000000U)
 
#define I2C_FREQRANGE(__PCLK__)   ((__PCLK__)/1000000U)
 
#define I2C_MEM_ADD_LSB(__ADDRESS__)   ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)0x00FF)))
 
#define I2C_MEM_ADD_LSB(__ADDRESS__)   ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)0x00FF)))
 
#define I2C_MEM_ADD_LSB(__ADDRESS__)   ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)0x00FF)))
 
#define I2C_MEM_ADD_MSB(__ADDRESS__)   ((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0xFF00)) >> 8)))
 
#define I2C_MEM_ADD_MSB(__ADDRESS__)   ((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0xFF00)) >> 8)))
 
#define I2C_MEM_ADD_MSB(__ADDRESS__)   ((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0xFF00)) >> 8)))
 
#define I2C_MIN_PCLK_FREQ(__PCLK__, __SPEED__)   (((__SPEED__) <= 100000U) ? ((__PCLK__) < I2C_MIN_PCLK_FREQ_STANDARD) : ((__PCLK__) < I2C_MIN_PCLK_FREQ_FAST))
 
#define I2C_MIN_PCLK_FREQ(__PCLK__, __SPEED__)   (((__SPEED__) <= 100000U) ? ((__PCLK__) < I2C_MIN_PCLK_FREQ_STANDARD) : ((__PCLK__) < I2C_MIN_PCLK_FREQ_FAST))
 
#define I2C_MIN_PCLK_FREQ(__PCLK__, __SPEED__)   (((__SPEED__) <= 100000U) ? ((__PCLK__) < I2C_MIN_PCLK_FREQ_STANDARD) : ((__PCLK__) < I2C_MIN_PCLK_FREQ_FAST))
 
#define I2C_RISE_TIME(__FREQRANGE__, __SPEED__)   (((__SPEED__) <= 100000U) ? ((__FREQRANGE__) + 1U) : ((((__FREQRANGE__) * 300U) / 1000U) + 1U))
 
#define I2C_RISE_TIME(__FREQRANGE__, __SPEED__)   (((__SPEED__) <= 100000U) ? ((__FREQRANGE__) + 1U) : ((((__FREQRANGE__) * 300U) / 1000U) + 1U))
 
#define I2C_RISE_TIME(__FREQRANGE__, __SPEED__)   (((__SPEED__) <= 100000U) ? ((__FREQRANGE__) + 1U) : ((((__FREQRANGE__) * 300U) / 1000U) + 1U))
 
#define I2C_SPEED(__PCLK__, __SPEED__, __DUTYCYCLE__)
 
#define I2C_SPEED(__PCLK__, __SPEED__, __DUTYCYCLE__)
 
#define I2C_SPEED(__PCLK__, __SPEED__, __DUTYCYCLE__)
 
#define I2C_SPEED_FAST(__PCLK__, __SPEED__, __DUTYCYCLE__)   (((__DUTYCYCLE__) == I2C_DUTYCYCLE_2)? I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 3U) : (I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 25U) | I2C_DUTYCYCLE_16_9))
 
#define I2C_SPEED_FAST(__PCLK__, __SPEED__, __DUTYCYCLE__)   (((__DUTYCYCLE__) == I2C_DUTYCYCLE_2)? I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 3U) : (I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 25U) | I2C_DUTYCYCLE_16_9))
 
#define I2C_SPEED_FAST(__PCLK__, __SPEED__, __DUTYCYCLE__)   (((__DUTYCYCLE__) == I2C_DUTYCYCLE_2)? I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 3U) : (I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 25U) | I2C_DUTYCYCLE_16_9))
 
#define I2C_SPEED_STANDARD(__PCLK__, __SPEED__)   ((I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U) < 4U)? 4U:I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U))
 
#define I2C_SPEED_STANDARD(__PCLK__, __SPEED__)   ((I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U) < 4U)? 4U:I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U))
 
#define I2C_SPEED_STANDARD(__PCLK__, __SPEED__)   ((I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U) < 4U)? 4U:I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U))
 

Detailed Description

Macro Definition Documentation

◆ I2C_10BIT_ADDRESS [1/3]

#define I2C_10BIT_ADDRESS (   __ADDRESS__)    ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)0x00FF)))

◆ I2C_10BIT_ADDRESS [2/3]

#define I2C_10BIT_ADDRESS (   __ADDRESS__)    ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)0x00FF)))

◆ I2C_10BIT_ADDRESS [3/3]

#define I2C_10BIT_ADDRESS (   __ADDRESS__)    ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)0x00FF)))

◆ I2C_10BIT_HEADER_READ [1/3]

#define I2C_10BIT_HEADER_READ (   __ADDRESS__)    ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)(0x00F1))))

◆ I2C_10BIT_HEADER_READ [2/3]

#define I2C_10BIT_HEADER_READ (   __ADDRESS__)    ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)(0x00F1))))

◆ I2C_10BIT_HEADER_READ [3/3]

#define I2C_10BIT_HEADER_READ (   __ADDRESS__)    ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)(0x00F1))))

◆ I2C_10BIT_HEADER_WRITE [1/3]

#define I2C_10BIT_HEADER_WRITE (   __ADDRESS__)    ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)0x00F0)))

◆ I2C_10BIT_HEADER_WRITE [2/3]

#define I2C_10BIT_HEADER_WRITE (   __ADDRESS__)    ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)0x00F0)))

◆ I2C_10BIT_HEADER_WRITE [3/3]

#define I2C_10BIT_HEADER_WRITE (   __ADDRESS__)    ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)0x00F0)))

◆ I2C_7BIT_ADD_READ [1/3]

#define I2C_7BIT_ADD_READ (   __ADDRESS__)    ((uint8_t)((__ADDRESS__) | I2C_OAR1_ADD0))

◆ I2C_7BIT_ADD_READ [2/3]

#define I2C_7BIT_ADD_READ (   __ADDRESS__)    ((uint8_t)((__ADDRESS__) | I2C_OAR1_ADD0))

◆ I2C_7BIT_ADD_READ [3/3]

#define I2C_7BIT_ADD_READ (   __ADDRESS__)    ((uint8_t)((__ADDRESS__) | I2C_OAR1_ADD0))

◆ I2C_7BIT_ADD_WRITE [1/3]

#define I2C_7BIT_ADD_WRITE (   __ADDRESS__)    ((uint8_t)((__ADDRESS__) & (uint8_t)(~I2C_OAR1_ADD0)))

◆ I2C_7BIT_ADD_WRITE [2/3]

#define I2C_7BIT_ADD_WRITE (   __ADDRESS__)    ((uint8_t)((__ADDRESS__) & (uint8_t)(~I2C_OAR1_ADD0)))

◆ I2C_7BIT_ADD_WRITE [3/3]

#define I2C_7BIT_ADD_WRITE (   __ADDRESS__)    ((uint8_t)((__ADDRESS__) & (uint8_t)(~I2C_OAR1_ADD0)))

◆ I2C_CCR_CALCULATION [1/3]

#define I2C_CCR_CALCULATION (   __PCLK__,
  __SPEED__,
  __COEFF__ 
)    (((((__PCLK__) - 1U)/((__SPEED__) * (__COEFF__))) + 1U) & I2C_CCR_CCR)

◆ I2C_CCR_CALCULATION [2/3]

#define I2C_CCR_CALCULATION (   __PCLK__,
  __SPEED__,
  __COEFF__ 
)    (((((__PCLK__) - 1U)/((__SPEED__) * (__COEFF__))) + 1U) & I2C_CCR_CCR)

◆ I2C_CCR_CALCULATION [3/3]

#define I2C_CCR_CALCULATION (   __PCLK__,
  __SPEED__,
  __COEFF__ 
)    (((((__PCLK__) - 1U)/((__SPEED__) * (__COEFF__))) + 1U) & I2C_CCR_CCR)

◆ I2C_FREQRANGE [1/3]

#define I2C_FREQRANGE (   __PCLK__)    ((__PCLK__)/1000000U)

◆ I2C_FREQRANGE [2/3]

#define I2C_FREQRANGE (   __PCLK__)    ((__PCLK__)/1000000U)

◆ I2C_FREQRANGE [3/3]

#define I2C_FREQRANGE (   __PCLK__)    ((__PCLK__)/1000000U)

◆ I2C_MEM_ADD_LSB [1/3]

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

◆ I2C_MEM_ADD_LSB [2/3]

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

◆ I2C_MEM_ADD_LSB [3/3]

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

◆ I2C_MEM_ADD_MSB [1/3]

#define I2C_MEM_ADD_MSB (   __ADDRESS__)    ((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0xFF00)) >> 8)))

◆ I2C_MEM_ADD_MSB [2/3]

#define I2C_MEM_ADD_MSB (   __ADDRESS__)    ((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0xFF00)) >> 8)))

◆ I2C_MEM_ADD_MSB [3/3]

#define I2C_MEM_ADD_MSB (   __ADDRESS__)    ((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0xFF00)) >> 8)))

◆ I2C_MIN_PCLK_FREQ [1/3]

#define I2C_MIN_PCLK_FREQ (   __PCLK__,
  __SPEED__ 
)    (((__SPEED__) <= 100000U) ? ((__PCLK__) < I2C_MIN_PCLK_FREQ_STANDARD) : ((__PCLK__) < I2C_MIN_PCLK_FREQ_FAST))

◆ I2C_MIN_PCLK_FREQ [2/3]

#define I2C_MIN_PCLK_FREQ (   __PCLK__,
  __SPEED__ 
)    (((__SPEED__) <= 100000U) ? ((__PCLK__) < I2C_MIN_PCLK_FREQ_STANDARD) : ((__PCLK__) < I2C_MIN_PCLK_FREQ_FAST))

◆ I2C_MIN_PCLK_FREQ [3/3]

#define I2C_MIN_PCLK_FREQ (   __PCLK__,
  __SPEED__ 
)    (((__SPEED__) <= 100000U) ? ((__PCLK__) < I2C_MIN_PCLK_FREQ_STANDARD) : ((__PCLK__) < I2C_MIN_PCLK_FREQ_FAST))

◆ I2C_RISE_TIME [1/3]

#define I2C_RISE_TIME (   __FREQRANGE__,
  __SPEED__ 
)    (((__SPEED__) <= 100000U) ? ((__FREQRANGE__) + 1U) : ((((__FREQRANGE__) * 300U) / 1000U) + 1U))

◆ I2C_RISE_TIME [2/3]

#define I2C_RISE_TIME (   __FREQRANGE__,
  __SPEED__ 
)    (((__SPEED__) <= 100000U) ? ((__FREQRANGE__) + 1U) : ((((__FREQRANGE__) * 300U) / 1000U) + 1U))

◆ I2C_RISE_TIME [3/3]

#define I2C_RISE_TIME (   __FREQRANGE__,
  __SPEED__ 
)    (((__SPEED__) <= 100000U) ? ((__FREQRANGE__) + 1U) : ((((__FREQRANGE__) * 300U) / 1000U) + 1U))

◆ I2C_SPEED [1/3]

#define I2C_SPEED (   __PCLK__,
  __SPEED__,
  __DUTYCYCLE__ 
)
Value:
(((__SPEED__) <= 100000U)? (I2C_SPEED_STANDARD((__PCLK__), (__SPEED__))) : \
((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__)) & I2C_CCR_CCR) == 0U)? 1U : \
((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__))) | I2C_CCR_FS))

Definition at line 666 of file stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h.

◆ I2C_SPEED [2/3]

#define I2C_SPEED (   __PCLK__,
  __SPEED__,
  __DUTYCYCLE__ 
)
Value:
(((__SPEED__) <= 100000U)? (I2C_SPEED_STANDARD((__PCLK__), (__SPEED__))) : \
((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__)) & I2C_CCR_CCR) == 0U)? 1U : \
((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__))) | I2C_CCR_FS))

Definition at line 666 of file stm32f469/stm32f469i-disco/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h.

◆ I2C_SPEED [3/3]

#define I2C_SPEED (   __PCLK__,
  __SPEED__,
  __DUTYCYCLE__ 
)
Value:
(((__SPEED__) <= 100000U)? (I2C_SPEED_STANDARD((__PCLK__), (__SPEED__))) : \
((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__)) & I2C_CCR_CCR) == 0U)? 1U : \
((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__))) | I2C_CCR_FS))

Definition at line 666 of file stm32f411/stm32f411e-disco/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h.

◆ I2C_SPEED_FAST [1/3]

#define I2C_SPEED_FAST (   __PCLK__,
  __SPEED__,
  __DUTYCYCLE__ 
)    (((__DUTYCYCLE__) == I2C_DUTYCYCLE_2)? I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 3U) : (I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 25U) | I2C_DUTYCYCLE_16_9))

◆ I2C_SPEED_FAST [2/3]

#define I2C_SPEED_FAST (   __PCLK__,
  __SPEED__,
  __DUTYCYCLE__ 
)    (((__DUTYCYCLE__) == I2C_DUTYCYCLE_2)? I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 3U) : (I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 25U) | I2C_DUTYCYCLE_16_9))

◆ I2C_SPEED_FAST [3/3]

#define I2C_SPEED_FAST (   __PCLK__,
  __SPEED__,
  __DUTYCYCLE__ 
)    (((__DUTYCYCLE__) == I2C_DUTYCYCLE_2)? I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 3U) : (I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 25U) | I2C_DUTYCYCLE_16_9))

◆ I2C_SPEED_STANDARD [1/3]

#define I2C_SPEED_STANDARD (   __PCLK__,
  __SPEED__ 
)    ((I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U) < 4U)? 4U:I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U))

◆ I2C_SPEED_STANDARD [2/3]

#define I2C_SPEED_STANDARD (   __PCLK__,
  __SPEED__ 
)    ((I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U) < 4U)? 4U:I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U))

◆ I2C_SPEED_STANDARD [3/3]

#define I2C_SPEED_STANDARD (   __PCLK__,
  __SPEED__ 
)    ((I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U) < 4U)? 4U:I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U))
I2C_SPEED_FAST
#define I2C_SPEED_FAST(__PCLK__, __SPEED__, __DUTYCYCLE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:665
I2C_CCR_FS
#define I2C_CCR_FS
Definition: stm32f407xx.h:9302
I2C_CCR_CCR
#define I2C_CCR_CCR
Definition: stm32f407xx.h:9296
I2C_SPEED_STANDARD
#define I2C_SPEED_STANDARD(__PCLK__, __SPEED__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:664


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:15:06