20 #ifndef STM32F4xx_LL_FMPI2C_H
21 #define STM32F4xx_LL_FMPI2C_H
27 #if defined(FMPI2C_CR1_PE)
29 #include "stm32f4xx.h"
53 #if defined(USE_FULL_LL_DRIVER)
63 #if defined(USE_FULL_LL_DRIVER)
127 #define LL_FMPI2C_ICR_ADDRCF FMPI2C_ICR_ADDRCF
128 #define LL_FMPI2C_ICR_NACKCF FMPI2C_ICR_NACKCF
129 #define LL_FMPI2C_ICR_STOPCF FMPI2C_ICR_STOPCF
130 #define LL_FMPI2C_ICR_BERRCF FMPI2C_ICR_BERRCF
131 #define LL_FMPI2C_ICR_ARLOCF FMPI2C_ICR_ARLOCF
132 #define LL_FMPI2C_ICR_OVRCF FMPI2C_ICR_OVRCF
133 #define LL_FMPI2C_ICR_PECCF FMPI2C_ICR_PECCF
134 #define LL_FMPI2C_ICR_TIMOUTCF FMPI2C_ICR_TIMOUTCF
135 #define LL_FMPI2C_ICR_ALERTCF FMPI2C_ICR_ALERTCF
144 #define LL_FMPI2C_ISR_TXE FMPI2C_ISR_TXE
145 #define LL_FMPI2C_ISR_TXIS FMPI2C_ISR_TXIS
146 #define LL_FMPI2C_ISR_RXNE FMPI2C_ISR_RXNE
147 #define LL_FMPI2C_ISR_ADDR FMPI2C_ISR_ADDR
148 #define LL_FMPI2C_ISR_NACKF FMPI2C_ISR_NACKF
149 #define LL_FMPI2C_ISR_STOPF FMPI2C_ISR_STOPF
150 #define LL_FMPI2C_ISR_TC FMPI2C_ISR_TC
151 #define LL_FMPI2C_ISR_TCR FMPI2C_ISR_TCR
152 #define LL_FMPI2C_ISR_BERR FMPI2C_ISR_BERR
153 #define LL_FMPI2C_ISR_ARLO FMPI2C_ISR_ARLO
154 #define LL_FMPI2C_ISR_OVR FMPI2C_ISR_OVR
155 #define LL_FMPI2C_ISR_PECERR FMPI2C_ISR_PECERR
156 #define LL_FMPI2C_ISR_TIMEOUT FMPI2C_ISR_TIMEOUT
157 #define LL_FMPI2C_ISR_ALERT FMPI2C_ISR_ALERT
158 #define LL_FMPI2C_ISR_BUSY FMPI2C_ISR_BUSY
167 #define LL_FMPI2C_CR1_TXIE FMPI2C_CR1_TXIE
168 #define LL_FMPI2C_CR1_RXIE FMPI2C_CR1_RXIE
169 #define LL_FMPI2C_CR1_ADDRIE FMPI2C_CR1_ADDRIE
170 #define LL_FMPI2C_CR1_NACKIE FMPI2C_CR1_NACKIE
171 #define LL_FMPI2C_CR1_STOPIE FMPI2C_CR1_STOPIE
172 #define LL_FMPI2C_CR1_TCIE FMPI2C_CR1_TCIE
173 #define LL_FMPI2C_CR1_ERRIE FMPI2C_CR1_ERRIE
181 #define LL_FMPI2C_MODE_I2C 0x00000000U
182 #define LL_FMPI2C_MODE_SMBUS_HOST FMPI2C_CR1_SMBHEN
183 #define LL_FMPI2C_MODE_SMBUS_DEVICE 0x00000000U
185 #define LL_FMPI2C_MODE_SMBUS_DEVICE_ARP FMPI2C_CR1_SMBDEN
193 #define LL_FMPI2C_ANALOGFILTER_ENABLE 0x00000000U
194 #define LL_FMPI2C_ANALOGFILTER_DISABLE FMPI2C_CR1_ANFOFF
202 #define LL_FMPI2C_ADDRESSING_MODE_7BIT 0x00000000U
203 #define LL_FMPI2C_ADDRESSING_MODE_10BIT FMPI2C_CR2_ADD10
211 #define LL_FMPI2C_OWNADDRESS1_7BIT 0x00000000U
212 #define LL_FMPI2C_OWNADDRESS1_10BIT FMPI2C_OAR1_OA1MODE
220 #define LL_FMPI2C_OWNADDRESS2_NOMASK FMPI2C_OAR2_OA2NOMASK
221 #define LL_FMPI2C_OWNADDRESS2_MASK01 FMPI2C_OAR2_OA2MASK01
222 #define LL_FMPI2C_OWNADDRESS2_MASK02 FMPI2C_OAR2_OA2MASK02
223 #define LL_FMPI2C_OWNADDRESS2_MASK03 FMPI2C_OAR2_OA2MASK03
224 #define LL_FMPI2C_OWNADDRESS2_MASK04 FMPI2C_OAR2_OA2MASK04
225 #define LL_FMPI2C_OWNADDRESS2_MASK05 FMPI2C_OAR2_OA2MASK05
226 #define LL_FMPI2C_OWNADDRESS2_MASK06 FMPI2C_OAR2_OA2MASK06
227 #define LL_FMPI2C_OWNADDRESS2_MASK07 FMPI2C_OAR2_OA2MASK07
236 #define LL_FMPI2C_ACK 0x00000000U
237 #define LL_FMPI2C_NACK FMPI2C_CR2_NACK
245 #define LL_FMPI2C_ADDRSLAVE_7BIT 0x00000000U
246 #define LL_FMPI2C_ADDRSLAVE_10BIT FMPI2C_CR2_ADD10
254 #define LL_FMPI2C_REQUEST_WRITE 0x00000000U
255 #define LL_FMPI2C_REQUEST_READ FMPI2C_CR2_RD_WRN
263 #define LL_FMPI2C_MODE_RELOAD FMPI2C_CR2_RELOAD
264 #define LL_FMPI2C_MODE_AUTOEND FMPI2C_CR2_AUTOEND
266 #define LL_FMPI2C_MODE_SOFTEND 0x00000000U
268 #define LL_FMPI2C_MODE_SMBUS_RELOAD LL_FMPI2C_MODE_RELOAD
270 #define LL_FMPI2C_MODE_SMBUS_AUTOEND_NO_PEC LL_FMPI2C_MODE_AUTOEND
272 #define LL_FMPI2C_MODE_SMBUS_SOFTEND_NO_PEC LL_FMPI2C_MODE_SOFTEND
274 #define LL_FMPI2C_MODE_SMBUS_AUTOEND_WITH_PEC (uint32_t)(LL_FMPI2C_MODE_AUTOEND | FMPI2C_CR2_PECBYTE)
276 #define LL_FMPI2C_MODE_SMBUS_SOFTEND_WITH_PEC (uint32_t)(LL_FMPI2C_MODE_SOFTEND | FMPI2C_CR2_PECBYTE)
285 #define LL_FMPI2C_GENERATE_NOSTARTSTOP 0x00000000U
287 #define LL_FMPI2C_GENERATE_STOP (uint32_t)(0x80000000U | FMPI2C_CR2_STOP)
289 #define LL_FMPI2C_GENERATE_START_READ (uint32_t)(0x80000000U | FMPI2C_CR2_START | FMPI2C_CR2_RD_WRN)
291 #define LL_FMPI2C_GENERATE_START_WRITE (uint32_t)(0x80000000U | FMPI2C_CR2_START)
293 #define LL_FMPI2C_GENERATE_RESTART_7BIT_READ (uint32_t)(0x80000000U | FMPI2C_CR2_START | FMPI2C_CR2_RD_WRN)
295 #define LL_FMPI2C_GENERATE_RESTART_7BIT_WRITE (uint32_t)(0x80000000U | FMPI2C_CR2_START)
297 #define LL_FMPI2C_GENERATE_RESTART_10BIT_READ (uint32_t)(0x80000000U | FMPI2C_CR2_START | \
298 FMPI2C_CR2_RD_WRN | FMPI2C_CR2_HEAD10R)
300 #define LL_FMPI2C_GENERATE_RESTART_10BIT_WRITE (uint32_t)(0x80000000U | FMPI2C_CR2_START)
309 #define LL_FMPI2C_DIRECTION_WRITE 0x00000000U
311 #define LL_FMPI2C_DIRECTION_READ FMPI2C_ISR_DIR
320 #define LL_FMPI2C_DMA_REG_DATA_TRANSMIT 0x00000000U
322 #define LL_FMPI2C_DMA_REG_DATA_RECEIVE 0x00000001U
331 #define LL_FMPI2C_FMPSMBUS_TIMEOUTA_MODE_SCL_LOW 0x00000000U
333 #define LL_FMPI2C_FMPSMBUS_TIMEOUTA_MODE_SDA_SCL_HIGH FMPI2C_TIMEOUTR_TIDLE
342 #define LL_FMPI2C_FMPSMBUS_TIMEOUTA FMPI2C_TIMEOUTR_TIMOUTEN
343 #define LL_FMPI2C_FMPSMBUS_TIMEOUTB FMPI2C_TIMEOUTR_TEXTEN
345 #define LL_FMPI2C_FMPSMBUS_ALL_TIMEOUT (uint32_t)(FMPI2C_TIMEOUTR_TIMOUTEN | \
346 FMPI2C_TIMEOUTR_TEXTEN)
372 #define LL_FMPI2C_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
380 #define LL_FMPI2C_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
401 #define __LL_FMPI2C_CONVERT_TIMINGS(__PRESCALER__, __SETUP_TIME__, __HOLD_TIME__, __SCLH_PERIOD__, __SCLL_PERIOD__) \
402 ((((uint32_t)(__PRESCALER__) << FMPI2C_TIMINGR_PRESC_Pos) & FMPI2C_TIMINGR_PRESC) | \
403 (((uint32_t)(__SETUP_TIME__) << FMPI2C_TIMINGR_SCLDEL_Pos) & FMPI2C_TIMINGR_SCLDEL) | \
404 (((uint32_t)(__HOLD_TIME__) << FMPI2C_TIMINGR_SDADEL_Pos) & FMPI2C_TIMINGR_SDADEL) | \
405 (((uint32_t)(__SCLH_PERIOD__) << FMPI2C_TIMINGR_SCLH_Pos) & FMPI2C_TIMINGR_SCLH) | \
406 (((uint32_t)(__SCLL_PERIOD__) << FMPI2C_TIMINGR_SCLL_Pos) & FMPI2C_TIMINGR_SCLL))
432 SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_PE);
446 CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_PE);
457 return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_PE) == (FMPI2C_CR1_PE)) ? 1UL : 0UL);
478 MODIFY_REG(FMPI2Cx->CR1, FMPI2C_CR1_ANFOFF | FMPI2C_CR1_DNF, AnalogFilter | (DigitalFilter << FMPI2C_CR1_DNF_Pos));
495 MODIFY_REG(FMPI2Cx->CR1, FMPI2C_CR1_DNF, DigitalFilter << FMPI2C_CR1_DNF_Pos);
506 return (uint32_t)(READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_DNF) >> FMPI2C_CR1_DNF_Pos);
518 CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ANFOFF);
530 SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ANFOFF);
541 return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ANFOFF) != (FMPI2C_CR1_ANFOFF)) ? 1UL : 0UL);
552 SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TXDMAEN);
563 CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TXDMAEN);
574 return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TXDMAEN) == (FMPI2C_CR1_TXDMAEN)) ? 1UL : 0UL);
585 SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_RXDMAEN);
596 CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_RXDMAEN);
607 return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_RXDMAEN) == (FMPI2C_CR1_RXDMAEN)) ? 1UL : 0UL);
622 uint32_t data_reg_addr;
624 if (Direction == LL_FMPI2C_DMA_REG_DATA_TRANSMIT)
627 data_reg_addr = (uint32_t) &(FMPI2Cx->TXDR);
632 data_reg_addr = (uint32_t) &(FMPI2Cx->RXDR);
635 return data_reg_addr;
647 CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_NOSTRETCH);
659 SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_NOSTRETCH);
670 return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_NOSTRETCH) != (FMPI2C_CR1_NOSTRETCH)) ? 1UL : 0UL);
681 SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_SBC);
692 CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_SBC);
703 return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_SBC) == (FMPI2C_CR1_SBC)) ? 1UL : 0UL);
715 SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_GCEN);
727 CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_GCEN);
738 return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_GCEN) == (FMPI2C_CR1_GCEN)) ? 1UL : 0UL);
753 MODIFY_REG(FMPI2Cx->CR2, FMPI2C_CR2_ADD10, AddressingMode);
766 return (uint32_t)(READ_BIT(FMPI2Cx->CR2, FMPI2C_CR2_ADD10));
782 MODIFY_REG(FMPI2Cx->OAR1, FMPI2C_OAR1_OA1 | FMPI2C_OAR1_OA1MODE, OwnAddress1 | OwnAddrSize);
793 SET_BIT(FMPI2Cx->OAR1, FMPI2C_OAR1_OA1EN);
804 CLEAR_BIT(FMPI2Cx->OAR1, FMPI2C_OAR1_OA1EN);
815 return ((READ_BIT(FMPI2Cx->OAR1, FMPI2C_OAR1_OA1EN) == (FMPI2C_OAR1_OA1EN)) ? 1UL : 0UL);
838 MODIFY_REG(FMPI2Cx->OAR2, FMPI2C_OAR2_OA2 | FMPI2C_OAR2_OA2MSK, OwnAddress2 | OwnAddrMask);
849 SET_BIT(FMPI2Cx->OAR2, FMPI2C_OAR2_OA2EN);
860 CLEAR_BIT(FMPI2Cx->OAR2, FMPI2C_OAR2_OA2EN);
871 return ((READ_BIT(FMPI2Cx->OAR2, FMPI2C_OAR2_OA2EN) == (FMPI2C_OAR2_OA2EN)) ? 1UL : 0UL);
885 WRITE_REG(FMPI2Cx->TIMINGR, Timing);
896 return (uint32_t)(READ_BIT(FMPI2Cx->TIMINGR, FMPI2C_TIMINGR_PRESC) >> FMPI2C_TIMINGR_PRESC_Pos);
907 return (uint32_t)(READ_BIT(FMPI2Cx->TIMINGR, FMPI2C_TIMINGR_SCLL) >> FMPI2C_TIMINGR_SCLL_Pos);
918 return (uint32_t)(READ_BIT(FMPI2Cx->TIMINGR, FMPI2C_TIMINGR_SCLH) >> FMPI2C_TIMINGR_SCLH_Pos);
929 return (uint32_t)(READ_BIT(FMPI2Cx->TIMINGR, FMPI2C_TIMINGR_SDADEL) >> FMPI2C_TIMINGR_SDADEL_Pos);
940 return (uint32_t)(READ_BIT(FMPI2Cx->TIMINGR, FMPI2C_TIMINGR_SCLDEL) >> FMPI2C_TIMINGR_SCLDEL_Pos);
959 MODIFY_REG(FMPI2Cx->CR1, FMPI2C_CR1_SMBHEN | FMPI2C_CR1_SMBDEN, PeripheralMode);
977 return (uint32_t)(READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_SMBHEN | FMPI2C_CR1_SMBDEN));
995 SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ALERTEN);
1013 CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ALERTEN);
1026 return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ALERTEN) == (FMPI2C_CR1_ALERTEN)) ? 1UL : 0UL);
1039 SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_PECEN);
1052 CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_PECEN);
1065 return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_PECEN) == (FMPI2C_CR1_PECEN)) ? 1UL : 0UL);
1087 MODIFY_REG(FMPI2Cx->TIMEOUTR, FMPI2C_TIMEOUTR_TIMEOUTA | FMPI2C_TIMEOUTR_TIDLE | FMPI2C_TIMEOUTR_TIMEOUTB,
1088 TimeoutA | TimeoutAMode | (TimeoutB << FMPI2C_TIMEOUTR_TIMEOUTB_Pos));
1103 WRITE_REG(FMPI2Cx->TIMEOUTR, TimeoutA);
1116 return (uint32_t)(READ_BIT(FMPI2Cx->TIMEOUTR, FMPI2C_TIMEOUTR_TIMEOUTA));
1133 WRITE_REG(FMPI2Cx->TIMEOUTR, TimeoutAMode);
1148 return (uint32_t)(READ_BIT(FMPI2Cx->TIMEOUTR, FMPI2C_TIMEOUTR_TIDLE));
1163 WRITE_REG(FMPI2Cx->TIMEOUTR, TimeoutB << FMPI2C_TIMEOUTR_TIMEOUTB_Pos);
1176 return (uint32_t)(READ_BIT(FMPI2Cx->TIMEOUTR, FMPI2C_TIMEOUTR_TIMEOUTB) >> FMPI2C_TIMEOUTR_TIMEOUTB_Pos);
1194 SET_BIT(FMPI2Cx->TIMEOUTR, ClockTimeout);
1212 CLEAR_BIT(FMPI2Cx->TIMEOUTR, ClockTimeout);
1230 return ((READ_BIT(FMPI2Cx->TIMEOUTR, (FMPI2C_TIMEOUTR_TIMOUTEN | FMPI2C_TIMEOUTR_TEXTEN)) == \
1231 (ClockTimeout)) ? 1UL : 0UL);
1250 SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TXIE);
1261 CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TXIE);
1272 return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TXIE) == (FMPI2C_CR1_TXIE)) ? 1UL : 0UL);
1283 SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_RXIE);
1294 CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_RXIE);
1305 return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_RXIE) == (FMPI2C_CR1_RXIE)) ? 1UL : 0UL);
1316 SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ADDRIE);
1327 CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ADDRIE);
1338 return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ADDRIE) == (FMPI2C_CR1_ADDRIE)) ? 1UL : 0UL);
1349 SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_NACKIE);
1360 CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_NACKIE);
1371 return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_NACKIE) == (FMPI2C_CR1_NACKIE)) ? 1UL : 0UL);
1382 SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_STOPIE);
1393 CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_STOPIE);
1404 return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_STOPIE) == (FMPI2C_CR1_STOPIE)) ? 1UL : 0UL);
1418 SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TCIE);
1432 CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TCIE);
1443 return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TCIE) == (FMPI2C_CR1_TCIE)) ? 1UL : 0UL);
1463 SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ERRIE);
1483 CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ERRIE);
1494 return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ERRIE) == (FMPI2C_CR1_ERRIE)) ? 1UL : 0UL);
1515 return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_TXE) == (FMPI2C_ISR_TXE)) ? 1UL : 0UL);
1528 return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_TXIS) == (FMPI2C_ISR_TXIS)) ? 1UL : 0UL);
1541 return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_RXNE) == (FMPI2C_ISR_RXNE)) ? 1UL : 0UL);
1554 return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_ADDR) == (FMPI2C_ISR_ADDR)) ? 1UL : 0UL);
1567 return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_NACKF) == (FMPI2C_ISR_NACKF)) ? 1UL : 0UL);
1580 return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_STOPF) == (FMPI2C_ISR_STOPF)) ? 1UL : 0UL);
1593 return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_TC) == (FMPI2C_ISR_TC)) ? 1UL : 0UL);
1606 return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_TCR) == (FMPI2C_ISR_TCR)) ? 1UL : 0UL);
1619 return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_BERR) == (FMPI2C_ISR_BERR)) ? 1UL : 0UL);
1632 return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_ARLO) == (FMPI2C_ISR_ARLO)) ? 1UL : 0UL);
1645 return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_OVR) == (FMPI2C_ISR_OVR)) ? 1UL : 0UL);
1660 return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_PECERR) == (FMPI2C_ISR_PECERR)) ? 1UL : 0UL);
1675 return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_TIMEOUT) == (FMPI2C_ISR_TIMEOUT)) ? 1UL : 0UL);
1691 return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_ALERT) == (FMPI2C_ISR_ALERT)) ? 1UL : 0UL);
1704 return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_BUSY) == (FMPI2C_ISR_BUSY)) ? 1UL : 0UL);
1715 SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_ADDRCF);
1726 SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_NACKCF);
1737 SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_STOPCF);
1749 WRITE_REG(FMPI2Cx->ISR, FMPI2C_ISR_TXE);
1760 SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_BERRCF);
1771 SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_ARLOCF);
1782 SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_OVRCF);
1795 SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_PECCF);
1808 SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_TIMOUTCF);
1821 SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_ALERTCF);
1842 SET_BIT(FMPI2Cx->CR2, FMPI2C_CR2_AUTOEND);
1854 CLEAR_BIT(FMPI2Cx->CR2, FMPI2C_CR2_AUTOEND);
1865 return ((READ_BIT(FMPI2Cx->CR2, FMPI2C_CR2_AUTOEND) == (FMPI2C_CR2_AUTOEND)) ? 1UL : 0UL);
1877 SET_BIT(FMPI2Cx->CR2, FMPI2C_CR2_RELOAD);
1889 CLEAR_BIT(FMPI2Cx->CR2, FMPI2C_CR2_RELOAD);
1900 return ((READ_BIT(FMPI2Cx->CR2, FMPI2C_CR2_RELOAD) == (FMPI2C_CR2_RELOAD)) ? 1UL : 0UL);
1913 MODIFY_REG(FMPI2Cx->CR2, FMPI2C_CR2_NBYTES, TransferSize << FMPI2C_CR2_NBYTES_Pos);
1924 return (uint32_t)(READ_BIT(FMPI2Cx->CR2, FMPI2C_CR2_NBYTES) >> FMPI2C_CR2_NBYTES_Pos);
1940 MODIFY_REG(FMPI2Cx->CR2, FMPI2C_CR2_NACK, TypeAcknowledge);
1953 SET_BIT(FMPI2Cx->CR2, FMPI2C_CR2_START);
1964 SET_BIT(FMPI2Cx->CR2, FMPI2C_CR2_STOP);
1978 CLEAR_BIT(FMPI2Cx->CR2, FMPI2C_CR2_HEAD10R);
1990 SET_BIT(FMPI2Cx->CR2, FMPI2C_CR2_HEAD10R);
2001 return ((READ_BIT(FMPI2Cx->CR2, FMPI2C_CR2_HEAD10R) != (FMPI2C_CR2_HEAD10R)) ? 1UL : 0UL);
2016 MODIFY_REG(FMPI2Cx->CR2, FMPI2C_CR2_RD_WRN, TransferRequest);
2029 return (uint32_t)(READ_BIT(FMPI2Cx->CR2, FMPI2C_CR2_RD_WRN));
2042 MODIFY_REG(FMPI2Cx->CR2, FMPI2C_CR2_SADD, SlaveAddr);
2053 return (uint32_t)(READ_BIT(FMPI2Cx->CR2, FMPI2C_CR2_SADD));
2095 uint32_t TransferSize, uint32_t EndMode, uint32_t Request)
2098 uint32_t tmp = ((uint32_t)(((uint32_t)SlaveAddr & FMPI2C_CR2_SADD) | \
2099 ((uint32_t)SlaveAddrSize & FMPI2C_CR2_ADD10) | \
2100 (((uint32_t)TransferSize << FMPI2C_CR2_NBYTES_Pos) & FMPI2C_CR2_NBYTES) | \
2101 (uint32_t)EndMode | (uint32_t)Request) & (~0x80000000U));
2104 MODIFY_REG(FMPI2Cx->CR2, FMPI2C_CR2_SADD | FMPI2C_CR2_ADD10 |
2105 (FMPI2C_CR2_RD_WRN & (uint32_t)(Request >> (31U - FMPI2C_CR2_RD_WRN_Pos))) |
2106 FMPI2C_CR2_START | FMPI2C_CR2_STOP | FMPI2C_CR2_RELOAD |
2107 FMPI2C_CR2_NBYTES | FMPI2C_CR2_AUTOEND | FMPI2C_CR2_HEAD10R,
2123 return (uint32_t)(READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_DIR));
2134 return (uint32_t)(READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_ADDCODE) >> FMPI2C_ISR_ADDCODE_Pos << 1);
2151 SET_BIT(FMPI2Cx->CR2, FMPI2C_CR2_PECBYTE);
2164 return ((READ_BIT(FMPI2Cx->CR2, FMPI2C_CR2_PECBYTE) == (FMPI2C_CR2_PECBYTE)) ? 1UL : 0UL);
2177 return (uint32_t)(READ_BIT(FMPI2Cx->PECR, FMPI2C_PECR_PEC));
2188 return (uint8_t)(READ_BIT(FMPI2Cx->RXDR, FMPI2C_RXDR_RXDATA));
2200 WRITE_REG(FMPI2Cx->TXDR, Data);
2207 #if defined(USE_FULL_LL_DRIVER)
__STATIC_INLINE void LL_FMPI2C_SetSMBusTimeoutAMode(FMPI2C_TypeDef *FMPI2Cx, uint32_t TimeoutAMode)
Set the SMBus Clock TimeoutA mode.
__STATIC_INLINE uint32_t LL_FMPI2C_GetDataSetupTime(const FMPI2C_TypeDef *FMPI2Cx)
Get the SDA setup time. @rmtoll TIMINGR SCLDEL LL_FMPI2C_GetDataSetupTime.
__STATIC_INLINE uint32_t LL_FMPI2C_GetSMBusTimeoutA(const FMPI2C_TypeDef *FMPI2Cx)
Get the SMBus Clock TimeoutA setting.
__STATIC_INLINE void LL_FMPI2C_Disable(FMPI2C_TypeDef *FMPI2Cx)
Disable FMPI2C peripheral (PE = 0).
__STATIC_INLINE void LL_FMPI2C_DisableGeneralCall(FMPI2C_TypeDef *FMPI2Cx)
Disable General Call.
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledDMAReq_TX(const FMPI2C_TypeDef *FMPI2Cx)
Check if DMA transmission requests are enabled or disabled. @rmtoll CR1 TXDMAEN LL_FMPI2C_IsEnabledDM...
__STATIC_INLINE uint32_t LL_FMPI2C_GetSMBusTimeoutB(const FMPI2C_TypeDef *FMPI2Cx)
Get the SMBus Extended Cumulative Clock TimeoutB setting.
__STATIC_INLINE void LL_FMPI2C_EnableGeneralCall(FMPI2C_TypeDef *FMPI2Cx)
Enable General Call.
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledSMBusAlert(const FMPI2C_TypeDef *FMPI2Cx)
Check if SMBus alert (Host or Device mode) is enabled or disabled.
__STATIC_INLINE uint32_t LL_FMPI2C_GetMasterAddressingMode(const FMPI2C_TypeDef *FMPI2Cx)
Get the Master addressing mode. @rmtoll CR2 ADD10 LL_FMPI2C_GetMasterAddressingMode.
__STATIC_INLINE void LL_FMPI2C_DisableAnalogFilter(FMPI2C_TypeDef *FMPI2Cx)
Disable Analog Noise Filter.
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledClockStretching(const FMPI2C_TypeDef *FMPI2Cx)
Check if Clock stretching is enabled or disabled. @rmtoll CR1 NOSTRETCH LL_FMPI2C_IsEnabledClockStret...
__STATIC_INLINE void LL_FMPI2C_EnableOwnAddress1(FMPI2C_TypeDef *FMPI2Cx)
Enable acknowledge on Own Address1 match address. @rmtoll OAR1 OA1EN LL_FMPI2C_EnableOwnAddress1.
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledOwnAddress2(const FMPI2C_TypeDef *FMPI2Cx)
Check if Own Address1 acknowledge is enabled or disabled. @rmtoll OAR2 OA2EN LL_FMPI2C_IsEnabledOwnAd...
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledOwnAddress1(const FMPI2C_TypeDef *FMPI2Cx)
Check if Own Address1 acknowledge is enabled or disabled. @rmtoll OAR1 OA1EN LL_FMPI2C_IsEnabledOwnAd...
__STATIC_INLINE void LL_FMPI2C_ConfigFilters(FMPI2C_TypeDef *FMPI2Cx, uint32_t AnalogFilter, uint32_t DigitalFilter)
Configure Noise Filters (Analog and Digital).
__STATIC_INLINE void LL_FMPI2C_DisableSMBusPEC(FMPI2C_TypeDef *FMPI2Cx)
Disable SMBus Packet Error Calculation (PEC).
__STATIC_INLINE uint32_t LL_FMPI2C_GetSMBusTimeoutAMode(const FMPI2C_TypeDef *FMPI2Cx)
Get the SMBus Clock TimeoutA mode.
__STATIC_INLINE void LL_FMPI2C_DisableOwnAddress1(FMPI2C_TypeDef *FMPI2Cx)
Disable acknowledge on Own Address1 match address. @rmtoll OAR1 OA1EN LL_FMPI2C_DisableOwnAddress1.
__STATIC_INLINE void LL_FMPI2C_DisableOwnAddress2(FMPI2C_TypeDef *FMPI2Cx)
Disable acknowledge on Own Address2 match address. @rmtoll OAR2 OA2EN LL_FMPI2C_DisableOwnAddress2.
__STATIC_INLINE void LL_FMPI2C_EnableSMBusTimeout(FMPI2C_TypeDef *FMPI2Cx, uint32_t ClockTimeout)
Enable the SMBus Clock Timeout.
__STATIC_INLINE uint32_t LL_FMPI2C_GetClockHighPeriod(const FMPI2C_TypeDef *FMPI2Cx)
Get the SCL high period setting. @rmtoll TIMINGR SCLH LL_FMPI2C_GetClockHighPeriod.
__STATIC_INLINE void LL_FMPI2C_EnableOwnAddress2(FMPI2C_TypeDef *FMPI2Cx)
Enable acknowledge on Own Address2 match address. @rmtoll OAR2 OA2EN LL_FMPI2C_EnableOwnAddress2.
__STATIC_INLINE void LL_FMPI2C_EnableSMBusPEC(FMPI2C_TypeDef *FMPI2Cx)
Enable SMBus Packet Error Calculation (PEC).
__STATIC_INLINE void LL_FMPI2C_SetOwnAddress1(FMPI2C_TypeDef *FMPI2Cx, uint32_t OwnAddress1, uint32_t OwnAddrSize)
Set the Own Address1. @rmtoll OAR1 OA1 LL_FMPI2C_SetOwnAddress1 OAR1 OA1MODE LL_FMPI2C_SetOwnAddress...
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledGeneralCall(const FMPI2C_TypeDef *FMPI2Cx)
Check if General Call is enabled or disabled. @rmtoll CR1 GCEN LL_FMPI2C_IsEnabledGeneralCall.
__STATIC_INLINE uint32_t LL_FMPI2C_GetMode(const FMPI2C_TypeDef *FMPI2Cx)
Get peripheral mode.
__STATIC_INLINE uint32_t LL_FMPI2C_GetDataHoldTime(const FMPI2C_TypeDef *FMPI2Cx)
Get the SDA hold time. @rmtoll TIMINGR SDADEL LL_FMPI2C_GetDataHoldTime.
__STATIC_INLINE void LL_FMPI2C_EnableSMBusAlert(FMPI2C_TypeDef *FMPI2Cx)
Enable SMBus alert (Host or Device mode)
__STATIC_INLINE void LL_FMPI2C_SetSMBusTimeoutA(FMPI2C_TypeDef *FMPI2Cx, uint32_t TimeoutA)
Configure the SMBus Clock TimeoutA (SCL low timeout or SCL and SDA high timeout depends on TimeoutA m...
__STATIC_INLINE uint32_t LL_FMPI2C_GetTimingPrescaler(const FMPI2C_TypeDef *FMPI2Cx)
Get the Timing Prescaler setting. @rmtoll TIMINGR PRESC LL_FMPI2C_GetTimingPrescaler.
__STATIC_INLINE void LL_FMPI2C_Enable(FMPI2C_TypeDef *FMPI2Cx)
Enable FMPI2C peripheral (PE = 1). @rmtoll CR1 PE LL_FMPI2C_Enable.
__STATIC_INLINE void LL_FMPI2C_ConfigSMBusTimeout(FMPI2C_TypeDef *FMPI2Cx, uint32_t TimeoutA, uint32_t TimeoutAMode, uint32_t TimeoutB)
Configure the SMBus Clock Timeout.
__STATIC_INLINE void LL_FMPI2C_SetSMBusTimeoutB(FMPI2C_TypeDef *FMPI2Cx, uint32_t TimeoutB)
Configure the SMBus Extended Cumulative Clock TimeoutB (Master or Slave mode).
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledSMBusPEC(const FMPI2C_TypeDef *FMPI2Cx)
Check if SMBus Packet Error Calculation (PEC) is enabled or disabled.
__STATIC_INLINE void LL_FMPI2C_SetMode(FMPI2C_TypeDef *FMPI2Cx, uint32_t PeripheralMode)
Configure peripheral mode.
__STATIC_INLINE void LL_FMPI2C_EnableClockStretching(FMPI2C_TypeDef *FMPI2Cx)
Enable Clock stretching.
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabled(const FMPI2C_TypeDef *FMPI2Cx)
Check if the FMPI2C peripheral is enabled or disabled. @rmtoll CR1 PE LL_FMPI2C_IsEnabled.
__STATIC_INLINE void LL_FMPI2C_EnableAnalogFilter(FMPI2C_TypeDef *FMPI2Cx)
Enable Analog Noise Filter.
__STATIC_INLINE void LL_FMPI2C_DisableSMBusTimeout(FMPI2C_TypeDef *FMPI2Cx, uint32_t ClockTimeout)
Disable the SMBus Clock Timeout.
__STATIC_INLINE void LL_FMPI2C_DisableSlaveByteControl(FMPI2C_TypeDef *FMPI2Cx)
Disable hardware byte control in slave mode. @rmtoll CR1 SBC LL_FMPI2C_DisableSlaveByteControl.
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledSlaveByteControl(const FMPI2C_TypeDef *FMPI2Cx)
Check if hardware byte control in slave mode is enabled or disabled. @rmtoll CR1 SBC LL_FMPI2C_IsEnab...
__STATIC_INLINE void LL_FMPI2C_SetOwnAddress2(FMPI2C_TypeDef *FMPI2Cx, uint32_t OwnAddress2, uint32_t OwnAddrMask)
Set the 7bits Own Address2.
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledDMAReq_RX(const FMPI2C_TypeDef *FMPI2Cx)
Check if DMA reception requests are enabled or disabled. @rmtoll CR1 RXDMAEN LL_FMPI2C_IsEnabledDMARe...
__STATIC_INLINE void LL_FMPI2C_SetDigitalFilter(FMPI2C_TypeDef *FMPI2Cx, uint32_t DigitalFilter)
Configure Digital Noise Filter.
__STATIC_INLINE uint32_t LL_FMPI2C_GetDigitalFilter(const FMPI2C_TypeDef *FMPI2Cx)
Get the current Digital Noise Filter configuration. @rmtoll CR1 DNF LL_FMPI2C_GetDigitalFilter.
__STATIC_INLINE void LL_FMPI2C_EnableDMAReq_RX(FMPI2C_TypeDef *FMPI2Cx)
Enable DMA reception requests. @rmtoll CR1 RXDMAEN LL_FMPI2C_EnableDMAReq_RX.
__STATIC_INLINE void LL_FMPI2C_EnableDMAReq_TX(FMPI2C_TypeDef *FMPI2Cx)
Enable DMA transmission requests. @rmtoll CR1 TXDMAEN LL_FMPI2C_EnableDMAReq_TX.
__STATIC_INLINE void LL_FMPI2C_SetMasterAddressingMode(FMPI2C_TypeDef *FMPI2Cx, uint32_t AddressingMode)
Configure the Master to operate in 7-bit or 10-bit addressing mode.
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledAnalogFilter(const FMPI2C_TypeDef *FMPI2Cx)
Check if Analog Noise Filter is enabled or disabled. @rmtoll CR1 ANFOFF LL_FMPI2C_IsEnabledAnalogFilt...
__STATIC_INLINE uint32_t LL_FMPI2C_DMA_GetRegAddr(const FMPI2C_TypeDef *FMPI2Cx, uint32_t Direction)
Get the data register address used for DMA transfer @rmtoll TXDR TXDATA LL_FMPI2C_DMA_GetRegAddr RXD...
__STATIC_INLINE void LL_FMPI2C_DisableDMAReq_RX(FMPI2C_TypeDef *FMPI2Cx)
Disable DMA reception requests. @rmtoll CR1 RXDMAEN LL_FMPI2C_DisableDMAReq_RX.
__STATIC_INLINE void LL_FMPI2C_DisableDMAReq_TX(FMPI2C_TypeDef *FMPI2Cx)
Disable DMA transmission requests. @rmtoll CR1 TXDMAEN LL_FMPI2C_DisableDMAReq_TX.
__STATIC_INLINE void LL_FMPI2C_SetTiming(FMPI2C_TypeDef *FMPI2Cx, uint32_t Timing)
Configure the SDA setup, hold time and the SCL high, low period.
__STATIC_INLINE uint32_t LL_FMPI2C_GetClockLowPeriod(const FMPI2C_TypeDef *FMPI2Cx)
Get the SCL low period setting. @rmtoll TIMINGR SCLL LL_FMPI2C_GetClockLowPeriod.
__STATIC_INLINE void LL_FMPI2C_DisableSMBusAlert(FMPI2C_TypeDef *FMPI2Cx)
Disable SMBus alert (Host or Device mode)
__STATIC_INLINE void LL_FMPI2C_DisableClockStretching(FMPI2C_TypeDef *FMPI2Cx)
Disable Clock stretching.
__STATIC_INLINE void LL_FMPI2C_EnableSlaveByteControl(FMPI2C_TypeDef *FMPI2Cx)
Enable hardware byte control in slave mode. @rmtoll CR1 SBC LL_FMPI2C_EnableSlaveByteControl.
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledSMBusTimeout(const FMPI2C_TypeDef *FMPI2Cx, uint32_t ClockTimeout)
Check if the SMBus Clock Timeout is enabled or disabled.
__STATIC_INLINE void LL_FMPI2C_HandleTransfer(FMPI2C_TypeDef *FMPI2Cx, uint32_t SlaveAddr, uint32_t SlaveAddrSize, uint32_t TransferSize, uint32_t EndMode, uint32_t Request)
Handles FMPI2Cx communication when starting transfer or during transfer (TC or TCR flag are set)....
__STATIC_INLINE void LL_FMPI2C_SetTransferSize(FMPI2C_TypeDef *FMPI2Cx, uint32_t TransferSize)
Configure the number of bytes for transfer.
__STATIC_INLINE void LL_FMPI2C_AcknowledgeNextData(FMPI2C_TypeDef *FMPI2Cx, uint32_t TypeAcknowledge)
Prepare the generation of a ACKnowledge or Non ACKnowledge condition after the address receive match ...
__STATIC_INLINE void LL_FMPI2C_DisableAuto10BitRead(FMPI2C_TypeDef *FMPI2Cx)
Disable automatic RESTART Read request condition for 10bit address header (master mode).
__STATIC_INLINE uint32_t LL_FMPI2C_GetTransferDirection(const FMPI2C_TypeDef *FMPI2Cx)
Indicate the value of transfer direction (slave mode).
__STATIC_INLINE uint32_t LL_FMPI2C_GetSMBusPEC(const FMPI2C_TypeDef *FMPI2Cx)
Get the SMBus Packet Error byte calculated.
__STATIC_INLINE uint32_t LL_FMPI2C_GetSlaveAddr(const FMPI2C_TypeDef *FMPI2Cx)
Get the slave address programmed for transfer. @rmtoll CR2 SADD LL_FMPI2C_GetSlaveAddr.
__STATIC_INLINE void LL_FMPI2C_DisableReloadMode(FMPI2C_TypeDef *FMPI2Cx)
Disable reload mode (master mode).
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledSMBusPECCompare(const FMPI2C_TypeDef *FMPI2Cx)
Check if the SMBus Packet Error byte internal comparison is requested or not.
__STATIC_INLINE void LL_FMPI2C_SetSlaveAddr(FMPI2C_TypeDef *FMPI2Cx, uint32_t SlaveAddr)
Configure the slave address for transfer (master mode).
__STATIC_INLINE void LL_FMPI2C_EnableAutoEndMode(FMPI2C_TypeDef *FMPI2Cx)
Enable automatic STOP condition generation (master mode).
__STATIC_INLINE uint32_t LL_FMPI2C_GetAddressMatchCode(const FMPI2C_TypeDef *FMPI2Cx)
Return the slave matched address. @rmtoll ISR ADDCODE LL_FMPI2C_GetAddressMatchCode.
__STATIC_INLINE uint32_t LL_FMPI2C_GetTransferRequest(const FMPI2C_TypeDef *FMPI2Cx)
Get the transfer direction requested (master mode). @rmtoll CR2 RD_WRN LL_FMPI2C_GetTransferRequest.
__STATIC_INLINE uint32_t LL_FMPI2C_GetTransferSize(const FMPI2C_TypeDef *FMPI2Cx)
Get the number of bytes configured for transfer. @rmtoll CR2 NBYTES LL_FMPI2C_GetTransferSize.
__STATIC_INLINE void LL_FMPI2C_EnableReloadMode(FMPI2C_TypeDef *FMPI2Cx)
Enable reload mode (master mode).
__STATIC_INLINE void LL_FMPI2C_SetTransferRequest(FMPI2C_TypeDef *FMPI2Cx, uint32_t TransferRequest)
Configure the transfer direction (master mode).
__STATIC_INLINE void LL_FMPI2C_GenerateStartCondition(FMPI2C_TypeDef *FMPI2Cx)
Generate a START or RESTART condition.
__STATIC_INLINE void LL_FMPI2C_GenerateStopCondition(FMPI2C_TypeDef *FMPI2Cx)
Generate a STOP condition after the current byte transfer (master mode). @rmtoll CR2 STOP LL_FMPI2C_G...
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledAuto10BitRead(const FMPI2C_TypeDef *FMPI2Cx)
Check if automatic RESTART Read request condition for 10bit address header is enabled or disabled....
__STATIC_INLINE void LL_FMPI2C_TransmitData8(FMPI2C_TypeDef *FMPI2Cx, uint8_t Data)
Write in Transmit Data Register . @rmtoll TXDR TXDATA LL_FMPI2C_TransmitData8.
__STATIC_INLINE void LL_FMPI2C_EnableSMBusPECCompare(FMPI2C_TypeDef *FMPI2Cx)
Enable internal comparison of the SMBus Packet Error byte (transmission or reception mode).
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledAutoEndMode(const FMPI2C_TypeDef *FMPI2Cx)
Check if automatic STOP condition is enabled or disabled. @rmtoll CR2 AUTOEND LL_FMPI2C_IsEnabledAuto...
__STATIC_INLINE uint8_t LL_FMPI2C_ReceiveData8(const FMPI2C_TypeDef *FMPI2Cx)
Read Receive Data register. @rmtoll RXDR RXDATA LL_FMPI2C_ReceiveData8.
__STATIC_INLINE void LL_FMPI2C_DisableAutoEndMode(FMPI2C_TypeDef *FMPI2Cx)
Disable automatic STOP condition generation (master mode).
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledReloadMode(const FMPI2C_TypeDef *FMPI2Cx)
Check if reload mode is enabled or disabled. @rmtoll CR2 RELOAD LL_FMPI2C_IsEnabledReloadMode.
__STATIC_INLINE void LL_FMPI2C_EnableAuto10BitRead(FMPI2C_TypeDef *FMPI2Cx)
Enable automatic RESTART Read request condition for 10bit address header (master mode).
__STATIC_INLINE void LL_FMPI2C_ClearSMBusFlag_ALERT(FMPI2C_TypeDef *FMPI2Cx)
Clear SMBus Alert flag.
__STATIC_INLINE void LL_FMPI2C_ClearFlag_STOP(FMPI2C_TypeDef *FMPI2Cx)
Clear Stop detection flag. @rmtoll ICR STOPCF LL_FMPI2C_ClearFlag_STOP.
__STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_ADDR(const FMPI2C_TypeDef *FMPI2Cx)
Indicate the status of Address matched flag (slave mode).
__STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_ARLO(const FMPI2C_TypeDef *FMPI2Cx)
Indicate the status of Arbitration lost flag.
__STATIC_INLINE void LL_FMPI2C_ClearFlag_OVR(FMPI2C_TypeDef *FMPI2Cx)
Clear Overrun/Underrun flag. @rmtoll ICR OVRCF LL_FMPI2C_ClearFlag_OVR.
__STATIC_INLINE void LL_FMPI2C_ClearFlag_ADDR(FMPI2C_TypeDef *FMPI2Cx)
Clear Address Matched flag. @rmtoll ICR ADDRCF LL_FMPI2C_ClearFlag_ADDR.
__STATIC_INLINE uint32_t LL_FMPI2C_IsActiveSMBusFlag_PECERR(const FMPI2C_TypeDef *FMPI2Cx)
Indicate the status of SMBus PEC error flag in reception.
__STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_BERR(const FMPI2C_TypeDef *FMPI2Cx)
Indicate the status of Bus error flag.
__STATIC_INLINE void LL_FMPI2C_ClearFlag_BERR(FMPI2C_TypeDef *FMPI2Cx)
Clear Bus error flag. @rmtoll ICR BERRCF LL_FMPI2C_ClearFlag_BERR.
__STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_OVR(const FMPI2C_TypeDef *FMPI2Cx)
Indicate the status of Overrun/Underrun flag (slave mode).
__STATIC_INLINE void LL_FMPI2C_ClearFlag_TXE(FMPI2C_TypeDef *FMPI2Cx)
Clear Transmit data register empty flag (TXE).
__STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_BUSY(const FMPI2C_TypeDef *FMPI2Cx)
Indicate the status of Bus Busy flag.
__STATIC_INLINE uint32_t LL_FMPI2C_IsActiveSMBusFlag_TIMEOUT(const FMPI2C_TypeDef *FMPI2Cx)
Indicate the status of SMBus Timeout detection flag.
__STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_TXIS(const FMPI2C_TypeDef *FMPI2Cx)
Indicate the status of Transmit interrupt flag.
__STATIC_INLINE uint32_t LL_FMPI2C_IsActiveSMBusFlag_ALERT(const FMPI2C_TypeDef *FMPI2Cx)
Indicate the status of SMBus alert flag.
__STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_TXE(const FMPI2C_TypeDef *FMPI2Cx)
Indicate the status of Transmit data register empty flag.
__STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_RXNE(const FMPI2C_TypeDef *FMPI2Cx)
Indicate the status of Receive data register not empty flag.
__STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_TC(const FMPI2C_TypeDef *FMPI2Cx)
Indicate the status of Transfer complete flag (master mode).
__STATIC_INLINE void LL_FMPI2C_ClearFlag_NACK(FMPI2C_TypeDef *FMPI2Cx)
Clear Not Acknowledge flag. @rmtoll ICR NACKCF LL_FMPI2C_ClearFlag_NACK.
__STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_NACK(const FMPI2C_TypeDef *FMPI2Cx)
Indicate the status of Not Acknowledge received flag.
__STATIC_INLINE void LL_FMPI2C_ClearSMBusFlag_TIMEOUT(FMPI2C_TypeDef *FMPI2Cx)
Clear SMBus Timeout detection flag.
__STATIC_INLINE void LL_FMPI2C_ClearSMBusFlag_PECERR(FMPI2C_TypeDef *FMPI2Cx)
Clear SMBus PEC error flag.
__STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_STOP(const FMPI2C_TypeDef *FMPI2Cx)
Indicate the status of Stop detection flag.
__STATIC_INLINE void LL_FMPI2C_ClearFlag_ARLO(FMPI2C_TypeDef *FMPI2Cx)
Clear Arbitration lost flag. @rmtoll ICR ARLOCF LL_FMPI2C_ClearFlag_ARLO.
__STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_TCR(const FMPI2C_TypeDef *FMPI2Cx)
Indicate the status of Transfer complete flag (master mode).
__STATIC_INLINE void LL_FMPI2C_EnableIT_RX(FMPI2C_TypeDef *FMPI2Cx)
Enable RXNE interrupt. @rmtoll CR1 RXIE LL_FMPI2C_EnableIT_RX.
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledIT_TC(const FMPI2C_TypeDef *FMPI2Cx)
Check if Transfer Complete interrupt is enabled or disabled. @rmtoll CR1 TCIE LL_FMPI2C_IsEnabledIT_T...
__STATIC_INLINE void LL_FMPI2C_DisableIT_ADDR(FMPI2C_TypeDef *FMPI2Cx)
Disable Address match interrupt (slave mode only). @rmtoll CR1 ADDRIE LL_FMPI2C_DisableIT_ADDR.
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledIT_ADDR(const FMPI2C_TypeDef *FMPI2Cx)
Check if Address match interrupt is enabled or disabled. @rmtoll CR1 ADDRIE LL_FMPI2C_IsEnabledIT_ADD...
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledIT_RX(const FMPI2C_TypeDef *FMPI2Cx)
Check if the RXNE Interrupt is enabled or disabled. @rmtoll CR1 RXIE LL_FMPI2C_IsEnabledIT_RX.
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledIT_NACK(const FMPI2C_TypeDef *FMPI2Cx)
Check if Not acknowledge received interrupt is enabled or disabled. @rmtoll CR1 NACKIE LL_FMPI2C_IsEn...
__STATIC_INLINE void LL_FMPI2C_EnableIT_NACK(FMPI2C_TypeDef *FMPI2Cx)
Enable Not acknowledge received interrupt. @rmtoll CR1 NACKIE LL_FMPI2C_EnableIT_NACK.
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledIT_TX(const FMPI2C_TypeDef *FMPI2Cx)
Check if the TXIS Interrupt is enabled or disabled. @rmtoll CR1 TXIE LL_FMPI2C_IsEnabledIT_TX.
__STATIC_INLINE void LL_FMPI2C_DisableIT_RX(FMPI2C_TypeDef *FMPI2Cx)
Disable RXNE interrupt. @rmtoll CR1 RXIE LL_FMPI2C_DisableIT_RX.
__STATIC_INLINE void LL_FMPI2C_DisableIT_NACK(FMPI2C_TypeDef *FMPI2Cx)
Disable Not acknowledge received interrupt. @rmtoll CR1 NACKIE LL_FMPI2C_DisableIT_NACK.
__STATIC_INLINE void LL_FMPI2C_EnableIT_TX(FMPI2C_TypeDef *FMPI2Cx)
Enable TXIS interrupt. @rmtoll CR1 TXIE LL_FMPI2C_EnableIT_TX.
__STATIC_INLINE void LL_FMPI2C_DisableIT_ERR(FMPI2C_TypeDef *FMPI2Cx)
Disable Error interrupts.
__STATIC_INLINE void LL_FMPI2C_EnableIT_ADDR(FMPI2C_TypeDef *FMPI2Cx)
Enable Address match interrupt (slave mode only). @rmtoll CR1 ADDRIE LL_FMPI2C_EnableIT_ADDR.
__STATIC_INLINE void LL_FMPI2C_EnableIT_TC(FMPI2C_TypeDef *FMPI2Cx)
Enable Transfer Complete interrupt.
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledIT_ERR(const FMPI2C_TypeDef *FMPI2Cx)
Check if Error interrupts are enabled or disabled. @rmtoll CR1 ERRIE LL_FMPI2C_IsEnabledIT_ERR.
__STATIC_INLINE void LL_FMPI2C_DisableIT_TC(FMPI2C_TypeDef *FMPI2Cx)
Disable Transfer Complete interrupt.
__STATIC_INLINE void LL_FMPI2C_DisableIT_STOP(FMPI2C_TypeDef *FMPI2Cx)
Disable STOP detection interrupt. @rmtoll CR1 STOPIE LL_FMPI2C_DisableIT_STOP.
__STATIC_INLINE void LL_FMPI2C_EnableIT_ERR(FMPI2C_TypeDef *FMPI2Cx)
Enable Error interrupts.
__STATIC_INLINE void LL_FMPI2C_DisableIT_TX(FMPI2C_TypeDef *FMPI2Cx)
Disable TXIS interrupt. @rmtoll CR1 TXIE LL_FMPI2C_DisableIT_TX.
__STATIC_INLINE void LL_FMPI2C_EnableIT_STOP(FMPI2C_TypeDef *FMPI2Cx)
Enable STOP detection interrupt. @rmtoll CR1 STOPIE LL_FMPI2C_EnableIT_STOP.
__STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledIT_STOP(const FMPI2C_TypeDef *FMPI2Cx)
Check if STOP detection interrupt is enabled or disabled. @rmtoll CR1 STOPIE LL_FMPI2C_IsEnabledIT_ST...
ErrorStatus LL_FMPI2C_DeInit(const FMPI2C_TypeDef *FMPI2Cx)
De-initialize the FMPI2C registers to their default reset values.
void LL_FMPI2C_StructInit(LL_FMPI2C_InitTypeDef *FMPI2C_InitStruct)
Set each LL_FMPI2C_InitTypeDef field to default value.
ErrorStatus LL_FMPI2C_Init(FMPI2C_TypeDef *FMPI2Cx, const LL_FMPI2C_InitTypeDef *FMPI2C_InitStruct)
Initialize the FMPI2C registers according to the specified parameters in FMPI2C_InitStruct.