20#ifndef STM32H7xx_LL_I2C_H
21#define STM32H7xx_LL_I2C_H
34#if defined (I2C1) || defined (I2C2) || defined (I2C3) || defined (I2C4) || defined (I2C5)
54#if defined(USE_FULL_LL_DRIVER) || defined(__rtems__)
65#if defined(USE_FULL_LL_DRIVER) || defined(__rtems__)
72 uint32_t PeripheralMode;
85 uint32_t AnalogFilter;
91 uint32_t DigitalFilter;
103 uint32_t TypeAcknowledge;
110 uint32_t OwnAddrSize;
132#define LL_I2C_ICR_ADDRCF I2C_ICR_ADDRCF
133#define LL_I2C_ICR_NACKCF I2C_ICR_NACKCF
134#define LL_I2C_ICR_STOPCF I2C_ICR_STOPCF
135#define LL_I2C_ICR_BERRCF I2C_ICR_BERRCF
136#define LL_I2C_ICR_ARLOCF I2C_ICR_ARLOCF
137#define LL_I2C_ICR_OVRCF I2C_ICR_OVRCF
138#define LL_I2C_ICR_PECCF I2C_ICR_PECCF
139#define LL_I2C_ICR_TIMOUTCF I2C_ICR_TIMOUTCF
140#define LL_I2C_ICR_ALERTCF I2C_ICR_ALERTCF
150#define LL_I2C_ISR_TXE I2C_ISR_TXE
151#define LL_I2C_ISR_TXIS I2C_ISR_TXIS
152#define LL_I2C_ISR_RXNE I2C_ISR_RXNE
153#define LL_I2C_ISR_ADDR I2C_ISR_ADDR
154#define LL_I2C_ISR_NACKF I2C_ISR_NACKF
155#define LL_I2C_ISR_STOPF I2C_ISR_STOPF
156#define LL_I2C_ISR_TC I2C_ISR_TC
157#define LL_I2C_ISR_TCR I2C_ISR_TCR
158#define LL_I2C_ISR_BERR I2C_ISR_BERR
159#define LL_I2C_ISR_ARLO I2C_ISR_ARLO
160#define LL_I2C_ISR_OVR I2C_ISR_OVR
161#define LL_I2C_ISR_PECERR I2C_ISR_PECERR
162#define LL_I2C_ISR_TIMEOUT I2C_ISR_TIMEOUT
163#define LL_I2C_ISR_ALERT I2C_ISR_ALERT
164#define LL_I2C_ISR_BUSY I2C_ISR_BUSY
174#define LL_I2C_CR1_TXIE I2C_CR1_TXIE
175#define LL_I2C_CR1_RXIE I2C_CR1_RXIE
176#define LL_I2C_CR1_ADDRIE I2C_CR1_ADDRIE
177#define LL_I2C_CR1_NACKIE I2C_CR1_NACKIE
178#define LL_I2C_CR1_STOPIE I2C_CR1_STOPIE
179#define LL_I2C_CR1_TCIE I2C_CR1_TCIE
180#define LL_I2C_CR1_ERRIE I2C_CR1_ERRIE
189#define LL_I2C_MODE_I2C 0x00000000U
190#define LL_I2C_MODE_SMBUS_HOST I2C_CR1_SMBHEN
191#define LL_I2C_MODE_SMBUS_DEVICE 0x00000000U
193#define LL_I2C_MODE_SMBUS_DEVICE_ARP I2C_CR1_SMBDEN
202#define LL_I2C_ANALOGFILTER_ENABLE 0x00000000U
203#define LL_I2C_ANALOGFILTER_DISABLE I2C_CR1_ANFOFF
212#define LL_I2C_ADDRESSING_MODE_7BIT 0x00000000U
213#define LL_I2C_ADDRESSING_MODE_10BIT I2C_CR2_ADD10
222#define LL_I2C_OWNADDRESS1_7BIT 0x00000000U
223#define LL_I2C_OWNADDRESS1_10BIT I2C_OAR1_OA1MODE
232#define LL_I2C_OWNADDRESS2_NOMASK I2C_OAR2_OA2NOMASK
233#define LL_I2C_OWNADDRESS2_MASK01 I2C_OAR2_OA2MASK01
234#define LL_I2C_OWNADDRESS2_MASK02 I2C_OAR2_OA2MASK02
235#define LL_I2C_OWNADDRESS2_MASK03 I2C_OAR2_OA2MASK03
236#define LL_I2C_OWNADDRESS2_MASK04 I2C_OAR2_OA2MASK04
237#define LL_I2C_OWNADDRESS2_MASK05 I2C_OAR2_OA2MASK05
238#define LL_I2C_OWNADDRESS2_MASK06 I2C_OAR2_OA2MASK06
239#define LL_I2C_OWNADDRESS2_MASK07 I2C_OAR2_OA2MASK07
249#define LL_I2C_ACK 0x00000000U
250#define LL_I2C_NACK I2C_CR2_NACK
259#define LL_I2C_ADDRSLAVE_7BIT 0x00000000U
260#define LL_I2C_ADDRSLAVE_10BIT I2C_CR2_ADD10
269#define LL_I2C_REQUEST_WRITE 0x00000000U
270#define LL_I2C_REQUEST_READ I2C_CR2_RD_WRN
279#define LL_I2C_MODE_RELOAD I2C_CR2_RELOAD
280#define LL_I2C_MODE_AUTOEND I2C_CR2_AUTOEND
282#define LL_I2C_MODE_SOFTEND 0x00000000U
284#define LL_I2C_MODE_SMBUS_RELOAD LL_I2C_MODE_RELOAD
286#define LL_I2C_MODE_SMBUS_AUTOEND_NO_PEC LL_I2C_MODE_AUTOEND
288#define LL_I2C_MODE_SMBUS_SOFTEND_NO_PEC LL_I2C_MODE_SOFTEND
290#define LL_I2C_MODE_SMBUS_AUTOEND_WITH_PEC (uint32_t)(LL_I2C_MODE_AUTOEND | I2C_CR2_PECBYTE)
292#define LL_I2C_MODE_SMBUS_SOFTEND_WITH_PEC (uint32_t)(LL_I2C_MODE_SOFTEND | I2C_CR2_PECBYTE)
302#define LL_I2C_GENERATE_NOSTARTSTOP 0x00000000U
304#define LL_I2C_GENERATE_STOP (uint32_t)(0x80000000U | I2C_CR2_STOP)
306#define LL_I2C_GENERATE_START_READ (uint32_t)(0x80000000U | I2C_CR2_START | I2C_CR2_RD_WRN)
308#define LL_I2C_GENERATE_START_WRITE (uint32_t)(0x80000000U | I2C_CR2_START)
310#define LL_I2C_GENERATE_RESTART_7BIT_READ (uint32_t)(0x80000000U | I2C_CR2_START | I2C_CR2_RD_WRN)
312#define LL_I2C_GENERATE_RESTART_7BIT_WRITE (uint32_t)(0x80000000U | I2C_CR2_START)
314#define LL_I2C_GENERATE_RESTART_10BIT_READ (uint32_t)(0x80000000U | I2C_CR2_START | \
315 I2C_CR2_RD_WRN | I2C_CR2_HEAD10R)
317#define LL_I2C_GENERATE_RESTART_10BIT_WRITE (uint32_t)(0x80000000U | I2C_CR2_START)
327#define LL_I2C_DIRECTION_WRITE 0x00000000U
329#define LL_I2C_DIRECTION_READ I2C_ISR_DIR
339#define LL_I2C_DMA_REG_DATA_TRANSMIT 0x00000000U
341#define LL_I2C_DMA_REG_DATA_RECEIVE 0x00000001U
351#define LL_I2C_SMBUS_TIMEOUTA_MODE_SCL_LOW 0x00000000U
353#define LL_I2C_SMBUS_TIMEOUTA_MODE_SDA_SCL_HIGH I2C_TIMEOUTR_TIDLE
363#define LL_I2C_SMBUS_TIMEOUTA I2C_TIMEOUTR_TIMOUTEN
364#define LL_I2C_SMBUS_TIMEOUTB I2C_TIMEOUTR_TEXTEN
366#define LL_I2C_SMBUS_ALL_TIMEOUT (uint32_t)(I2C_TIMEOUTR_TIMOUTEN | \
395#define LL_I2C_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
403#define LL_I2C_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
425#define __LL_I2C_CONVERT_TIMINGS(__PRESCALER__, __SETUP_TIME__, __HOLD_TIME__, __SCLH_PERIOD__, __SCLL_PERIOD__) \
426 ((((uint32_t)(__PRESCALER__) << I2C_TIMINGR_PRESC_Pos) & I2C_TIMINGR_PRESC) | \
427 (((uint32_t)(__SETUP_TIME__) << I2C_TIMINGR_SCLDEL_Pos) & I2C_TIMINGR_SCLDEL) | \
428 (((uint32_t)(__HOLD_TIME__) << I2C_TIMINGR_SDADEL_Pos) & I2C_TIMINGR_SDADEL) | \
429 (((uint32_t)(__SCLH_PERIOD__) << I2C_TIMINGR_SCLH_Pos) & I2C_TIMINGR_SCLH) | \
430 (((uint32_t)(__SCLL_PERIOD__) << I2C_TIMINGR_SCLL_Pos) & I2C_TIMINGR_SCLL))
456__STATIC_INLINE
void LL_I2C_Enable(
I2C_TypeDef *I2Cx)
470__STATIC_INLINE
void LL_I2C_Disable(
I2C_TypeDef *I2Cx)
481__STATIC_INLINE uint32_t LL_I2C_IsEnabled(
const I2C_TypeDef *I2Cx)
502__STATIC_INLINE
void LL_I2C_ConfigFilters(
I2C_TypeDef *I2Cx, uint32_t AnalogFilter, uint32_t DigitalFilter)
519__STATIC_INLINE
void LL_I2C_SetDigitalFilter(
I2C_TypeDef *I2Cx, uint32_t DigitalFilter)
521 MODIFY_REG(I2Cx->
CR1,
I2C_CR1_DNF, DigitalFilter << I2C_CR1_DNF_Pos);
530__STATIC_INLINE uint32_t LL_I2C_GetDigitalFilter(
const I2C_TypeDef *I2Cx)
532 return (uint32_t)(READ_BIT(I2Cx->
CR1,
I2C_CR1_DNF) >> I2C_CR1_DNF_Pos);
542__STATIC_INLINE
void LL_I2C_EnableAnalogFilter(
I2C_TypeDef *I2Cx)
554__STATIC_INLINE
void LL_I2C_DisableAnalogFilter(
I2C_TypeDef *I2Cx)
565__STATIC_INLINE uint32_t LL_I2C_IsEnabledAnalogFilter(
const I2C_TypeDef *I2Cx)
576__STATIC_INLINE
void LL_I2C_EnableDMAReq_TX(
I2C_TypeDef *I2Cx)
587__STATIC_INLINE
void LL_I2C_DisableDMAReq_TX(
I2C_TypeDef *I2Cx)
598__STATIC_INLINE uint32_t LL_I2C_IsEnabledDMAReq_TX(
const I2C_TypeDef *I2Cx)
609__STATIC_INLINE
void LL_I2C_EnableDMAReq_RX(
I2C_TypeDef *I2Cx)
620__STATIC_INLINE
void LL_I2C_DisableDMAReq_RX(
I2C_TypeDef *I2Cx)
631__STATIC_INLINE uint32_t LL_I2C_IsEnabledDMAReq_RX(
const I2C_TypeDef *I2Cx)
646__STATIC_INLINE uint32_t LL_I2C_DMA_GetRegAddr(
const I2C_TypeDef *I2Cx, uint32_t Direction)
648 uint32_t data_reg_addr;
650 if (Direction == LL_I2C_DMA_REG_DATA_TRANSMIT)
653 data_reg_addr = (uint32_t) &(I2Cx->
TXDR);
658 data_reg_addr = (uint32_t) &(I2Cx->
RXDR);
661 return data_reg_addr;
671__STATIC_INLINE
void LL_I2C_EnableClockStretching(
I2C_TypeDef *I2Cx)
683__STATIC_INLINE
void LL_I2C_DisableClockStretching(
I2C_TypeDef *I2Cx)
694__STATIC_INLINE uint32_t LL_I2C_IsEnabledClockStretching(
const I2C_TypeDef *I2Cx)
705__STATIC_INLINE
void LL_I2C_EnableSlaveByteControl(
I2C_TypeDef *I2Cx)
716__STATIC_INLINE
void LL_I2C_DisableSlaveByteControl(
I2C_TypeDef *I2Cx)
727__STATIC_INLINE uint32_t LL_I2C_IsEnabledSlaveByteControl(
const I2C_TypeDef *I2Cx)
741__STATIC_INLINE
void LL_I2C_EnableWakeUpFromStop(
I2C_TypeDef *I2Cx)
754__STATIC_INLINE
void LL_I2C_DisableWakeUpFromStop(
I2C_TypeDef *I2Cx)
767__STATIC_INLINE uint32_t LL_I2C_IsEnabledWakeUpFromStop(
const I2C_TypeDef *I2Cx)
779__STATIC_INLINE
void LL_I2C_EnableGeneralCall(
I2C_TypeDef *I2Cx)
791__STATIC_INLINE
void LL_I2C_DisableGeneralCall(
I2C_TypeDef *I2Cx)
802__STATIC_INLINE uint32_t LL_I2C_IsEnabledGeneralCall(
const I2C_TypeDef *I2Cx)
817__STATIC_INLINE
void LL_I2C_SetMasterAddressingMode(
I2C_TypeDef *I2Cx, uint32_t AddressingMode)
830__STATIC_INLINE uint32_t LL_I2C_GetMasterAddressingMode(
const I2C_TypeDef *I2Cx)
846__STATIC_INLINE
void LL_I2C_SetOwnAddress1(
I2C_TypeDef *I2Cx, uint32_t OwnAddress1, uint32_t OwnAddrSize)
857__STATIC_INLINE
void LL_I2C_EnableOwnAddress1(
I2C_TypeDef *I2Cx)
868__STATIC_INLINE
void LL_I2C_DisableOwnAddress1(
I2C_TypeDef *I2Cx)
879__STATIC_INLINE uint32_t LL_I2C_IsEnabledOwnAddress1(
const I2C_TypeDef *I2Cx)
902__STATIC_INLINE
void LL_I2C_SetOwnAddress2(
I2C_TypeDef *I2Cx, uint32_t OwnAddress2, uint32_t OwnAddrMask)
913__STATIC_INLINE
void LL_I2C_EnableOwnAddress2(
I2C_TypeDef *I2Cx)
924__STATIC_INLINE
void LL_I2C_DisableOwnAddress2(
I2C_TypeDef *I2Cx)
935__STATIC_INLINE uint32_t LL_I2C_IsEnabledOwnAddress2(
const I2C_TypeDef *I2Cx)
949__STATIC_INLINE
void LL_I2C_SetTiming(
I2C_TypeDef *I2Cx, uint32_t Timing)
951 WRITE_REG(I2Cx->
TIMINGR, Timing);
960__STATIC_INLINE uint32_t LL_I2C_GetTimingPrescaler(
const I2C_TypeDef *I2Cx)
971__STATIC_INLINE uint32_t LL_I2C_GetClockLowPeriod(
const I2C_TypeDef *I2Cx)
982__STATIC_INLINE uint32_t LL_I2C_GetClockHighPeriod(
const I2C_TypeDef *I2Cx)
993__STATIC_INLINE uint32_t LL_I2C_GetDataHoldTime(
const I2C_TypeDef *I2Cx)
1004__STATIC_INLINE uint32_t LL_I2C_GetDataSetupTime(
const I2C_TypeDef *I2Cx)
1023__STATIC_INLINE
void LL_I2C_SetMode(
I2C_TypeDef *I2Cx, uint32_t PeripheralMode)
1041__STATIC_INLINE uint32_t LL_I2C_GetMode(
const I2C_TypeDef *I2Cx)
1059__STATIC_INLINE
void LL_I2C_EnableSMBusAlert(
I2C_TypeDef *I2Cx)
1077__STATIC_INLINE
void LL_I2C_DisableSMBusAlert(
I2C_TypeDef *I2Cx)
1090__STATIC_INLINE uint32_t LL_I2C_IsEnabledSMBusAlert(
const I2C_TypeDef *I2Cx)
1103__STATIC_INLINE
void LL_I2C_EnableSMBusPEC(
I2C_TypeDef *I2Cx)
1116__STATIC_INLINE
void LL_I2C_DisableSMBusPEC(
I2C_TypeDef *I2Cx)
1129__STATIC_INLINE uint32_t LL_I2C_IsEnabledSMBusPEC(
const I2C_TypeDef *I2Cx)
1150__STATIC_INLINE
void LL_I2C_ConfigSMBusTimeout(
I2C_TypeDef *I2Cx, uint32_t TimeoutA, uint32_t TimeoutAMode,
1154 TimeoutA | TimeoutAMode | (TimeoutB << I2C_TIMEOUTR_TIMEOUTB_Pos));
1167__STATIC_INLINE
void LL_I2C_SetSMBusTimeoutA(
I2C_TypeDef *I2Cx, uint32_t TimeoutA)
1169 WRITE_REG(I2Cx->
TIMEOUTR, TimeoutA);
1180__STATIC_INLINE uint32_t LL_I2C_GetSMBusTimeoutA(
const I2C_TypeDef *I2Cx)
1197__STATIC_INLINE
void LL_I2C_SetSMBusTimeoutAMode(
I2C_TypeDef *I2Cx, uint32_t TimeoutAMode)
1199 WRITE_REG(I2Cx->
TIMEOUTR, TimeoutAMode);
1212__STATIC_INLINE uint32_t LL_I2C_GetSMBusTimeoutAMode(
const I2C_TypeDef *I2Cx)
1227__STATIC_INLINE
void LL_I2C_SetSMBusTimeoutB(
I2C_TypeDef *I2Cx, uint32_t TimeoutB)
1229 WRITE_REG(I2Cx->
TIMEOUTR, TimeoutB << I2C_TIMEOUTR_TIMEOUTB_Pos);
1240__STATIC_INLINE uint32_t LL_I2C_GetSMBusTimeoutB(
const I2C_TypeDef *I2Cx)
1258__STATIC_INLINE
void LL_I2C_EnableSMBusTimeout(
I2C_TypeDef *I2Cx, uint32_t ClockTimeout)
1260 SET_BIT(I2Cx->
TIMEOUTR, ClockTimeout);
1276__STATIC_INLINE
void LL_I2C_DisableSMBusTimeout(
I2C_TypeDef *I2Cx, uint32_t ClockTimeout)
1278 CLEAR_BIT(I2Cx->
TIMEOUTR, ClockTimeout);
1294__STATIC_INLINE uint32_t LL_I2C_IsEnabledSMBusTimeout(
const I2C_TypeDef *I2Cx, uint32_t ClockTimeout)
1297 (ClockTimeout)) ? 1UL : 0UL);
1315__STATIC_INLINE
void LL_I2C_EnableIT_TX(
I2C_TypeDef *I2Cx)
1326__STATIC_INLINE
void LL_I2C_DisableIT_TX(
I2C_TypeDef *I2Cx)
1337__STATIC_INLINE uint32_t LL_I2C_IsEnabledIT_TX(
const I2C_TypeDef *I2Cx)
1348__STATIC_INLINE
void LL_I2C_EnableIT_RX(
I2C_TypeDef *I2Cx)
1359__STATIC_INLINE
void LL_I2C_DisableIT_RX(
I2C_TypeDef *I2Cx)
1370__STATIC_INLINE uint32_t LL_I2C_IsEnabledIT_RX(
const I2C_TypeDef *I2Cx)
1381__STATIC_INLINE
void LL_I2C_EnableIT_ADDR(
I2C_TypeDef *I2Cx)
1392__STATIC_INLINE
void LL_I2C_DisableIT_ADDR(
I2C_TypeDef *I2Cx)
1403__STATIC_INLINE uint32_t LL_I2C_IsEnabledIT_ADDR(
const I2C_TypeDef *I2Cx)
1414__STATIC_INLINE
void LL_I2C_EnableIT_NACK(
I2C_TypeDef *I2Cx)
1425__STATIC_INLINE
void LL_I2C_DisableIT_NACK(
I2C_TypeDef *I2Cx)
1436__STATIC_INLINE uint32_t LL_I2C_IsEnabledIT_NACK(
const I2C_TypeDef *I2Cx)
1447__STATIC_INLINE
void LL_I2C_EnableIT_STOP(
I2C_TypeDef *I2Cx)
1458__STATIC_INLINE
void LL_I2C_DisableIT_STOP(
I2C_TypeDef *I2Cx)
1469__STATIC_INLINE uint32_t LL_I2C_IsEnabledIT_STOP(
const I2C_TypeDef *I2Cx)
1483__STATIC_INLINE
void LL_I2C_EnableIT_TC(
I2C_TypeDef *I2Cx)
1497__STATIC_INLINE
void LL_I2C_DisableIT_TC(
I2C_TypeDef *I2Cx)
1508__STATIC_INLINE uint32_t LL_I2C_IsEnabledIT_TC(
const I2C_TypeDef *I2Cx)
1528__STATIC_INLINE
void LL_I2C_EnableIT_ERR(
I2C_TypeDef *I2Cx)
1548__STATIC_INLINE
void LL_I2C_DisableIT_ERR(
I2C_TypeDef *I2Cx)
1559__STATIC_INLINE uint32_t LL_I2C_IsEnabledIT_ERR(
const I2C_TypeDef *I2Cx)
1581__STATIC_INLINE uint32_t LL_I2C_IsActiveFlag_TXE(
const I2C_TypeDef *I2Cx)
1594__STATIC_INLINE uint32_t LL_I2C_IsActiveFlag_TXIS(
const I2C_TypeDef *I2Cx)
1607__STATIC_INLINE uint32_t LL_I2C_IsActiveFlag_RXNE(
const I2C_TypeDef *I2Cx)
1620__STATIC_INLINE uint32_t LL_I2C_IsActiveFlag_ADDR(
const I2C_TypeDef *I2Cx)
1633__STATIC_INLINE uint32_t LL_I2C_IsActiveFlag_NACK(
const I2C_TypeDef *I2Cx)
1646__STATIC_INLINE uint32_t LL_I2C_IsActiveFlag_STOP(
const I2C_TypeDef *I2Cx)
1659__STATIC_INLINE uint32_t LL_I2C_IsActiveFlag_TC(
const I2C_TypeDef *I2Cx)
1672__STATIC_INLINE uint32_t LL_I2C_IsActiveFlag_TCR(
const I2C_TypeDef *I2Cx)
1685__STATIC_INLINE uint32_t LL_I2C_IsActiveFlag_BERR(
const I2C_TypeDef *I2Cx)
1698__STATIC_INLINE uint32_t LL_I2C_IsActiveFlag_ARLO(
const I2C_TypeDef *I2Cx)
1711__STATIC_INLINE uint32_t LL_I2C_IsActiveFlag_OVR(
const I2C_TypeDef *I2Cx)
1726__STATIC_INLINE uint32_t LL_I2C_IsActiveSMBusFlag_PECERR(
const I2C_TypeDef *I2Cx)
1741__STATIC_INLINE uint32_t LL_I2C_IsActiveSMBusFlag_TIMEOUT(
const I2C_TypeDef *I2Cx)
1757__STATIC_INLINE uint32_t LL_I2C_IsActiveSMBusFlag_ALERT(
const I2C_TypeDef *I2Cx)
1770__STATIC_INLINE uint32_t LL_I2C_IsActiveFlag_BUSY(
const I2C_TypeDef *I2Cx)
1781__STATIC_INLINE
void LL_I2C_ClearFlag_ADDR(
I2C_TypeDef *I2Cx)
1792__STATIC_INLINE
void LL_I2C_ClearFlag_NACK(
I2C_TypeDef *I2Cx)
1803__STATIC_INLINE
void LL_I2C_ClearFlag_STOP(
I2C_TypeDef *I2Cx)
1815__STATIC_INLINE
void LL_I2C_ClearFlag_TXE(
I2C_TypeDef *I2Cx)
1826__STATIC_INLINE
void LL_I2C_ClearFlag_BERR(
I2C_TypeDef *I2Cx)
1837__STATIC_INLINE
void LL_I2C_ClearFlag_ARLO(
I2C_TypeDef *I2Cx)
1848__STATIC_INLINE
void LL_I2C_ClearFlag_OVR(
I2C_TypeDef *I2Cx)
1861__STATIC_INLINE
void LL_I2C_ClearSMBusFlag_PECERR(
I2C_TypeDef *I2Cx)
1874__STATIC_INLINE
void LL_I2C_ClearSMBusFlag_TIMEOUT(
I2C_TypeDef *I2Cx)
1887__STATIC_INLINE
void LL_I2C_ClearSMBusFlag_ALERT(
I2C_TypeDef *I2Cx)
1909__STATIC_INLINE
void LL_I2C_EnableAutoEndMode(
I2C_TypeDef *I2Cx)
1921__STATIC_INLINE
void LL_I2C_DisableAutoEndMode(
I2C_TypeDef *I2Cx)
1932__STATIC_INLINE uint32_t LL_I2C_IsEnabledAutoEndMode(
const I2C_TypeDef *I2Cx)
1944__STATIC_INLINE
void LL_I2C_EnableReloadMode(
I2C_TypeDef *I2Cx)
1956__STATIC_INLINE
void LL_I2C_DisableReloadMode(
I2C_TypeDef *I2Cx)
1967__STATIC_INLINE uint32_t LL_I2C_IsEnabledReloadMode(
const I2C_TypeDef *I2Cx)
1980__STATIC_INLINE
void LL_I2C_SetTransferSize(
I2C_TypeDef *I2Cx, uint32_t TransferSize)
1991__STATIC_INLINE uint32_t LL_I2C_GetTransferSize(
const I2C_TypeDef *I2Cx)
2007__STATIC_INLINE
void LL_I2C_AcknowledgeNextData(
I2C_TypeDef *I2Cx, uint32_t TypeAcknowledge)
2020__STATIC_INLINE
void LL_I2C_GenerateStartCondition(
I2C_TypeDef *I2Cx)
2031__STATIC_INLINE
void LL_I2C_GenerateStopCondition(
I2C_TypeDef *I2Cx)
2045__STATIC_INLINE
void LL_I2C_EnableAuto10BitRead(
I2C_TypeDef *I2Cx)
2057__STATIC_INLINE
void LL_I2C_DisableAuto10BitRead(
I2C_TypeDef *I2Cx)
2068__STATIC_INLINE uint32_t LL_I2C_IsEnabledAuto10BitRead(
const I2C_TypeDef *I2Cx)
2083__STATIC_INLINE
void LL_I2C_SetTransferRequest(
I2C_TypeDef *I2Cx, uint32_t TransferRequest)
2096__STATIC_INLINE uint32_t LL_I2C_GetTransferRequest(
const I2C_TypeDef *I2Cx)
2109__STATIC_INLINE
void LL_I2C_SetSlaveAddr(
I2C_TypeDef *I2Cx, uint32_t SlaveAddr)
2120__STATIC_INLINE uint32_t LL_I2C_GetSlaveAddr(
const I2C_TypeDef *I2Cx)
2163__STATIC_INLINE
void LL_I2C_HandleTransfer(
I2C_TypeDef *I2Cx, uint32_t SlaveAddr, uint32_t SlaveAddrSize,
2164 uint32_t TransferSize, uint32_t EndMode, uint32_t Request)
2167 (
I2C_CR2_RD_WRN & (uint32_t)(Request >> (31U - I2C_CR2_RD_WRN_Pos))) |
2170 SlaveAddr | SlaveAddrSize | (TransferSize << I2C_CR2_NBYTES_Pos) | EndMode | Request);
2183__STATIC_INLINE uint32_t LL_I2C_GetTransferDirection(
const I2C_TypeDef *I2Cx)
2194__STATIC_INLINE uint32_t LL_I2C_GetAddressMatchCode(
const I2C_TypeDef *I2Cx)
2211__STATIC_INLINE
void LL_I2C_EnableSMBusPECCompare(
I2C_TypeDef *I2Cx)
2224__STATIC_INLINE uint32_t LL_I2C_IsEnabledSMBusPECCompare(
const I2C_TypeDef *I2Cx)
2237__STATIC_INLINE uint32_t LL_I2C_GetSMBusPEC(
const I2C_TypeDef *I2Cx)
2248__STATIC_INLINE uint8_t LL_I2C_ReceiveData8(
const I2C_TypeDef *I2Cx)
2260__STATIC_INLINE
void LL_I2C_TransmitData8(
I2C_TypeDef *I2Cx, uint8_t Data)
2262 WRITE_REG(I2Cx->
TXDR, Data);
2269#if defined(USE_FULL_LL_DRIVER) || defined(__rtems__)
2275ErrorStatus LL_I2C_Init(
I2C_TypeDef *I2Cx, LL_I2C_InitTypeDef *I2C_InitStruct);
2277void LL_I2C_StructInit(LL_I2C_InitTypeDef *I2C_InitStruct);
#define I2C_ISR_RXNE
Definition: stm32h723xx.h:13128
#define I2C_ISR_ADDR
Definition: stm32h723xx.h:13131
#define I2C_ISR_BERR
Definition: stm32h723xx.h:13146
#define I2C_ISR_BUSY
Definition: stm32h723xx.h:13164
#define I2C_CR1_NOSTRETCH
Definition: stm32h723xx.h:12986
#define I2C_CR2_SADD
Definition: stm32h723xx.h:13009
#define I2C_ICR_ARLOCF
Definition: stm32h723xx.h:13187
#define I2C_CR1_TXDMAEN
Definition: stm32h723xx.h:12977
#define I2C_ISR_TXE
Definition: stm32h723xx.h:13122
#define I2C_TIMINGR_SCLH
Definition: stm32h723xx.h:13091
#define I2C_CR1_STOPIE
Definition: stm32h723xx.h:12962
#define I2C_CR1_ALERTEN
Definition: stm32h723xx.h:13001
#define I2C_CR2_RELOAD
Definition: stm32h723xx.h:13033
#define I2C_CR2_NBYTES
Definition: stm32h723xx.h:13030
#define I2C_ISR_STOPF
Definition: stm32h723xx.h:13137
#define I2C_CR2_RD_WRN
Definition: stm32h723xx.h:13012
#define I2C_CR1_ADDRIE
Definition: stm32h723xx.h:12956
#define I2C_OAR2_OA2MSK
Definition: stm32h723xx.h:13058
#define I2C_CR2_HEAD10R
Definition: stm32h723xx.h:13018
#define I2C_CR2_STOP
Definition: stm32h723xx.h:13024
#define I2C_CR1_PECEN
Definition: stm32h723xx.h:13004
#define I2C_TIMINGR_SDADEL
Definition: stm32h723xx.h:13094
#define I2C_OAR2_OA2
Definition: stm32h723xx.h:13055
#define I2C_TIMEOUTR_TIMOUTEN
Definition: stm32h723xx.h:13111
#define I2C_CR1_ANFOFF
Definition: stm32h723xx.h:12974
#define I2C_ISR_ALERT
Definition: stm32h723xx.h:13161
#define I2C_CR2_ADD10
Definition: stm32h723xx.h:13015
#define I2C_RXDR_RXDATA
Definition: stm32h723xx.h:13209
#define I2C_ISR_ARLO
Definition: stm32h723xx.h:13149
#define I2C_CR2_START
Definition: stm32h723xx.h:13021
#define I2C_ICR_OVRCF
Definition: stm32h723xx.h:13190
#define I2C_TIMEOUTR_TIMEOUTB
Definition: stm32h723xx.h:13114
#define I2C_OAR1_OA1MODE
Definition: stm32h723xx.h:13047
#define I2C_ISR_TIMEOUT
Definition: stm32h723xx.h:13158
#define I2C_CR1_SMBDEN
Definition: stm32h723xx.h:12998
#define I2C_CR2_PECBYTE
Definition: stm32h723xx.h:13039
#define I2C_CR1_TCIE
Definition: stm32h723xx.h:12965
#define I2C_CR1_WUPEN
Definition: stm32h723xx.h:12989
#define I2C_CR1_ERRIE
Definition: stm32h723xx.h:12968
#define I2C_ISR_TCR
Definition: stm32h723xx.h:13143
#define I2C_ICR_PECCF
Definition: stm32h723xx.h:13193
#define I2C_CR1_RXDMAEN
Definition: stm32h723xx.h:12980
#define I2C_ISR_PECERR
Definition: stm32h723xx.h:13155
#define I2C_CR2_NACK
Definition: stm32h723xx.h:13027
#define I2C_CR1_TXIE
Definition: stm32h723xx.h:12950
#define I2C_ISR_ADDCODE
Definition: stm32h723xx.h:13170
#define I2C_TIMINGR_SCLDEL
Definition: stm32h723xx.h:13097
#define I2C_CR1_PE
Definition: stm32h723xx.h:12947
#define I2C_TIMEOUTR_TEXTEN
Definition: stm32h723xx.h:13117
#define I2C_CR1_SBC
Definition: stm32h723xx.h:12983
#define I2C_ICR_BERRCF
Definition: stm32h723xx.h:13184
#define I2C_ICR_TIMOUTCF
Definition: stm32h723xx.h:13196
#define I2C_ISR_DIR
Definition: stm32h723xx.h:13167
#define I2C_OAR2_OA2EN
Definition: stm32h723xx.h:13083
#define I2C_ISR_TXIS
Definition: stm32h723xx.h:13125
#define I2C_TIMEOUTR_TIDLE
Definition: stm32h723xx.h:13108
#define I2C_OAR1_OA1EN
Definition: stm32h723xx.h:13050
#define I2C_ICR_NACKCF
Definition: stm32h723xx.h:13178
#define I2C_OAR1_OA1
Definition: stm32h723xx.h:13044
#define I2C_CR2_AUTOEND
Definition: stm32h723xx.h:13036
#define I2C_ICR_STOPCF
Definition: stm32h723xx.h:13181
#define I2C_CR1_GCEN
Definition: stm32h723xx.h:12992
#define I2C_PECR_PEC
Definition: stm32h723xx.h:13204
#define I2C_ICR_ADDRCF
Definition: stm32h723xx.h:13175
#define I2C_ISR_TC
Definition: stm32h723xx.h:13140
#define I2C_TIMEOUTR_TIMEOUTA
Definition: stm32h723xx.h:13105
#define I2C_CR1_SMBHEN
Definition: stm32h723xx.h:12995
#define I2C_TIMINGR_SCLL
Definition: stm32h723xx.h:13088
#define I2C_ISR_NACKF
Definition: stm32h723xx.h:13134
#define I2C_CR1_DNF
Definition: stm32h723xx.h:12971
#define I2C_CR1_NACKIE
Definition: stm32h723xx.h:12959
#define I2C_TIMINGR_PRESC
Definition: stm32h723xx.h:13100
#define I2C_ICR_ALERTCF
Definition: stm32h723xx.h:13199
#define I2C_CR1_RXIE
Definition: stm32h723xx.h:12953
#define I2C_ISR_OVR
Definition: stm32h723xx.h:13152
CMSIS STM32H7xx Device Peripheral Access Layer Header File.
Inter-integrated Circuit Interface.
Definition: stm32h723xx.h:1133
__IO uint32_t ISR
Definition: stm32h723xx.h:1140
__IO uint32_t CR2
Definition: stm32h723xx.h:1135
__IO uint32_t RXDR
Definition: stm32h723xx.h:1143
__IO uint32_t PECR
Definition: stm32h723xx.h:1142
__IO uint32_t OAR2
Definition: stm32h723xx.h:1137
__IO uint32_t ICR
Definition: stm32h723xx.h:1141
__IO uint32_t CR1
Definition: stm32h723xx.h:1134
__IO uint32_t TIMINGR
Definition: stm32h723xx.h:1138
__IO uint32_t TIMEOUTR
Definition: stm32h723xx.h:1139
__IO uint32_t TXDR
Definition: stm32h723xx.h:1144
__IO uint32_t OAR1
Definition: stm32h723xx.h:1136