|
@@ -69,38 +69,46 @@ typedef struct
|
|
|
uint32_t PeripheralMode; /*!< Specifies the peripheral mode.
|
|
|
This parameter can be a value of @ref I2C_LL_EC_PERIPHERAL_MODE.
|
|
|
|
|
|
- This feature can be modified afterwards using unitary function @ref LL_I2C_SetMode(). */
|
|
|
+ This feature can be modified afterwards using unitary function
|
|
|
+ @ref LL_I2C_SetMode(). */
|
|
|
|
|
|
uint32_t Timing; /*!< Specifies the SDA setup, hold time and the SCL high, low period values.
|
|
|
This parameter must be set by referring to the STM32CubeMX Tool and
|
|
|
the helper macro @ref __LL_I2C_CONVERT_TIMINGS().
|
|
|
|
|
|
- This feature can be modified afterwards using unitary function @ref LL_I2C_SetTiming(). */
|
|
|
+ This feature can be modified afterwards using unitary function
|
|
|
+ @ref LL_I2C_SetTiming(). */
|
|
|
|
|
|
uint32_t AnalogFilter; /*!< Enables or disables analog noise filter.
|
|
|
This parameter can be a value of @ref I2C_LL_EC_ANALOGFILTER_SELECTION.
|
|
|
|
|
|
- This feature can be modified afterwards using unitary functions @ref LL_I2C_EnableAnalogFilter() or LL_I2C_DisableAnalogFilter(). */
|
|
|
+ This feature can be modified afterwards using unitary functions
|
|
|
+ @ref LL_I2C_EnableAnalogFilter() or LL_I2C_DisableAnalogFilter(). */
|
|
|
|
|
|
uint32_t DigitalFilter; /*!< Configures the digital noise filter.
|
|
|
This parameter can be a number between Min_Data = 0x00 and Max_Data = 0x0F.
|
|
|
|
|
|
- This feature can be modified afterwards using unitary function @ref LL_I2C_SetDigitalFilter(). */
|
|
|
+ This feature can be modified afterwards using unitary function
|
|
|
+ @ref LL_I2C_SetDigitalFilter(). */
|
|
|
|
|
|
uint32_t OwnAddress1; /*!< Specifies the device own address 1.
|
|
|
This parameter must be a value between Min_Data = 0x00 and Max_Data = 0x3FF.
|
|
|
|
|
|
- This feature can be modified afterwards using unitary function @ref LL_I2C_SetOwnAddress1(). */
|
|
|
+ This feature can be modified afterwards using unitary function
|
|
|
+ @ref LL_I2C_SetOwnAddress1(). */
|
|
|
|
|
|
- uint32_t TypeAcknowledge; /*!< Specifies the ACKnowledge or Non ACKnowledge condition after the address receive match code or next received byte.
|
|
|
+ uint32_t TypeAcknowledge; /*!< Specifies the ACKnowledge or Non ACKnowledge condition after the address receive
|
|
|
+ match code or next received byte.
|
|
|
This parameter can be a value of @ref I2C_LL_EC_I2C_ACKNOWLEDGE.
|
|
|
|
|
|
- This feature can be modified afterwards using unitary function @ref LL_I2C_AcknowledgeNextData(). */
|
|
|
+ This feature can be modified afterwards using unitary function
|
|
|
+ @ref LL_I2C_AcknowledgeNextData(). */
|
|
|
|
|
|
uint32_t OwnAddrSize; /*!< Specifies the device own address 1 size (7-bit or 10-bit).
|
|
|
This parameter can be a value of @ref I2C_LL_EC_OWNADDRESS1.
|
|
|
|
|
|
- This feature can be modified afterwards using unitary function @ref LL_I2C_SetOwnAddress1(). */
|
|
|
+ This feature can be modified afterwards using unitary function
|
|
|
+ @ref LL_I2C_SetOwnAddress1(). */
|
|
|
} LL_I2C_InitTypeDef;
|
|
|
/**
|
|
|
* @}
|
|
@@ -170,10 +178,11 @@ typedef struct
|
|
|
/** @defgroup I2C_LL_EC_PERIPHERAL_MODE Peripheral Mode
|
|
|
* @{
|
|
|
*/
|
|
|
-#define LL_I2C_MODE_I2C 0x00000000U /*!< I2C Master or Slave mode */
|
|
|
-#define LL_I2C_MODE_SMBUS_HOST I2C_CR1_SMBHEN /*!< SMBus Host address acknowledge */
|
|
|
-#define LL_I2C_MODE_SMBUS_DEVICE 0x00000000U /*!< SMBus Device default mode (Default address not acknowledge) */
|
|
|
-#define LL_I2C_MODE_SMBUS_DEVICE_ARP I2C_CR1_SMBDEN /*!< SMBus Device Default address acknowledge */
|
|
|
+#define LL_I2C_MODE_I2C 0x00000000U /*!< I2C Master or Slave mode */
|
|
|
+#define LL_I2C_MODE_SMBUS_HOST I2C_CR1_SMBHEN /*!< SMBus Host address acknowledge */
|
|
|
+#define LL_I2C_MODE_SMBUS_DEVICE 0x00000000U /*!< SMBus Device default mode
|
|
|
+ (Default address not acknowledge) */
|
|
|
+#define LL_I2C_MODE_SMBUS_DEVICE_ARP I2C_CR1_SMBDEN /*!< SMBus Device Default address acknowledge */
|
|
|
/**
|
|
|
* @}
|
|
|
*/
|
|
@@ -208,14 +217,15 @@ typedef struct
|
|
|
/** @defgroup I2C_LL_EC_OWNADDRESS2 Own Address 2 Masks
|
|
|
* @{
|
|
|
*/
|
|
|
-#define LL_I2C_OWNADDRESS2_NOMASK I2C_OAR2_OA2NOMASK /*!< Own Address2 No mask. */
|
|
|
-#define LL_I2C_OWNADDRESS2_MASK01 I2C_OAR2_OA2MASK01 /*!< Only Address2 bits[7:2] are compared. */
|
|
|
-#define LL_I2C_OWNADDRESS2_MASK02 I2C_OAR2_OA2MASK02 /*!< Only Address2 bits[7:3] are compared. */
|
|
|
-#define LL_I2C_OWNADDRESS2_MASK03 I2C_OAR2_OA2MASK03 /*!< Only Address2 bits[7:4] are compared. */
|
|
|
-#define LL_I2C_OWNADDRESS2_MASK04 I2C_OAR2_OA2MASK04 /*!< Only Address2 bits[7:5] are compared. */
|
|
|
-#define LL_I2C_OWNADDRESS2_MASK05 I2C_OAR2_OA2MASK05 /*!< Only Address2 bits[7:6] are compared. */
|
|
|
-#define LL_I2C_OWNADDRESS2_MASK06 I2C_OAR2_OA2MASK06 /*!< Only Address2 bits[7] are compared. */
|
|
|
-#define LL_I2C_OWNADDRESS2_MASK07 I2C_OAR2_OA2MASK07 /*!< No comparison is done. All Address2 are acknowledged.*/
|
|
|
+#define LL_I2C_OWNADDRESS2_NOMASK I2C_OAR2_OA2NOMASK /*!< Own Address2 No mask. */
|
|
|
+#define LL_I2C_OWNADDRESS2_MASK01 I2C_OAR2_OA2MASK01 /*!< Only Address2 bits[7:2] are compared. */
|
|
|
+#define LL_I2C_OWNADDRESS2_MASK02 I2C_OAR2_OA2MASK02 /*!< Only Address2 bits[7:3] are compared. */
|
|
|
+#define LL_I2C_OWNADDRESS2_MASK03 I2C_OAR2_OA2MASK03 /*!< Only Address2 bits[7:4] are compared. */
|
|
|
+#define LL_I2C_OWNADDRESS2_MASK04 I2C_OAR2_OA2MASK04 /*!< Only Address2 bits[7:5] are compared. */
|
|
|
+#define LL_I2C_OWNADDRESS2_MASK05 I2C_OAR2_OA2MASK05 /*!< Only Address2 bits[7:6] are compared. */
|
|
|
+#define LL_I2C_OWNADDRESS2_MASK06 I2C_OAR2_OA2MASK06 /*!< Only Address2 bits[7] are compared. */
|
|
|
+#define LL_I2C_OWNADDRESS2_MASK07 I2C_OAR2_OA2MASK07 /*!< No comparison is done.
|
|
|
+ All Address2 are acknowledged. */
|
|
|
/**
|
|
|
* @}
|
|
|
*/
|
|
@@ -250,14 +260,21 @@ typedef struct
|
|
|
/** @defgroup I2C_LL_EC_MODE Transfer End Mode
|
|
|
* @{
|
|
|
*/
|
|
|
-#define LL_I2C_MODE_RELOAD I2C_CR2_RELOAD /*!< Enable I2C Reload mode. */
|
|
|
-#define LL_I2C_MODE_AUTOEND I2C_CR2_AUTOEND /*!< Enable I2C Automatic end mode with no HW PEC comparison. */
|
|
|
-#define LL_I2C_MODE_SOFTEND 0x00000000U /*!< Enable I2C Software end mode with no HW PEC comparison. */
|
|
|
-#define LL_I2C_MODE_SMBUS_RELOAD LL_I2C_MODE_RELOAD /*!< Enable SMBUS Automatic end mode with HW PEC comparison. */
|
|
|
-#define LL_I2C_MODE_SMBUS_AUTOEND_NO_PEC LL_I2C_MODE_AUTOEND /*!< Enable SMBUS Automatic end mode with HW PEC comparison. */
|
|
|
-#define LL_I2C_MODE_SMBUS_SOFTEND_NO_PEC LL_I2C_MODE_SOFTEND /*!< Enable SMBUS Software end mode with HW PEC comparison. */
|
|
|
-#define LL_I2C_MODE_SMBUS_AUTOEND_WITH_PEC (uint32_t)(LL_I2C_MODE_AUTOEND | I2C_CR2_PECBYTE) /*!< Enable SMBUS Automatic end mode with HW PEC comparison. */
|
|
|
-#define LL_I2C_MODE_SMBUS_SOFTEND_WITH_PEC (uint32_t)(LL_I2C_MODE_SOFTEND | I2C_CR2_PECBYTE) /*!< Enable SMBUS Software end mode with HW PEC comparison. */
|
|
|
+#define LL_I2C_MODE_RELOAD I2C_CR2_RELOAD /*!< Enable I2C Reload mode. */
|
|
|
+#define LL_I2C_MODE_AUTOEND I2C_CR2_AUTOEND /*!< Enable I2C Automatic end mode
|
|
|
+ with no HW PEC comparison. */
|
|
|
+#define LL_I2C_MODE_SOFTEND 0x00000000U /*!< Enable I2C Software end mode
|
|
|
+ with no HW PEC comparison. */
|
|
|
+#define LL_I2C_MODE_SMBUS_RELOAD LL_I2C_MODE_RELOAD /*!< Enable SMBUS Automatic end mode
|
|
|
+ with HW PEC comparison. */
|
|
|
+#define LL_I2C_MODE_SMBUS_AUTOEND_NO_PEC LL_I2C_MODE_AUTOEND /*!< Enable SMBUS Automatic end mode
|
|
|
+ with HW PEC comparison. */
|
|
|
+#define LL_I2C_MODE_SMBUS_SOFTEND_NO_PEC LL_I2C_MODE_SOFTEND /*!< Enable SMBUS Software end mode
|
|
|
+ with HW PEC comparison. */
|
|
|
+#define LL_I2C_MODE_SMBUS_AUTOEND_WITH_PEC (uint32_t)(LL_I2C_MODE_AUTOEND | I2C_CR2_PECBYTE)
|
|
|
+/*!< Enable SMBUS Automatic end mode with HW PEC comparison. */
|
|
|
+#define LL_I2C_MODE_SMBUS_SOFTEND_WITH_PEC (uint32_t)(LL_I2C_MODE_SOFTEND | I2C_CR2_PECBYTE)
|
|
|
+/*!< Enable SMBUS Software end mode with HW PEC comparison. */
|
|
|
/**
|
|
|
* @}
|
|
|
*/
|
|
@@ -265,14 +282,23 @@ typedef struct
|
|
|
/** @defgroup I2C_LL_EC_GENERATE Start And Stop Generation
|
|
|
* @{
|
|
|
*/
|
|
|
-#define LL_I2C_GENERATE_NOSTARTSTOP 0x00000000U /*!< Don't Generate Stop and Start condition. */
|
|
|
-#define LL_I2C_GENERATE_STOP (uint32_t)(0x80000000U | I2C_CR2_STOP) /*!< Generate Stop condition (Size should be set to 0). */
|
|
|
-#define LL_I2C_GENERATE_START_READ (uint32_t)(0x80000000U | I2C_CR2_START | I2C_CR2_RD_WRN) /*!< Generate Start for read request. */
|
|
|
-#define LL_I2C_GENERATE_START_WRITE (uint32_t)(0x80000000U | I2C_CR2_START) /*!< Generate Start for write request. */
|
|
|
-#define LL_I2C_GENERATE_RESTART_7BIT_READ (uint32_t)(0x80000000U | I2C_CR2_START | I2C_CR2_RD_WRN) /*!< Generate Restart for read request, slave 7Bit address. */
|
|
|
-#define LL_I2C_GENERATE_RESTART_7BIT_WRITE (uint32_t)(0x80000000U | I2C_CR2_START) /*!< Generate Restart for write request, slave 7Bit address. */
|
|
|
-#define LL_I2C_GENERATE_RESTART_10BIT_READ (uint32_t)(0x80000000U | I2C_CR2_START | I2C_CR2_RD_WRN | I2C_CR2_HEAD10R) /*!< Generate Restart for read request, slave 10Bit address. */
|
|
|
-#define LL_I2C_GENERATE_RESTART_10BIT_WRITE (uint32_t)(0x80000000U | I2C_CR2_START) /*!< Generate Restart for write request, slave 10Bit address.*/
|
|
|
+#define LL_I2C_GENERATE_NOSTARTSTOP 0x00000000U
|
|
|
+/*!< Don't Generate Stop and Start condition. */
|
|
|
+#define LL_I2C_GENERATE_STOP (uint32_t)(0x80000000U | I2C_CR2_STOP)
|
|
|
+/*!< Generate Stop condition (Size should be set to 0). */
|
|
|
+#define LL_I2C_GENERATE_START_READ (uint32_t)(0x80000000U | I2C_CR2_START | I2C_CR2_RD_WRN)
|
|
|
+/*!< Generate Start for read request. */
|
|
|
+#define LL_I2C_GENERATE_START_WRITE (uint32_t)(0x80000000U | I2C_CR2_START)
|
|
|
+/*!< Generate Start for write request. */
|
|
|
+#define LL_I2C_GENERATE_RESTART_7BIT_READ (uint32_t)(0x80000000U | I2C_CR2_START | I2C_CR2_RD_WRN)
|
|
|
+/*!< Generate Restart for read request, slave 7Bit address. */
|
|
|
+#define LL_I2C_GENERATE_RESTART_7BIT_WRITE (uint32_t)(0x80000000U | I2C_CR2_START)
|
|
|
+/*!< Generate Restart for write request, slave 7Bit address. */
|
|
|
+#define LL_I2C_GENERATE_RESTART_10BIT_READ (uint32_t)(0x80000000U | I2C_CR2_START | \
|
|
|
+ I2C_CR2_RD_WRN | I2C_CR2_HEAD10R)
|
|
|
+/*!< Generate Restart for read request, slave 10Bit address. */
|
|
|
+#define LL_I2C_GENERATE_RESTART_10BIT_WRITE (uint32_t)(0x80000000U | I2C_CR2_START)
|
|
|
+/*!< Generate Restart for write request, slave 10Bit address.*/
|
|
|
/**
|
|
|
* @}
|
|
|
*/
|
|
@@ -280,8 +306,10 @@ typedef struct
|
|
|
/** @defgroup I2C_LL_EC_DIRECTION Read Write Direction
|
|
|
* @{
|
|
|
*/
|
|
|
-#define LL_I2C_DIRECTION_WRITE 0x00000000U /*!< Write transfer request by master, slave enters receiver mode. */
|
|
|
-#define LL_I2C_DIRECTION_READ I2C_ISR_DIR /*!< Read transfer request by master, slave enters transmitter mode.*/
|
|
|
+#define LL_I2C_DIRECTION_WRITE 0x00000000U /*!< Write transfer request by master,
|
|
|
+ slave enters receiver mode. */
|
|
|
+#define LL_I2C_DIRECTION_READ I2C_ISR_DIR /*!< Read transfer request by master,
|
|
|
+ slave enters transmitter mode.*/
|
|
|
/**
|
|
|
* @}
|
|
|
*/
|
|
@@ -289,8 +317,10 @@ typedef struct
|
|
|
/** @defgroup I2C_LL_EC_DMA_REG_DATA DMA Register Data
|
|
|
* @{
|
|
|
*/
|
|
|
-#define LL_I2C_DMA_REG_DATA_TRANSMIT 0x00000000U /*!< Get address of data register used for transmission */
|
|
|
-#define LL_I2C_DMA_REG_DATA_RECEIVE 0x00000001U /*!< Get address of data register used for reception */
|
|
|
+#define LL_I2C_DMA_REG_DATA_TRANSMIT 0x00000000U /*!< Get address of data register used for
|
|
|
+ transmission */
|
|
|
+#define LL_I2C_DMA_REG_DATA_RECEIVE 0x00000001U /*!< Get address of data register used for
|
|
|
+ reception */
|
|
|
/**
|
|
|
* @}
|
|
|
*/
|
|
@@ -298,8 +328,10 @@ typedef struct
|
|
|
/** @defgroup I2C_LL_EC_SMBUS_TIMEOUTA_MODE SMBus TimeoutA Mode SCL SDA Timeout
|
|
|
* @{
|
|
|
*/
|
|
|
-#define LL_I2C_SMBUS_TIMEOUTA_MODE_SCL_LOW 0x00000000U /*!< TimeoutA is used to detect SCL low level timeout. */
|
|
|
-#define LL_I2C_SMBUS_TIMEOUTA_MODE_SDA_SCL_HIGH I2C_TIMEOUTR_TIDLE /*!< TimeoutA is used to detect both SCL and SDA high level timeout.*/
|
|
|
+#define LL_I2C_SMBUS_TIMEOUTA_MODE_SCL_LOW 0x00000000U /*!< TimeoutA is used to detect
|
|
|
+ SCL low level timeout. */
|
|
|
+#define LL_I2C_SMBUS_TIMEOUTA_MODE_SDA_SCL_HIGH I2C_TIMEOUTR_TIDLE /*!< TimeoutA is used to detect
|
|
|
+ both SCL and SDA high level timeout.*/
|
|
|
/**
|
|
|
* @}
|
|
|
*/
|
|
@@ -307,9 +339,12 @@ typedef struct
|
|
|
/** @defgroup I2C_LL_EC_SMBUS_TIMEOUT_SELECTION SMBus Timeout Selection
|
|
|
* @{
|
|
|
*/
|
|
|
-#define LL_I2C_SMBUS_TIMEOUTA I2C_TIMEOUTR_TIMOUTEN /*!< TimeoutA enable bit */
|
|
|
-#define LL_I2C_SMBUS_TIMEOUTB I2C_TIMEOUTR_TEXTEN /*!< TimeoutB (extended clock) enable bit */
|
|
|
-#define LL_I2C_SMBUS_ALL_TIMEOUT (uint32_t)(I2C_TIMEOUTR_TIMOUTEN | I2C_TIMEOUTR_TEXTEN) /*!< TimeoutA and TimeoutB (extended clock) enable bits */
|
|
|
+#define LL_I2C_SMBUS_TIMEOUTA I2C_TIMEOUTR_TIMOUTEN /*!< TimeoutA enable bit */
|
|
|
+#define LL_I2C_SMBUS_TIMEOUTB I2C_TIMEOUTR_TEXTEN /*!< TimeoutB (extended clock)
|
|
|
+ enable bit */
|
|
|
+#define LL_I2C_SMBUS_ALL_TIMEOUT (uint32_t)(I2C_TIMEOUTR_TIMOUTEN | \
|
|
|
+ I2C_TIMEOUTR_TEXTEN) /*!< TimeoutA and TimeoutB
|
|
|
+(extended clock) enable bits */
|
|
|
/**
|
|
|
* @}
|
|
|
*/
|
|
@@ -353,18 +388,22 @@ typedef struct
|
|
|
/**
|
|
|
* @brief Configure the SDA setup, hold time and the SCL high, low period.
|
|
|
* @param __PRESCALER__ This parameter must be a value between Min_Data=0 and Max_Data=0xF.
|
|
|
- * @param __DATA_SETUP_TIME__ This parameter must be a value between Min_Data=0 and Max_Data=0xF. (tscldel = (SCLDEL+1)xtpresc)
|
|
|
- * @param __DATA_HOLD_TIME__ This parameter must be a value between Min_Data=0 and Max_Data=0xF. (tsdadel = SDADELxtpresc)
|
|
|
- * @param __CLOCK_HIGH_PERIOD__ This parameter must be a value between Min_Data=0 and Max_Data=0xFF. (tsclh = (SCLH+1)xtpresc)
|
|
|
- * @param __CLOCK_LOW_PERIOD__ This parameter must be a value between Min_Data=0 and Max_Data=0xFF. (tscll = (SCLL+1)xtpresc)
|
|
|
+ * @param __SETUP_TIME__ This parameter must be a value between Min_Data=0 and Max_Data=0xF.
|
|
|
+ (tscldel = (SCLDEL+1)xtpresc)
|
|
|
+ * @param __HOLD_TIME__ This parameter must be a value between Min_Data=0 and Max_Data=0xF.
|
|
|
+ (tsdadel = SDADELxtpresc)
|
|
|
+ * @param __SCLH_PERIOD__ This parameter must be a value between Min_Data=0 and Max_Data=0xFF.
|
|
|
+ (tsclh = (SCLH+1)xtpresc)
|
|
|
+ * @param __SCLL_PERIOD__ This parameter must be a value between Min_Data=0 and Max_Data=0xFF.
|
|
|
+ (tscll = (SCLL+1)xtpresc)
|
|
|
* @retval Value between Min_Data=0 and Max_Data=0xFFFFFFFF
|
|
|
*/
|
|
|
-#define __LL_I2C_CONVERT_TIMINGS(__PRESCALER__, __DATA_SETUP_TIME__, __DATA_HOLD_TIME__, __CLOCK_HIGH_PERIOD__, __CLOCK_LOW_PERIOD__) \
|
|
|
- ((((uint32_t)(__PRESCALER__) << I2C_TIMINGR_PRESC_Pos) & I2C_TIMINGR_PRESC) | \
|
|
|
- (((uint32_t)(__DATA_SETUP_TIME__) << I2C_TIMINGR_SCLDEL_Pos) & I2C_TIMINGR_SCLDEL) | \
|
|
|
- (((uint32_t)(__DATA_HOLD_TIME__) << I2C_TIMINGR_SDADEL_Pos) & I2C_TIMINGR_SDADEL) | \
|
|
|
- (((uint32_t)(__CLOCK_HIGH_PERIOD__) << I2C_TIMINGR_SCLH_Pos) & I2C_TIMINGR_SCLH) | \
|
|
|
- (((uint32_t)(__CLOCK_LOW_PERIOD__) << I2C_TIMINGR_SCLL_Pos) & I2C_TIMINGR_SCLL))
|
|
|
+#define __LL_I2C_CONVERT_TIMINGS(__PRESCALER__, __SETUP_TIME__, __HOLD_TIME__, __SCLH_PERIOD__, __SCLL_PERIOD__) \
|
|
|
+ ((((uint32_t)(__PRESCALER__) << I2C_TIMINGR_PRESC_Pos) & I2C_TIMINGR_PRESC) | \
|
|
|
+ (((uint32_t)(__SETUP_TIME__) << I2C_TIMINGR_SCLDEL_Pos) & I2C_TIMINGR_SCLDEL) | \
|
|
|
+ (((uint32_t)(__HOLD_TIME__) << I2C_TIMINGR_SDADEL_Pos) & I2C_TIMINGR_SDADEL) | \
|
|
|
+ (((uint32_t)(__SCLH_PERIOD__) << I2C_TIMINGR_SCLH_Pos) & I2C_TIMINGR_SCLH) | \
|
|
|
+ (((uint32_t)(__SCLL_PERIOD__) << I2C_TIMINGR_SCLL_Pos) & I2C_TIMINGR_SCLL))
|
|
|
/**
|
|
|
* @}
|
|
|
*/
|
|
@@ -428,7 +467,8 @@ __STATIC_INLINE uint32_t LL_I2C_IsEnabled(I2C_TypeDef *I2Cx)
|
|
|
* @param AnalogFilter This parameter can be one of the following values:
|
|
|
* @arg @ref LL_I2C_ANALOGFILTER_ENABLE
|
|
|
* @arg @ref LL_I2C_ANALOGFILTER_DISABLE
|
|
|
- * @param DigitalFilter This parameter must be a value between Min_Data=0x00 (Digital filter disabled) and Max_Data=0x0F (Digital filter enabled and filtering capability up to 15*ti2cclk).
|
|
|
+ * @param DigitalFilter This parameter must be a value between Min_Data=0x00 (Digital filter disabled)
|
|
|
+ and Max_Data=0x0F (Digital filter enabled and filtering capability up to 15*ti2cclk).
|
|
|
* This parameter is used to configure the digital noise filter on SDA and SCL input.
|
|
|
* The digital filter will filter spikes with a length of up to DNF[3:0]*ti2cclk.
|
|
|
* @retval None
|
|
@@ -444,7 +484,8 @@ __STATIC_INLINE void LL_I2C_ConfigFilters(I2C_TypeDef *I2Cx, uint32_t AnalogFilt
|
|
|
* This filter can only be programmed when the I2C is disabled (PE = 0).
|
|
|
* @rmtoll CR1 DNF LL_I2C_SetDigitalFilter
|
|
|
* @param I2Cx I2C Instance.
|
|
|
- * @param DigitalFilter This parameter must be a value between Min_Data=0x00 (Digital filter disabled) and Max_Data=0x0F (Digital filter enabled and filtering capability up to 15*ti2cclk).
|
|
|
+ * @param DigitalFilter This parameter must be a value between Min_Data=0x00 (Digital filter disabled)
|
|
|
+ and Max_Data=0x0F (Digital filter enabled and filtering capability up to 15*ti2cclk).
|
|
|
* This parameter is used to configure the digital noise filter on SDA and SCL input.
|
|
|
* The digital filter will filter spikes with a length of up to DNF[3:0]*ti2cclk.
|
|
|
* @retval None
|
|
@@ -583,12 +624,12 @@ __STATIC_INLINE uint32_t LL_I2C_DMA_GetRegAddr(I2C_TypeDef *I2Cx, uint32_t Direc
|
|
|
if (Direction == LL_I2C_DMA_REG_DATA_TRANSMIT)
|
|
|
{
|
|
|
/* return address of TXDR register */
|
|
|
- data_reg_addr = (uint32_t) & (I2Cx->TXDR);
|
|
|
+ data_reg_addr = (uint32_t) &(I2Cx->TXDR);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
/* return address of RXDR register */
|
|
|
- data_reg_addr = (uint32_t) & (I2Cx->RXDR);
|
|
|
+ data_reg_addr = (uint32_t) &(I2Cx->RXDR);
|
|
|
}
|
|
|
|
|
|
return data_reg_addr;
|
|
@@ -664,7 +705,7 @@ __STATIC_INLINE uint32_t LL_I2C_IsEnabledSlaveByteControl(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Enable Wakeup from STOP.
|
|
|
- * @note Macro IS_I2C_WAKEUP_FROMSTOP_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_I2C_WAKEUP_FROMSTOP_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* WakeUpFromStop feature is supported by the I2Cx Instance.
|
|
|
* @note This bit can only be programmed when Digital Filter is disabled.
|
|
|
* @rmtoll CR1 WUPEN LL_I2C_EnableWakeUpFromStop
|
|
@@ -678,7 +719,7 @@ __STATIC_INLINE void LL_I2C_EnableWakeUpFromStop(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Disable Wakeup from STOP.
|
|
|
- * @note Macro IS_I2C_WAKEUP_FROMSTOP_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_I2C_WAKEUP_FROMSTOP_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* WakeUpFromStop feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll CR1 WUPEN LL_I2C_DisableWakeUpFromStop
|
|
|
* @param I2Cx I2C Instance.
|
|
@@ -691,7 +732,7 @@ __STATIC_INLINE void LL_I2C_DisableWakeUpFromStop(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Check if Wakeup from STOP is enabled or disabled.
|
|
|
- * @note Macro IS_I2C_WAKEUP_FROMSTOP_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_I2C_WAKEUP_FROMSTOP_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* WakeUpFromStop feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll CR1 WUPEN LL_I2C_IsEnabledWakeUpFromStop
|
|
|
* @param I2Cx I2C Instance.
|
|
@@ -941,7 +982,7 @@ __STATIC_INLINE uint32_t LL_I2C_GetDataSetupTime(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Configure peripheral mode.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll CR1 SMBHEN LL_I2C_SetMode\n
|
|
|
* CR1 SMBDEN LL_I2C_SetMode
|
|
@@ -960,7 +1001,7 @@ __STATIC_INLINE void LL_I2C_SetMode(I2C_TypeDef *I2Cx, uint32_t PeripheralMode)
|
|
|
|
|
|
/**
|
|
|
* @brief Get peripheral mode.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll CR1 SMBHEN LL_I2C_GetMode\n
|
|
|
* CR1 SMBDEN LL_I2C_GetMode
|
|
@@ -978,7 +1019,7 @@ __STATIC_INLINE uint32_t LL_I2C_GetMode(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Enable SMBus alert (Host or Device mode)
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @note SMBus Device mode:
|
|
|
* - SMBus Alert pin is drived low and
|
|
@@ -996,7 +1037,7 @@ __STATIC_INLINE void LL_I2C_EnableSMBusAlert(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Disable SMBus alert (Host or Device mode)
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @note SMBus Device mode:
|
|
|
* - SMBus Alert pin is not drived (can be used as a standard GPIO) and
|
|
@@ -1014,7 +1055,7 @@ __STATIC_INLINE void LL_I2C_DisableSMBusAlert(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Check if SMBus alert (Host or Device mode) is enabled or disabled.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll CR1 ALERTEN LL_I2C_IsEnabledSMBusAlert
|
|
|
* @param I2Cx I2C Instance.
|
|
@@ -1027,7 +1068,7 @@ __STATIC_INLINE uint32_t LL_I2C_IsEnabledSMBusAlert(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Enable SMBus Packet Error Calculation (PEC).
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll CR1 PECEN LL_I2C_EnableSMBusPEC
|
|
|
* @param I2Cx I2C Instance.
|
|
@@ -1040,7 +1081,7 @@ __STATIC_INLINE void LL_I2C_EnableSMBusPEC(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Disable SMBus Packet Error Calculation (PEC).
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll CR1 PECEN LL_I2C_DisableSMBusPEC
|
|
|
* @param I2Cx I2C Instance.
|
|
@@ -1053,7 +1094,7 @@ __STATIC_INLINE void LL_I2C_DisableSMBusPEC(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Check if SMBus Packet Error Calculation (PEC) is enabled or disabled.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll CR1 PECEN LL_I2C_IsEnabledSMBusPEC
|
|
|
* @param I2Cx I2C Instance.
|
|
@@ -1066,7 +1107,7 @@ __STATIC_INLINE uint32_t LL_I2C_IsEnabledSMBusPEC(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Configure the SMBus Clock Timeout.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @note This configuration can only be programmed when associated Timeout is disabled (TimeoutA and/orTimeoutB).
|
|
|
* @rmtoll TIMEOUTR TIMEOUTA LL_I2C_ConfigSMBusTimeout\n
|
|
@@ -1089,7 +1130,7 @@ __STATIC_INLINE void LL_I2C_ConfigSMBusTimeout(I2C_TypeDef *I2Cx, uint32_t Timeo
|
|
|
|
|
|
/**
|
|
|
* @brief Configure the SMBus Clock TimeoutA (SCL low timeout or SCL and SDA high timeout depends on TimeoutA mode).
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @note These bits can only be programmed when TimeoutA is disabled.
|
|
|
* @rmtoll TIMEOUTR TIMEOUTA LL_I2C_SetSMBusTimeoutA
|
|
@@ -1104,7 +1145,7 @@ __STATIC_INLINE void LL_I2C_SetSMBusTimeoutA(I2C_TypeDef *I2Cx, uint32_t Timeout
|
|
|
|
|
|
/**
|
|
|
* @brief Get the SMBus Clock TimeoutA setting.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll TIMEOUTR TIMEOUTA LL_I2C_GetSMBusTimeoutA
|
|
|
* @param I2Cx I2C Instance.
|
|
@@ -1117,7 +1158,7 @@ __STATIC_INLINE uint32_t LL_I2C_GetSMBusTimeoutA(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Set the SMBus Clock TimeoutA mode.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @note This bit can only be programmed when TimeoutA is disabled.
|
|
|
* @rmtoll TIMEOUTR TIDLE LL_I2C_SetSMBusTimeoutAMode
|
|
@@ -1134,7 +1175,7 @@ __STATIC_INLINE void LL_I2C_SetSMBusTimeoutAMode(I2C_TypeDef *I2Cx, uint32_t Tim
|
|
|
|
|
|
/**
|
|
|
* @brief Get the SMBus Clock TimeoutA mode.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll TIMEOUTR TIDLE LL_I2C_GetSMBusTimeoutAMode
|
|
|
* @param I2Cx I2C Instance.
|
|
@@ -1149,7 +1190,7 @@ __STATIC_INLINE uint32_t LL_I2C_GetSMBusTimeoutAMode(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Configure the SMBus Extended Cumulative Clock TimeoutB (Master or Slave mode).
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @note These bits can only be programmed when TimeoutB is disabled.
|
|
|
* @rmtoll TIMEOUTR TIMEOUTB LL_I2C_SetSMBusTimeoutB
|
|
@@ -1164,7 +1205,7 @@ __STATIC_INLINE void LL_I2C_SetSMBusTimeoutB(I2C_TypeDef *I2Cx, uint32_t Timeout
|
|
|
|
|
|
/**
|
|
|
* @brief Get the SMBus Extended Cumulative Clock TimeoutB setting.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll TIMEOUTR TIMEOUTB LL_I2C_GetSMBusTimeoutB
|
|
|
* @param I2Cx I2C Instance.
|
|
@@ -1177,7 +1218,7 @@ __STATIC_INLINE uint32_t LL_I2C_GetSMBusTimeoutB(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Enable the SMBus Clock Timeout.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll TIMEOUTR TIMOUTEN LL_I2C_EnableSMBusTimeout\n
|
|
|
* TIMEOUTR TEXTEN LL_I2C_EnableSMBusTimeout
|
|
@@ -1195,7 +1236,7 @@ __STATIC_INLINE void LL_I2C_EnableSMBusTimeout(I2C_TypeDef *I2Cx, uint32_t Clock
|
|
|
|
|
|
/**
|
|
|
* @brief Disable the SMBus Clock Timeout.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll TIMEOUTR TIMOUTEN LL_I2C_DisableSMBusTimeout\n
|
|
|
* TIMEOUTR TEXTEN LL_I2C_DisableSMBusTimeout
|
|
@@ -1213,7 +1254,7 @@ __STATIC_INLINE void LL_I2C_DisableSMBusTimeout(I2C_TypeDef *I2Cx, uint32_t Cloc
|
|
|
|
|
|
/**
|
|
|
* @brief Check if the SMBus Clock Timeout is enabled or disabled.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll TIMEOUTR TIMOUTEN LL_I2C_IsEnabledSMBusTimeout\n
|
|
|
* TIMEOUTR TEXTEN LL_I2C_IsEnabledSMBusTimeout
|
|
@@ -1226,7 +1267,8 @@ __STATIC_INLINE void LL_I2C_DisableSMBusTimeout(I2C_TypeDef *I2Cx, uint32_t Cloc
|
|
|
*/
|
|
|
__STATIC_INLINE uint32_t LL_I2C_IsEnabledSMBusTimeout(I2C_TypeDef *I2Cx, uint32_t ClockTimeout)
|
|
|
{
|
|
|
- return ((READ_BIT(I2Cx->TIMEOUTR, (I2C_TIMEOUTR_TIMOUTEN | I2C_TIMEOUTR_TEXTEN)) == (ClockTimeout)) ? 1UL : 0UL);
|
|
|
+ return ((READ_BIT(I2Cx->TIMEOUTR, (I2C_TIMEOUTR_TIMOUTEN | I2C_TIMEOUTR_TEXTEN)) == \
|
|
|
+ (ClockTimeout)) ? 1UL : 0UL);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1443,7 +1485,7 @@ __STATIC_INLINE uint32_t LL_I2C_IsEnabledIT_TC(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Enable Error interrupts.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @note Any of these errors will generate interrupt :
|
|
|
* Arbitration Loss (ARLO)
|
|
@@ -1463,7 +1505,7 @@ __STATIC_INLINE void LL_I2C_EnableIT_ERR(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Disable Error interrupts.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @note Any of these errors will generate interrupt :
|
|
|
* Arbitration Loss (ARLO)
|
|
@@ -1645,7 +1687,7 @@ __STATIC_INLINE uint32_t LL_I2C_IsActiveFlag_OVR(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Indicate the status of SMBus PEC error flag in reception.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @note RESET: Clear default value.
|
|
|
* SET: When the received PEC does not match with the PEC register content.
|
|
@@ -1660,7 +1702,7 @@ __STATIC_INLINE uint32_t LL_I2C_IsActiveSMBusFlag_PECERR(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Indicate the status of SMBus Timeout detection flag.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @note RESET: Clear default value.
|
|
|
* SET: When a timeout or extended clock timeout occurs.
|
|
@@ -1675,7 +1717,7 @@ __STATIC_INLINE uint32_t LL_I2C_IsActiveSMBusFlag_TIMEOUT(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Indicate the status of SMBus alert flag.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @note RESET: Clear default value.
|
|
|
* SET: When SMBus host configuration, SMBus alert enabled and
|
|
@@ -1782,7 +1824,7 @@ __STATIC_INLINE void LL_I2C_ClearFlag_OVR(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Clear SMBus PEC error flag.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll ICR PECCF LL_I2C_ClearSMBusFlag_PECERR
|
|
|
* @param I2Cx I2C Instance.
|
|
@@ -1795,7 +1837,7 @@ __STATIC_INLINE void LL_I2C_ClearSMBusFlag_PECERR(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Clear SMBus Timeout detection flag.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll ICR TIMOUTCF LL_I2C_ClearSMBusFlag_TIMEOUT
|
|
|
* @param I2Cx I2C Instance.
|
|
@@ -1808,7 +1850,7 @@ __STATIC_INLINE void LL_I2C_ClearSMBusFlag_TIMEOUT(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Clear SMBus Alert flag.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll ICR ALERTCF LL_I2C_ClearSMBusFlag_ALERT
|
|
|
* @param I2Cx I2C Instance.
|
|
@@ -1923,7 +1965,8 @@ __STATIC_INLINE uint32_t LL_I2C_GetTransferSize(I2C_TypeDef *I2Cx)
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @brief Prepare the generation of a ACKnowledge or Non ACKnowledge condition after the address receive match code or next received byte.
|
|
|
+ * @brief Prepare the generation of a ACKnowledge or Non ACKnowledge condition after the address receive match code
|
|
|
+ or next received byte.
|
|
|
* @note Usage in Slave mode only.
|
|
|
* @rmtoll CR2 NACK LL_I2C_AcknowledgeNextData
|
|
|
* @param I2Cx I2C Instance.
|
|
@@ -1964,7 +2007,8 @@ __STATIC_INLINE void LL_I2C_GenerateStopCondition(I2C_TypeDef *I2Cx)
|
|
|
/**
|
|
|
* @brief Enable automatic RESTART Read request condition for 10bit address header (master mode).
|
|
|
* @note The master sends the complete 10bit slave address read sequence :
|
|
|
- * Start + 2 bytes 10bit address in Write direction + Restart + first 7 bits of 10bit address in Read direction.
|
|
|
+ * Start + 2 bytes 10bit address in Write direction + Restart + first 7 bits of 10bit address
|
|
|
+ in Read direction.
|
|
|
* @rmtoll CR2 HEAD10R LL_I2C_EnableAuto10BitRead
|
|
|
* @param I2Cx I2C Instance.
|
|
|
* @retval None
|
|
@@ -2090,7 +2134,9 @@ __STATIC_INLINE uint32_t LL_I2C_GetSlaveAddr(I2C_TypeDef *I2Cx)
|
|
|
__STATIC_INLINE void LL_I2C_HandleTransfer(I2C_TypeDef *I2Cx, uint32_t SlaveAddr, uint32_t SlaveAddrSize,
|
|
|
uint32_t TransferSize, uint32_t EndMode, uint32_t Request)
|
|
|
{
|
|
|
- MODIFY_REG(I2Cx->CR2, I2C_CR2_SADD | I2C_CR2_ADD10 | (I2C_CR2_RD_WRN & (uint32_t)(Request >> (31U - I2C_CR2_RD_WRN_Pos))) | I2C_CR2_START | I2C_CR2_STOP | I2C_CR2_RELOAD |
|
|
|
+ MODIFY_REG(I2Cx->CR2, I2C_CR2_SADD | I2C_CR2_ADD10 |
|
|
|
+ (I2C_CR2_RD_WRN & (uint32_t)(Request >> (31U - I2C_CR2_RD_WRN_Pos))) |
|
|
|
+ I2C_CR2_START | I2C_CR2_STOP | I2C_CR2_RELOAD |
|
|
|
I2C_CR2_NBYTES | I2C_CR2_AUTOEND | I2C_CR2_HEAD10R,
|
|
|
SlaveAddr | SlaveAddrSize | (TransferSize << I2C_CR2_NBYTES_Pos) | EndMode | Request);
|
|
|
}
|
|
@@ -2123,9 +2169,10 @@ __STATIC_INLINE uint32_t LL_I2C_GetAddressMatchCode(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Enable internal comparison of the SMBus Packet Error byte (transmission or reception mode).
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
- * @note This feature is cleared by hardware when the PEC byte is transferred, or when a STOP condition or an Address Matched is received.
|
|
|
+ * @note This feature is cleared by hardware when the PEC byte is transferred, or when a STOP condition
|
|
|
+ or an Address Matched is received.
|
|
|
* This bit has no effect when RELOAD bit is set.
|
|
|
* This bit has no effect in device mode when SBC bit is not set.
|
|
|
* @rmtoll CR2 PECBYTE LL_I2C_EnableSMBusPECCompare
|
|
@@ -2139,7 +2186,7 @@ __STATIC_INLINE void LL_I2C_EnableSMBusPECCompare(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Check if the SMBus Packet Error byte internal comparison is requested or not.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll CR2 PECBYTE LL_I2C_IsEnabledSMBusPECCompare
|
|
|
* @param I2Cx I2C Instance.
|
|
@@ -2152,12 +2199,12 @@ __STATIC_INLINE uint32_t LL_I2C_IsEnabledSMBusPECCompare(I2C_TypeDef *I2Cx)
|
|
|
|
|
|
/**
|
|
|
* @brief Get the SMBus Packet Error byte calculated.
|
|
|
- * @note Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
+ * @note The macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not
|
|
|
* SMBus feature is supported by the I2Cx Instance.
|
|
|
* @rmtoll PECR PEC LL_I2C_GetSMBusPEC
|
|
|
* @param I2Cx I2C Instance.
|
|
|
* @retval Value between Min_Data=0x00 and Max_Data=0xFF
|
|
|
-*/
|
|
|
+ */
|
|
|
__STATIC_INLINE uint32_t LL_I2C_GetSMBusPEC(I2C_TypeDef *I2Cx)
|
|
|
{
|
|
|
return (uint32_t)(READ_BIT(I2Cx->PECR, I2C_PECR_PEC));
|