STM32L4xx_HAL_Driver  1.14.0

Functions

__STATIC_INLINE void LL_I2C_Enable (I2C_TypeDef *I2Cx)
 Enable I2C peripheral (PE = 1). CR1 PE LL_I2C_Enable. More...
 
__STATIC_INLINE void LL_I2C_Disable (I2C_TypeDef *I2Cx)
 Disable I2C peripheral (PE = 0). More...
 
__STATIC_INLINE uint32_t LL_I2C_IsEnabled (I2C_TypeDef *I2Cx)
 Check if the I2C peripheral is enabled or disabled. CR1 PE LL_I2C_IsEnabled. More...
 
__STATIC_INLINE void LL_I2C_ConfigFilters (I2C_TypeDef *I2Cx, uint32_t AnalogFilter, uint32_t DigitalFilter)
 Configure Noise Filters (Analog and Digital). More...
 
__STATIC_INLINE void LL_I2C_SetDigitalFilter (I2C_TypeDef *I2Cx, uint32_t DigitalFilter)
 Configure Digital Noise Filter. More...
 
__STATIC_INLINE uint32_t LL_I2C_GetDigitalFilter (I2C_TypeDef *I2Cx)
 Get the current Digital Noise Filter configuration. CR1 DNF LL_I2C_GetDigitalFilter. More...
 
__STATIC_INLINE void LL_I2C_EnableAnalogFilter (I2C_TypeDef *I2Cx)
 Enable Analog Noise Filter. More...
 
__STATIC_INLINE void LL_I2C_DisableAnalogFilter (I2C_TypeDef *I2Cx)
 Disable Analog Noise Filter. More...
 
__STATIC_INLINE uint32_t LL_I2C_IsEnabledAnalogFilter (I2C_TypeDef *I2Cx)
 Check if Analog Noise Filter is enabled or disabled. CR1 ANFOFF LL_I2C_IsEnabledAnalogFilter. More...
 
__STATIC_INLINE void LL_I2C_EnableDMAReq_TX (I2C_TypeDef *I2Cx)
 Enable DMA transmission requests. CR1 TXDMAEN LL_I2C_EnableDMAReq_TX. More...
 
__STATIC_INLINE void LL_I2C_DisableDMAReq_TX (I2C_TypeDef *I2Cx)
 Disable DMA transmission requests. CR1 TXDMAEN LL_I2C_DisableDMAReq_TX. More...
 
__STATIC_INLINE uint32_t LL_I2C_IsEnabledDMAReq_TX (I2C_TypeDef *I2Cx)
 Check if DMA transmission requests are enabled or disabled. CR1 TXDMAEN LL_I2C_IsEnabledDMAReq_TX. More...
 
__STATIC_INLINE void LL_I2C_EnableDMAReq_RX (I2C_TypeDef *I2Cx)
 Enable DMA reception requests. CR1 RXDMAEN LL_I2C_EnableDMAReq_RX. More...
 
__STATIC_INLINE void LL_I2C_DisableDMAReq_RX (I2C_TypeDef *I2Cx)
 Disable DMA reception requests. CR1 RXDMAEN LL_I2C_DisableDMAReq_RX. More...
 
__STATIC_INLINE uint32_t LL_I2C_IsEnabledDMAReq_RX (I2C_TypeDef *I2Cx)
 Check if DMA reception requests are enabled or disabled. CR1 RXDMAEN LL_I2C_IsEnabledDMAReq_RX. More...
 
__STATIC_INLINE uint32_t LL_I2C_DMA_GetRegAddr (I2C_TypeDef *I2Cx, uint32_t Direction)
 Get the data register address used for DMA transfer TXDR TXDATA LL_I2C_DMA_GetRegAddr
RXDR RXDATA LL_I2C_DMA_GetRegAddr. More...
 
__STATIC_INLINE void LL_I2C_EnableClockStretching (I2C_TypeDef *I2Cx)
 Enable Clock stretching. More...
 
__STATIC_INLINE void LL_I2C_DisableClockStretching (I2C_TypeDef *I2Cx)
 Disable Clock stretching. More...
 
__STATIC_INLINE uint32_t LL_I2C_IsEnabledClockStretching (I2C_TypeDef *I2Cx)
 Check if Clock stretching is enabled or disabled. CR1 NOSTRETCH LL_I2C_IsEnabledClockStretching. More...
 
__STATIC_INLINE void LL_I2C_EnableSlaveByteControl (I2C_TypeDef *I2Cx)
 Enable hardware byte control in slave mode. CR1 SBC LL_I2C_EnableSlaveByteControl. More...
 
__STATIC_INLINE void LL_I2C_DisableSlaveByteControl (I2C_TypeDef *I2Cx)
 Disable hardware byte control in slave mode. CR1 SBC LL_I2C_DisableSlaveByteControl. More...
 
__STATIC_INLINE uint32_t LL_I2C_IsEnabledSlaveByteControl (I2C_TypeDef *I2Cx)
 Check if hardware byte control in slave mode is enabled or disabled. CR1 SBC LL_I2C_IsEnabledSlaveByteControl. More...
 
__STATIC_INLINE void LL_I2C_EnableWakeUpFromStop (I2C_TypeDef *I2Cx)
 Enable Wakeup from STOP. More...
 
__STATIC_INLINE void LL_I2C_DisableWakeUpFromStop (I2C_TypeDef *I2Cx)
 Disable Wakeup from STOP. More...
 
__STATIC_INLINE uint32_t LL_I2C_IsEnabledWakeUpFromStop (I2C_TypeDef *I2Cx)
 Check if Wakeup from STOP is enabled or disabled. More...
 
__STATIC_INLINE void LL_I2C_EnableGeneralCall (I2C_TypeDef *I2Cx)
 Enable General Call. More...
 
__STATIC_INLINE void LL_I2C_DisableGeneralCall (I2C_TypeDef *I2Cx)
 Disable General Call. More...
 
__STATIC_INLINE uint32_t LL_I2C_IsEnabledGeneralCall (I2C_TypeDef *I2Cx)
 Check if General Call is enabled or disabled. CR1 GCEN LL_I2C_IsEnabledGeneralCall. More...
 
__STATIC_INLINE void LL_I2C_SetMasterAddressingMode (I2C_TypeDef *I2Cx, uint32_t AddressingMode)
 Configure the Master to operate in 7-bit or 10-bit addressing mode. More...
 
__STATIC_INLINE uint32_t LL_I2C_GetMasterAddressingMode (I2C_TypeDef *I2Cx)
 Get the Master addressing mode. CR2 ADD10 LL_I2C_GetMasterAddressingMode. More...
 
__STATIC_INLINE void LL_I2C_SetOwnAddress1 (I2C_TypeDef *I2Cx, uint32_t OwnAddress1, uint32_t OwnAddrSize)
 Set the Own Address1. OAR1 OA1 LL_I2C_SetOwnAddress1
OAR1 OA1MODE LL_I2C_SetOwnAddress1. More...
 
__STATIC_INLINE void LL_I2C_EnableOwnAddress1 (I2C_TypeDef *I2Cx)
 Enable acknowledge on Own Address1 match address. OAR1 OA1EN LL_I2C_EnableOwnAddress1. More...
 
