STM32F4xx_HAL_Driver  1.8.3
stm32f4xx_ll_fmpi2c.h
Go to the documentation of this file.
1 
19 /* Define to prevent recursive inclusion -------------------------------------*/
20 #ifndef STM32F4xx_LL_FMPI2C_H
21 #define STM32F4xx_LL_FMPI2C_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #if defined(FMPI2C_CR1_PE)
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32f4xx.h"
30 
35 #if defined (FMPI2C1)
36 
41 /* Private types -------------------------------------------------------------*/
42 /* Private variables ---------------------------------------------------------*/
43 
44 /* Private constants ---------------------------------------------------------*/
52 /* Private macros ------------------------------------------------------------*/
53 #if defined(USE_FULL_LL_DRIVER)
60 #endif /*USE_FULL_LL_DRIVER*/
61 
62 /* Exported types ------------------------------------------------------------*/
63 #if defined(USE_FULL_LL_DRIVER)
67 typedef struct
68 {
69  uint32_t PeripheralMode;
75  uint32_t Timing;
82  uint32_t AnalogFilter;
88  uint32_t DigitalFilter;
94  uint32_t OwnAddress1;
100  uint32_t TypeAcknowledge;
107  uint32_t OwnAddrSize;
116 #endif /*USE_FULL_LL_DRIVER*/
117 
118 /* Exported constants --------------------------------------------------------*/
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)
356 /* Exported macro ------------------------------------------------------------*/
372 #define LL_FMPI2C_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
373 
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))
415 /* Exported functions --------------------------------------------------------*/
430 __STATIC_INLINE void LL_FMPI2C_Enable(FMPI2C_TypeDef *FMPI2Cx)
431 {
432  SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_PE);
433 }
434 
444 __STATIC_INLINE void LL_FMPI2C_Disable(FMPI2C_TypeDef *FMPI2Cx)
445 {
446  CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_PE);
447 }
448 
455 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabled(const FMPI2C_TypeDef *FMPI2Cx)
456 {
457  return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_PE) == (FMPI2C_CR1_PE)) ? 1UL : 0UL);
458 }
459 
476 __STATIC_INLINE void LL_FMPI2C_ConfigFilters(FMPI2C_TypeDef *FMPI2Cx, uint32_t AnalogFilter, uint32_t DigitalFilter)
477 {
478  MODIFY_REG(FMPI2Cx->CR1, FMPI2C_CR1_ANFOFF | FMPI2C_CR1_DNF, AnalogFilter | (DigitalFilter << FMPI2C_CR1_DNF_Pos));
479 }
480 
493 __STATIC_INLINE void LL_FMPI2C_SetDigitalFilter(FMPI2C_TypeDef *FMPI2Cx, uint32_t DigitalFilter)
494 {
495  MODIFY_REG(FMPI2Cx->CR1, FMPI2C_CR1_DNF, DigitalFilter << FMPI2C_CR1_DNF_Pos);
496 }
497 
504 __STATIC_INLINE uint32_t LL_FMPI2C_GetDigitalFilter(const FMPI2C_TypeDef *FMPI2Cx)
505 {
506  return (uint32_t)(READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_DNF) >> FMPI2C_CR1_DNF_Pos);
507 }
508 
516 __STATIC_INLINE void LL_FMPI2C_EnableAnalogFilter(FMPI2C_TypeDef *FMPI2Cx)
517 {
518  CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ANFOFF);
519 }
520 
528 __STATIC_INLINE void LL_FMPI2C_DisableAnalogFilter(FMPI2C_TypeDef *FMPI2Cx)
529 {
530  SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ANFOFF);
531 }
532 
539 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledAnalogFilter(const FMPI2C_TypeDef *FMPI2Cx)
540 {
541  return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ANFOFF) != (FMPI2C_CR1_ANFOFF)) ? 1UL : 0UL);
542 }
543 
550 __STATIC_INLINE void LL_FMPI2C_EnableDMAReq_TX(FMPI2C_TypeDef *FMPI2Cx)
551 {
552  SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TXDMAEN);
553 }
554 
561 __STATIC_INLINE void LL_FMPI2C_DisableDMAReq_TX(FMPI2C_TypeDef *FMPI2Cx)
562 {
563  CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TXDMAEN);
564 }
565 
572 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledDMAReq_TX(const FMPI2C_TypeDef *FMPI2Cx)
573 {
574  return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TXDMAEN) == (FMPI2C_CR1_TXDMAEN)) ? 1UL : 0UL);
575 }
576 
583 __STATIC_INLINE void LL_FMPI2C_EnableDMAReq_RX(FMPI2C_TypeDef *FMPI2Cx)
584 {
585  SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_RXDMAEN);
586 }
587 
594 __STATIC_INLINE void LL_FMPI2C_DisableDMAReq_RX(FMPI2C_TypeDef *FMPI2Cx)
595 {
596  CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_RXDMAEN);
597 }
598 
605 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledDMAReq_RX(const FMPI2C_TypeDef *FMPI2Cx)
606 {
607  return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_RXDMAEN) == (FMPI2C_CR1_RXDMAEN)) ? 1UL : 0UL);
608 }
609 
620 __STATIC_INLINE uint32_t LL_FMPI2C_DMA_GetRegAddr(const FMPI2C_TypeDef *FMPI2Cx, uint32_t Direction)
621 {
622  uint32_t data_reg_addr;
623 
624  if (Direction == LL_FMPI2C_DMA_REG_DATA_TRANSMIT)
625  {
626  /* return address of TXDR register */
627  data_reg_addr = (uint32_t) &(FMPI2Cx->TXDR);
628  }
629  else
630  {
631  /* return address of RXDR register */
632  data_reg_addr = (uint32_t) &(FMPI2Cx->RXDR);
633  }
634 
635  return data_reg_addr;
636 }
637 
645 __STATIC_INLINE void LL_FMPI2C_EnableClockStretching(FMPI2C_TypeDef *FMPI2Cx)
646 {
647  CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_NOSTRETCH);
648 }
649 
657 __STATIC_INLINE void LL_FMPI2C_DisableClockStretching(FMPI2C_TypeDef *FMPI2Cx)
658 {
659  SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_NOSTRETCH);
660 }
661 
668 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledClockStretching(const FMPI2C_TypeDef *FMPI2Cx)
669 {
670  return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_NOSTRETCH) != (FMPI2C_CR1_NOSTRETCH)) ? 1UL : 0UL);
671 }
672 
679 __STATIC_INLINE void LL_FMPI2C_EnableSlaveByteControl(FMPI2C_TypeDef *FMPI2Cx)
680 {
681  SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_SBC);
682 }
683 
690 __STATIC_INLINE void LL_FMPI2C_DisableSlaveByteControl(FMPI2C_TypeDef *FMPI2Cx)
691 {
692  CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_SBC);
693 }
694 
701 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledSlaveByteControl(const FMPI2C_TypeDef *FMPI2Cx)
702 {
703  return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_SBC) == (FMPI2C_CR1_SBC)) ? 1UL : 0UL);
704 }
705 
713 __STATIC_INLINE void LL_FMPI2C_EnableGeneralCall(FMPI2C_TypeDef *FMPI2Cx)
714 {
715  SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_GCEN);
716 }
717 
725 __STATIC_INLINE void LL_FMPI2C_DisableGeneralCall(FMPI2C_TypeDef *FMPI2Cx)
726 {
727  CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_GCEN);
728 }
729 
736 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledGeneralCall(const FMPI2C_TypeDef *FMPI2Cx)
737 {
738  return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_GCEN) == (FMPI2C_CR1_GCEN)) ? 1UL : 0UL);
739 }
740 
751 __STATIC_INLINE void LL_FMPI2C_SetMasterAddressingMode(FMPI2C_TypeDef *FMPI2Cx, uint32_t AddressingMode)
752 {
753  MODIFY_REG(FMPI2Cx->CR2, FMPI2C_CR2_ADD10, AddressingMode);
754 }
755 
764 __STATIC_INLINE uint32_t LL_FMPI2C_GetMasterAddressingMode(const FMPI2C_TypeDef *FMPI2Cx)
765 {
766  return (uint32_t)(READ_BIT(FMPI2Cx->CR2, FMPI2C_CR2_ADD10));
767 }
768 
780 __STATIC_INLINE void LL_FMPI2C_SetOwnAddress1(FMPI2C_TypeDef *FMPI2Cx, uint32_t OwnAddress1, uint32_t OwnAddrSize)
781 {
782  MODIFY_REG(FMPI2Cx->OAR1, FMPI2C_OAR1_OA1 | FMPI2C_OAR1_OA1MODE, OwnAddress1 | OwnAddrSize);
783 }
784 
791 __STATIC_INLINE void LL_FMPI2C_EnableOwnAddress1(FMPI2C_TypeDef *FMPI2Cx)
792 {
793  SET_BIT(FMPI2Cx->OAR1, FMPI2C_OAR1_OA1EN);
794 }
795 
802 __STATIC_INLINE void LL_FMPI2C_DisableOwnAddress1(FMPI2C_TypeDef *FMPI2Cx)
803 {
804  CLEAR_BIT(FMPI2Cx->OAR1, FMPI2C_OAR1_OA1EN);
805 }
806 
813 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledOwnAddress1(const FMPI2C_TypeDef *FMPI2Cx)
814 {
815  return ((READ_BIT(FMPI2Cx->OAR1, FMPI2C_OAR1_OA1EN) == (FMPI2C_OAR1_OA1EN)) ? 1UL : 0UL);
816 }
817 
836 __STATIC_INLINE void LL_FMPI2C_SetOwnAddress2(FMPI2C_TypeDef *FMPI2Cx, uint32_t OwnAddress2, uint32_t OwnAddrMask)
837 {
838  MODIFY_REG(FMPI2Cx->OAR2, FMPI2C_OAR2_OA2 | FMPI2C_OAR2_OA2MSK, OwnAddress2 | OwnAddrMask);
839 }
840 
847 __STATIC_INLINE void LL_FMPI2C_EnableOwnAddress2(FMPI2C_TypeDef *FMPI2Cx)
848 {
849  SET_BIT(FMPI2Cx->OAR2, FMPI2C_OAR2_OA2EN);
850 }
851 
858 __STATIC_INLINE void LL_FMPI2C_DisableOwnAddress2(FMPI2C_TypeDef *FMPI2Cx)
859 {
860  CLEAR_BIT(FMPI2Cx->OAR2, FMPI2C_OAR2_OA2EN);
861 }
862 
869 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledOwnAddress2(const FMPI2C_TypeDef *FMPI2Cx)
870 {
871  return ((READ_BIT(FMPI2Cx->OAR2, FMPI2C_OAR2_OA2EN) == (FMPI2C_OAR2_OA2EN)) ? 1UL : 0UL);
872 }
873 
883 __STATIC_INLINE void LL_FMPI2C_SetTiming(FMPI2C_TypeDef *FMPI2Cx, uint32_t Timing)
884 {
885  WRITE_REG(FMPI2Cx->TIMINGR, Timing);
886 }
887 
894 __STATIC_INLINE uint32_t LL_FMPI2C_GetTimingPrescaler(const FMPI2C_TypeDef *FMPI2Cx)
895 {
896  return (uint32_t)(READ_BIT(FMPI2Cx->TIMINGR, FMPI2C_TIMINGR_PRESC) >> FMPI2C_TIMINGR_PRESC_Pos);
897 }
898 
905 __STATIC_INLINE uint32_t LL_FMPI2C_GetClockLowPeriod(const FMPI2C_TypeDef *FMPI2Cx)
906 {
907  return (uint32_t)(READ_BIT(FMPI2Cx->TIMINGR, FMPI2C_TIMINGR_SCLL) >> FMPI2C_TIMINGR_SCLL_Pos);
908 }
909 
916 __STATIC_INLINE uint32_t LL_FMPI2C_GetClockHighPeriod(const FMPI2C_TypeDef *FMPI2Cx)
917 {
918  return (uint32_t)(READ_BIT(FMPI2Cx->TIMINGR, FMPI2C_TIMINGR_SCLH) >> FMPI2C_TIMINGR_SCLH_Pos);
919 }
920 
927 __STATIC_INLINE uint32_t LL_FMPI2C_GetDataHoldTime(const FMPI2C_TypeDef *FMPI2Cx)
928 {
929  return (uint32_t)(READ_BIT(FMPI2Cx->TIMINGR, FMPI2C_TIMINGR_SDADEL) >> FMPI2C_TIMINGR_SDADEL_Pos);
930 }
931 
938 __STATIC_INLINE uint32_t LL_FMPI2C_GetDataSetupTime(const FMPI2C_TypeDef *FMPI2Cx)
939 {
940  return (uint32_t)(READ_BIT(FMPI2Cx->TIMINGR, FMPI2C_TIMINGR_SCLDEL) >> FMPI2C_TIMINGR_SCLDEL_Pos);
941 }
942 
957 __STATIC_INLINE void LL_FMPI2C_SetMode(FMPI2C_TypeDef *FMPI2Cx, uint32_t PeripheralMode)
958 {
959  MODIFY_REG(FMPI2Cx->CR1, FMPI2C_CR1_SMBHEN | FMPI2C_CR1_SMBDEN, PeripheralMode);
960 }
961 
975 __STATIC_INLINE uint32_t LL_FMPI2C_GetMode(const FMPI2C_TypeDef *FMPI2Cx)
976 {
977  return (uint32_t)(READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_SMBHEN | FMPI2C_CR1_SMBDEN));
978 }
979 
993 __STATIC_INLINE void LL_FMPI2C_EnableSMBusAlert(FMPI2C_TypeDef *FMPI2Cx)
994 {
995  SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ALERTEN);
996 }
997 
1011 __STATIC_INLINE void LL_FMPI2C_DisableSMBusAlert(FMPI2C_TypeDef *FMPI2Cx)
1012 {
1013  CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ALERTEN);
1014 }
1015 
1024 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledSMBusAlert(const FMPI2C_TypeDef *FMPI2Cx)
1025 {
1026  return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ALERTEN) == (FMPI2C_CR1_ALERTEN)) ? 1UL : 0UL);
1027 }
1028 
1037 __STATIC_INLINE void LL_FMPI2C_EnableSMBusPEC(FMPI2C_TypeDef *FMPI2Cx)
1038 {
1039  SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_PECEN);
1040 }
1041 
1050 __STATIC_INLINE void LL_FMPI2C_DisableSMBusPEC(FMPI2C_TypeDef *FMPI2Cx)
1051 {
1052  CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_PECEN);
1053 }
1054 
1063 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledSMBusPEC(const FMPI2C_TypeDef *FMPI2Cx)
1064 {
1065  return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_PECEN) == (FMPI2C_CR1_PECEN)) ? 1UL : 0UL);
1066 }
1067 
1084 __STATIC_INLINE void LL_FMPI2C_ConfigSMBusTimeout(FMPI2C_TypeDef *FMPI2Cx, uint32_t TimeoutA, uint32_t TimeoutAMode,
1085  uint32_t TimeoutB)
1086 {
1087  MODIFY_REG(FMPI2Cx->TIMEOUTR, FMPI2C_TIMEOUTR_TIMEOUTA | FMPI2C_TIMEOUTR_TIDLE | FMPI2C_TIMEOUTR_TIMEOUTB,
1088  TimeoutA | TimeoutAMode | (TimeoutB << FMPI2C_TIMEOUTR_TIMEOUTB_Pos));
1089 }
1090 
1101 __STATIC_INLINE void LL_FMPI2C_SetSMBusTimeoutA(FMPI2C_TypeDef *FMPI2Cx, uint32_t TimeoutA)
1102 {
1103  WRITE_REG(FMPI2Cx->TIMEOUTR, TimeoutA);
1104 }
1105 
1114 __STATIC_INLINE uint32_t LL_FMPI2C_GetSMBusTimeoutA(const FMPI2C_TypeDef *FMPI2Cx)
1115 {
1116  return (uint32_t)(READ_BIT(FMPI2Cx->TIMEOUTR, FMPI2C_TIMEOUTR_TIMEOUTA));
1117 }
1118 
1131 __STATIC_INLINE void LL_FMPI2C_SetSMBusTimeoutAMode(FMPI2C_TypeDef *FMPI2Cx, uint32_t TimeoutAMode)
1132 {
1133  WRITE_REG(FMPI2Cx->TIMEOUTR, TimeoutAMode);
1134 }
1135 
1146 __STATIC_INLINE uint32_t LL_FMPI2C_GetSMBusTimeoutAMode(const FMPI2C_TypeDef *FMPI2Cx)
1147 {
1148  return (uint32_t)(READ_BIT(FMPI2Cx->TIMEOUTR, FMPI2C_TIMEOUTR_TIDLE));
1149 }
1150 
1161 __STATIC_INLINE void LL_FMPI2C_SetSMBusTimeoutB(FMPI2C_TypeDef *FMPI2Cx, uint32_t TimeoutB)
1162 {
1163  WRITE_REG(FMPI2Cx->TIMEOUTR, TimeoutB << FMPI2C_TIMEOUTR_TIMEOUTB_Pos);
1164 }
1165 
1174 __STATIC_INLINE uint32_t LL_FMPI2C_GetSMBusTimeoutB(const FMPI2C_TypeDef *FMPI2Cx)
1175 {
1176  return (uint32_t)(READ_BIT(FMPI2Cx->TIMEOUTR, FMPI2C_TIMEOUTR_TIMEOUTB) >> FMPI2C_TIMEOUTR_TIMEOUTB_Pos);
1177 }
1178 
1192 __STATIC_INLINE void LL_FMPI2C_EnableSMBusTimeout(FMPI2C_TypeDef *FMPI2Cx, uint32_t ClockTimeout)
1193 {
1194  SET_BIT(FMPI2Cx->TIMEOUTR, ClockTimeout);
1195 }
1196 
1210 __STATIC_INLINE void LL_FMPI2C_DisableSMBusTimeout(FMPI2C_TypeDef *FMPI2Cx, uint32_t ClockTimeout)
1211 {
1212  CLEAR_BIT(FMPI2Cx->TIMEOUTR, ClockTimeout);
1213 }
1214 
1228 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledSMBusTimeout(const FMPI2C_TypeDef *FMPI2Cx, uint32_t ClockTimeout)
1229 {
1230  return ((READ_BIT(FMPI2Cx->TIMEOUTR, (FMPI2C_TIMEOUTR_TIMOUTEN | FMPI2C_TIMEOUTR_TEXTEN)) == \
1231  (ClockTimeout)) ? 1UL : 0UL);
1232 }
1233 
1248 __STATIC_INLINE void LL_FMPI2C_EnableIT_TX(FMPI2C_TypeDef *FMPI2Cx)
1249 {
1250  SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TXIE);
1251 }
1252 
1259 __STATIC_INLINE void LL_FMPI2C_DisableIT_TX(FMPI2C_TypeDef *FMPI2Cx)
1260 {
1261  CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TXIE);
1262 }
1263 
1270 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledIT_TX(const FMPI2C_TypeDef *FMPI2Cx)
1271 {
1272  return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TXIE) == (FMPI2C_CR1_TXIE)) ? 1UL : 0UL);
1273 }
1274 
1281 __STATIC_INLINE void LL_FMPI2C_EnableIT_RX(FMPI2C_TypeDef *FMPI2Cx)
1282 {
1283  SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_RXIE);
1284 }
1285 
1292 __STATIC_INLINE void LL_FMPI2C_DisableIT_RX(FMPI2C_TypeDef *FMPI2Cx)
1293 {
1294  CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_RXIE);
1295 }
1296 
1303 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledIT_RX(const FMPI2C_TypeDef *FMPI2Cx)
1304 {
1305  return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_RXIE) == (FMPI2C_CR1_RXIE)) ? 1UL : 0UL);
1306 }
1307 
1314 __STATIC_INLINE void LL_FMPI2C_EnableIT_ADDR(FMPI2C_TypeDef *FMPI2Cx)
1315 {
1316  SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ADDRIE);
1317 }
1318 
1325 __STATIC_INLINE void LL_FMPI2C_DisableIT_ADDR(FMPI2C_TypeDef *FMPI2Cx)
1326 {
1327  CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ADDRIE);
1328 }
1329 
1336 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledIT_ADDR(const FMPI2C_TypeDef *FMPI2Cx)
1337 {
1338  return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ADDRIE) == (FMPI2C_CR1_ADDRIE)) ? 1UL : 0UL);
1339 }
1340 
1347 __STATIC_INLINE void LL_FMPI2C_EnableIT_NACK(FMPI2C_TypeDef *FMPI2Cx)
1348 {
1349  SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_NACKIE);
1350 }
1351 
1358 __STATIC_INLINE void LL_FMPI2C_DisableIT_NACK(FMPI2C_TypeDef *FMPI2Cx)
1359 {
1360  CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_NACKIE);
1361 }
1362 
1369 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledIT_NACK(const FMPI2C_TypeDef *FMPI2Cx)
1370 {
1371  return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_NACKIE) == (FMPI2C_CR1_NACKIE)) ? 1UL : 0UL);
1372 }
1373 
1380 __STATIC_INLINE void LL_FMPI2C_EnableIT_STOP(FMPI2C_TypeDef *FMPI2Cx)
1381 {
1382  SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_STOPIE);
1383 }
1384 
1391 __STATIC_INLINE void LL_FMPI2C_DisableIT_STOP(FMPI2C_TypeDef *FMPI2Cx)
1392 {
1393  CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_STOPIE);
1394 }
1395 
1402 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledIT_STOP(const FMPI2C_TypeDef *FMPI2Cx)
1403 {
1404  return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_STOPIE) == (FMPI2C_CR1_STOPIE)) ? 1UL : 0UL);
1405 }
1406 
1416 __STATIC_INLINE void LL_FMPI2C_EnableIT_TC(FMPI2C_TypeDef *FMPI2Cx)
1417 {
1418  SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TCIE);
1419 }
1420 
1430 __STATIC_INLINE void LL_FMPI2C_DisableIT_TC(FMPI2C_TypeDef *FMPI2Cx)
1431 {
1432  CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TCIE);
1433 }
1434 
1441 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledIT_TC(const FMPI2C_TypeDef *FMPI2Cx)
1442 {
1443  return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_TCIE) == (FMPI2C_CR1_TCIE)) ? 1UL : 0UL);
1444 }
1445 
1461 __STATIC_INLINE void LL_FMPI2C_EnableIT_ERR(FMPI2C_TypeDef *FMPI2Cx)
1462 {
1463  SET_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ERRIE);
1464 }
1465 
1481 __STATIC_INLINE void LL_FMPI2C_DisableIT_ERR(FMPI2C_TypeDef *FMPI2Cx)
1482 {
1483  CLEAR_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ERRIE);
1484 }
1485 
1492 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledIT_ERR(const FMPI2C_TypeDef *FMPI2Cx)
1493 {
1494  return ((READ_BIT(FMPI2Cx->CR1, FMPI2C_CR1_ERRIE) == (FMPI2C_CR1_ERRIE)) ? 1UL : 0UL);
1495 }
1496 
1513 __STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_TXE(const FMPI2C_TypeDef *FMPI2Cx)
1514 {
1515  return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_TXE) == (FMPI2C_ISR_TXE)) ? 1UL : 0UL);
1516 }
1517 
1526 __STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_TXIS(const FMPI2C_TypeDef *FMPI2Cx)
1527 {
1528  return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_TXIS) == (FMPI2C_ISR_TXIS)) ? 1UL : 0UL);
1529 }
1530 
1539 __STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_RXNE(const FMPI2C_TypeDef *FMPI2Cx)
1540 {
1541  return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_RXNE) == (FMPI2C_ISR_RXNE)) ? 1UL : 0UL);
1542 }
1543 
1552 __STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_ADDR(const FMPI2C_TypeDef *FMPI2Cx)
1553 {
1554  return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_ADDR) == (FMPI2C_ISR_ADDR)) ? 1UL : 0UL);
1555 }
1556 
1565 __STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_NACK(const FMPI2C_TypeDef *FMPI2Cx)
1566 {
1567  return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_NACKF) == (FMPI2C_ISR_NACKF)) ? 1UL : 0UL);
1568 }
1569 
1578 __STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_STOP(const FMPI2C_TypeDef *FMPI2Cx)
1579 {
1580  return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_STOPF) == (FMPI2C_ISR_STOPF)) ? 1UL : 0UL);
1581 }
1582 
1591 __STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_TC(const FMPI2C_TypeDef *FMPI2Cx)
1592 {
1593  return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_TC) == (FMPI2C_ISR_TC)) ? 1UL : 0UL);
1594 }
1595 
1604 __STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_TCR(const FMPI2C_TypeDef *FMPI2Cx)
1605 {
1606  return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_TCR) == (FMPI2C_ISR_TCR)) ? 1UL : 0UL);
1607 }
1608 
1617 __STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_BERR(const FMPI2C_TypeDef *FMPI2Cx)
1618 {
1619  return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_BERR) == (FMPI2C_ISR_BERR)) ? 1UL : 0UL);
1620 }
1621 
1630 __STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_ARLO(const FMPI2C_TypeDef *FMPI2Cx)
1631 {
1632  return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_ARLO) == (FMPI2C_ISR_ARLO)) ? 1UL : 0UL);
1633 }
1634 
1643 __STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_OVR(const FMPI2C_TypeDef *FMPI2Cx)
1644 {
1645  return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_OVR) == (FMPI2C_ISR_OVR)) ? 1UL : 0UL);
1646 }
1647 
1658 __STATIC_INLINE uint32_t LL_FMPI2C_IsActiveSMBusFlag_PECERR(const FMPI2C_TypeDef *FMPI2Cx)
1659 {
1660  return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_PECERR) == (FMPI2C_ISR_PECERR)) ? 1UL : 0UL);
1661 }
1662 
1673 __STATIC_INLINE uint32_t LL_FMPI2C_IsActiveSMBusFlag_TIMEOUT(const FMPI2C_TypeDef *FMPI2Cx)
1674 {
1675  return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_TIMEOUT) == (FMPI2C_ISR_TIMEOUT)) ? 1UL : 0UL);
1676 }
1677 
1689 __STATIC_INLINE uint32_t LL_FMPI2C_IsActiveSMBusFlag_ALERT(const FMPI2C_TypeDef *FMPI2Cx)
1690 {
1691  return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_ALERT) == (FMPI2C_ISR_ALERT)) ? 1UL : 0UL);
1692 }
1693 
1702 __STATIC_INLINE uint32_t LL_FMPI2C_IsActiveFlag_BUSY(const FMPI2C_TypeDef *FMPI2Cx)
1703 {
1704  return ((READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_BUSY) == (FMPI2C_ISR_BUSY)) ? 1UL : 0UL);
1705 }
1706 
1713 __STATIC_INLINE void LL_FMPI2C_ClearFlag_ADDR(FMPI2C_TypeDef *FMPI2Cx)
1714 {
1715  SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_ADDRCF);
1716 }
1717 
1724 __STATIC_INLINE void LL_FMPI2C_ClearFlag_NACK(FMPI2C_TypeDef *FMPI2Cx)
1725 {
1726  SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_NACKCF);
1727 }
1728 
1735 __STATIC_INLINE void LL_FMPI2C_ClearFlag_STOP(FMPI2C_TypeDef *FMPI2Cx)
1736 {
1737  SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_STOPCF);
1738 }
1739 
1747 __STATIC_INLINE void LL_FMPI2C_ClearFlag_TXE(FMPI2C_TypeDef *FMPI2Cx)
1748 {
1749  WRITE_REG(FMPI2Cx->ISR, FMPI2C_ISR_TXE);
1750 }
1751 
1758 __STATIC_INLINE void LL_FMPI2C_ClearFlag_BERR(FMPI2C_TypeDef *FMPI2Cx)
1759 {
1760  SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_BERRCF);
1761 }
1762 
1769 __STATIC_INLINE void LL_FMPI2C_ClearFlag_ARLO(FMPI2C_TypeDef *FMPI2Cx)
1770 {
1771  SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_ARLOCF);
1772 }
1773 
1780 __STATIC_INLINE void LL_FMPI2C_ClearFlag_OVR(FMPI2C_TypeDef *FMPI2Cx)
1781 {
1782  SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_OVRCF);
1783 }
1784 
1793 __STATIC_INLINE void LL_FMPI2C_ClearSMBusFlag_PECERR(FMPI2C_TypeDef *FMPI2Cx)
1794 {
1795  SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_PECCF);
1796 }
1797 
1806 __STATIC_INLINE void LL_FMPI2C_ClearSMBusFlag_TIMEOUT(FMPI2C_TypeDef *FMPI2Cx)
1807 {
1808  SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_TIMOUTCF);
1809 }
1810 
1819 __STATIC_INLINE void LL_FMPI2C_ClearSMBusFlag_ALERT(FMPI2C_TypeDef *FMPI2Cx)
1820 {
1821  SET_BIT(FMPI2Cx->ICR, FMPI2C_ICR_ALERTCF);
1822 }
1823 
1840 __STATIC_INLINE void LL_FMPI2C_EnableAutoEndMode(FMPI2C_TypeDef *FMPI2Cx)
1841 {
1842  SET_BIT(FMPI2Cx->CR2, FMPI2C_CR2_AUTOEND);
1843 }
1844 
1852 __STATIC_INLINE void LL_FMPI2C_DisableAutoEndMode(FMPI2C_TypeDef *FMPI2Cx)
1853 {
1854  CLEAR_BIT(FMPI2Cx->CR2, FMPI2C_CR2_AUTOEND);
1855 }
1856 
1863 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledAutoEndMode(const FMPI2C_TypeDef *FMPI2Cx)
1864 {
1865  return ((READ_BIT(FMPI2Cx->CR2, FMPI2C_CR2_AUTOEND) == (FMPI2C_CR2_AUTOEND)) ? 1UL : 0UL);
1866 }
1867 
1875 __STATIC_INLINE void LL_FMPI2C_EnableReloadMode(FMPI2C_TypeDef *FMPI2Cx)
1876 {
1877  SET_BIT(FMPI2Cx->CR2, FMPI2C_CR2_RELOAD);
1878 }
1879 
1887 __STATIC_INLINE void LL_FMPI2C_DisableReloadMode(FMPI2C_TypeDef *FMPI2Cx)
1888 {
1889  CLEAR_BIT(FMPI2Cx->CR2, FMPI2C_CR2_RELOAD);
1890 }
1891 
1898 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledReloadMode(const FMPI2C_TypeDef *FMPI2Cx)
1899 {
1900  return ((READ_BIT(FMPI2Cx->CR2, FMPI2C_CR2_RELOAD) == (FMPI2C_CR2_RELOAD)) ? 1UL : 0UL);
1901 }
1902 
1911 __STATIC_INLINE void LL_FMPI2C_SetTransferSize(FMPI2C_TypeDef *FMPI2Cx, uint32_t TransferSize)
1912 {
1913  MODIFY_REG(FMPI2Cx->CR2, FMPI2C_CR2_NBYTES, TransferSize << FMPI2C_CR2_NBYTES_Pos);
1914 }
1915 
1922 __STATIC_INLINE uint32_t LL_FMPI2C_GetTransferSize(const FMPI2C_TypeDef *FMPI2Cx)
1923 {
1924  return (uint32_t)(READ_BIT(FMPI2Cx->CR2, FMPI2C_CR2_NBYTES) >> FMPI2C_CR2_NBYTES_Pos);
1925 }
1926 
1938 __STATIC_INLINE void LL_FMPI2C_AcknowledgeNextData(FMPI2C_TypeDef *FMPI2Cx, uint32_t TypeAcknowledge)
1939 {
1940  MODIFY_REG(FMPI2Cx->CR2, FMPI2C_CR2_NACK, TypeAcknowledge);
1941 }
1942 
1951 __STATIC_INLINE void LL_FMPI2C_GenerateStartCondition(FMPI2C_TypeDef *FMPI2Cx)
1952 {
1953  SET_BIT(FMPI2Cx->CR2, FMPI2C_CR2_START);
1954 }
1955 
1962 __STATIC_INLINE void LL_FMPI2C_GenerateStopCondition(FMPI2C_TypeDef *FMPI2Cx)
1963 {
1964  SET_BIT(FMPI2Cx->CR2, FMPI2C_CR2_STOP);
1965 }
1966 
1976 __STATIC_INLINE void LL_FMPI2C_EnableAuto10BitRead(FMPI2C_TypeDef *FMPI2Cx)
1977 {
1978  CLEAR_BIT(FMPI2Cx->CR2, FMPI2C_CR2_HEAD10R);
1979 }
1980 
1988 __STATIC_INLINE void LL_FMPI2C_DisableAuto10BitRead(FMPI2C_TypeDef *FMPI2Cx)
1989 {
1990  SET_BIT(FMPI2Cx->CR2, FMPI2C_CR2_HEAD10R);
1991 }
1992 
1999 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledAuto10BitRead(const FMPI2C_TypeDef *FMPI2Cx)
2000 {
2001  return ((READ_BIT(FMPI2Cx->CR2, FMPI2C_CR2_HEAD10R) != (FMPI2C_CR2_HEAD10R)) ? 1UL : 0UL);
2002 }
2003 
2014 __STATIC_INLINE void LL_FMPI2C_SetTransferRequest(FMPI2C_TypeDef *FMPI2Cx, uint32_t TransferRequest)
2015 {
2016  MODIFY_REG(FMPI2Cx->CR2, FMPI2C_CR2_RD_WRN, TransferRequest);
2017 }
2018 
2027 __STATIC_INLINE uint32_t LL_FMPI2C_GetTransferRequest(const FMPI2C_TypeDef *FMPI2Cx)
2028 {
2029  return (uint32_t)(READ_BIT(FMPI2Cx->CR2, FMPI2C_CR2_RD_WRN));
2030 }
2031 
2040 __STATIC_INLINE void LL_FMPI2C_SetSlaveAddr(FMPI2C_TypeDef *FMPI2Cx, uint32_t SlaveAddr)
2041 {
2042  MODIFY_REG(FMPI2Cx->CR2, FMPI2C_CR2_SADD, SlaveAddr);
2043 }
2044 
2051 __STATIC_INLINE uint32_t LL_FMPI2C_GetSlaveAddr(const FMPI2C_TypeDef *FMPI2Cx)
2052 {
2053  return (uint32_t)(READ_BIT(FMPI2Cx->CR2, FMPI2C_CR2_SADD));
2054 }
2055 
2094 __STATIC_INLINE void LL_FMPI2C_HandleTransfer(FMPI2C_TypeDef *FMPI2Cx, uint32_t SlaveAddr, uint32_t SlaveAddrSize,
2095  uint32_t TransferSize, uint32_t EndMode, uint32_t Request)
2096 {
2097  /* Declaration of tmp to prevent undefined behavior of volatile usage */
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));
2102 
2103  /* update CR2 register */
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,
2108  tmp);
2109 }
2110 
2121 __STATIC_INLINE uint32_t LL_FMPI2C_GetTransferDirection(const FMPI2C_TypeDef *FMPI2Cx)
2122 {
2123  return (uint32_t)(READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_DIR));
2124 }
2125 
2132 __STATIC_INLINE uint32_t LL_FMPI2C_GetAddressMatchCode(const FMPI2C_TypeDef *FMPI2Cx)
2133 {
2134  return (uint32_t)(READ_BIT(FMPI2Cx->ISR, FMPI2C_ISR_ADDCODE) >> FMPI2C_ISR_ADDCODE_Pos << 1);
2135 }
2136 
2149 __STATIC_INLINE void LL_FMPI2C_EnableSMBusPECCompare(FMPI2C_TypeDef *FMPI2Cx)
2150 {
2151  SET_BIT(FMPI2Cx->CR2, FMPI2C_CR2_PECBYTE);
2152 }
2153 
2162 __STATIC_INLINE uint32_t LL_FMPI2C_IsEnabledSMBusPECCompare(const FMPI2C_TypeDef *FMPI2Cx)
2163 {
2164  return ((READ_BIT(FMPI2Cx->CR2, FMPI2C_CR2_PECBYTE) == (FMPI2C_CR2_PECBYTE)) ? 1UL : 0UL);
2165 }
2166 
2175 __STATIC_INLINE uint32_t LL_FMPI2C_GetSMBusPEC(const FMPI2C_TypeDef *FMPI2Cx)
2176 {
2177  return (uint32_t)(READ_BIT(FMPI2Cx->PECR, FMPI2C_PECR_PEC));
2178 }
2179 
2186 __STATIC_INLINE uint8_t LL_FMPI2C_ReceiveData8(const FMPI2C_TypeDef *FMPI2Cx)
2187 {
2188  return (uint8_t)(READ_BIT(FMPI2Cx->RXDR, FMPI2C_RXDR_RXDATA));
2189 }
2190 
2198 __STATIC_INLINE void LL_FMPI2C_TransmitData8(FMPI2C_TypeDef *FMPI2Cx, uint8_t Data)
2199 {
2200  WRITE_REG(FMPI2Cx->TXDR, Data);
2201 }
2202 
2207 #if defined(USE_FULL_LL_DRIVER)
2212 ErrorStatus LL_FMPI2C_Init(FMPI2C_TypeDef *FMPI2Cx, const LL_FMPI2C_InitTypeDef *FMPI2C_InitStruct);
2213 ErrorStatus LL_FMPI2C_DeInit(const FMPI2C_TypeDef *FMPI2Cx);
2214 void LL_FMPI2C_StructInit(LL_FMPI2C_InitTypeDef *FMPI2C_InitStruct);
2215 
2216 
2220 #endif /* USE_FULL_LL_DRIVER */
2221 
2230 #endif /* FMPI2C1 */
2231 
2236 #endif /* FMPI2C_CR1_PE */
2237 #ifdef __cplusplus
2238 }
2239 #endif
2240 
2241 #endif /* STM32F4xx_LL_FMPI2C_H */
__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.