STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
I2C Private Macros
Collaboration diagram for I2C Private Macros:

Topics

 I2C Private macros to check input parameters
 

Macros

#define I2C_MIN_PCLK_FREQ(__PCLK__, __SPEED__)
 
#define I2C_CCR_CALCULATION(__PCLK__, __SPEED__, __COEFF__)
 
#define I2C_FREQRANGE(__PCLK__)
 
#define I2C_RISE_TIME(__FREQRANGE__, __SPEED__)
 
#define I2C_SPEED_STANDARD(__PCLK__, __SPEED__)
 
#define I2C_SPEED_FAST(__PCLK__, __SPEED__, __DUTYCYCLE__)
 
#define I2C_SPEED(__PCLK__, __SPEED__, __DUTYCYCLE__)
 
#define I2C_7BIT_ADD_WRITE(__ADDRESS__)
 
#define I2C_7BIT_ADD_READ(__ADDRESS__)
 
#define I2C_10BIT_ADDRESS(__ADDRESS__)
 
#define I2C_10BIT_HEADER_WRITE(__ADDRESS__)
 
#define I2C_10BIT_HEADER_READ(__ADDRESS__)
 
#define I2C_MEM_ADD_MSB(__ADDRESS__)
 
#define I2C_MEM_ADD_LSB(__ADDRESS__)
 
#define I2C_GET_DMA_REMAIN_DATA(__HANDLE__)
 

Detailed Description

Macro Definition Documentation

◆ I2C_MIN_PCLK_FREQ

#define I2C_MIN_PCLK_FREQ ( __PCLK__,
__SPEED__ )

#include <stm32f4xx_hal_i2c.h>

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

Definition at line 659 of file stm32f4xx_hal_i2c.h.

Referenced by HAL_I2C_Init().

◆ I2C_CCR_CALCULATION

#define I2C_CCR_CALCULATION ( __PCLK__,
__SPEED__,
__COEFF__ )

#include <stm32f4xx_hal_i2c.h>

Value:
(((((__PCLK__) - 1U)/((__SPEED__) * (__COEFF__))) + 1U) & I2C_CCR_CCR)

Definition at line 660 of file stm32f4xx_hal_i2c.h.

◆ I2C_FREQRANGE

#define I2C_FREQRANGE ( __PCLK__)

#include <stm32f4xx_hal_i2c.h>

Value:
((__PCLK__)/1000000U)

Definition at line 661 of file stm32f4xx_hal_i2c.h.

Referenced by HAL_I2C_Init().

◆ I2C_RISE_TIME

#define I2C_RISE_TIME ( __FREQRANGE__,
__SPEED__ )

#include <stm32f4xx_hal_i2c.h>

Value:
(((__SPEED__) <= 100000U) ? ((__FREQRANGE__) + 1U) : ((((__FREQRANGE__) * 300U) / 1000U) + 1U))

Definition at line 662 of file stm32f4xx_hal_i2c.h.

Referenced by HAL_I2C_Init().

◆ I2C_SPEED_STANDARD

#define I2C_SPEED_STANDARD ( __PCLK__,
__SPEED__ )

#include <stm32f4xx_hal_i2c.h>

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

Definition at line 663 of file stm32f4xx_hal_i2c.h.

◆ I2C_SPEED_FAST

#define I2C_SPEED_FAST ( __PCLK__,
__SPEED__,
__DUTYCYCLE__ )

#include <stm32f4xx_hal_i2c.h>

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

Definition at line 664 of file stm32f4xx_hal_i2c.h.

◆ I2C_SPEED

#define I2C_SPEED ( __PCLK__,
__SPEED__,
__DUTYCYCLE__ )

#include <stm32f4xx_hal_i2c.h>

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))
#define I2C_SPEED_FAST(__PCLK__, __SPEED__, __DUTYCYCLE__)
#define I2C_SPEED_STANDARD(__PCLK__, __SPEED__)

Definition at line 665 of file stm32f4xx_hal_i2c.h.

Referenced by HAL_I2C_Init().

◆ I2C_7BIT_ADD_WRITE

#define I2C_7BIT_ADD_WRITE ( __ADDRESS__)

#include <stm32f4xx_hal_i2c.h>

Value:
((uint8_t)((__ADDRESS__) & (uint8_t)(~I2C_OAR1_ADD0)))

Definition at line 669 of file stm32f4xx_hal_i2c.h.

Referenced by HAL_I2C_IsDeviceReady(), I2C_Master_SB(), I2C_MasterRequestWrite(), I2C_RequestMemoryRead(), and I2C_RequestMemoryWrite().

◆ I2C_7BIT_ADD_READ

#define I2C_7BIT_ADD_READ ( __ADDRESS__)

#include <stm32f4xx_hal_i2c.h>

Value:
((uint8_t)((__ADDRESS__) | I2C_OAR1_ADD0))

Definition at line 670 of file stm32f4xx_hal_i2c.h.

Referenced by I2C_Master_SB(), I2C_MasterRequestRead(), and I2C_RequestMemoryRead().

◆ I2C_10BIT_ADDRESS

#define I2C_10BIT_ADDRESS ( __ADDRESS__)

#include <stm32f4xx_hal_i2c.h>

Value:
((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)0x00FF)))

Definition at line 672 of file stm32f4xx_hal_i2c.h.

Referenced by I2C_Master_ADD10(), I2C_MasterRequestRead(), and I2C_MasterRequestWrite().

◆ I2C_10BIT_HEADER_WRITE

#define I2C_10BIT_HEADER_WRITE ( __ADDRESS__)

#include <stm32f4xx_hal_i2c.h>

Value:
((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)0x00F0)))

Definition at line 673 of file stm32f4xx_hal_i2c.h.

Referenced by I2C_Master_SB(), I2C_MasterRequestRead(), and I2C_MasterRequestWrite().

◆ I2C_10BIT_HEADER_READ

#define I2C_10BIT_HEADER_READ ( __ADDRESS__)

#include <stm32f4xx_hal_i2c.h>

Value:
((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0x0300)) >> 7) | (uint16_t)(0x00F1))))

Definition at line 674 of file stm32f4xx_hal_i2c.h.

Referenced by I2C_Master_SB(), and I2C_MasterRequestRead().

◆ I2C_MEM_ADD_MSB

#define I2C_MEM_ADD_MSB ( __ADDRESS__)

#include <stm32f4xx_hal_i2c.h>

Value:
((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)0xFF00)) >> 8)))

Definition at line 676 of file stm32f4xx_hal_i2c.h.

Referenced by I2C_MemoryTransmit_TXE_BTF(), I2C_RequestMemoryRead(), and I2C_RequestMemoryWrite().

◆ I2C_MEM_ADD_LSB

#define I2C_MEM_ADD_LSB ( __ADDRESS__)

#include <stm32f4xx_hal_i2c.h>

Value:
((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)0x00FF)))

Definition at line 677 of file stm32f4xx_hal_i2c.h.

Referenced by I2C_MemoryTransmit_TXE_BTF(), I2C_RequestMemoryRead(), and I2C_RequestMemoryWrite().

◆ I2C_GET_DMA_REMAIN_DATA

#define I2C_GET_DMA_REMAIN_DATA ( __HANDLE__)

#include <stm32f4xx_hal_i2c.c>

Value:
#define __HAL_DMA_GET_COUNTER(__HANDLE__)
Returns the number of remaining data units in the current DMAy Streamx transfer.

Definition at line 341 of file stm32f4xx_hal_i2c.c.

Referenced by I2C_Slave_STOPF().