stm32f4xx_fmpi2c.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_fmpi2c.h
  4. * @author MCD Application Team
  5. * @version V1.8.0
  6. * @date 04-November-2016
  7. * @brief This file contains all the functions prototypes for the I2C Fast Mode
  8. * Plus firmware library.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * <h2><center>&copy; COPYRIGHT 2016 STMicroelectronics</center></h2>
  13. *
  14. * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  15. * You may not use this file except in compliance with the License.
  16. * You may obtain a copy of the License at:
  17. *
  18. * http://www.st.com/software_license_agreement_liberty_v2
  19. *
  20. * Unless required by applicable law or agreed to in writing, software
  21. * distributed under the License is distributed on an "AS IS" BASIS,
  22. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the License for the specific language governing permissions and
  24. * limitations under the License.
  25. *
  26. ******************************************************************************
  27. */
  28. /* Define to prevent recursive inclusion -------------------------------------*/
  29. #ifndef __STM32F4xx_FMPI2C_H
  30. #define __STM32F4xx_FMPI2C_H
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. /* Includes ------------------------------------------------------------------*/
  35. #include "stm32f4xx.h"
  36. /** @addtogroup STM32F4xx_StdPeriph_Driver
  37. * @{
  38. */
  39. /** @addtogroup FMPI2C
  40. * @{
  41. */
  42. #if defined(STM32F410xx) || defined(STM32F412xG) || defined(STM32F413_423xx) || defined(STM32F446xx)
  43. /* Exported types ------------------------------------------------------------*/
  44. /**
  45. * @brief FMPI2C Init structure definition
  46. */
  47. typedef struct
  48. {
  49. uint32_t FMPI2C_Timing; /*!< Specifies the FMPI2C_TIMINGR_register value.
  50. This parameter calculated by referring to FMPI2C initialization
  51. section in Reference manual*/
  52. uint32_t FMPI2C_AnalogFilter; /*!< Enables or disables analog noise filter.
  53. This parameter can be a value of @ref FMPI2C_Analog_Filter */
  54. uint32_t FMPI2C_DigitalFilter; /*!< Configures the digital noise filter.
  55. This parameter can be a number between 0x00 and 0x0F */
  56. uint32_t FMPI2C_Mode; /*!< Specifies the FMPI2C mode.
  57. This parameter can be a value of @ref FMPI2C_mode */
  58. uint32_t FMPI2C_OwnAddress1; /*!< Specifies the device own address 1.
  59. This parameter can be a 7-bit or 10-bit address */
  60. uint32_t FMPI2C_Ack; /*!< Enables or disables the acknowledgement.
  61. This parameter can be a value of @ref FMPI2C_acknowledgement */
  62. uint32_t FMPI2C_AcknowledgedAddress; /*!< Specifies if 7-bit or 10-bit address is acknowledged.
  63. This parameter can be a value of @ref FMPI2C_acknowledged_address */
  64. }FMPI2C_InitTypeDef;
  65. /* Exported constants --------------------------------------------------------*/
  66. /** @defgroup FMPI2C_Exported_Constants
  67. * @{
  68. */
  69. #define IS_FMPI2C_ALL_PERIPH(PERIPH) ((PERIPH) == FMPI2C1)
  70. /** @defgroup FMPI2C_Analog_Filter
  71. * @{
  72. */
  73. #define FMPI2C_AnalogFilter_Enable ((uint32_t)0x00000000)
  74. #define FMPI2C_AnalogFilter_Disable FMPI2C_CR1_ANFOFF
  75. #define IS_FMPI2C_ANALOG_FILTER(FILTER) (((FILTER) == FMPI2C_AnalogFilter_Enable) || \
  76. ((FILTER) == FMPI2C_AnalogFilter_Disable))
  77. /**
  78. * @}
  79. */
  80. /** @defgroup FMPI2C_Digital_Filter
  81. * @{
  82. */
  83. #define IS_FMPI2C_DIGITAL_FILTER(FILTER) ((FILTER) <= 0x0000000F)
  84. /**
  85. * @}
  86. */
  87. /** @defgroup FMPI2C_mode
  88. * @{
  89. */
  90. #define FMPI2C_Mode_FMPI2C ((uint32_t)0x00000000)
  91. #define FMPI2C_Mode_SMBusDevice FMPI2C_CR1_SMBDEN
  92. #define FMPI2C_Mode_SMBusHost FMPI2C_CR1_SMBHEN
  93. #define IS_FMPI2C_MODE(MODE) (((MODE) == FMPI2C_Mode_FMPI2C) || \
  94. ((MODE) == FMPI2C_Mode_SMBusDevice) || \
  95. ((MODE) == FMPI2C_Mode_SMBusHost))
  96. /**
  97. * @}
  98. */
  99. /** @defgroup FMPI2C_acknowledgement
  100. * @{
  101. */
  102. #define FMPI2C_Ack_Enable ((uint32_t)0x00000000)
  103. #define FMPI2C_Ack_Disable FMPI2C_CR2_NACK
  104. #define IS_FMPI2C_ACK(ACK) (((ACK) == FMPI2C_Ack_Enable) || \
  105. ((ACK) == FMPI2C_Ack_Disable))
  106. /**
  107. * @}
  108. */
  109. /** @defgroup FMPI2C_acknowledged_address
  110. * @{
  111. */
  112. #define FMPI2C_AcknowledgedAddress_7bit ((uint32_t)0x00000000)
  113. #define FMPI2C_AcknowledgedAddress_10bit FMPI2C_OAR1_OA1MODE
  114. #define IS_FMPI2C_ACKNOWLEDGE_ADDRESS(ADDRESS) (((ADDRESS) == FMPI2C_AcknowledgedAddress_7bit) || \
  115. ((ADDRESS) == FMPI2C_AcknowledgedAddress_10bit))
  116. /**
  117. * @}
  118. */
  119. /** @defgroup FMPI2C_own_address1
  120. * @{
  121. */
  122. #define IS_FMPI2C_OWN_ADDRESS1(ADDRESS1) ((ADDRESS1) <= (uint32_t)0x000003FF)
  123. /**
  124. * @}
  125. */
  126. /** @defgroup FMPI2C_transfer_direction
  127. * @{
  128. */
  129. #define FMPI2C_Direction_Transmitter ((uint16_t)0x0000)
  130. #define FMPI2C_Direction_Receiver ((uint16_t)0x0400)
  131. #define IS_FMPI2C_DIRECTION(DIRECTION) (((DIRECTION) == FMPI2C_Direction_Transmitter) || \
  132. ((DIRECTION) == FMPI2C_Direction_Receiver))
  133. /**
  134. * @}
  135. */
  136. /** @defgroup FMPI2C_DMA_transfer_requests
  137. * @{
  138. */
  139. #define FMPI2C_DMAReq_Tx FMPI2C_CR1_TXDMAEN
  140. #define FMPI2C_DMAReq_Rx FMPI2C_CR1_RXDMAEN
  141. #define IS_FMPI2C_DMA_REQ(REQ) ((((REQ) & (uint32_t)0xFFFF3FFF) == 0x00) && ((REQ) != 0x00))
  142. /**
  143. * @}
  144. */
  145. /** @defgroup FMPI2C_slave_address
  146. * @{
  147. */
  148. #define IS_FMPI2C_SLAVE_ADDRESS(ADDRESS) ((ADDRESS) <= (uint16_t)0x03FF)
  149. /**
  150. * @}
  151. */
  152. /** @defgroup FMPI2C_own_address2
  153. * @{
  154. */
  155. #define IS_FMPI2C_OWN_ADDRESS2(ADDRESS2) ((ADDRESS2) <= (uint16_t)0x00FF)
  156. /**
  157. * @}
  158. */
  159. /** @defgroup FMPI2C_own_address2_mask
  160. * @{
  161. */
  162. #define FMPI2C_OA2_NoMask ((uint8_t)0x00)
  163. #define FMPI2C_OA2_Mask01 ((uint8_t)0x01)
  164. #define FMPI2C_OA2_Mask02 ((uint8_t)0x02)
  165. #define FMPI2C_OA2_Mask03 ((uint8_t)0x03)
  166. #define FMPI2C_OA2_Mask04 ((uint8_t)0x04)
  167. #define FMPI2C_OA2_Mask05 ((uint8_t)0x05)
  168. #define FMPI2C_OA2_Mask06 ((uint8_t)0x06)
  169. #define FMPI2C_OA2_Mask07 ((uint8_t)0x07)
  170. #define IS_FMPI2C_OWN_ADDRESS2_MASK(MASK) (((MASK) == FMPI2C_OA2_NoMask) || \
  171. ((MASK) == FMPI2C_OA2_Mask01) || \
  172. ((MASK) == FMPI2C_OA2_Mask02) || \
  173. ((MASK) == FMPI2C_OA2_Mask03) || \
  174. ((MASK) == FMPI2C_OA2_Mask04) || \
  175. ((MASK) == FMPI2C_OA2_Mask05) || \
  176. ((MASK) == FMPI2C_OA2_Mask06) || \
  177. ((MASK) == FMPI2C_OA2_Mask07))
  178. /**
  179. * @}
  180. */
  181. /** @defgroup FMPI2C_timeout
  182. * @{
  183. */
  184. #define IS_FMPI2C_TIMEOUT(TIMEOUT) ((TIMEOUT) <= (uint16_t)0x0FFF)
  185. /**
  186. * @}
  187. */
  188. /** @defgroup FMPI2C_registers
  189. * @{
  190. */
  191. #define FMPI2C_Register_CR1 ((uint8_t)0x00)
  192. #define FMPI2C_Register_CR2 ((uint8_t)0x04)
  193. #define FMPI2C_Register_OAR1 ((uint8_t)0x08)
  194. #define FMPI2C_Register_OAR2 ((uint8_t)0x0C)
  195. #define FMPI2C_Register_TIMINGR ((uint8_t)0x10)
  196. #define FMPI2C_Register_TIMEOUTR ((uint8_t)0x14)
  197. #define FMPI2C_Register_ISR ((uint8_t)0x18)
  198. #define FMPI2C_Register_ICR ((uint8_t)0x1C)
  199. #define FMPI2C_Register_PECR ((uint8_t)0x20)
  200. #define FMPI2C_Register_RXDR ((uint8_t)0x24)
  201. #define FMPI2C_Register_TXDR ((uint8_t)0x28)
  202. #define IS_FMPI2C_REGISTER(REGISTER) (((REGISTER) == FMPI2C_Register_CR1) || \
  203. ((REGISTER) == FMPI2C_Register_CR2) || \
  204. ((REGISTER) == FMPI2C_Register_OAR1) || \
  205. ((REGISTER) == FMPI2C_Register_OAR2) || \
  206. ((REGISTER) == FMPI2C_Register_TIMINGR) || \
  207. ((REGISTER) == FMPI2C_Register_TIMEOUTR) || \
  208. ((REGISTER) == FMPI2C_Register_ISR) || \
  209. ((REGISTER) == FMPI2C_Register_ICR) || \
  210. ((REGISTER) == FMPI2C_Register_PECR) || \
  211. ((REGISTER) == FMPI2C_Register_RXDR) || \
  212. ((REGISTER) == FMPI2C_Register_TXDR))
  213. /**
  214. * @}
  215. */
  216. /** @defgroup FMPI2C_interrupts_definition
  217. * @{
  218. */
  219. #define FMPI2C_IT_ERRI FMPI2C_CR1_ERRIE
  220. #define FMPI2C_IT_TCI FMPI2C_CR1_TCIE
  221. #define FMPI2C_IT_STOPI FMPI2C_CR1_STOPIE
  222. #define FMPI2C_IT_NACKI FMPI2C_CR1_NACKIE
  223. #define FMPI2C_IT_ADDRI FMPI2C_CR1_ADDRIE
  224. #define FMPI2C_IT_RXI FMPI2C_CR1_RXIE
  225. #define FMPI2C_IT_TXI FMPI2C_CR1_TXIE
  226. #define IS_FMPI2C_CONFIG_IT(IT) ((((IT) & (uint32_t)0xFFFFFF01) == 0x00) && ((IT) != 0x00))
  227. /**
  228. * @}
  229. */
  230. /** @defgroup FMPI2C_flags_definition
  231. * @{
  232. */
  233. #define FMPI2C_FLAG_TXE FMPI2C_ISR_TXE
  234. #define FMPI2C_FLAG_TXIS FMPI2C_ISR_TXIS
  235. #define FMPI2C_FLAG_RXNE FMPI2C_ISR_RXNE
  236. #define FMPI2C_FLAG_ADDR FMPI2C_ISR_ADDR
  237. #define FMPI2C_FLAG_NACKF FMPI2C_ISR_NACKF
  238. #define FMPI2C_FLAG_STOPF FMPI2C_ISR_STOPF
  239. #define FMPI2C_FLAG_TC FMPI2C_ISR_TC
  240. #define FMPI2C_FLAG_TCR FMPI2C_ISR_TCR
  241. #define FMPI2C_FLAG_BERR FMPI2C_ISR_BERR
  242. #define FMPI2C_FLAG_ARLO FMPI2C_ISR_ARLO
  243. #define FMPI2C_FLAG_OVR FMPI2C_ISR_OVR
  244. #define FMPI2C_FLAG_PECERR FMPI2C_ISR_PECERR
  245. #define FMPI2C_FLAG_TIMEOUT FMPI2C_ISR_TIMEOUT
  246. #define FMPI2C_FLAG_ALERT FMPI2C_ISR_ALERT
  247. #define FMPI2C_FLAG_BUSY FMPI2C_ISR_BUSY
  248. #define IS_FMPI2C_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFF4000) == 0x00) && ((FLAG) != 0x00))
  249. #define IS_FMPI2C_GET_FLAG(FLAG) (((FLAG) == FMPI2C_FLAG_TXE) || ((FLAG) == FMPI2C_FLAG_TXIS) || \
  250. ((FLAG) == FMPI2C_FLAG_RXNE) || ((FLAG) == FMPI2C_FLAG_ADDR) || \
  251. ((FLAG) == FMPI2C_FLAG_NACKF) || ((FLAG) == FMPI2C_FLAG_STOPF) || \
  252. ((FLAG) == FMPI2C_FLAG_TC) || ((FLAG) == FMPI2C_FLAG_TCR) || \
  253. ((FLAG) == FMPI2C_FLAG_BERR) || ((FLAG) == FMPI2C_FLAG_ARLO) || \
  254. ((FLAG) == FMPI2C_FLAG_OVR) || ((FLAG) == FMPI2C_FLAG_PECERR) || \
  255. ((FLAG) == FMPI2C_FLAG_TIMEOUT) || ((FLAG) == FMPI2C_FLAG_ALERT) || \
  256. ((FLAG) == FMPI2C_FLAG_BUSY))
  257. /**
  258. * @}
  259. */
  260. /** @defgroup FMPI2C_interrupts_definition
  261. * @{
  262. */
  263. #define FMPI2C_IT_TXIS FMPI2C_ISR_TXIS
  264. #define FMPI2C_IT_RXNE FMPI2C_ISR_RXNE
  265. #define FMPI2C_IT_ADDR FMPI2C_ISR_ADDR
  266. #define FMPI2C_IT_NACKF FMPI2C_ISR_NACKF
  267. #define FMPI2C_IT_STOPF FMPI2C_ISR_STOPF
  268. #define FMPI2C_IT_TC FMPI2C_ISR_TC
  269. #define FMPI2C_IT_TCR FMPI2C_ISR_TCR
  270. #define FMPI2C_IT_BERR FMPI2C_ISR_BERR
  271. #define FMPI2C_IT_ARLO FMPI2C_ISR_ARLO
  272. #define FMPI2C_IT_OVR FMPI2C_ISR_OVR
  273. #define FMPI2C_IT_PECERR FMPI2C_ISR_PECERR
  274. #define FMPI2C_IT_TIMEOUT FMPI2C_ISR_TIMEOUT
  275. #define FMPI2C_IT_ALERT FMPI2C_ISR_ALERT
  276. #define IS_FMPI2C_CLEAR_IT(IT) ((((IT) & (uint32_t)0xFFFFC001) == 0x00) && ((IT) != 0x00))
  277. #define IS_FMPI2C_GET_IT(IT) (((IT) == FMPI2C_IT_TXIS) || ((IT) == FMPI2C_IT_RXNE) || \
  278. ((IT) == FMPI2C_IT_ADDR) || ((IT) == FMPI2C_IT_NACKF) || \
  279. ((IT) == FMPI2C_IT_STOPF) || ((IT) == FMPI2C_IT_TC) || \
  280. ((IT) == FMPI2C_IT_TCR) || ((IT) == FMPI2C_IT_BERR) || \
  281. ((IT) == FMPI2C_IT_ARLO) || ((IT) == FMPI2C_IT_OVR) || \
  282. ((IT) == FMPI2C_IT_PECERR) || ((IT) == FMPI2C_IT_TIMEOUT) || \
  283. ((IT) == FMPI2C_IT_ALERT))
  284. /**
  285. * @}
  286. */
  287. /** @defgroup FMPI2C_ReloadEndMode_definition
  288. * @{
  289. */
  290. #define FMPI2C_Reload_Mode FMPI2C_CR2_RELOAD
  291. #define FMPI2C_AutoEnd_Mode FMPI2C_CR2_AUTOEND
  292. #define FMPI2C_SoftEnd_Mode ((uint32_t)0x00000000)
  293. #define IS_RELOAD_END_MODE(MODE) (((MODE) == FMPI2C_Reload_Mode) || \
  294. ((MODE) == FMPI2C_AutoEnd_Mode) || \
  295. ((MODE) == FMPI2C_SoftEnd_Mode))
  296. /**
  297. * @}
  298. */
  299. /** @defgroup FMPI2C_StartStopMode_definition
  300. * @{
  301. */
  302. #define FMPI2C_No_StartStop ((uint32_t)0x00000000)
  303. #define FMPI2C_Generate_Stop FMPI2C_CR2_STOP
  304. #define FMPI2C_Generate_Start_Read (uint32_t)(FMPI2C_CR2_START | FMPI2C_CR2_RD_WRN)
  305. #define FMPI2C_Generate_Start_Write FMPI2C_CR2_START
  306. #define IS_START_STOP_MODE(MODE) (((MODE) == FMPI2C_Generate_Stop) || \
  307. ((MODE) == FMPI2C_Generate_Start_Read) || \
  308. ((MODE) == FMPI2C_Generate_Start_Write) || \
  309. ((MODE) == FMPI2C_No_StartStop))
  310. /**
  311. * @}
  312. */
  313. /**
  314. * @}
  315. */
  316. /* Exported macro ------------------------------------------------------------*/
  317. /* Exported functions ------------------------------------------------------- */
  318. /* Initialization and Configuration functions *********************************/
  319. void FMPI2C_DeInit(FMPI2C_TypeDef* FMPI2Cx);
  320. void FMPI2C_Init(FMPI2C_TypeDef* FMPI2Cx, FMPI2C_InitTypeDef* FMPI2C_InitStruct);
  321. void FMPI2C_StructInit(FMPI2C_InitTypeDef* FMPI2C_InitStruct);
  322. void FMPI2C_Cmd(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  323. void FMPI2C_SoftwareResetCmd(FMPI2C_TypeDef* FMPI2Cx);
  324. void FMPI2C_ITConfig(FMPI2C_TypeDef* FMPI2Cx, uint32_t FMPI2C_IT, FunctionalState NewState);
  325. void FMPI2C_StretchClockCmd(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  326. void FMPI2C_DualAddressCmd(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  327. void FMPI2C_OwnAddress2Config(FMPI2C_TypeDef* FMPI2Cx, uint16_t Address, uint8_t Mask);
  328. void FMPI2C_GeneralCallCmd(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  329. void FMPI2C_SlaveByteControlCmd(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  330. void FMPI2C_SlaveAddressConfig(FMPI2C_TypeDef* FMPI2Cx, uint16_t Address);
  331. void FMPI2C_10BitAddressingModeCmd(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  332. /* Communications handling functions ******************************************/
  333. void FMPI2C_AutoEndCmd(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  334. void FMPI2C_ReloadCmd(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  335. void FMPI2C_NumberOfBytesConfig(FMPI2C_TypeDef* FMPI2Cx, uint8_t Number_Bytes);
  336. void FMPI2C_MasterRequestConfig(FMPI2C_TypeDef* FMPI2Cx, uint16_t FMPI2C_Direction);
  337. void FMPI2C_GenerateSTART(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  338. void FMPI2C_GenerateSTOP(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  339. void FMPI2C_10BitAddressHeaderCmd(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  340. void FMPI2C_AcknowledgeConfig(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  341. uint8_t FMPI2C_GetAddressMatched(FMPI2C_TypeDef* FMPI2Cx);
  342. uint16_t FMPI2C_GetTransferDirection(FMPI2C_TypeDef* FMPI2Cx);
  343. void FMPI2C_TransferHandling(FMPI2C_TypeDef* FMPI2Cx, uint16_t Address, uint8_t Number_Bytes, uint32_t ReloadEndMode, uint32_t StartStopMode);
  344. /* SMBUS management functions ************************************************/
  345. void FMPI2C_SMBusAlertCmd(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  346. void FMPI2C_ClockTimeoutCmd(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  347. void FMPI2C_ExtendedClockTimeoutCmd(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  348. void FMPI2C_IdleClockTimeoutCmd(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  349. void FMPI2C_TimeoutAConfig(FMPI2C_TypeDef* FMPI2Cx, uint16_t Timeout);
  350. void FMPI2C_TimeoutBConfig(FMPI2C_TypeDef* FMPI2Cx, uint16_t Timeout);
  351. void FMPI2C_CalculatePEC(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  352. void FMPI2C_PECRequestCmd(FMPI2C_TypeDef* FMPI2Cx, FunctionalState NewState);
  353. uint8_t FMPI2C_GetPEC(FMPI2C_TypeDef* FMPI2Cx);
  354. /* FMPI2C registers management functions *****************************************/
  355. uint32_t FMPI2C_ReadRegister(FMPI2C_TypeDef* FMPI2Cx, uint8_t FMPI2C_Register);
  356. /* Data transfers management functions ****************************************/
  357. void FMPI2C_SendData(FMPI2C_TypeDef* FMPI2Cx, uint8_t Data);
  358. uint8_t FMPI2C_ReceiveData(FMPI2C_TypeDef* FMPI2Cx);
  359. /* DMA transfers management functions *****************************************/
  360. void FMPI2C_DMACmd(FMPI2C_TypeDef* FMPI2Cx, uint32_t FMPI2C_DMAReq, FunctionalState NewState);
  361. /* Interrupts and flags management functions **********************************/
  362. FlagStatus FMPI2C_GetFlagStatus(FMPI2C_TypeDef* FMPI2Cx, uint32_t FMPI2C_FLAG);
  363. void FMPI2C_ClearFlag(FMPI2C_TypeDef* FMPI2Cx, uint32_t FMPI2C_FLAG);
  364. ITStatus FMPI2C_GetITStatus(FMPI2C_TypeDef* FMPI2Cx, uint32_t FMPI2C_IT);
  365. void FMPI2C_ClearITPendingBit(FMPI2C_TypeDef* FMPI2Cx, uint32_t FMPI2C_IT);
  366. #endif /* STM32F410xx || STM32F412xG || STM32F413_423xx || STM32F446xx */
  367. /**
  368. * @}
  369. */
  370. /**
  371. * @}
  372. */
  373. #ifdef __cplusplus
  374. }
  375. #endif
  376. #endif /*__STM32F4xx_FMPI2C_H */
  377. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/