STM32L4xx_HAL_Driver  1.14.0

Functions

__STATIC_INLINE void LL_I2C_EnableAutoEndMode (I2C_TypeDef *I2Cx)
 Enable automatic STOP condition generation (master mode). More...
 
__STATIC_INLINE void LL_I2C_DisableAutoEndMode (I2C_TypeDef *I2Cx)
 Disable automatic STOP condition generation (master mode). More...
 
__STATIC_INLINE uint32_t LL_I2C_IsEnabledAutoEndMode (I2C_TypeDef *I2Cx)
 Check if automatic STOP condition is enabled or disabled. CR2 AUTOEND LL_I2C_IsEnabledAutoEndMode. More...
 
__STATIC_INLINE void LL_I2C_EnableReloadMode (I2C_TypeDef *I2Cx)
 Enable reload mode (master mode). More...
 
__STATIC_INLINE void LL_I2C_DisableReloadMode (I2C_TypeDef *I2Cx)
 Disable reload mode (master mode). More...
 
__STATIC_INLINE uint32_t LL_I2C_IsEnabledReloadMode (I2C_TypeDef *I2Cx)
 Check if reload mode is enabled or disabled. CR2 RELOAD LL_I2C_IsEnabledReloadMode. More...
 
__STATIC_INLINE void LL_I2C_SetTransferSize (I2C_TypeDef *I2Cx, uint32_t TransferSize)
 Configure the number of bytes for transfer. More...
 
__STATIC_INLINE uint32_t LL_I2C_GetTransferSize (I2C_TypeDef *I2Cx)
 Get the number of bytes configured for transfer. CR2 NBYTES LL_I2C_GetTransferSize. More...
 
__STATIC_INLINE void LL_I2C_AcknowledgeNextData (I2C_TypeDef *I2Cx, uint32_t TypeAcknowledge)
 Prepare the generation of a ACKnowledge or Non ACKnowledge condition after the address receive match code or next received byte. More...
 
__STATIC_INLINE void LL_I2C_GenerateStartCondition (I2C_TypeDef *I2Cx)
 Generate a START or RESTART condition. More...
 
__STATIC_INLINE void LL_I2C_GenerateStopCondition (I2C_TypeDef *I2Cx)
 Generate a STOP condition after the current byte transfer (master mode). CR2 STOP LL_I2C_GenerateStopCondition. More...
 
__STATIC_INLINE void LL_I2C_EnableAuto10BitRead (I2C_TypeDef *I2Cx)
 Enable automatic RESTART Read request condition for 10bit address header (master mode). More...
 
__STATIC_INLINE void LL_I2C_DisableAuto10BitRead (I2C_TypeDef *I2Cx)
 Disable automatic RESTART Read request condition for 10bit address header (master mode). More...
 
__STATIC_INLINE uint32_t LL_I2C_IsEnabledAuto10BitRead (I2C_TypeDef *I2Cx)
 Check if automatic RESTART Read request condition for 10bit address header is enabled or disabled. CR2 HEAD10R LL_I2C_IsEnabledAuto10BitRead. More...
 
__STATIC_INLINE void LL_I2C_SetTransferRequest (I2C_TypeDef *I2Cx, uint32_t TransferRequest)
 Configure the transfer direction (master mode). More...
 
__STATIC_INLINE uint32_t LL_I2C_GetTransferRequest (I2C_TypeDef *I2Cx)
 Get the transfer direction requested (master mode). CR2 RD_WRN LL_I2C_GetTransferRequest. More...
 
__STATIC_INLINE void LL_I2C_SetSlaveAddr (I2C_TypeDef *I2Cx, uint32_t SlaveAddr)
 Configure the slave address for transfer (master mode). More...
 
__STATIC_INLINE uint32_t LL_I2C_GetSlaveAddr (I2C_TypeDef *I2Cx)
 Get the slave address programmed for transfer. CR2 SADD LL_I2C_GetSlaveAddr. More...
 
