stm32f4xx_hal_fmpsmbus.h 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_hal_fmpsmbus.h
  4. * @author MCD Application Team
  5. * @brief Header file of FMPSMBUS HAL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under BSD 3-Clause license,
  13. * the "License"; You may not use this file except in compliance with the
  14. * License. You may obtain a copy of the License at:
  15. * opensource.org/licenses/BSD-3-Clause
  16. *
  17. ******************************************************************************
  18. */
  19. /* Define to prevent recursive inclusion -------------------------------------*/
  20. #ifndef STM32F4xx_HAL_FMPSMBUS_H
  21. #define STM32F4xx_HAL_FMPSMBUS_H
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. #if defined(FMPI2C_CR1_PE)
  26. /* Includes ------------------------------------------------------------------*/
  27. #include "stm32f4xx_hal_def.h"
  28. #include "stm32f4xx_hal_fmpsmbus_ex.h"
  29. /** @addtogroup STM32F4xx_HAL_Driver
  30. * @{
  31. */
  32. /** @addtogroup FMPSMBUS
  33. * @{
  34. */
  35. /* Exported types ------------------------------------------------------------*/
  36. /** @defgroup FMPSMBUS_Exported_Types FMPSMBUS Exported Types
  37. * @{
  38. */
  39. /** @defgroup FMPSMBUS_Configuration_Structure_definition FMPSMBUS Configuration Structure definition
  40. * @brief FMPSMBUS Configuration Structure definition
  41. * @{
  42. */
  43. typedef struct
  44. {
  45. uint32_t Timing; /*!< Specifies the FMPSMBUS_TIMINGR_register value.
  46. This parameter calculated by referring to FMPSMBUS initialization
  47. section in Reference manual */
  48. uint32_t AnalogFilter; /*!< Specifies if Analog Filter is enable or not.
  49. This parameter can be a value of @ref FMPSMBUS_Analog_Filter */
  50. uint32_t OwnAddress1; /*!< Specifies the first device own address.
  51. This parameter can be a 7-bit or 10-bit address. */
  52. uint32_t AddressingMode; /*!< Specifies if 7-bit or 10-bit addressing mode for master is selected.
  53. This parameter can be a value of @ref FMPSMBUS_addressing_mode */
  54. uint32_t DualAddressMode; /*!< Specifies if dual addressing mode is selected.
  55. This parameter can be a value of @ref FMPSMBUS_dual_addressing_mode */
  56. uint32_t OwnAddress2; /*!< Specifies the second device own address if dual addressing mode is selected
  57. This parameter can be a 7-bit address. */
  58. uint32_t OwnAddress2Masks; /*!< Specifies the acknowledge mask address second device own address if dual addressing mode is selected
  59. This parameter can be a value of @ref FMPSMBUS_own_address2_masks. */
  60. uint32_t GeneralCallMode; /*!< Specifies if general call mode is selected.
  61. This parameter can be a value of @ref FMPSMBUS_general_call_addressing_mode. */
  62. uint32_t NoStretchMode; /*!< Specifies if nostretch mode is selected.
  63. This parameter can be a value of @ref FMPSMBUS_nostretch_mode */
  64. uint32_t PacketErrorCheckMode; /*!< Specifies if Packet Error Check mode is selected.
  65. This parameter can be a value of @ref FMPSMBUS_packet_error_check_mode */
  66. uint32_t PeripheralMode; /*!< Specifies which mode of Periphal is selected.
  67. This parameter can be a value of @ref FMPSMBUS_peripheral_mode */
  68. uint32_t SMBusTimeout; /*!< Specifies the content of the 32 Bits FMPSMBUS_TIMEOUT_register value.
  69. (Enable bits and different timeout values)
  70. This parameter calculated by referring to FMPSMBUS initialization
  71. section in Reference manual */
  72. } FMPSMBUS_InitTypeDef;
  73. /**
  74. * @}
  75. */
  76. /** @defgroup HAL_state_definition HAL state definition
  77. * @brief HAL State definition
  78. * @{
  79. */
  80. #define HAL_FMPSMBUS_STATE_RESET (0x00000000U) /*!< FMPSMBUS not yet initialized or disabled */
  81. #define HAL_FMPSMBUS_STATE_READY (0x00000001U) /*!< FMPSMBUS initialized and ready for use */
  82. #define HAL_FMPSMBUS_STATE_BUSY (0x00000002U) /*!< FMPSMBUS internal process is ongoing */
  83. #define HAL_FMPSMBUS_STATE_MASTER_BUSY_TX (0x00000012U) /*!< Master Data Transmission process is ongoing */
  84. #define HAL_FMPSMBUS_STATE_MASTER_BUSY_RX (0x00000022U) /*!< Master Data Reception process is ongoing */
  85. #define HAL_FMPSMBUS_STATE_SLAVE_BUSY_TX (0x00000032U) /*!< Slave Data Transmission process is ongoing */
  86. #define HAL_FMPSMBUS_STATE_SLAVE_BUSY_RX (0x00000042U) /*!< Slave Data Reception process is ongoing */
  87. #define HAL_FMPSMBUS_STATE_TIMEOUT (0x00000003U) /*!< Timeout state */
  88. #define HAL_FMPSMBUS_STATE_ERROR (0x00000004U) /*!< Reception process is ongoing */
  89. #define HAL_FMPSMBUS_STATE_LISTEN (0x00000008U) /*!< Address Listen Mode is ongoing */
  90. /**
  91. * @}
  92. */
  93. /** @defgroup FMPSMBUS_Error_Code_definition FMPSMBUS Error Code definition
  94. * @brief FMPSMBUS Error Code definition
  95. * @{
  96. */
  97. #define HAL_FMPSMBUS_ERROR_NONE (0x00000000U) /*!< No error */
  98. #define HAL_FMPSMBUS_ERROR_BERR (0x00000001U) /*!< BERR error */
  99. #define HAL_FMPSMBUS_ERROR_ARLO (0x00000002U) /*!< ARLO error */
  100. #define HAL_FMPSMBUS_ERROR_ACKF (0x00000004U) /*!< ACKF error */
  101. #define HAL_FMPSMBUS_ERROR_OVR (0x00000008U) /*!< OVR error */
  102. #define HAL_FMPSMBUS_ERROR_HALTIMEOUT (0x00000010U) /*!< Timeout error */
  103. #define HAL_FMPSMBUS_ERROR_BUSTIMEOUT (0x00000020U) /*!< Bus Timeout error */
  104. #define HAL_FMPSMBUS_ERROR_ALERT (0x00000040U) /*!< Alert error */
  105. #define HAL_FMPSMBUS_ERROR_PECERR (0x00000080U) /*!< PEC error */
  106. #if (USE_HAL_FMPSMBUS_REGISTER_CALLBACKS == 1)
  107. #define HAL_FMPSMBUS_ERROR_INVALID_CALLBACK (0x00000100U) /*!< Invalid Callback error */
  108. #endif /* USE_HAL_FMPSMBUS_REGISTER_CALLBACKS */
  109. #define HAL_FMPSMBUS_ERROR_INVALID_PARAM (0x00000200U) /*!< Invalid Parameters error */
  110. /**
  111. * @}
  112. */
  113. /** @defgroup FMPSMBUS_handle_Structure_definition FMPSMBUS handle Structure definition
  114. * @brief FMPSMBUS handle Structure definition
  115. * @{
  116. */
  117. #if (USE_HAL_FMPSMBUS_REGISTER_CALLBACKS == 1)
  118. typedef struct __FMPSMBUS_HandleTypeDef
  119. #else
  120. typedef struct
  121. #endif /* USE_HAL_FMPSMBUS_REGISTER_CALLBACKS */
  122. {
  123. FMPI2C_TypeDef *Instance; /*!< FMPSMBUS registers base address */
  124. FMPSMBUS_InitTypeDef Init; /*!< FMPSMBUS communication parameters */
  125. uint8_t *pBuffPtr; /*!< Pointer to FMPSMBUS transfer buffer */
  126. uint16_t XferSize; /*!< FMPSMBUS transfer size */
  127. __IO uint16_t XferCount; /*!< FMPSMBUS transfer counter */
  128. __IO uint32_t XferOptions; /*!< FMPSMBUS transfer options */
  129. __IO uint32_t PreviousState; /*!< FMPSMBUS communication Previous state */
  130. HAL_LockTypeDef Lock; /*!< FMPSMBUS locking object */
  131. __IO uint32_t State; /*!< FMPSMBUS communication state */
  132. __IO uint32_t ErrorCode; /*!< FMPSMBUS Error code */
  133. #if (USE_HAL_FMPSMBUS_REGISTER_CALLBACKS == 1)
  134. void (* MasterTxCpltCallback)(struct __FMPSMBUS_HandleTypeDef *hfmpsmbus); /*!< FMPSMBUS Master Tx Transfer completed callback */
  135. void (* MasterRxCpltCallback)(struct __FMPSMBUS_HandleTypeDef *hfmpsmbus); /*!< FMPSMBUS Master Rx Transfer completed callback */
  136. void (* SlaveTxCpltCallback)(struct __FMPSMBUS_HandleTypeDef *hfmpsmbus); /*!< FMPSMBUS Slave Tx Transfer completed callback */
  137. void (* SlaveRxCpltCallback)(struct __FMPSMBUS_HandleTypeDef *hfmpsmbus); /*!< FMPSMBUS Slave Rx Transfer completed callback */
  138. void (* ListenCpltCallback)(struct __FMPSMBUS_HandleTypeDef *hfmpsmbus); /*!< FMPSMBUS Listen Complete callback */
  139. void (* ErrorCallback)(struct __FMPSMBUS_HandleTypeDef *hfmpsmbus); /*!< FMPSMBUS Error callback */
  140. void (* AddrCallback)(struct __FMPSMBUS_HandleTypeDef *hfmpsmbus, uint8_t TransferDirection, uint16_t AddrMatchCode); /*!< FMPSMBUS Slave Address Match callback */
  141. void (* MspInitCallback)(struct __FMPSMBUS_HandleTypeDef *hfmpsmbus); /*!< FMPSMBUS Msp Init callback */
  142. void (* MspDeInitCallback)(struct __FMPSMBUS_HandleTypeDef *hfmpsmbus); /*!< FMPSMBUS Msp DeInit callback */
  143. #endif /* USE_HAL_FMPSMBUS_REGISTER_CALLBACKS */
  144. } FMPSMBUS_HandleTypeDef;
  145. #if (USE_HAL_FMPSMBUS_REGISTER_CALLBACKS == 1)
  146. /**
  147. * @brief HAL FMPSMBUS Callback ID enumeration definition
  148. */
  149. typedef enum
  150. {
  151. HAL_FMPSMBUS_MASTER_TX_COMPLETE_CB_ID = 0x00U, /*!< FMPSMBUS Master Tx Transfer completed callback ID */
  152. HAL_FMPSMBUS_MASTER_RX_COMPLETE_CB_ID = 0x01U, /*!< FMPSMBUS Master Rx Transfer completed callback ID */
  153. HAL_FMPSMBUS_SLAVE_TX_COMPLETE_CB_ID = 0x02U, /*!< FMPSMBUS Slave Tx Transfer completed callback ID */
  154. HAL_FMPSMBUS_SLAVE_RX_COMPLETE_CB_ID = 0x03U, /*!< FMPSMBUS Slave Rx Transfer completed callback ID */
  155. HAL_FMPSMBUS_LISTEN_COMPLETE_CB_ID = 0x04U, /*!< FMPSMBUS Listen Complete callback ID */
  156. HAL_FMPSMBUS_ERROR_CB_ID = 0x05U, /*!< FMPSMBUS Error callback ID */
  157. HAL_FMPSMBUS_MSPINIT_CB_ID = 0x06U, /*!< FMPSMBUS Msp Init callback ID */
  158. HAL_FMPSMBUS_MSPDEINIT_CB_ID = 0x07U /*!< FMPSMBUS Msp DeInit callback ID */
  159. } HAL_FMPSMBUS_CallbackIDTypeDef;
  160. /**
  161. * @brief HAL FMPSMBUS Callback pointer definition
  162. */
  163. typedef void (*pFMPSMBUS_CallbackTypeDef)(FMPSMBUS_HandleTypeDef *hfmpsmbus); /*!< pointer to an FMPSMBUS callback function */
  164. typedef void (*pFMPSMBUS_AddrCallbackTypeDef)(FMPSMBUS_HandleTypeDef *hfmpsmbus, uint8_t TransferDirection, uint16_t AddrMatchCode); /*!< pointer to an FMPSMBUS Address Match callback function */
  165. #endif /* USE_HAL_FMPSMBUS_REGISTER_CALLBACKS */
  166. /**
  167. * @}
  168. */
  169. /**
  170. * @}
  171. */
  172. /* Exported constants --------------------------------------------------------*/
  173. /** @defgroup FMPSMBUS_Exported_Constants FMPSMBUS Exported Constants
  174. * @{
  175. */
  176. /** @defgroup FMPSMBUS_Analog_Filter FMPSMBUS Analog Filter
  177. * @{
  178. */
  179. #define FMPSMBUS_ANALOGFILTER_ENABLE (0x00000000U)
  180. #define FMPSMBUS_ANALOGFILTER_DISABLE FMPI2C_CR1_ANFOFF
  181. /**
  182. * @}
  183. */
  184. /** @defgroup FMPSMBUS_addressing_mode FMPSMBUS addressing mode
  185. * @{
  186. */
  187. #define FMPSMBUS_ADDRESSINGMODE_7BIT (0x00000001U)
  188. #define FMPSMBUS_ADDRESSINGMODE_10BIT (0x00000002U)
  189. /**
  190. * @}
  191. */
  192. /** @defgroup FMPSMBUS_dual_addressing_mode FMPSMBUS dual addressing mode
  193. * @{
  194. */
  195. #define FMPSMBUS_DUALADDRESS_DISABLE (0x00000000U)
  196. #define FMPSMBUS_DUALADDRESS_ENABLE FMPI2C_OAR2_OA2EN
  197. /**
  198. * @}
  199. */
  200. /** @defgroup FMPSMBUS_own_address2_masks FMPSMBUS ownaddress2 masks
  201. * @{
  202. */
  203. #define FMPSMBUS_OA2_NOMASK ((uint8_t)0x00U)
  204. #define FMPSMBUS_OA2_MASK01 ((uint8_t)0x01U)
  205. #define FMPSMBUS_OA2_MASK02 ((uint8_t)0x02U)
  206. #define FMPSMBUS_OA2_MASK03 ((uint8_t)0x03U)
  207. #define FMPSMBUS_OA2_MASK04 ((uint8_t)0x04U)
  208. #define FMPSMBUS_OA2_MASK05 ((uint8_t)0x05U)
  209. #define FMPSMBUS_OA2_MASK06 ((uint8_t)0x06U)
  210. #define FMPSMBUS_OA2_MASK07 ((uint8_t)0x07U)
  211. /**
  212. * @}
  213. */
  214. /** @defgroup FMPSMBUS_general_call_addressing_mode FMPSMBUS general call addressing mode
  215. * @{
  216. */
  217. #define FMPSMBUS_GENERALCALL_DISABLE (0x00000000U)
  218. #define FMPSMBUS_GENERALCALL_ENABLE FMPI2C_CR1_GCEN
  219. /**
  220. * @}
  221. */
  222. /** @defgroup FMPSMBUS_nostretch_mode FMPSMBUS nostretch mode
  223. * @{
  224. */
  225. #define FMPSMBUS_NOSTRETCH_DISABLE (0x00000000U)
  226. #define FMPSMBUS_NOSTRETCH_ENABLE FMPI2C_CR1_NOSTRETCH
  227. /**
  228. * @}
  229. */
  230. /** @defgroup FMPSMBUS_packet_error_check_mode FMPSMBUS packet error check mode
  231. * @{
  232. */
  233. #define FMPSMBUS_PEC_DISABLE (0x00000000U)
  234. #define FMPSMBUS_PEC_ENABLE FMPI2C_CR1_PECEN
  235. /**
  236. * @}
  237. */
  238. /** @defgroup FMPSMBUS_peripheral_mode FMPSMBUS peripheral mode
  239. * @{
  240. */
  241. #define FMPSMBUS_PERIPHERAL_MODE_FMPSMBUS_HOST FMPI2C_CR1_SMBHEN
  242. #define FMPSMBUS_PERIPHERAL_MODE_FMPSMBUS_SLAVE (0x00000000U)
  243. #define FMPSMBUS_PERIPHERAL_MODE_FMPSMBUS_SLAVE_ARP FMPI2C_CR1_SMBDEN
  244. /**
  245. * @}
  246. */
  247. /** @defgroup FMPSMBUS_ReloadEndMode_definition FMPSMBUS ReloadEndMode definition
  248. * @{
  249. */
  250. #define FMPSMBUS_SOFTEND_MODE (0x00000000U)
  251. #define FMPSMBUS_RELOAD_MODE FMPI2C_CR2_RELOAD
  252. #define FMPSMBUS_AUTOEND_MODE FMPI2C_CR2_AUTOEND
  253. #define FMPSMBUS_SENDPEC_MODE FMPI2C_CR2_PECBYTE
  254. /**
  255. * @}
  256. */
  257. /** @defgroup FMPSMBUS_StartStopMode_definition FMPSMBUS StartStopMode definition
  258. * @{
  259. */
  260. #define FMPSMBUS_NO_STARTSTOP (0x00000000U)
  261. #define FMPSMBUS_GENERATE_STOP (uint32_t)(0x80000000U | FMPI2C_CR2_STOP)
  262. #define FMPSMBUS_GENERATE_START_READ (uint32_t)(0x80000000U | FMPI2C_CR2_START | FMPI2C_CR2_RD_WRN)
  263. #define FMPSMBUS_GENERATE_START_WRITE (uint32_t)(0x80000000U | FMPI2C_CR2_START)
  264. /**
  265. * @}
  266. */
  267. /** @defgroup FMPSMBUS_XferOptions_definition FMPSMBUS XferOptions definition
  268. * @{
  269. */
  270. /* List of XferOptions in usage of :
  271. * 1- Restart condition when direction change
  272. * 2- No Restart condition in other use cases
  273. */
  274. #define FMPSMBUS_FIRST_FRAME FMPSMBUS_SOFTEND_MODE
  275. #define FMPSMBUS_NEXT_FRAME ((uint32_t)(FMPSMBUS_RELOAD_MODE | FMPSMBUS_SOFTEND_MODE))
  276. #define FMPSMBUS_FIRST_AND_LAST_FRAME_NO_PEC FMPSMBUS_AUTOEND_MODE
  277. #define FMPSMBUS_LAST_FRAME_NO_PEC FMPSMBUS_AUTOEND_MODE
  278. #define FMPSMBUS_FIRST_FRAME_WITH_PEC ((uint32_t)(FMPSMBUS_SOFTEND_MODE | FMPSMBUS_SENDPEC_MODE))
  279. #define FMPSMBUS_FIRST_AND_LAST_FRAME_WITH_PEC ((uint32_t)(FMPSMBUS_AUTOEND_MODE | FMPSMBUS_SENDPEC_MODE))
  280. #define FMPSMBUS_LAST_FRAME_WITH_PEC ((uint32_t)(FMPSMBUS_AUTOEND_MODE | FMPSMBUS_SENDPEC_MODE))
  281. /* List of XferOptions in usage of :
  282. * 1- Restart condition in all use cases (direction change or not)
  283. */
  284. #define FMPSMBUS_OTHER_FRAME_NO_PEC (0x000000AAU)
  285. #define FMPSMBUS_OTHER_FRAME_WITH_PEC (0x0000AA00U)
  286. #define FMPSMBUS_OTHER_AND_LAST_FRAME_NO_PEC (0x00AA0000U)
  287. #define FMPSMBUS_OTHER_AND_LAST_FRAME_WITH_PEC (0xAA000000U)
  288. /**
  289. * @}
  290. */
  291. /** @defgroup FMPSMBUS_Interrupt_configuration_definition FMPSMBUS Interrupt configuration definition
  292. * @brief FMPSMBUS Interrupt definition
  293. * Elements values convention: 0xXXXXXXXX
  294. * - XXXXXXXX : Interrupt control mask
  295. * @{
  296. */
  297. #define FMPSMBUS_IT_ERRI FMPI2C_CR1_ERRIE
  298. #define FMPSMBUS_IT_TCI FMPI2C_CR1_TCIE
  299. #define FMPSMBUS_IT_STOPI FMPI2C_CR1_STOPIE
  300. #define FMPSMBUS_IT_NACKI FMPI2C_CR1_NACKIE
  301. #define FMPSMBUS_IT_ADDRI FMPI2C_CR1_ADDRIE
  302. #define FMPSMBUS_IT_RXI FMPI2C_CR1_RXIE
  303. #define FMPSMBUS_IT_TXI FMPI2C_CR1_TXIE
  304. #define FMPSMBUS_IT_TX (FMPSMBUS_IT_ERRI | FMPSMBUS_IT_TCI | FMPSMBUS_IT_STOPI | FMPSMBUS_IT_NACKI | \
  305. FMPSMBUS_IT_TXI)
  306. #define FMPSMBUS_IT_RX (FMPSMBUS_IT_ERRI | FMPSMBUS_IT_TCI | FMPSMBUS_IT_NACKI | FMPSMBUS_IT_RXI)
  307. #define FMPSMBUS_IT_ALERT (FMPSMBUS_IT_ERRI)
  308. #define FMPSMBUS_IT_ADDR (FMPSMBUS_IT_ADDRI | FMPSMBUS_IT_STOPI | FMPSMBUS_IT_NACKI)
  309. /**
  310. * @}
  311. */
  312. /** @defgroup FMPSMBUS_Flag_definition FMPSMBUS Flag definition
  313. * @brief Flag definition
  314. * Elements values convention: 0xXXXXYYYY
  315. * - XXXXXXXX : Flag mask
  316. * @{
  317. */
  318. #define FMPSMBUS_FLAG_TXE FMPI2C_ISR_TXE
  319. #define FMPSMBUS_FLAG_TXIS FMPI2C_ISR_TXIS
  320. #define FMPSMBUS_FLAG_RXNE FMPI2C_ISR_RXNE
  321. #define FMPSMBUS_FLAG_ADDR FMPI2C_ISR_ADDR
  322. #define FMPSMBUS_FLAG_AF FMPI2C_ISR_NACKF
  323. #define FMPSMBUS_FLAG_STOPF FMPI2C_ISR_STOPF
  324. #define FMPSMBUS_FLAG_TC FMPI2C_ISR_TC
  325. #define FMPSMBUS_FLAG_TCR FMPI2C_ISR_TCR
  326. #define FMPSMBUS_FLAG_BERR FMPI2C_ISR_BERR
  327. #define FMPSMBUS_FLAG_ARLO FMPI2C_ISR_ARLO
  328. #define FMPSMBUS_FLAG_OVR FMPI2C_ISR_OVR
  329. #define FMPSMBUS_FLAG_PECERR FMPI2C_ISR_PECERR
  330. #define FMPSMBUS_FLAG_TIMEOUT FMPI2C_ISR_TIMEOUT
  331. #define FMPSMBUS_FLAG_ALERT FMPI2C_ISR_ALERT
  332. #define FMPSMBUS_FLAG_BUSY FMPI2C_ISR_BUSY
  333. #define FMPSMBUS_FLAG_DIR FMPI2C_ISR_DIR
  334. /**
  335. * @}
  336. */
  337. /**
  338. * @}
  339. */
  340. /* Exported macros ------------------------------------------------------------*/
  341. /** @defgroup FMPSMBUS_Exported_Macros FMPSMBUS Exported Macros
  342. * @{
  343. */
  344. /** @brief Reset FMPSMBUS handle state.
  345. * @param __HANDLE__ specifies the FMPSMBUS Handle.
  346. * @retval None
  347. */
  348. #if (USE_HAL_FMPSMBUS_REGISTER_CALLBACKS == 1)
  349. #define __HAL_FMPSMBUS_RESET_HANDLE_STATE(__HANDLE__) do{ \
  350. (__HANDLE__)->State = HAL_FMPSMBUS_STATE_RESET; \
  351. (__HANDLE__)->MspInitCallback = NULL; \
  352. (__HANDLE__)->MspDeInitCallback = NULL; \
  353. } while(0)
  354. #else
  355. #define __HAL_FMPSMBUS_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_FMPSMBUS_STATE_RESET)
  356. #endif
  357. /** @brief Enable the specified FMPSMBUS interrupts.
  358. * @param __HANDLE__ specifies the FMPSMBUS Handle.
  359. * @param __INTERRUPT__ specifies the interrupt source to enable.
  360. * This parameter can be one of the following values:
  361. * @arg @ref FMPSMBUS_IT_ERRI Errors interrupt enable
  362. * @arg @ref FMPSMBUS_IT_TCI Transfer complete interrupt enable
  363. * @arg @ref FMPSMBUS_IT_STOPI STOP detection interrupt enable
  364. * @arg @ref FMPSMBUS_IT_NACKI NACK received interrupt enable
  365. * @arg @ref FMPSMBUS_IT_ADDRI Address match interrupt enable
  366. * @arg @ref FMPSMBUS_IT_RXI RX interrupt enable
  367. * @arg @ref FMPSMBUS_IT_TXI TX interrupt enable
  368. *
  369. * @retval None
  370. */
  371. #define __HAL_FMPSMBUS_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR1 |= (__INTERRUPT__))
  372. /** @brief Disable the specified FMPSMBUS interrupts.
  373. * @param __HANDLE__ specifies the FMPSMBUS Handle.
  374. * @param __INTERRUPT__ specifies the interrupt source to disable.
  375. * This parameter can be one of the following values:
  376. * @arg @ref FMPSMBUS_IT_ERRI Errors interrupt enable
  377. * @arg @ref FMPSMBUS_IT_TCI Transfer complete interrupt enable
  378. * @arg @ref FMPSMBUS_IT_STOPI STOP detection interrupt enable
  379. * @arg @ref FMPSMBUS_IT_NACKI NACK received interrupt enable
  380. * @arg @ref FMPSMBUS_IT_ADDRI Address match interrupt enable
  381. * @arg @ref FMPSMBUS_IT_RXI RX interrupt enable
  382. * @arg @ref FMPSMBUS_IT_TXI TX interrupt enable
  383. *
  384. * @retval None
  385. */
  386. #define __HAL_FMPSMBUS_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR1 &= (~(__INTERRUPT__)))
  387. /** @brief Check whether the specified FMPSMBUS interrupt source is enabled or not.
  388. * @param __HANDLE__ specifies the FMPSMBUS Handle.
  389. * @param __INTERRUPT__ specifies the FMPSMBUS interrupt source to check.
  390. * This parameter can be one of the following values:
  391. * @arg @ref FMPSMBUS_IT_ERRI Errors interrupt enable
  392. * @arg @ref FMPSMBUS_IT_TCI Transfer complete interrupt enable
  393. * @arg @ref FMPSMBUS_IT_STOPI STOP detection interrupt enable
  394. * @arg @ref FMPSMBUS_IT_NACKI NACK received interrupt enable
  395. * @arg @ref FMPSMBUS_IT_ADDRI Address match interrupt enable
  396. * @arg @ref FMPSMBUS_IT_RXI RX interrupt enable
  397. * @arg @ref FMPSMBUS_IT_TXI TX interrupt enable
  398. *
  399. * @retval The new state of __IT__ (SET or RESET).
  400. */
  401. #define __HAL_FMPSMBUS_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) \
  402. ((((__HANDLE__)->Instance->CR1 & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
  403. /** @brief Check whether the specified FMPSMBUS flag is set or not.
  404. * @param __HANDLE__ specifies the FMPSMBUS Handle.
  405. * @param __FLAG__ specifies the flag to check.
  406. * This parameter can be one of the following values:
  407. * @arg @ref FMPSMBUS_FLAG_TXE Transmit data register empty
  408. * @arg @ref FMPSMBUS_FLAG_TXIS Transmit interrupt status
  409. * @arg @ref FMPSMBUS_FLAG_RXNE Receive data register not empty
  410. * @arg @ref FMPSMBUS_FLAG_ADDR Address matched (slave mode)
  411. * @arg @ref FMPSMBUS_FLAG_AF NACK received flag
  412. * @arg @ref FMPSMBUS_FLAG_STOPF STOP detection flag
  413. * @arg @ref FMPSMBUS_FLAG_TC Transfer complete (master mode)
  414. * @arg @ref FMPSMBUS_FLAG_TCR Transfer complete reload
  415. * @arg @ref FMPSMBUS_FLAG_BERR Bus error
  416. * @arg @ref FMPSMBUS_FLAG_ARLO Arbitration lost
  417. * @arg @ref FMPSMBUS_FLAG_OVR Overrun/Underrun
  418. * @arg @ref FMPSMBUS_FLAG_PECERR PEC error in reception
  419. * @arg @ref FMPSMBUS_FLAG_TIMEOUT Timeout or Tlow detection flag
  420. * @arg @ref FMPSMBUS_FLAG_ALERT SMBus alert
  421. * @arg @ref FMPSMBUS_FLAG_BUSY Bus busy
  422. * @arg @ref FMPSMBUS_FLAG_DIR Transfer direction (slave mode)
  423. *
  424. * @retval The new state of __FLAG__ (SET or RESET).
  425. */
  426. #define FMPSMBUS_FLAG_MASK (0x0001FFFFU)
  427. #define __HAL_FMPSMBUS_GET_FLAG(__HANDLE__, __FLAG__) \
  428. (((((__HANDLE__)->Instance->ISR) & ((__FLAG__) & FMPSMBUS_FLAG_MASK)) == ((__FLAG__) & FMPSMBUS_FLAG_MASK)) ? SET : RESET)
  429. /** @brief Clear the FMPSMBUS pending flags which are cleared by writing 1 in a specific bit.
  430. * @param __HANDLE__ specifies the FMPSMBUS Handle.
  431. * @param __FLAG__ specifies the flag to clear.
  432. * This parameter can be any combination of the following values:
  433. * @arg @ref FMPSMBUS_FLAG_ADDR Address matched (slave mode)
  434. * @arg @ref FMPSMBUS_FLAG_AF NACK received flag
  435. * @arg @ref FMPSMBUS_FLAG_STOPF STOP detection flag
  436. * @arg @ref FMPSMBUS_FLAG_BERR Bus error
  437. * @arg @ref FMPSMBUS_FLAG_ARLO Arbitration lost
  438. * @arg @ref FMPSMBUS_FLAG_OVR Overrun/Underrun
  439. * @arg @ref FMPSMBUS_FLAG_PECERR PEC error in reception
  440. * @arg @ref FMPSMBUS_FLAG_TIMEOUT Timeout or Tlow detection flag
  441. * @arg @ref FMPSMBUS_FLAG_ALERT SMBus alert
  442. *
  443. * @retval None
  444. */
  445. #define __HAL_FMPSMBUS_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__))
  446. /** @brief Enable the specified FMPSMBUS peripheral.
  447. * @param __HANDLE__ specifies the FMPSMBUS Handle.
  448. * @retval None
  449. */
  450. #define __HAL_FMPSMBUS_ENABLE(__HANDLE__) (SET_BIT((__HANDLE__)->Instance->CR1, FMPI2C_CR1_PE))
  451. /** @brief Disable the specified FMPSMBUS peripheral.
  452. * @param __HANDLE__ specifies the FMPSMBUS Handle.
  453. * @retval None
  454. */
  455. #define __HAL_FMPSMBUS_DISABLE(__HANDLE__) (CLEAR_BIT((__HANDLE__)->Instance->CR1, FMPI2C_CR1_PE))
  456. /** @brief Generate a Non-Acknowledge FMPSMBUS peripheral in Slave mode.
  457. * @param __HANDLE__ specifies the FMPSMBUS Handle.
  458. * @retval None
  459. */
  460. #define __HAL_FMPSMBUS_GENERATE_NACK(__HANDLE__) (SET_BIT((__HANDLE__)->Instance->CR2, FMPI2C_CR2_NACK))
  461. /**
  462. * @}
  463. */
  464. /* Private constants ---------------------------------------------------------*/
  465. /* Private macros ------------------------------------------------------------*/
  466. /** @defgroup FMPSMBUS_Private_Macro FMPSMBUS Private Macros
  467. * @{
  468. */
  469. #define IS_FMPSMBUS_ANALOG_FILTER(FILTER) (((FILTER) == FMPSMBUS_ANALOGFILTER_ENABLE) || \
  470. ((FILTER) == FMPSMBUS_ANALOGFILTER_DISABLE))
  471. #define IS_FMPSMBUS_DIGITAL_FILTER(FILTER) ((FILTER) <= 0x0000000FU)
  472. #define IS_FMPSMBUS_ADDRESSING_MODE(MODE) (((MODE) == FMPSMBUS_ADDRESSINGMODE_7BIT) || \
  473. ((MODE) == FMPSMBUS_ADDRESSINGMODE_10BIT))
  474. #define IS_FMPSMBUS_DUAL_ADDRESS(ADDRESS) (((ADDRESS) == FMPSMBUS_DUALADDRESS_DISABLE) || \
  475. ((ADDRESS) == FMPSMBUS_DUALADDRESS_ENABLE))
  476. #define IS_FMPSMBUS_OWN_ADDRESS2_MASK(MASK) (((MASK) == FMPSMBUS_OA2_NOMASK) || \
  477. ((MASK) == FMPSMBUS_OA2_MASK01) || \
  478. ((MASK) == FMPSMBUS_OA2_MASK02) || \
  479. ((MASK) == FMPSMBUS_OA2_MASK03) || \
  480. ((MASK) == FMPSMBUS_OA2_MASK04) || \
  481. ((MASK) == FMPSMBUS_OA2_MASK05) || \
  482. ((MASK) == FMPSMBUS_OA2_MASK06) || \
  483. ((MASK) == FMPSMBUS_OA2_MASK07))
  484. #define IS_FMPSMBUS_GENERAL_CALL(CALL) (((CALL) == FMPSMBUS_GENERALCALL_DISABLE) || \
  485. ((CALL) == FMPSMBUS_GENERALCALL_ENABLE))
  486. #define IS_FMPSMBUS_NO_STRETCH(STRETCH) (((STRETCH) == FMPSMBUS_NOSTRETCH_DISABLE) || \
  487. ((STRETCH) == FMPSMBUS_NOSTRETCH_ENABLE))
  488. #define IS_FMPSMBUS_PEC(PEC) (((PEC) == FMPSMBUS_PEC_DISABLE) || \
  489. ((PEC) == FMPSMBUS_PEC_ENABLE))
  490. #define IS_FMPSMBUS_PERIPHERAL_MODE(MODE) (((MODE) == FMPSMBUS_PERIPHERAL_MODE_FMPSMBUS_HOST) || \
  491. ((MODE) == FMPSMBUS_PERIPHERAL_MODE_FMPSMBUS_SLAVE) || \
  492. ((MODE) == FMPSMBUS_PERIPHERAL_MODE_FMPSMBUS_SLAVE_ARP))
  493. #define IS_FMPSMBUS_TRANSFER_MODE(MODE) (((MODE) == FMPSMBUS_RELOAD_MODE) || \
  494. ((MODE) == FMPSMBUS_AUTOEND_MODE) || \
  495. ((MODE) == FMPSMBUS_SOFTEND_MODE) || \
  496. ((MODE) == FMPSMBUS_SENDPEC_MODE) || \
  497. ((MODE) == (FMPSMBUS_RELOAD_MODE | FMPSMBUS_SENDPEC_MODE)) || \
  498. ((MODE) == (FMPSMBUS_AUTOEND_MODE | FMPSMBUS_SENDPEC_MODE)) || \
  499. ((MODE) == (FMPSMBUS_AUTOEND_MODE | FMPSMBUS_RELOAD_MODE)) || \
  500. ((MODE) == (FMPSMBUS_AUTOEND_MODE | FMPSMBUS_SENDPEC_MODE | FMPSMBUS_RELOAD_MODE )))
  501. #define IS_FMPSMBUS_TRANSFER_REQUEST(REQUEST) (((REQUEST) == FMPSMBUS_GENERATE_STOP) || \
  502. ((REQUEST) == FMPSMBUS_GENERATE_START_READ) || \
  503. ((REQUEST) == FMPSMBUS_GENERATE_START_WRITE) || \
  504. ((REQUEST) == FMPSMBUS_NO_STARTSTOP))
  505. #define IS_FMPSMBUS_TRANSFER_OPTIONS_REQUEST(REQUEST) (IS_FMPSMBUS_TRANSFER_OTHER_OPTIONS_REQUEST(REQUEST) || \
  506. ((REQUEST) == FMPSMBUS_FIRST_FRAME) || \
  507. ((REQUEST) == FMPSMBUS_NEXT_FRAME) || \
  508. ((REQUEST) == FMPSMBUS_FIRST_AND_LAST_FRAME_NO_PEC) || \
  509. ((REQUEST) == FMPSMBUS_LAST_FRAME_NO_PEC) || \
  510. ((REQUEST) == FMPSMBUS_FIRST_FRAME_WITH_PEC) || \
  511. ((REQUEST) == FMPSMBUS_FIRST_AND_LAST_FRAME_WITH_PEC) || \
  512. ((REQUEST) == FMPSMBUS_LAST_FRAME_WITH_PEC))
  513. #define IS_FMPSMBUS_TRANSFER_OTHER_OPTIONS_REQUEST(REQUEST) (((REQUEST) == FMPSMBUS_OTHER_FRAME_NO_PEC) || \
  514. ((REQUEST) == FMPSMBUS_OTHER_AND_LAST_FRAME_NO_PEC) || \
  515. ((REQUEST) == FMPSMBUS_OTHER_FRAME_WITH_PEC) || \
  516. ((REQUEST) == FMPSMBUS_OTHER_AND_LAST_FRAME_WITH_PEC))
  517. #define FMPSMBUS_RESET_CR1(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= \
  518. (uint32_t)~((uint32_t)(FMPI2C_CR1_SMBHEN | FMPI2C_CR1_SMBDEN | FMPI2C_CR1_PECEN)))
  519. #define FMPSMBUS_RESET_CR2(__HANDLE__) ((__HANDLE__)->Instance->CR2 &= \
  520. (uint32_t)~((uint32_t)(FMPI2C_CR2_SADD | FMPI2C_CR2_HEAD10R | FMPI2C_CR2_NBYTES | FMPI2C_CR2_RELOAD | FMPI2C_CR2_RD_WRN)))
  521. #define FMPSMBUS_GENERATE_START(__ADDMODE__,__ADDRESS__) (((__ADDMODE__) == FMPSMBUS_ADDRESSINGMODE_7BIT) ? (uint32_t)((((uint32_t)(__ADDRESS__) & (FMPI2C_CR2_SADD)) | (FMPI2C_CR2_START) | (FMPI2C_CR2_AUTOEND)) & (~FMPI2C_CR2_RD_WRN)) : \
  522. (uint32_t)((((uint32_t)(__ADDRESS__) & (FMPI2C_CR2_SADD)) | (FMPI2C_CR2_ADD10) | (FMPI2C_CR2_START)) & (~FMPI2C_CR2_RD_WRN)))
  523. #define FMPSMBUS_GET_ADDR_MATCH(__HANDLE__) (((__HANDLE__)->Instance->ISR & FMPI2C_ISR_ADDCODE) >> 17U)
  524. #define FMPSMBUS_GET_DIR(__HANDLE__) (((__HANDLE__)->Instance->ISR & FMPI2C_ISR_DIR) >> 16U)
  525. #define FMPSMBUS_GET_STOP_MODE(__HANDLE__) ((__HANDLE__)->Instance->CR2 & FMPI2C_CR2_AUTOEND)
  526. #define FMPSMBUS_GET_PEC_MODE(__HANDLE__) ((__HANDLE__)->Instance->CR2 & FMPI2C_CR2_PECBYTE)
  527. #define FMPSMBUS_GET_ALERT_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CR1 & FMPI2C_CR1_ALERTEN)
  528. #define FMPSMBUS_CHECK_FLAG(__ISR__, __FLAG__) ((((__ISR__) & ((__FLAG__) & FMPSMBUS_FLAG_MASK)) == \
  529. ((__FLAG__) & FMPSMBUS_FLAG_MASK)) ? SET : RESET)
  530. #define FMPSMBUS_CHECK_IT_SOURCE(__CR1__, __IT__) ((((__CR1__) & (__IT__)) == (__IT__)) ? SET : RESET)
  531. #define IS_FMPSMBUS_OWN_ADDRESS1(ADDRESS1) ((ADDRESS1) <= 0x000003FFU)
  532. #define IS_FMPSMBUS_OWN_ADDRESS2(ADDRESS2) ((ADDRESS2) <= (uint16_t)0x00FFU)
  533. /**
  534. * @}
  535. */
  536. /* Exported functions --------------------------------------------------------*/
  537. /** @addtogroup FMPSMBUS_Exported_Functions FMPSMBUS Exported Functions
  538. * @{
  539. */
  540. /** @addtogroup FMPSMBUS_Exported_Functions_Group1 Initialization and de-initialization functions
  541. * @{
  542. */
  543. /* Initialization and de-initialization functions ****************************/
  544. HAL_StatusTypeDef HAL_FMPSMBUS_Init(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  545. HAL_StatusTypeDef HAL_FMPSMBUS_DeInit(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  546. void HAL_FMPSMBUS_MspInit(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  547. void HAL_FMPSMBUS_MspDeInit(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  548. HAL_StatusTypeDef HAL_FMPSMBUS_ConfigAnalogFilter(FMPSMBUS_HandleTypeDef *hfmpsmbus, uint32_t AnalogFilter);
  549. HAL_StatusTypeDef HAL_FMPSMBUS_ConfigDigitalFilter(FMPSMBUS_HandleTypeDef *hfmpsmbus, uint32_t DigitalFilter);
  550. /* Callbacks Register/UnRegister functions ***********************************/
  551. #if (USE_HAL_FMPSMBUS_REGISTER_CALLBACKS == 1)
  552. HAL_StatusTypeDef HAL_FMPSMBUS_RegisterCallback(FMPSMBUS_HandleTypeDef *hfmpsmbus, HAL_FMPSMBUS_CallbackIDTypeDef CallbackID,
  553. pFMPSMBUS_CallbackTypeDef pCallback);
  554. HAL_StatusTypeDef HAL_FMPSMBUS_UnRegisterCallback(FMPSMBUS_HandleTypeDef *hfmpsmbus, HAL_FMPSMBUS_CallbackIDTypeDef CallbackID);
  555. HAL_StatusTypeDef HAL_FMPSMBUS_RegisterAddrCallback(FMPSMBUS_HandleTypeDef *hfmpsmbus, pFMPSMBUS_AddrCallbackTypeDef pCallback);
  556. HAL_StatusTypeDef HAL_FMPSMBUS_UnRegisterAddrCallback(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  557. #endif /* USE_HAL_FMPSMBUS_REGISTER_CALLBACKS */
  558. /**
  559. * @}
  560. */
  561. /** @addtogroup FMPSMBUS_Exported_Functions_Group2 Input and Output operation functions
  562. * @{
  563. */
  564. /* IO operation functions *****************************************************/
  565. /** @addtogroup Blocking_mode_Polling Blocking mode Polling
  566. * @{
  567. */
  568. /******* Blocking mode: Polling */
  569. HAL_StatusTypeDef HAL_FMPSMBUS_IsDeviceReady(FMPSMBUS_HandleTypeDef *hfmpsmbus, uint16_t DevAddress, uint32_t Trials,
  570. uint32_t Timeout);
  571. /**
  572. * @}
  573. */
  574. /** @addtogroup Non-Blocking_mode_Interrupt Non-Blocking mode Interrupt
  575. * @{
  576. */
  577. /******* Non-Blocking mode: Interrupt */
  578. HAL_StatusTypeDef HAL_FMPSMBUS_Master_Transmit_IT(FMPSMBUS_HandleTypeDef *hfmpsmbus, uint16_t DevAddress, uint8_t *pData,
  579. uint16_t Size, uint32_t XferOptions);
  580. HAL_StatusTypeDef HAL_FMPSMBUS_Master_Receive_IT(FMPSMBUS_HandleTypeDef *hfmpsmbus, uint16_t DevAddress, uint8_t *pData,
  581. uint16_t Size, uint32_t XferOptions);
  582. HAL_StatusTypeDef HAL_FMPSMBUS_Master_Abort_IT(FMPSMBUS_HandleTypeDef *hfmpsmbus, uint16_t DevAddress);
  583. HAL_StatusTypeDef HAL_FMPSMBUS_Slave_Transmit_IT(FMPSMBUS_HandleTypeDef *hfmpsmbus, uint8_t *pData, uint16_t Size,
  584. uint32_t XferOptions);
  585. HAL_StatusTypeDef HAL_FMPSMBUS_Slave_Receive_IT(FMPSMBUS_HandleTypeDef *hfmpsmbus, uint8_t *pData, uint16_t Size,
  586. uint32_t XferOptions);
  587. HAL_StatusTypeDef HAL_FMPSMBUS_EnableAlert_IT(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  588. HAL_StatusTypeDef HAL_FMPSMBUS_DisableAlert_IT(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  589. HAL_StatusTypeDef HAL_FMPSMBUS_EnableListen_IT(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  590. HAL_StatusTypeDef HAL_FMPSMBUS_DisableListen_IT(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  591. /**
  592. * @}
  593. */
  594. /** @addtogroup FMPSMBUS_IRQ_Handler_and_Callbacks IRQ Handler and Callbacks
  595. * @{
  596. */
  597. /******* FMPSMBUS IRQHandler and Callbacks used in non blocking modes (Interrupt) */
  598. void HAL_FMPSMBUS_EV_IRQHandler(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  599. void HAL_FMPSMBUS_ER_IRQHandler(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  600. void HAL_FMPSMBUS_MasterTxCpltCallback(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  601. void HAL_FMPSMBUS_MasterRxCpltCallback(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  602. void HAL_FMPSMBUS_SlaveTxCpltCallback(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  603. void HAL_FMPSMBUS_SlaveRxCpltCallback(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  604. void HAL_FMPSMBUS_AddrCallback(FMPSMBUS_HandleTypeDef *hfmpsmbus, uint8_t TransferDirection, uint16_t AddrMatchCode);
  605. void HAL_FMPSMBUS_ListenCpltCallback(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  606. void HAL_FMPSMBUS_ErrorCallback(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  607. /**
  608. * @}
  609. */
  610. /** @addtogroup FMPSMBUS_Exported_Functions_Group3 Peripheral State and Errors functions
  611. * @{
  612. */
  613. /* Peripheral State and Errors functions **************************************************/
  614. uint32_t HAL_FMPSMBUS_GetState(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  615. uint32_t HAL_FMPSMBUS_GetError(FMPSMBUS_HandleTypeDef *hfmpsmbus);
  616. /**
  617. * @}
  618. */
  619. /**
  620. * @}
  621. */
  622. /* Private Functions ---------------------------------------------------------*/
  623. /** @defgroup FMPSMBUS_Private_Functions FMPSMBUS Private Functions
  624. * @{
  625. */
  626. /* Private functions are defined in stm32f4xx_hal_fmpsmbus.c file */
  627. /**
  628. * @}
  629. */
  630. /**
  631. * @}
  632. */
  633. /**
  634. * @}
  635. */
  636. /**
  637. * @}
  638. */
  639. #endif /* FMPI2C_CR1_PE */
  640. #ifdef __cplusplus
  641. }
  642. #endif
  643. #endif /* STM32F4xx_HAL_FMPSMBUS_H */
  644. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/