__STATIC_INLINE void LL_I2C_DisableOwnAddress1 (I2C_TypeDef *I2Cx)
 Disable acknowledge on Own Address1 match address. OAR1 OA1EN LL_I2C_DisableOwnAddress1. More...
 
__STATIC_INLINE uint32_t LL_I2C_IsEnabledOwnAddress1 (I2C_TypeDef *I2Cx)
 Check if Own Address1 acknowledge is enabled or disabled. OAR1 OA1EN LL_I2C_IsEnabledOwnAddress1. More...
 
__STATIC_INLINE void LL_I2C_SetOwnAddress2 (I2C_TypeDef *I2Cx, uint32_t OwnAddress2, uint32_t OwnAddrMask)
 Set the 7bits Own Address2. More...
 
__STATIC_INLINE void LL_I2C_EnableOwnAddress2 (I2C_TypeDef *I2Cx)
 Enable acknowledge on Own Address2 match address. OAR2 OA2EN LL_I2C_EnableOwnAddress2. More...
 
__STATIC_INLINE void LL_I2C_DisableOwnAddress2 (I2C_TypeDef *I2Cx)
 Disable acknowledge on Own Address2 match address. OAR2 OA2EN LL_I2C_DisableOwnAddress2. More...
 
__STATIC_INLINE uint32_t LL_I2C_IsEnabledOwnAddress2 (I2C_TypeDef *I2Cx)
 Check if Own Address1 acknowledge is enabled or disabled. OAR2 OA2EN LL_I2C_IsEnabledOwnAddress2. More...
 
__STATIC_INLINE void LL_I2C_SetTiming (I2C_TypeDef *I2Cx, uint32_t Timing)
 Configure the SDA setup, hold time and the SCL high, low period. More...
 
__STATIC_INLINE uint32_t LL_I2C_GetTimingPrescaler (I2C_TypeDef *I2Cx)
 Get the Timing Prescaler setting. TIMINGR PRESC LL_I2C_GetTimingPrescaler. More...
 
__STATIC_INLINE uint32_t LL_I2C_GetClockLowPeriod (I2C_TypeDef *I2Cx)
 Get the SCL low period setting. TIMINGR SCLL LL_I2C_GetClockLowPeriod. More...
 
__STATIC_INLINE uint32_t LL_I2C_GetClockHighPeriod (I2C_TypeDef *I2Cx)
 Get the SCL high period setting. TIMINGR SCLH LL_I2C_GetClockHighPeriod. More...
 
__STATIC_INLINE uint32_t LL_I2C_GetDataHoldTime (I2C_TypeDef *I2Cx)
 Get the SDA hold time. TIMINGR SDADEL LL_I2C_GetDataHoldTime. More...
 
__STATIC_INLINE uint32_t LL_I2C_GetDataSetupTime (I2C_TypeDef *I2Cx)
 Get the SDA setup time. TIMINGR SCLDEL LL_I2C_GetDataSetupTime. More...
 
__STATIC_INLINE void LL_I2C_SetMode (I2C_TypeDef *I2Cx, uint32_t PeripheralMode)
 Configure peripheral mode. More...
 
__STATIC_INLINE uint32_t LL_I2C_GetMode (I2C_TypeDef *I2Cx)
 Get peripheral mode. More...
 
__STATIC_INLINE void LL_I2C_EnableSMBusAlert (I2C_TypeDef *I2Cx)
 Enable SMBus alert (Host or Device mode) More...
 
__STATIC_INLINE void LL_I2C_DisableSMBusAlert (I2C_TypeDef *I2Cx)
 Disable SMBus alert (Host or Device mode) More...
 
__STATIC_INLINE uint32_t LL_I2C_IsEnabledSMBusAlert (I2C_TypeDef *I2Cx)
 Check if SMBus alert (Host or Device mode) is enabled or disabled. More...
 
__STATIC_INLINE void LL_I2C_EnableSMBusPEC (I2C_TypeDef *I2Cx)
 Enable SMBus Packet Error Calculation (PEC). More...
 
__STATIC_INLINE void LL_I2C_DisableSMBusPEC (I2C_TypeDef *I2Cx)
 Disable SMBus Packet Error Calculation (PEC). More...
 
__STATIC_INLINE uint32_t LL_I2C_IsEnabledSMBusPEC (I2C_TypeDef *I2Cx)
 Check if SMBus Packet Error Calculation (PEC) is enabled or disabled. More...
 
__STATIC_INLINE void LL_I2C_ConfigSMBusTimeout (I2C_TypeDef *I2Cx, uint32_t TimeoutA, uint32_t TimeoutAMode, uint32_t TimeoutB)
 Configure the SMBus Clock Timeout. More...
 
__STATIC_INLINE void LL_I2C_SetSMBusTimeoutA (I2C_TypeDef *I2Cx, uint32_t TimeoutA)
 Configure the SMBus Clock TimeoutA (SCL low timeout or SCL and SDA high timeout depends on TimeoutA mode). More...
 
__STATIC_INLINE uint32_t LL_I2C_GetSMBusTimeoutA (I2C_TypeDef *I2Cx)
 Get the SMBus Clock TimeoutA setting. More...
 
__STATIC_INLINE void LL_I2C_SetSMBusTimeoutAMode (I2C_TypeDef *I2Cx, uint32_t TimeoutAMode)
 Set the SMBus Clock TimeoutA mode. More...
 
__STATIC_INLINE uint32_t LL_I2C_GetSMBusTimeoutAMode (I2C_TypeDef *I2Cx)
 Get the SMBus Clock TimeoutA mode. More...
 
__STATIC_INLINE void LL_I2C_SetSMBusTimeoutB (I2C_TypeDef *I2Cx, uint32_t TimeoutB)
 Configure the SMBus Extended Cumulative Clock TimeoutB (Master or Slave mode). More...
 
__STATIC_INLINE uint32_t LL_I2C_GetSMBusTimeoutB (I2C_TypeDef *I2Cx)
 Get the SMBus Extented Cumulative Clock TimeoutB setting. More...
 
__STATIC_INLINE void LL_I2C_EnableSMBusTimeout (I2C_TypeDef *I2Cx, uint32_t ClockTimeout)
 Enable the SMBus Clock Timeout. More...
 
__STATIC_INLINE void LL_I2C_DisableSMBusTimeout (I2C_TypeDef *I2Cx, uint32_t ClockTimeout)
 Disable the SMBus Clock Timeout. More...
 
__STATIC_INLINE uint32_t LL_I2C_IsEnabledSMBusTimeout (I2C_TypeDef *I2Cx, uint32_t ClockTimeout)
 Check if the SMBus Clock Timeout is enabled or disabled. More...
 

Detailed Description

Function Documentation

◆ LL_I2C_ConfigFilters()

__STATIC_INLINE void LL_I2C_ConfigFilters ( I2C_TypeDef *  I2Cx,
uint32_t  AnalogFilter,
uint32_t  DigitalFilter 
)

Configure Noise Filters (Analog and Digital).

Note
If the analog filter is also enabled, the digital filter is added to analog filter. The filters can only be programmed when the I2C is disabled (PE = 0). CR1 ANFOFF LL_I2C_ConfigFilters
CR1 DNF LL_I2C_ConfigFilters
Parameters
I2CxI2C Instance.
AnalogFilterThis parameter can be one of the following values:
  • LL_I2C_ANALOGFILTER_ENABLE
  • LL_I2C_ANALOGFILTER_DISABLE