__STATIC_INLINE void LL_I2C_HandleTransfer (I2C_TypeDef *I2Cx, uint32_t SlaveAddr, uint32_t SlaveAddrSize, uint32_t TransferSize, uint32_t EndMode, uint32_t Request)
 Handles I2Cx communication when starting transfer or during transfer (TC or TCR flag are set). CR2 SADD LL_I2C_HandleTransfer
CR2 ADD10 LL_I2C_HandleTransfer
CR2 RD_WRN LL_I2C_HandleTransfer
CR2 START LL_I2C_HandleTransfer
CR2 STOP LL_I2C_HandleTransfer
CR2 RELOAD LL_I2C_HandleTransfer
CR2 NBYTES LL_I2C_HandleTransfer
CR2 AUTOEND LL_I2C_HandleTransfer
CR2 HEAD10R LL_I2C_HandleTransfer. More...
 
__STATIC_INLINE uint32_t LL_I2C_GetTransferDirection (I2C_TypeDef *I2Cx)
 Indicate the value of transfer direction (slave mode). More...
 
__STATIC_INLINE uint32_t LL_I2C_GetAddressMatchCode (I2C_TypeDef *I2Cx)
 Return the slave matched address. ISR ADDCODE LL_I2C_GetAddressMatchCode. More...
 
__STATIC_INLINE void LL_I2C_EnableSMBusPECCompare (I2C_TypeDef *I2Cx)
 Enable internal comparison of the SMBus Packet Error byte (transmission or reception mode). More...
 
__STATIC_INLINE uint32_t LL_I2C_IsEnabledSMBusPECCompare (I2C_TypeDef *I2Cx)
 Check if the SMBus Packet Error byte internal comparison is requested or not. More...
 
__STATIC_INLINE uint32_t LL_I2C_GetSMBusPEC (I2C_TypeDef *I2Cx)
 Get the SMBus Packet Error byte calculated. More...
 
__STATIC_INLINE uint8_t LL_I2C_ReceiveData8 (I2C_TypeDef *I2Cx)
 Read Receive Data register. RXDR RXDATA LL_I2C_ReceiveData8. More...
 
__STATIC_INLINE void LL_I2C_TransmitData8 (I2C_TypeDef *I2Cx, uint8_t Data)
 Write in Transmit Data Register . TXDR TXDATA LL_I2C_TransmitData8. More...
 

Detailed Description

Function Documentation

◆ LL_I2C_AcknowledgeNextData()

__STATIC_INLINE void LL_I2C_AcknowledgeNextData ( I2C_TypeDef *  I2Cx,
uint32_t  TypeAcknowledge 
)

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. CR2 NACK LL_I2C_AcknowledgeNextData
Parameters
I2CxI2C Instance.
TypeAcknowledgeThis parameter can be one of the following values:
  • LL_I2C_ACK
  • LL_I2C_NACK
Return values
None

Definition at line 1935 of file stm32l4xx_ll_i2c.h.

