STM32F479xx HAL User Manual
|
Defines | |
#define | __LL_I2C_FREQ_HZ_TO_MHZ(__PCLK__) (uint32_t)((__PCLK__)/1000000U) |
Convert Peripheral Clock Frequency in Mhz. | |
#define | __LL_I2C_FREQ_MHZ_TO_HZ(__PCLK__) (uint32_t)((__PCLK__)*1000000U) |
Convert Peripheral Clock Frequency in Hz. | |
#define | __LL_I2C_RISE_TIME(__FREQRANGE__, __SPEED__) (uint32_t)(((__SPEED__) <= LL_I2C_MAX_SPEED_STANDARD) ? ((__FREQRANGE__) + 1U) : ((((__FREQRANGE__) * 300U) / 1000U) + 1U)) |
Compute I2C Clock rising time. | |
#define | __LL_I2C_SPEED_TO_CCR(__PCLK__, __SPEED__, __DUTYCYCLE__) |
Compute Speed clock range to a Clock Control Register (I2C_CCR_CCR) value. | |
#define | __LL_I2C_SPEED_STANDARD_TO_CCR(__PCLK__, __SPEED__) (uint32_t)(((((__PCLK__)/((__SPEED__) << 1U)) & I2C_CCR_CCR) < 4U)? 4U:((__PCLK__) / ((__SPEED__) << 1U))) |
Compute Speed Standard clock range to a Clock Control Register (I2C_CCR_CCR) value. | |
#define | __LL_I2C_SPEED_FAST_TO_CCR(__PCLK__, __SPEED__, __DUTYCYCLE__) |
Compute Speed Fast clock range to a Clock Control Register (I2C_CCR_CCR) value. | |
#define | __LL_I2C_10BIT_ADDRESS(__ADDRESS__) ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)(0x00FF)))) |
Get the Least significant bits of a 10-Bits address. | |
#define | __LL_I2C_10BIT_HEADER_WRITE(__ADDRESS__) ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)(0x0300))) >> 7) | (uint16_t)(0xF0)))) |
Convert a 10-Bits address to a 10-Bits header with Write direction. | |
#define | __LL_I2C_10BIT_HEADER_READ(__ADDRESS__) ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)(0x0300))) >> 7) | (uint16_t)(0xF1)))) |
Convert a 10-Bits address to a 10-Bits header with Read direction. |
#define __LL_I2C_10BIT_ADDRESS | ( | __ADDRESS__ | ) | ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)(0x00FF)))) |
Get the Least significant bits of a 10-Bits address.
__ADDRESS__ | This parameter must be a value of a 10-Bits slave address. |
Value | between Min_Data=0x00 and Max_Data=0xFF |
Definition at line 332 of file stm32f4xx_ll_i2c.h.
#define __LL_I2C_10BIT_HEADER_READ | ( | __ADDRESS__ | ) | ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)(0x0300))) >> 7) | (uint16_t)(0xF1)))) |
Convert a 10-Bits address to a 10-Bits header with Read direction.
__ADDRESS__ | This parameter must be a value of a 10-Bits slave address. |
Value | between Min_Data=0xF1 and Max_Data=0xF7 |
Definition at line 346 of file stm32f4xx_ll_i2c.h.
#define __LL_I2C_10BIT_HEADER_WRITE | ( | __ADDRESS__ | ) | ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)(0x0300))) >> 7) | (uint16_t)(0xF0)))) |
Convert a 10-Bits address to a 10-Bits header with Write direction.
__ADDRESS__ | This parameter must be a value of a 10-Bits slave address. |
Value | between Min_Data=0xF0 and Max_Data=0xF6 |
Definition at line 339 of file stm32f4xx_ll_i2c.h.
#define __LL_I2C_FREQ_HZ_TO_MHZ | ( | __PCLK__ | ) | (uint32_t)((__PCLK__)/1000000U) |
Convert Peripheral Clock Frequency in Mhz.
__PCLK__ | This parameter must be a value of peripheral clock (in Hz). |
Value | of peripheral clock (in Mhz) |
Definition at line 276 of file stm32f4xx_ll_i2c.h.
Referenced by LL_I2C_ConfigSpeed(), and LL_I2C_SetPeriphClock().
#define __LL_I2C_FREQ_MHZ_TO_HZ | ( | __PCLK__ | ) | (uint32_t)((__PCLK__)*1000000U) |
Convert Peripheral Clock Frequency in Hz.
__PCLK__ | This parameter must be a value of peripheral clock (in Mhz). |
Value | of peripheral clock (in Hz) |
Definition at line 283 of file stm32f4xx_ll_i2c.h.
Referenced by LL_I2C_GetPeriphClock().
#define __LL_I2C_RISE_TIME | ( | __FREQRANGE__, | |
__SPEED__ | |||
) | (uint32_t)(((__SPEED__) <= LL_I2C_MAX_SPEED_STANDARD) ? ((__FREQRANGE__) + 1U) : ((((__FREQRANGE__) * 300U) / 1000U) + 1U)) |
Compute I2C Clock rising time.
__FREQRANGE__ | This parameter must be a value of peripheral clock (in Mhz). |
__SPEED__ | This parameter must be a value lower than 400kHz (in Hz). |
Value | between Min_Data=0x02 and Max_Data=0x3F |
Definition at line 291 of file stm32f4xx_ll_i2c.h.
Referenced by LL_I2C_ConfigSpeed().
#define __LL_I2C_SPEED_FAST_TO_CCR | ( | __PCLK__, | |
__SPEED__, | |||
__DUTYCYCLE__ | |||
) |
(uint32_t)(((__DUTYCYCLE__) == LL_I2C_DUTYCYCLE_2)? \ (((((__PCLK__) / ((__SPEED__) * 3U)) & I2C_CCR_CCR) == 0U)? 1U:((__PCLK__) / ((__SPEED__) * 3U))) : \ (((((__PCLK__) / ((__SPEED__) * 25U)) & I2C_CCR_CCR) == 0U)? 1U:((__PCLK__) / ((__SPEED__) * 25U))))
Compute Speed Fast clock range to a Clock Control Register (I2C_CCR_CCR) value.
__PCLK__ | This parameter must be a value of peripheral clock (in Hz). |
__SPEED__ | This parameter must be a value between Min_Data=100Khz and Max_Data=400Khz (in Hz). |
__DUTYCYCLE__ | This parameter can be one of the following values: |
Value | between Min_Data=0x001 and Max_Data=0xFFF |
Definition at line 323 of file stm32f4xx_ll_i2c.h.
#define __LL_I2C_SPEED_STANDARD_TO_CCR | ( | __PCLK__, | |
__SPEED__ | |||
) | (uint32_t)(((((__PCLK__)/((__SPEED__) << 1U)) & I2C_CCR_CCR) < 4U)? 4U:((__PCLK__) / ((__SPEED__) << 1U))) |
Compute Speed Standard clock range to a Clock Control Register (I2C_CCR_CCR) value.
__PCLK__ | This parameter must be a value of peripheral clock (in Hz). |
__SPEED__ | This parameter must be a value lower than 100kHz (in Hz). |
Value | between Min_Data=0x004 and Max_Data=0xFFF. |
Definition at line 312 of file stm32f4xx_ll_i2c.h.
#define __LL_I2C_SPEED_TO_CCR | ( | __PCLK__, | |
__SPEED__, | |||
__DUTYCYCLE__ | |||
) |
(uint32_t)(((__SPEED__) <= LL_I2C_MAX_SPEED_STANDARD)? \ (__LL_I2C_SPEED_STANDARD_TO_CCR((__PCLK__), (__SPEED__))) : \ (__LL_I2C_SPEED_FAST_TO_CCR((__PCLK__), (__SPEED__), (__DUTYCYCLE__))))
Compute Speed clock range to a Clock Control Register (I2C_CCR_CCR) value.
__PCLK__ | This parameter must be a value of peripheral clock (in Hz). |
__SPEED__ | This parameter must be a value lower than 400kHz (in Hz). |
__DUTYCYCLE__ | This parameter can be one of the following values: |
Value | between Min_Data=0x004 and Max_Data=0xFFF, except in FAST DUTY mode where Min_Data=0x001. |
Definition at line 302 of file stm32f4xx_ll_i2c.h.