DigitalFilterThis 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.
Return values
None

Definition at line 436 of file stm32l4xx_ll_i2c.h.

437 {
438  MODIFY_REG(I2Cx->CR1, I2C_CR1_ANFOFF | I2C_CR1_DNF, AnalogFilter | (DigitalFilter << I2C_CR1_DNF_Pos));
439 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_I2C_ConfigSMBusTimeout()

__STATIC_INLINE void LL_I2C_ConfigSMBusTimeout ( I2C_TypeDef *  I2Cx,
uint32_t  TimeoutA,
uint32_t  TimeoutAMode,
uint32_t  TimeoutB 
)

Configure the SMBus Clock Timeout.

Note
Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not SMBus feature is supported by the I2Cx Instance.
This configuration can only be programmed when associated Timeout is disabled (TimeoutA and/orTimeoutB). TIMEOUTR TIMEOUTA LL_I2C_ConfigSMBusTimeout
TIMEOUTR TIDLE LL_I2C_ConfigSMBusTimeout
TIMEOUTR TIMEOUTB LL_I2C_ConfigSMBusTimeout
Parameters
I2CxI2C Instance.
TimeoutAThis parameter must be a value between Min_Data=0 and Max_Data=0xFFF.
TimeoutAModeThis parameter can be one of the following values:
  • LL_I2C_SMBUS_TIMEOUTA_MODE_SCL_LOW
  • LL_I2C_SMBUS_TIMEOUTA_MODE_SDA_SCL_HIGH
TimeoutB
Return values
None

Definition at line 1083 of file stm32l4xx_ll_i2c.h.

1085 {
1086  MODIFY_REG(I2Cx->TIMEOUTR, I2C_TIMEOUTR_TIMEOUTA | I2C_TIMEOUTR_TIDLE | I2C_TIMEOUTR_TIMEOUTB,
1087  TimeoutA | TimeoutAMode | (TimeoutB << I2C_TIMEOUTR_TIMEOUTB_Pos));
1088 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_I2C_Disable()

__STATIC_INLINE void LL_I2C_Disable ( I2C_TypeDef *  I2Cx)

Disable I2C peripheral (PE = 0).

Note
When PE = 0, the I2C SCL and SDA lines are released. Internal state machines and status bits are put back to their reset value. When cleared, PE must be kept low for at least 3 APB clock cycles. CR1 PE LL_I2C_Disable
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 405 of file stm32l4xx_ll_i2c.h.

406 {
407  CLEAR_BIT(I2Cx->CR1, I2C_CR1_PE);
408 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_I2C_DisableAnalogFilter()

__STATIC_INLINE void LL_I2C_DisableAnalogFilter ( I2C_TypeDef *  I2Cx)

Disable Analog Noise Filter.

Note
This filter can only be programmed when the I2C is disabled (PE = 0). CR1 ANFOFF LL_I2C_DisableAnalogFilter
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 487 of file stm32l4xx_ll_i2c.h.

488 {
489  SET_BIT(I2Cx->CR1, I2C_CR1_ANFOFF);
490 }

◆ LL_I2C_DisableClockStretching()

__STATIC_INLINE void LL_I2C_DisableClockStretching ( I2C_TypeDef *  I2Cx)

Disable Clock stretching.

Note
This bit can only be programmed when the I2C is disabled (PE = 0). CR1 NOSTRETCH LL_I2C_DisableClockStretching
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 616 of file stm32l4xx_ll_i2c.h.

617 {
618  SET_BIT(I2Cx->CR1, I2C_CR1_NOSTRETCH);
619 }

◆ LL_I2C_DisableDMAReq_RX()

__STATIC_INLINE void LL_I2C_DisableDMAReq_RX ( I2C_TypeDef *  I2Cx)

Disable DMA reception requests. CR1 RXDMAEN LL_I2C_DisableDMAReq_RX.

Parameters
I2CxI2C Instance.
Return values
None

Definition at line 553 of file stm32l4xx_ll_i2c.h.

554 {
555  CLEAR_BIT(I2Cx->CR1, I2C_CR1_RXDMAEN);
556 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_I2C_DisableDMAReq_TX()

__STATIC_INLINE void LL_I2C_DisableDMAReq_TX ( I2C_TypeDef *  I2Cx)

Disable DMA transmission requests. CR1 TXDMAEN LL_I2C_DisableDMAReq_TX.

Parameters
I2CxI2C Instance.
Return values
None

Definition at line 520 of file stm32l4xx_ll_i2c.h.

521 {
522  CLEAR_BIT(I2Cx->CR1, I2C_CR1_TXDMAEN);
523 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_I2C_DisableGeneralCall()

__STATIC_INLINE void LL_I2C_DisableGeneralCall ( I2C_TypeDef *  I2Cx)

Disable General Call.

Note
When disabled the Address 0x00 is NACKed. CR1 GCEN LL_I2C_DisableGeneralCall
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 724 of file stm32l4xx_ll_i2c.h.

725 {
726  CLEAR_BIT(I2Cx->CR1, I2C_CR1_GCEN);
727 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_I2C_DisableOwnAddress1()

__STATIC_INLINE void LL_I2C_DisableOwnAddress1 ( I2C_TypeDef *  I2Cx)

Disable acknowledge on Own Address1 match address. OAR1 OA1EN LL_I2C_DisableOwnAddress1.

Parameters
I2CxI2C Instance.
Return values
None

Definition at line 801 of file stm32l4xx_ll_i2c.h.

802 {
803  CLEAR_BIT(I2Cx->OAR1, I2C_OAR1_OA1EN);
804 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_I2C_DisableOwnAddress2()

__STATIC_INLINE void LL_I2C_DisableOwnAddress2 ( I2C_TypeDef *  I2Cx)

Disable acknowledge on Own Address2 match address. OAR2 OA2EN LL_I2C_DisableOwnAddress2.

Parameters
I2CxI2C Instance.
Return values
None

Definition at line 857 of file stm32l4xx_ll_i2c.h.

858 {
859  CLEAR_BIT(I2Cx->OAR2, I2C_OAR2_OA2EN);
860 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_I2C_DisableSlaveByteControl()

__STATIC_INLINE void LL_I2C_DisableSlaveByteControl ( I2C_TypeDef *  I2Cx)

Disable hardware byte control in slave mode. CR1 SBC LL_I2C_DisableSlaveByteControl.

Parameters
I2CxI2C Instance.
Return values
None

Definition at line 649 of file stm32l4xx_ll_i2c.h.

650 {
651  CLEAR_BIT(I2Cx->CR1, I2C_CR1_SBC);
652 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_I2C_DisableSMBusAlert()

__STATIC_INLINE void LL_I2C_DisableSMBusAlert ( I2C_TypeDef *  I2Cx)

Disable SMBus alert (Host or Device mode)

Note
Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not SMBus feature is supported by the I2Cx Instance.
SMBus Device mode:
  • SMBus Alert pin is not drived (can be used as a standard GPIO) and Alert Response Address Header acknowledge is disabled. SMBus Host mode:
  • SMBus Alert pin management is not supported. CR1 ALERTEN LL_I2C_DisableSMBusAlert
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 1010 of file stm32l4xx_ll_i2c.h.

1011 {
1012  CLEAR_BIT(I2Cx->CR1, I2C_CR1_ALERTEN);
1013 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_I2C_DisableSMBusPEC()

__STATIC_INLINE void LL_I2C_DisableSMBusPEC ( I2C_TypeDef *  I2Cx)

Disable SMBus Packet Error Calculation (PEC).

Note
Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not SMBus feature is supported by the I2Cx Instance. CR1 PECEN LL_I2C_DisableSMBusPEC
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 1049 of file stm32l4xx_ll_i2c.h.

1050 {
1051  CLEAR_BIT(I2Cx->CR1, I2C_CR1_PECEN);
1052 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_I2C_DisableSMBusTimeout()

__STATIC_INLINE void LL_I2C_DisableSMBusTimeout ( I2C_TypeDef *  I2Cx,
uint32_t  ClockTimeout 
)

Disable the SMBus Clock Timeout.

Note
Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not SMBus feature is supported by the I2Cx Instance. TIMEOUTR TIMOUTEN LL_I2C_DisableSMBusTimeout
TIMEOUTR TEXTEN LL_I2C_DisableSMBusTimeout
Parameters
I2CxI2C Instance.
ClockTimeoutThis parameter can be one of the following values:
  • LL_I2C_SMBUS_TIMEOUTA
  • LL_I2C_SMBUS_TIMEOUTB
  • LL_I2C_SMBUS_ALL_TIMEOUT
Return values
None

Definition at line 1209 of file stm32l4xx_ll_i2c.h.

1210 {
1211  CLEAR_BIT(I2Cx->TIMEOUTR, ClockTimeout);
1212 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_I2C_DisableWakeUpFromStop()

__STATIC_INLINE void LL_I2C_DisableWakeUpFromStop ( I2C_TypeDef *  I2Cx)

Disable Wakeup from STOP.

Note
Macro IS_I2C_WAKEUP_FROMSTOP_INSTANCE(I2Cx) can be used to check whether or not WakeUpFromStop feature is supported by the I2Cx Instance. CR1 WUPEN LL_I2C_DisableWakeUpFromStop
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 687 of file stm32l4xx_ll_i2c.h.

688 {
689  CLEAR_BIT(I2Cx->CR1, I2C_CR1_WUPEN);
690 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_I2C_DMA_GetRegAddr()

__STATIC_INLINE uint32_t LL_I2C_DMA_GetRegAddr ( I2C_TypeDef *  I2Cx,
uint32_t  Direction 
)

Get the data register address used for DMA transfer TXDR TXDATA LL_I2C_DMA_GetRegAddr
RXDR RXDATA LL_I2C_DMA_GetRegAddr.

Parameters
I2CxI2C Instance
DirectionThis parameter can be one of the following values:
  • LL_I2C_DMA_REG_DATA_TRANSMIT
  • LL_I2C_DMA_REG_DATA_RECEIVE
Return values
Addressof data register

Definition at line 579 of file stm32l4xx_ll_i2c.h.

580 {
581  register uint32_t data_reg_addr;
582 
583  if (Direction == LL_I2C_DMA_REG_DATA_TRANSMIT)
584  {
585  /* return address of TXDR register */
586  data_reg_addr = (uint32_t) & (I2Cx->TXDR);
587  }
588  else
589  {
590  /* return address of RXDR register */
591  data_reg_addr = (uint32_t) & (I2Cx->RXDR);
592  }
593 
594  return data_reg_addr;
595 }

◆ LL_I2C_Enable()

__STATIC_INLINE void LL_I2C_Enable ( I2C_TypeDef *  I2Cx)

Enable I2C peripheral (PE = 1). CR1 PE LL_I2C_Enable.

Parameters
I2CxI2C Instance.
Return values
None

Definition at line 391 of file stm32l4xx_ll_i2c.h.

392 {
393  SET_BIT(I2Cx->CR1, I2C_CR1_PE);
394 }

◆ LL_I2C_EnableAnalogFilter()

__STATIC_INLINE void LL_I2C_EnableAnalogFilter ( I2C_TypeDef *  I2Cx)

Enable Analog Noise Filter.

Note
This filter can only be programmed when the I2C is disabled (PE = 0). CR1 ANFOFF LL_I2C_EnableAnalogFilter
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 475 of file stm32l4xx_ll_i2c.h.

476 {
477  CLEAR_BIT(I2Cx->CR1, I2C_CR1_ANFOFF);
478 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_I2C_EnableClockStretching()

__STATIC_INLINE void LL_I2C_EnableClockStretching ( I2C_TypeDef *  I2Cx)

Enable Clock stretching.

Note
This bit can only be programmed when the I2C is disabled (PE = 0). CR1 NOSTRETCH LL_I2C_EnableClockStretching
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 604 of file stm32l4xx_ll_i2c.h.

605 {
606  CLEAR_BIT(I2Cx->CR1, I2C_CR1_NOSTRETCH);
607 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_I2C_EnableDMAReq_RX()

__STATIC_INLINE void LL_I2C_EnableDMAReq_RX ( I2C_TypeDef *  I2Cx)

Enable DMA reception requests. CR1 RXDMAEN LL_I2C_EnableDMAReq_RX.

Parameters
I2CxI2C Instance.
Return values
None

Definition at line 542 of file stm32l4xx_ll_i2c.h.

543 {
544  SET_BIT(I2Cx->CR1, I2C_CR1_RXDMAEN);
545 }

◆ LL_I2C_EnableDMAReq_TX()

__STATIC_INLINE void LL_I2C_EnableDMAReq_TX ( I2C_TypeDef *  I2Cx)

Enable DMA transmission requests. CR1 TXDMAEN LL_I2C_EnableDMAReq_TX.

Parameters
I2CxI2C Instance.
Return values
None

Definition at line 509 of file stm32l4xx_ll_i2c.h.

510 {
511  SET_BIT(I2Cx->CR1, I2C_CR1_TXDMAEN);
512 }

◆ LL_I2C_EnableGeneralCall()

__STATIC_INLINE void LL_I2C_EnableGeneralCall ( I2C_TypeDef *  I2Cx)

Enable General Call.

Note
When enabled the Address 0x00 is ACKed. CR1 GCEN LL_I2C_EnableGeneralCall
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 712 of file stm32l4xx_ll_i2c.h.

713 {
714  SET_BIT(I2Cx->CR1, I2C_CR1_GCEN);
715 }

◆ LL_I2C_EnableOwnAddress1()

__STATIC_INLINE void LL_I2C_EnableOwnAddress1 ( I2C_TypeDef *  I2Cx)

Enable acknowledge on Own Address1 match address. OAR1 OA1EN LL_I2C_EnableOwnAddress1.

Parameters
I2CxI2C Instance.
Return values
None

Definition at line 790 of file stm32l4xx_ll_i2c.h.

791 {
792  SET_BIT(I2Cx->OAR1, I2C_OAR1_OA1EN);
793 }

◆ LL_I2C_EnableOwnAddress2()

__STATIC_INLINE void LL_I2C_EnableOwnAddress2 ( I2C_TypeDef *  I2Cx)

Enable acknowledge on Own Address2 match address. OAR2 OA2EN LL_I2C_EnableOwnAddress2.

Parameters
I2CxI2C Instance.
Return values
None

Definition at line 846 of file stm32l4xx_ll_i2c.h.

847 {
848  SET_BIT(I2Cx->OAR2, I2C_OAR2_OA2EN);
849 }

◆ LL_I2C_EnableSlaveByteControl()

__STATIC_INLINE void LL_I2C_EnableSlaveByteControl ( I2C_TypeDef *  I2Cx)

Enable hardware byte control in slave mode. CR1 SBC LL_I2C_EnableSlaveByteControl.

Parameters
I2CxI2C Instance.
Return values
None

Definition at line 638 of file stm32l4xx_ll_i2c.h.

639 {
640  SET_BIT(I2Cx->CR1, I2C_CR1_SBC);
641 }

◆ LL_I2C_EnableSMBusAlert()

__STATIC_INLINE void LL_I2C_EnableSMBusAlert ( I2C_TypeDef *  I2Cx)

Enable SMBus alert (Host or Device mode)

Note
Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not SMBus feature is supported by the I2Cx Instance.
SMBus Device mode:
  • SMBus Alert pin is drived low and Alert Response Address Header acknowledge is enabled. SMBus Host mode:
  • SMBus Alert pin management is supported. CR1 ALERTEN LL_I2C_EnableSMBusAlert
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 992 of file stm32l4xx_ll_i2c.h.

993 {
994  SET_BIT(I2Cx->CR1, I2C_CR1_ALERTEN);
995 }

◆ LL_I2C_EnableSMBusPEC()

__STATIC_INLINE void LL_I2C_EnableSMBusPEC ( I2C_TypeDef *  I2Cx)

Enable SMBus Packet Error Calculation (PEC).

Note
Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not SMBus feature is supported by the I2Cx Instance. CR1 PECEN LL_I2C_EnableSMBusPEC
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 1036 of file stm32l4xx_ll_i2c.h.

1037 {
1038  SET_BIT(I2Cx->CR1, I2C_CR1_PECEN);
1039 }

◆ LL_I2C_EnableSMBusTimeout()

__STATIC_INLINE void LL_I2C_EnableSMBusTimeout ( I2C_TypeDef *  I2Cx,
uint32_t  ClockTimeout 
)

Enable the SMBus Clock Timeout.

Note
Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not SMBus feature is supported by the I2Cx Instance. TIMEOUTR TIMOUTEN LL_I2C_EnableSMBusTimeout
TIMEOUTR TEXTEN LL_I2C_EnableSMBusTimeout
Parameters
I2CxI2C Instance.
ClockTimeoutThis parameter can be one of the following values:
  • LL_I2C_SMBUS_TIMEOUTA
  • LL_I2C_SMBUS_TIMEOUTB
  • LL_I2C_SMBUS_ALL_TIMEOUT
Return values
None

Definition at line 1191 of file stm32l4xx_ll_i2c.h.

1192 {
1193  SET_BIT(I2Cx->TIMEOUTR, ClockTimeout);
1194 }

◆ LL_I2C_EnableWakeUpFromStop()

__STATIC_INLINE void LL_I2C_EnableWakeUpFromStop ( I2C_TypeDef *  I2Cx)

Enable Wakeup from STOP.

Note
Macro IS_I2C_WAKEUP_FROMSTOP_INSTANCE(I2Cx) can be used to check whether or not WakeUpFromStop feature is supported by the I2Cx Instance.
This bit can only be programmed when Digital Filter is disabled. CR1 WUPEN LL_I2C_EnableWakeUpFromStop
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 674 of file stm32l4xx_ll_i2c.h.

675 {
676  SET_BIT(I2Cx->CR1, I2C_CR1_WUPEN);
677 }

◆ LL_I2C_GetClockHighPeriod()

__STATIC_INLINE uint32_t LL_I2C_GetClockHighPeriod ( I2C_TypeDef *  I2Cx)

Get the SCL high period setting. TIMINGR SCLH LL_I2C_GetClockHighPeriod.

Parameters
I2CxI2C Instance.
Return values
Valuebetween Min_Data=0x00 and Max_Data=0xFF

Definition at line 915 of file stm32l4xx_ll_i2c.h.

916 {
917  return (uint32_t)(READ_BIT(I2Cx->TIMINGR, I2C_TIMINGR_SCLH) >> I2C_TIMINGR_SCLH_Pos);
918 }

◆ LL_I2C_GetClockLowPeriod()

__STATIC_INLINE uint32_t LL_I2C_GetClockLowPeriod ( I2C_TypeDef *  I2Cx)

Get the SCL low period setting. TIMINGR SCLL LL_I2C_GetClockLowPeriod.

Parameters
I2CxI2C Instance.
Return values
Valuebetween Min_Data=0x00 and Max_Data=0xFF

Definition at line 904 of file stm32l4xx_ll_i2c.h.

905 {
906  return (uint32_t)(READ_BIT(I2Cx->TIMINGR, I2C_TIMINGR_SCLL) >> I2C_TIMINGR_SCLL_Pos);
907 }

◆ LL_I2C_GetDataHoldTime()

__STATIC_INLINE uint32_t LL_I2C_GetDataHoldTime ( I2C_TypeDef *  I2Cx)

Get the SDA hold time. TIMINGR SDADEL LL_I2C_GetDataHoldTime.

Parameters
I2CxI2C Instance.
Return values
Valuebetween Min_Data=0x0 and Max_Data=0xF

Definition at line 926 of file stm32l4xx_ll_i2c.h.

927 {
928  return (uint32_t)(READ_BIT(I2Cx->TIMINGR, I2C_TIMINGR_SDADEL) >> I2C_TIMINGR_SDADEL_Pos);
929 }

◆ LL_I2C_GetDataSetupTime()

__STATIC_INLINE uint32_t LL_I2C_GetDataSetupTime ( I2C_TypeDef *  I2Cx)

Get the SDA setup time. TIMINGR SCLDEL LL_I2C_GetDataSetupTime.

Parameters
I2CxI2C Instance.
Return values
Valuebetween Min_Data=0x0 and Max_Data=0xF

Definition at line 937 of file stm32l4xx_ll_i2c.h.

938 {
939  return (uint32_t)(READ_BIT(I2Cx->TIMINGR, I2C_TIMINGR_SCLDEL) >> I2C_TIMINGR_SCLDEL_Pos);
940 }

◆ LL_I2C_GetDigitalFilter()

__STATIC_INLINE uint32_t LL_I2C_GetDigitalFilter ( I2C_TypeDef *  I2Cx)

Get the current Digital Noise Filter configuration. CR1 DNF LL_I2C_GetDigitalFilter.

Parameters
I2CxI2C Instance.
Return values
Valuebetween Min_Data=0x0 and Max_Data=0xF

Definition at line 463 of file stm32l4xx_ll_i2c.h.

464 {
465  return (uint32_t)(READ_BIT(I2Cx->CR1, I2C_CR1_DNF) >> I2C_CR1_DNF_Pos);
466 }

◆ LL_I2C_GetMasterAddressingMode()

__STATIC_INLINE uint32_t LL_I2C_GetMasterAddressingMode ( I2C_TypeDef *  I2Cx)

Get the Master addressing mode. CR2 ADD10 LL_I2C_GetMasterAddressingMode.

Parameters
I2CxI2C Instance.
Return values
Returnedvalue can be one of the following values:
  • LL_I2C_ADDRESSING_MODE_7BIT
  • LL_I2C_ADDRESSING_MODE_10BIT

Definition at line 763 of file stm32l4xx_ll_i2c.h.

764 {
765  return (uint32_t)(READ_BIT(I2Cx->CR2, I2C_CR2_ADD10));
766 }

◆ LL_I2C_GetMode()

__STATIC_INLINE uint32_t LL_I2C_GetMode ( I2C_TypeDef *  I2Cx)

Get peripheral mode.

Note
Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not SMBus feature is supported by the I2Cx Instance. CR1 SMBHEN LL_I2C_GetMode
CR1 SMBDEN LL_I2C_GetMode
Parameters
I2CxI2C Instance.
Return values
Returnedvalue can be one of the following values:
  • LL_I2C_MODE_I2C
  • LL_I2C_MODE_SMBUS_HOST
  • LL_I2C_MODE_SMBUS_DEVICE
  • LL_I2C_MODE_SMBUS_DEVICE_ARP

Definition at line 974 of file stm32l4xx_ll_i2c.h.

975 {
976  return (uint32_t)(READ_BIT(I2Cx->CR1, I2C_CR1_SMBHEN | I2C_CR1_SMBDEN));
977 }

◆ LL_I2C_GetSMBusTimeoutA()

__STATIC_INLINE uint32_t LL_I2C_GetSMBusTimeoutA ( I2C_TypeDef *  I2Cx)

Get the SMBus Clock TimeoutA setting.

Note
Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not SMBus feature is supported by the I2Cx Instance. TIMEOUTR TIMEOUTA LL_I2C_GetSMBusTimeoutA
Parameters
I2CxI2C Instance.
Return values
Valuebetween Min_Data=0 and Max_Data=0xFFF

Definition at line 1113 of file stm32l4xx_ll_i2c.h.

1114 {
1115  return (uint32_t)(READ_BIT(I2Cx->TIMEOUTR, I2C_TIMEOUTR_TIMEOUTA));
1116 }

◆ LL_I2C_GetSMBusTimeoutAMode()

__STATIC_INLINE uint32_t LL_I2C_GetSMBusTimeoutAMode ( I2C_TypeDef *  I2Cx)

Get the SMBus Clock TimeoutA mode.

Note
Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not SMBus feature is supported by the I2Cx Instance. TIMEOUTR TIDLE LL_I2C_GetSMBusTimeoutAMode
Parameters
I2CxI2C Instance.
Return values
Returnedvalue can be one of the following values:
  • LL_I2C_SMBUS_TIMEOUTA_MODE_SCL_LOW
  • LL_I2C_SMBUS_TIMEOUTA_MODE_SDA_SCL_HIGH

Definition at line 1145 of file stm32l4xx_ll_i2c.h.

1146 {
1147  return (uint32_t)(READ_BIT(I2Cx->TIMEOUTR, I2C_TIMEOUTR_TIDLE));
1148 }

◆ LL_I2C_GetSMBusTimeoutB()

__STATIC_INLINE uint32_t LL_I2C_GetSMBusTimeoutB ( I2C_TypeDef *  I2Cx)

Get the SMBus Extented Cumulative Clock TimeoutB setting.

Note
Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not SMBus feature is supported by the I2Cx Instance. TIMEOUTR TIMEOUTB LL_I2C_GetSMBusTimeoutB
Parameters
I2CxI2C Instance.
Return values
Valuebetween Min_Data=0 and Max_Data=0xFFF

Definition at line 1173 of file stm32l4xx_ll_i2c.h.

1174 {
1175  return (uint32_t)(READ_BIT(I2Cx->TIMEOUTR, I2C_TIMEOUTR_TIMEOUTB) >> I2C_TIMEOUTR_TIMEOUTB_Pos);
1176 }

◆ LL_I2C_GetTimingPrescaler()

__STATIC_INLINE uint32_t LL_I2C_GetTimingPrescaler ( I2C_TypeDef *  I2Cx)

Get the Timing Prescaler setting. TIMINGR PRESC LL_I2C_GetTimingPrescaler.

Parameters
I2CxI2C Instance.
Return values
Valuebetween Min_Data=0x0 and Max_Data=0xF

Definition at line 893 of file stm32l4xx_ll_i2c.h.

894 {
895  return (uint32_t)(READ_BIT(I2Cx->TIMINGR, I2C_TIMINGR_PRESC) >> I2C_TIMINGR_PRESC_Pos);
896 }

◆ LL_I2C_IsEnabled()

__STATIC_INLINE uint32_t LL_I2C_IsEnabled ( I2C_TypeDef *  I2Cx)

Check if the I2C peripheral is enabled or disabled. CR1 PE LL_I2C_IsEnabled.

Parameters
I2CxI2C Instance.
Return values
Stateof bit (1 or 0).

Definition at line 416 of file stm32l4xx_ll_i2c.h.

417 {
418  return ((READ_BIT(I2Cx->CR1, I2C_CR1_PE) == (I2C_CR1_PE)) ? 1UL : 0UL);
419 }

◆ LL_I2C_IsEnabledAnalogFilter()

__STATIC_INLINE uint32_t LL_I2C_IsEnabledAnalogFilter ( I2C_TypeDef *  I2Cx)

Check if Analog Noise Filter is enabled or disabled. CR1 ANFOFF LL_I2C_IsEnabledAnalogFilter.

Parameters
I2CxI2C Instance.
Return values
Stateof bit (1 or 0).

Definition at line 498 of file stm32l4xx_ll_i2c.h.

499 {
500  return ((READ_BIT(I2Cx->CR1, I2C_CR1_ANFOFF) != (I2C_CR1_ANFOFF)) ? 1UL : 0UL);
501 }

◆ LL_I2C_IsEnabledClockStretching()

__STATIC_INLINE uint32_t LL_I2C_IsEnabledClockStretching ( I2C_TypeDef *  I2Cx)

Check if Clock stretching is enabled or disabled. CR1 NOSTRETCH LL_I2C_IsEnabledClockStretching.

Parameters
I2CxI2C Instance.
Return values
Stateof bit (1 or 0).

Definition at line 627 of file stm32l4xx_ll_i2c.h.

628 {
629  return ((READ_BIT(I2Cx->CR1, I2C_CR1_NOSTRETCH) != (I2C_CR1_NOSTRETCH)) ? 1UL : 0UL);
630 }

◆ LL_I2C_IsEnabledDMAReq_RX()

__STATIC_INLINE uint32_t LL_I2C_IsEnabledDMAReq_RX ( I2C_TypeDef *  I2Cx)

Check if DMA reception requests are enabled or disabled. CR1 RXDMAEN LL_I2C_IsEnabledDMAReq_RX.

Parameters
I2CxI2C Instance.
Return values
Stateof bit (1 or 0).

Definition at line 564 of file stm32l4xx_ll_i2c.h.

565 {
566  return ((READ_BIT(I2Cx->CR1, I2C_CR1_RXDMAEN) == (I2C_CR1_RXDMAEN)) ? 1UL : 0UL);
567 }

◆ LL_I2C_IsEnabledDMAReq_TX()

__STATIC_INLINE uint32_t LL_I2C_IsEnabledDMAReq_TX ( I2C_TypeDef *  I2Cx)

Check if DMA transmission requests are enabled or disabled. CR1 TXDMAEN LL_I2C_IsEnabledDMAReq_TX.

Parameters
I2CxI2C Instance.
Return values
Stateof bit (1 or 0).

Definition at line 531 of file stm32l4xx_ll_i2c.h.

532 {
533  return ((READ_BIT(I2Cx->CR1, I2C_CR1_TXDMAEN) == (I2C_CR1_TXDMAEN)) ? 1UL : 0UL);
534 }

◆ LL_I2C_IsEnabledGeneralCall()

__STATIC_INLINE uint32_t LL_I2C_IsEnabledGeneralCall ( I2C_TypeDef *  I2Cx)

Check if General Call is enabled or disabled. CR1 GCEN LL_I2C_IsEnabledGeneralCall.

Parameters
I2CxI2C Instance.
Return values
Stateof bit (1 or 0).

Definition at line 735 of file stm32l4xx_ll_i2c.h.

736 {
737  return ((READ_BIT(I2Cx->CR1, I2C_CR1_GCEN) == (I2C_CR1_GCEN)) ? 1UL : 0UL);
738 }

◆ LL_I2C_IsEnabledOwnAddress1()

__STATIC_INLINE uint32_t LL_I2C_IsEnabledOwnAddress1 ( I2C_TypeDef *  I2Cx)

Check if Own Address1 acknowledge is enabled or disabled. OAR1 OA1EN LL_I2C_IsEnabledOwnAddress1.

Parameters
I2CxI2C Instance.
Return values
Stateof bit (1 or 0).

Definition at line 812 of file stm32l4xx_ll_i2c.h.

813 {
814  return ((READ_BIT(I2Cx->OAR1, I2C_OAR1_OA1EN) == (I2C_OAR1_OA1EN)) ? 1UL : 0UL);
815 }

◆ LL_I2C_IsEnabledOwnAddress2()

__STATIC_INLINE uint32_t LL_I2C_IsEnabledOwnAddress2 ( I2C_TypeDef *  I2Cx)

Check if Own Address1 acknowledge is enabled or disabled. OAR2 OA2EN LL_I2C_IsEnabledOwnAddress2.

Parameters
I2CxI2C Instance.
Return values
Stateof bit (1 or 0).

Definition at line 868 of file stm32l4xx_ll_i2c.h.

869 {
870  return ((READ_BIT(I2Cx->OAR2, I2C_OAR2_OA2EN) == (I2C_OAR2_OA2EN)) ? 1UL : 0UL);
871 }

◆ LL_I2C_IsEnabledSlaveByteControl()

__STATIC_INLINE uint32_t LL_I2C_IsEnabledSlaveByteControl ( I2C_TypeDef *  I2Cx)

Check if hardware byte control in slave mode is enabled or disabled. CR1 SBC LL_I2C_IsEnabledSlaveByteControl.

Parameters
I2CxI2C Instance.
Return values
Stateof bit (1 or 0).

Definition at line 660 of file stm32l4xx_ll_i2c.h.

661 {
662  return ((READ_BIT(I2Cx->CR1, I2C_CR1_SBC) == (I2C_CR1_SBC)) ? 1UL : 0UL);
663 }

◆ LL_I2C_IsEnabledSMBusAlert()

__STATIC_INLINE uint32_t LL_I2C_IsEnabledSMBusAlert ( I2C_TypeDef *  I2Cx)

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 SMBus feature is supported by the I2Cx Instance. CR1 ALERTEN LL_I2C_IsEnabledSMBusAlert
Parameters
I2CxI2C Instance.
Return values
Stateof bit (1 or 0).

Definition at line 1023 of file stm32l4xx_ll_i2c.h.

1024 {
1025  return ((READ_BIT(I2Cx->CR1, I2C_CR1_ALERTEN) == (I2C_CR1_ALERTEN)) ? 1UL : 0UL);
1026 }

◆ LL_I2C_IsEnabledSMBusPEC()

__STATIC_INLINE uint32_t LL_I2C_IsEnabledSMBusPEC ( I2C_TypeDef *  I2Cx)

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 SMBus feature is supported by the I2Cx Instance. CR1 PECEN LL_I2C_IsEnabledSMBusPEC
Parameters
I2CxI2C Instance.
Return values
Stateof bit (1 or 0).

Definition at line 1062 of file stm32l4xx_ll_i2c.h.

1063 {
1064  return ((READ_BIT(I2Cx->CR1, I2C_CR1_PECEN) == (I2C_CR1_PECEN)) ? 1UL : 0UL);
1065 }

◆ LL_I2C_IsEnabledSMBusTimeout()

__STATIC_INLINE uint32_t LL_I2C_IsEnabledSMBusTimeout ( I2C_TypeDef *  I2Cx,
uint32_t  ClockTimeout 
)

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 SMBus feature is supported by the I2Cx Instance. TIMEOUTR TIMOUTEN LL_I2C_IsEnabledSMBusTimeout
TIMEOUTR TEXTEN LL_I2C_IsEnabledSMBusTimeout
Parameters
I2CxI2C Instance.
ClockTimeoutThis parameter can be one of the following values:
  • LL_I2C_SMBUS_TIMEOUTA
  • LL_I2C_SMBUS_TIMEOUTB
  • LL_I2C_SMBUS_ALL_TIMEOUT
Return values
Stateof bit (1 or 0).

Definition at line 1227 of file stm32l4xx_ll_i2c.h.

1228 {
1229  return ((READ_BIT(I2Cx->TIMEOUTR, (I2C_TIMEOUTR_TIMOUTEN | I2C_TIMEOUTR_TEXTEN)) == (ClockTimeout)) ? 1UL : 0UL);
1230 }

◆ LL_I2C_IsEnabledWakeUpFromStop()

__STATIC_INLINE uint32_t LL_I2C_IsEnabledWakeUpFromStop ( I2C_TypeDef *  I2Cx)

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 WakeUpFromStop feature is supported by the I2Cx Instance. CR1 WUPEN LL_I2C_IsEnabledWakeUpFromStop
Parameters
I2CxI2C Instance.
Return values
Stateof bit (1 or 0).

Definition at line 700 of file stm32l4xx_ll_i2c.h.

701 {
702  return ((READ_BIT(I2Cx->CR1, I2C_CR1_WUPEN) == (I2C_CR1_WUPEN)) ? 1UL : 0UL);
703 }

◆ LL_I2C_SetDigitalFilter()

__STATIC_INLINE void LL_I2C_SetDigitalFilter ( I2C_TypeDef *  I2Cx,
uint32_t  DigitalFilter 
)

Configure Digital Noise Filter.

Note
If the analog filter is also enabled, the digital filter is added to analog filter. This filter can only be programmed when the I2C is disabled (PE = 0). CR1 DNF LL_I2C_SetDigitalFilter
Parameters
I2CxI2C Instance.
DigitalFilterThis 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.
Return values
None

Definition at line 452 of file stm32l4xx_ll_i2c.h.

453 {
454  MODIFY_REG(I2Cx->CR1, I2C_CR1_DNF, DigitalFilter << I2C_CR1_DNF_Pos);
455 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_I2C_SetMasterAddressingMode()

__STATIC_INLINE void LL_I2C_SetMasterAddressingMode ( I2C_TypeDef *  I2Cx,
uint32_t  AddressingMode 
)

Configure the Master to operate in 7-bit or 10-bit addressing mode.

Note
Changing this bit is not allowed, when the START bit is set. CR2 ADD10 LL_I2C_SetMasterAddressingMode
Parameters
I2CxI2C Instance.
AddressingModeThis parameter can be one of the following values:
  • LL_I2C_ADDRESSING_MODE_7BIT
  • LL_I2C_ADDRESSING_MODE_10BIT
Return values
None

Definition at line 750 of file stm32l4xx_ll_i2c.h.

751 {
752  MODIFY_REG(I2Cx->CR2, I2C_CR2_ADD10, AddressingMode);
753 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_I2C_SetMode()

__STATIC_INLINE void LL_I2C_SetMode ( I2C_TypeDef *  I2Cx,
uint32_t  PeripheralMode 
)

Configure peripheral mode.

Note
Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not SMBus feature is supported by the I2Cx Instance. CR1 SMBHEN LL_I2C_SetMode
CR1 SMBDEN LL_I2C_SetMode
Parameters
I2CxI2C Instance.
PeripheralModeThis parameter can be one of the following values:
  • LL_I2C_MODE_I2C
  • LL_I2C_MODE_SMBUS_HOST
  • LL_I2C_MODE_SMBUS_DEVICE
  • LL_I2C_MODE_SMBUS_DEVICE_ARP
Return values
None

Definition at line 956 of file stm32l4xx_ll_i2c.h.

957 {
958  MODIFY_REG(I2Cx->CR1, I2C_CR1_SMBHEN | I2C_CR1_SMBDEN, PeripheralMode);
959 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_I2C_SetOwnAddress1()

__STATIC_INLINE void LL_I2C_SetOwnAddress1 ( I2C_TypeDef *  I2Cx,
uint32_t  OwnAddress1,
uint32_t  OwnAddrSize 
)

Set the Own Address1. OAR1 OA1 LL_I2C_SetOwnAddress1
OAR1 OA1MODE LL_I2C_SetOwnAddress1.

Parameters
I2CxI2C Instance.
OwnAddress1This parameter must be a value between Min_Data=0 and Max_Data=0x3FF.
OwnAddrSizeThis parameter can be one of the following values:
  • LL_I2C_OWNADDRESS1_7BIT
  • LL_I2C_OWNADDRESS1_10BIT
Return values
None

Definition at line 779 of file stm32l4xx_ll_i2c.h.

780 {
781  MODIFY_REG(I2Cx->OAR1, I2C_OAR1_OA1 | I2C_OAR1_OA1MODE, OwnAddress1 | OwnAddrSize);
782 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_I2C_SetOwnAddress2()

__STATIC_INLINE void LL_I2C_SetOwnAddress2 ( I2C_TypeDef *  I2Cx,
uint32_t  OwnAddress2,
uint32_t  OwnAddrMask 
)

Set the 7bits Own Address2.

Note
This action has no effect if own address2 is enabled. OAR2 OA2 LL_I2C_SetOwnAddress2
OAR2 OA2MSK LL_I2C_SetOwnAddress2
Parameters
I2CxI2C Instance.
OwnAddress2Value between Min_Data=0 and Max_Data=0x7F.
OwnAddrMaskThis parameter can be one of the following values:
  • LL_I2C_OWNADDRESS2_NOMASK
  • LL_I2C_OWNADDRESS2_MASK01
  • LL_I2C_OWNADDRESS2_MASK02
  • LL_I2C_OWNADDRESS2_MASK03
  • LL_I2C_OWNADDRESS2_MASK04
  • LL_I2C_OWNADDRESS2_MASK05
  • LL_I2C_OWNADDRESS2_MASK06
  • LL_I2C_OWNADDRESS2_MASK07
Return values
None

Definition at line 835 of file stm32l4xx_ll_i2c.h.

836 {
837  MODIFY_REG(I2Cx->OAR2, I2C_OAR2_OA2 | I2C_OAR2_OA2MSK, OwnAddress2 | OwnAddrMask);
838 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_I2C_SetSMBusTimeoutA()

__STATIC_INLINE void LL_I2C_SetSMBusTimeoutA ( I2C_TypeDef *  I2Cx,
uint32_t  TimeoutA 
)

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 SMBus feature is supported by the I2Cx Instance.
These bits can only be programmed when TimeoutA is disabled. TIMEOUTR TIMEOUTA LL_I2C_SetSMBusTimeoutA
Parameters
I2CxI2C Instance.
TimeoutAThis parameter must be a value between Min_Data=0 and Max_Data=0xFFF.
Return values
None

Definition at line 1100 of file stm32l4xx_ll_i2c.h.

1101 {
1102  WRITE_REG(I2Cx->TIMEOUTR, TimeoutA);
1103 }

◆ LL_I2C_SetSMBusTimeoutAMode()

__STATIC_INLINE void LL_I2C_SetSMBusTimeoutAMode ( I2C_TypeDef *  I2Cx,
uint32_t  TimeoutAMode 
)

Set the SMBus Clock TimeoutA mode.

Note
Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not SMBus feature is supported by the I2Cx Instance.
This bit can only be programmed when TimeoutA is disabled. TIMEOUTR TIDLE LL_I2C_SetSMBusTimeoutAMode
Parameters
I2CxI2C Instance.
TimeoutAModeThis parameter can be one of the following values:
  • LL_I2C_SMBUS_TIMEOUTA_MODE_SCL_LOW
  • LL_I2C_SMBUS_TIMEOUTA_MODE_SDA_SCL_HIGH
Return values
None

Definition at line 1130 of file stm32l4xx_ll_i2c.h.

1131 {
1132  WRITE_REG(I2Cx->TIMEOUTR, TimeoutAMode);
1133 }

◆ LL_I2C_SetSMBusTimeoutB()

__STATIC_INLINE void LL_I2C_SetSMBusTimeoutB ( I2C_TypeDef *  I2Cx,
uint32_t  TimeoutB 
)

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 SMBus feature is supported by the I2Cx Instance.
These bits can only be programmed when TimeoutB is disabled. TIMEOUTR TIMEOUTB LL_I2C_SetSMBusTimeoutB
Parameters
I2CxI2C Instance.
TimeoutBThis parameter must be a value between Min_Data=0 and Max_Data=0xFFF.
Return values
None

Definition at line 1160 of file stm32l4xx_ll_i2c.h.

1161 {
1162  WRITE_REG(I2Cx->TIMEOUTR, TimeoutB << I2C_TIMEOUTR_TIMEOUTB_Pos);
1163 }

◆ LL_I2C_SetTiming()

__STATIC_INLINE void LL_I2C_SetTiming ( I2C_TypeDef *  I2Cx,
uint32_t  Timing 
)

Configure the SDA setup, hold time and the SCL high, low period.

Note
This bit can only be programmed when the I2C is disabled (PE = 0). TIMINGR TIMINGR LL_I2C_SetTiming
Parameters
I2CxI2C Instance.
TimingThis parameter must be a value between Min_Data=0 and Max_Data=0xFFFFFFFF.
Note
This parameter is computed with the STM32CubeMX Tool.
Return values
None

Definition at line 882 of file stm32l4xx_ll_i2c.h.

883 {
884  WRITE_REG(I2Cx->TIMINGR, Timing);
885 }