1936 {
1937  MODIFY_REG(I2Cx->CR2, I2C_CR2_NACK, TypeAcknowledge);
1938 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_I2C_DisableAuto10BitRead()

__STATIC_INLINE void LL_I2C_DisableAuto10BitRead ( I2C_TypeDef *  I2Cx)

Disable automatic RESTART Read request condition for 10bit address header (master mode).

Note
The master only sends the first 7 bits of 10bit address in Read direction. CR2 HEAD10R LL_I2C_DisableAuto10BitRead
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 1984 of file stm32l4xx_ll_i2c.h.

1985 {
1986  SET_BIT(I2Cx->CR2, I2C_CR2_HEAD10R);
1987 }

◆ LL_I2C_DisableAutoEndMode()

__STATIC_INLINE void LL_I2C_DisableAutoEndMode ( I2C_TypeDef *  I2Cx)

Disable automatic STOP condition generation (master mode).

Note
Software end mode : TC flag is set when NBYTES data are transferre, stretching SCL low. CR2 AUTOEND LL_I2C_DisableAutoEndMode
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 1850 of file stm32l4xx_ll_i2c.h.

1851 {
1852  CLEAR_BIT(I2Cx->CR2, I2C_CR2_AUTOEND);
1853 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_I2C_DisableReloadMode()

__STATIC_INLINE void LL_I2C_DisableReloadMode ( I2C_TypeDef *  I2Cx)

Disable reload mode (master mode).

Note
The transfer is completed after the NBYTES data transfer(STOP or RESTART will follow). CR2 RELOAD LL_I2C_DisableReloadMode
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 1885 of file stm32l4xx_ll_i2c.h.

1886 {
1887  CLEAR_BIT(I2Cx->CR2, I2C_CR2_RELOAD);
1888 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_I2C_EnableAuto10BitRead()

__STATIC_INLINE void LL_I2C_EnableAuto10BitRead ( I2C_TypeDef *  I2Cx)

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. CR2 HEAD10R LL_I2C_EnableAuto10BitRead
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 1972 of file stm32l4xx_ll_i2c.h.

1973 {
1974  CLEAR_BIT(I2Cx->CR2, I2C_CR2_HEAD10R);
1975 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_I2C_EnableAutoEndMode()

__STATIC_INLINE void LL_I2C_EnableAutoEndMode ( I2C_TypeDef *  I2Cx)

Enable automatic STOP condition generation (master mode).

Note
Automatic end mode : a STOP condition is automatically sent when NBYTES data are transferred. This bit has no effect in slave mode or when RELOAD bit is set. CR2 AUTOEND LL_I2C_EnableAutoEndMode
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 1838 of file stm32l4xx_ll_i2c.h.

1839 {
1840  SET_BIT(I2Cx->CR2, I2C_CR2_AUTOEND);
1841 }

◆ LL_I2C_EnableReloadMode()

__STATIC_INLINE void LL_I2C_EnableReloadMode ( I2C_TypeDef *  I2Cx)

Enable reload mode (master mode).

Note
The transfer is not completed after the NBYTES data transfer, NBYTES will be reloaded when TCR flag is set. CR2 RELOAD LL_I2C_EnableReloadMode
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 1873 of file stm32l4xx_ll_i2c.h.

1874 {
1875  SET_BIT(I2Cx->CR2, I2C_CR2_RELOAD);
1876 }

◆ LL_I2C_EnableSMBusPECCompare()

__STATIC_INLINE void LL_I2C_EnableSMBusPECCompare ( I2C_TypeDef *  I2Cx)

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 SMBus feature is supported by the I2Cx Instance.
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. CR2 PECBYTE LL_I2C_EnableSMBusPECCompare
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 2135 of file stm32l4xx_ll_i2c.h.

2136 {
2137  SET_BIT(I2Cx->CR2, I2C_CR2_PECBYTE);
2138 }

◆ LL_I2C_GenerateStartCondition()

__STATIC_INLINE void LL_I2C_GenerateStartCondition ( I2C_TypeDef *  I2Cx)

Generate a START or RESTART condition.

Note
The START bit can be set even if bus is BUSY or I2C is in slave mode. This action has no effect when RELOAD is set. CR2 START LL_I2C_GenerateStartCondition
Parameters
I2CxI2C Instance.
Return values
None

Definition at line 1948 of file stm32l4xx_ll_i2c.h.

1949 {
1950  SET_BIT(I2Cx->CR2, I2C_CR2_START);
1951 }

◆ LL_I2C_GenerateStopCondition()

__STATIC_INLINE void LL_I2C_GenerateStopCondition ( I2C_TypeDef *  I2Cx)

Generate a STOP condition after the current byte transfer (master mode). CR2 STOP LL_I2C_GenerateStopCondition.

Parameters
I2CxI2C Instance.
Return values
None

Definition at line 1959 of file stm32l4xx_ll_i2c.h.

1960 {
1961  SET_BIT(I2Cx->CR2, I2C_CR2_STOP);
1962 }

◆ LL_I2C_GetAddressMatchCode()

__STATIC_INLINE uint32_t LL_I2C_GetAddressMatchCode ( I2C_TypeDef *  I2Cx)

Return the slave matched address. ISR ADDCODE LL_I2C_GetAddressMatchCode.

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

Definition at line 2119 of file stm32l4xx_ll_i2c.h.

2120 {
2121  return (uint32_t)(READ_BIT(I2Cx->ISR, I2C_ISR_ADDCODE) >> I2C_ISR_ADDCODE_Pos << 1);
2122 }

◆ LL_I2C_GetSlaveAddr()

__STATIC_INLINE uint32_t LL_I2C_GetSlaveAddr ( I2C_TypeDef *  I2Cx)

Get the slave address programmed for transfer. CR2 SADD LL_I2C_GetSlaveAddr.

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

Definition at line 2047 of file stm32l4xx_ll_i2c.h.

2048 {
2049  return (uint32_t)(READ_BIT(I2Cx->CR2, I2C_CR2_SADD));
2050 }

◆ LL_I2C_GetSMBusPEC()

__STATIC_INLINE uint32_t LL_I2C_GetSMBusPEC ( I2C_TypeDef *  I2Cx)

Get the SMBus Packet Error byte calculated.

Note
Macro IS_SMBUS_ALL_INSTANCE(I2Cx) can be used to check whether or not SMBus feature is supported by the I2Cx Instance. PECR PEC LL_I2C_GetSMBusPEC
Parameters
I2CxI2C Instance.
Return values
Valuebetween Min_Data=0x00 and Max_Data=0xFF

Definition at line 2161 of file stm32l4xx_ll_i2c.h.

2162 {
2163  return (uint32_t)(READ_BIT(I2Cx->PECR, I2C_PECR_PEC));
2164 }

◆ LL_I2C_GetTransferDirection()

__STATIC_INLINE uint32_t LL_I2C_GetTransferDirection ( I2C_TypeDef *  I2Cx)

Indicate the value of transfer direction (slave mode).

Note
RESET: Write transfer, Slave enters in receiver mode. SET: Read transfer, Slave enters in transmitter mode. ISR DIR LL_I2C_GetTransferDirection
Parameters
I2CxI2C Instance.
Return values
Returnedvalue can be one of the following values:
  • LL_I2C_DIRECTION_WRITE
  • LL_I2C_DIRECTION_READ

Definition at line 2108 of file stm32l4xx_ll_i2c.h.

2109 {
2110  return (uint32_t)(READ_BIT(I2Cx->ISR, I2C_ISR_DIR));
2111 }

◆ LL_I2C_GetTransferRequest()

__STATIC_INLINE uint32_t LL_I2C_GetTransferRequest ( I2C_TypeDef *  I2Cx)

Get the transfer direction requested (master mode). CR2 RD_WRN LL_I2C_GetTransferRequest.

Parameters
I2CxI2C Instance.
Return values
Returnedvalue can be one of the following values:
  • LL_I2C_REQUEST_WRITE
  • LL_I2C_REQUEST_READ

Definition at line 2023 of file stm32l4xx_ll_i2c.h.

2024 {
2025  return (uint32_t)(READ_BIT(I2Cx->CR2, I2C_CR2_RD_WRN));
2026 }

◆ LL_I2C_GetTransferSize()

__STATIC_INLINE uint32_t LL_I2C_GetTransferSize ( I2C_TypeDef *  I2Cx)

Get the number of bytes configured for transfer. CR2 NBYTES LL_I2C_GetTransferSize.

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

Definition at line 1920 of file stm32l4xx_ll_i2c.h.

1921 {
1922  return (uint32_t)(READ_BIT(I2Cx->CR2, I2C_CR2_NBYTES) >> I2C_CR2_NBYTES_Pos);
1923 }

◆ LL_I2C_HandleTransfer()

__STATIC_INLINE void LL_I2C_HandleTransfer ( I2C_TypeDef *  I2Cx,
uint32_t  SlaveAddr,
uint32_t  SlaveAddrSize,
uint32_t  TransferSize,
uint32_t  EndMode,
uint32_t  Request 
)

Handles I2Cx communication when starting transfer or during transfer (TC or TCR flag are set). CR2 SADD LL_I2C_HandleTransfer
CR2 ADD10 LL_I2C_HandleTransfer
CR2 RD_WRN LL_I2C_HandleTransfer
CR2 START LL_I2C_HandleTransfer
CR2 STOP LL_I2C_HandleTransfer
CR2 RELOAD LL_I2C_HandleTransfer
CR2 NBYTES LL_I2C_HandleTransfer
CR2 AUTOEND LL_I2C_HandleTransfer
CR2 HEAD10R LL_I2C_HandleTransfer.

Parameters
I2CxI2C Instance.
SlaveAddrSpecifies the slave address to be programmed.
SlaveAddrSizeThis parameter can be one of the following values:
  • LL_I2C_ADDRSLAVE_7BIT
  • LL_I2C_ADDRSLAVE_10BIT
TransferSizeSpecifies the number of bytes to be programmed. This parameter must be a value between Min_Data=0 and Max_Data=255.
EndModeThis parameter can be one of the following values:
  • LL_I2C_MODE_RELOAD
  • LL_I2C_MODE_AUTOEND
  • LL_I2C_MODE_SOFTEND
  • LL_I2C_MODE_SMBUS_RELOAD
  • LL_I2C_MODE_SMBUS_AUTOEND_NO_PEC
  • LL_I2C_MODE_SMBUS_SOFTEND_NO_PEC
  • LL_I2C_MODE_SMBUS_AUTOEND_WITH_PEC
  • LL_I2C_MODE_SMBUS_SOFTEND_WITH_PEC
RequestThis parameter can be one of the following values:
  • LL_I2C_GENERATE_NOSTARTSTOP
  • LL_I2C_GENERATE_STOP
  • LL_I2C_GENERATE_START_READ
  • LL_I2C_GENERATE_START_WRITE
  • LL_I2C_GENERATE_RESTART_7BIT_READ
  • LL_I2C_GENERATE_RESTART_7BIT_WRITE
  • LL_I2C_GENERATE_RESTART_10BIT_READ
  • LL_I2C_GENERATE_RESTART_10BIT_WRITE
Return values
None

Definition at line 2090 of file stm32l4xx_ll_i2c.h.

2092 {
2093  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 |
2094  I2C_CR2_NBYTES | I2C_CR2_AUTOEND | I2C_CR2_HEAD10R,
2095  SlaveAddr | SlaveAddrSize | (TransferSize << I2C_CR2_NBYTES_Pos) | EndMode | Request);
2096 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_I2C_IsEnabledAuto10BitRead()

__STATIC_INLINE uint32_t LL_I2C_IsEnabledAuto10BitRead ( I2C_TypeDef *  I2Cx)

Check if automatic RESTART Read request condition for 10bit address header is enabled or disabled. CR2 HEAD10R LL_I2C_IsEnabledAuto10BitRead.

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

Definition at line 1995 of file stm32l4xx_ll_i2c.h.

1996 {
1997  return ((READ_BIT(I2Cx->CR2, I2C_CR2_HEAD10R) != (I2C_CR2_HEAD10R)) ? 1UL : 0UL);
1998 }

◆ LL_I2C_IsEnabledAutoEndMode()

__STATIC_INLINE uint32_t LL_I2C_IsEnabledAutoEndMode ( I2C_TypeDef *  I2Cx)

Check if automatic STOP condition is enabled or disabled. CR2 AUTOEND LL_I2C_IsEnabledAutoEndMode.

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

Definition at line 1861 of file stm32l4xx_ll_i2c.h.

1862 {
1863  return ((READ_BIT(I2Cx->CR2, I2C_CR2_AUTOEND) == (I2C_CR2_AUTOEND)) ? 1UL : 0UL);
1864 }

◆ LL_I2C_IsEnabledReloadMode()

__STATIC_INLINE uint32_t LL_I2C_IsEnabledReloadMode ( I2C_TypeDef *  I2Cx)

Check if reload mode is enabled or disabled. CR2 RELOAD LL_I2C_IsEnabledReloadMode.

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

Definition at line 1896 of file stm32l4xx_ll_i2c.h.

1897 {
1898  return ((READ_BIT(I2Cx->CR2, I2C_CR2_RELOAD) == (I2C_CR2_RELOAD)) ? 1UL : 0UL);
1899 }

◆ LL_I2C_IsEnabledSMBusPECCompare()

__STATIC_INLINE uint32_t LL_I2C_IsEnabledSMBusPECCompare ( I2C_TypeDef *  I2Cx)

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

Definition at line 2148 of file stm32l4xx_ll_i2c.h.

2149 {
2150  return ((READ_BIT(I2Cx->CR2, I2C_CR2_PECBYTE) == (I2C_CR2_PECBYTE)) ? 1UL : 0UL);
2151 }

◆ LL_I2C_ReceiveData8()

__STATIC_INLINE uint8_t LL_I2C_ReceiveData8 ( I2C_TypeDef *  I2Cx)

Read Receive Data register. RXDR RXDATA LL_I2C_ReceiveData8.

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

Definition at line 2172 of file stm32l4xx_ll_i2c.h.

2173 {
2174  return (uint8_t)(READ_BIT(I2Cx->RXDR, I2C_RXDR_RXDATA));
2175 }

◆ LL_I2C_SetSlaveAddr()

__STATIC_INLINE void LL_I2C_SetSlaveAddr ( I2C_TypeDef *  I2Cx,
uint32_t  SlaveAddr 
)

Configure the slave address for transfer (master mode).

Note
Changing these bits when START bit is set is not allowed. CR2 SADD LL_I2C_SetSlaveAddr
Parameters
I2CxI2C Instance.
SlaveAddrThis parameter must be a value between Min_Data=0x00 and Max_Data=0x3F.
Return values
None

Definition at line 2036 of file stm32l4xx_ll_i2c.h.

2037 {
2038  MODIFY_REG(I2Cx->CR2, I2C_CR2_SADD, SlaveAddr);
2039 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_I2C_SetTransferRequest()

__STATIC_INLINE void LL_I2C_SetTransferRequest ( I2C_TypeDef *  I2Cx,
uint32_t  TransferRequest 
)

Configure the transfer direction (master mode).

Note
Changing these bits when START bit is set is not allowed. CR2 RD_WRN LL_I2C_SetTransferRequest
Parameters
I2CxI2C Instance.
TransferRequestThis parameter can be one of the following values:
  • LL_I2C_REQUEST_WRITE
  • LL_I2C_REQUEST_READ
Return values
None

Definition at line 2010 of file stm32l4xx_ll_i2c.h.

2011 {
2012  MODIFY_REG(I2Cx->CR2, I2C_CR2_RD_WRN, TransferRequest);
2013 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_I2C_SetTransferSize()

__STATIC_INLINE void LL_I2C_SetTransferSize ( I2C_TypeDef *  I2Cx,
uint32_t  TransferSize 
)

Configure the number of bytes for transfer.

Note
Changing these bits when START bit is set is not allowed. CR2 NBYTES LL_I2C_SetTransferSize
Parameters
I2CxI2C Instance.
TransferSizeThis parameter must be a value between Min_Data=0x00 and Max_Data=0xFF.
Return values
None

Definition at line 1909 of file stm32l4xx_ll_i2c.h.

1910 {
1911  MODIFY_REG(I2Cx->CR2, I2C_CR2_NBYTES, TransferSize << I2C_CR2_NBYTES_Pos);
1912 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_I2C_TransmitData8()

__STATIC_INLINE void LL_I2C_TransmitData8 ( I2C_TypeDef *  I2Cx,
uint8_t  Data 
)

Write in Transmit Data Register . TXDR TXDATA LL_I2C_TransmitData8.

Parameters
I2CxI2C Instance.
DataValue between Min_Data=0x00 and Max_Data=0xFF
Return values
None

Definition at line 2184 of file stm32l4xx_ll_i2c.h.

2185 {
2186  WRITE_REG(I2Cx->TXDR, Data);
2187 }