stm32h7xx_hal_swpmi.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  1. /**
  2. ******************************************************************************
  3. * @file stm32h7xx_hal_swpmi.h
  4. * @author MCD Application Team
  5. * @version V1.0.0
  6. * @date 21-April-2017
  7. * @brief Header file of SWPMI HAL module.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
  12. *
  13. * Redistribution and use in source and binary forms, with or without modification,
  14. * are permitted provided that the following conditions are met:
  15. * 1. Redistributions of source code must retain the above copyright notice,
  16. * this list of conditions and the following disclaimer.
  17. * 2. Redistributions in binary form must reproduce the above copyright notice,
  18. * this list of conditions and the following disclaimer in the documentation
  19. * and/or other materials provided with the distribution.
  20. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  21. * may be used to endorse or promote products derived from this software
  22. * without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  25. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  26. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  27. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  28. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  30. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  31. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  32. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  33. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. ******************************************************************************
  36. */
  37. /* Define to prevent recursive inclusion -------------------------------------*/
  38. #ifndef __STM32H7xx_HAL_SWPMI_H
  39. #define __STM32H7xx_HAL_SWPMI_H
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. /* Includes ------------------------------------------------------------------*/
  44. #include "stm32h7xx_hal_def.h"
  45. /** @addtogroup STM32H7xx_HAL_Driver
  46. * @{
  47. */
  48. /** @addtogroup SWPMI
  49. * @{
  50. */
  51. /* Exported types ------------------------------------------------------------*/
  52. /** @defgroup SWPMI_Exported_Types SWPMI Exported Types
  53. * @{
  54. */
  55. /**
  56. * @brief SWPMI Init Structure definition
  57. */
  58. typedef struct
  59. {
  60. uint32_t VoltageClass; /*!< Specifies the SWP Voltage Class.
  61. This parameter can be a value of @ref SWPMI_Voltage_Class */
  62. uint32_t BitRate; /*!< Specifies the SWPMI Bitrate.
  63. This parameter must be a number between 0 and 63.
  64. The Bitrate is computed using the following formula:
  65. SWPMI_freq = SWPMI_clk / (((BitRate) + 1) * 4)
  66. */
  67. uint32_t TxBufferingMode; /*!< Specifies the transmission buffering mode.
  68. This parameter can be a value of @ref SWPMI_Tx_Buffering_Mode */
  69. uint32_t RxBufferingMode; /*!< Specifies the reception buffering mode.
  70. This parameter can be a value of @ref SWPMI_Rx_Buffering_Mode */
  71. }SWPMI_InitTypeDef;
  72. /**
  73. * @brief HAL SWPMI State structures definition
  74. */
  75. typedef enum
  76. {
  77. HAL_SWPMI_STATE_RESET = 0x00, /*!< Peripheral Reset state */
  78. HAL_SWPMI_STATE_READY = 0x01, /*!< Peripheral Initialized and ready for use */
  79. HAL_SWPMI_STATE_BUSY = 0x02, /*!< an internal process is ongoing */
  80. HAL_SWPMI_STATE_BUSY_TX = 0x12, /*!< Data Transmission process is ongoing */
  81. HAL_SWPMI_STATE_BUSY_RX = 0x22, /*!< Data Reception process is ongoing */
  82. HAL_SWPMI_STATE_BUSY_TX_RX = 0x32, /*!< Data Transmission and Reception process is ongoing */
  83. HAL_SWPMI_STATE_TIMEOUT = 0x03, /*!< Timeout state */
  84. HAL_SWPMI_STATE_ERROR = 0x04 /*!< Error */
  85. }HAL_SWPMI_StateTypeDef;
  86. /**
  87. * @brief SWPMI handle Structure definition
  88. */
  89. typedef struct
  90. {
  91. SWPMI_TypeDef *Instance; /* SWPMI registers base address */
  92. SWPMI_InitTypeDef Init; /* SWMPI communication parameters */
  93. uint32_t *pTxBuffPtr; /* Pointer to SWPMI Tx transfer Buffer */
  94. uint32_t TxXferSize; /* SWPMI Tx Transfer size */
  95. uint32_t TxXferCount; /* SWPMI Tx Transfer Counter */
  96. uint32_t *pRxBuffPtr; /* Pointer to SWPMI Rx transfer Buffer */
  97. uint32_t RxXferSize; /* SWPMI Rx Transfer size */
  98. uint32_t RxXferCount; /* SWPMI Rx Transfer Counter */
  99. DMA_HandleTypeDef *hdmatx; /* SWPMI Tx DMA Handle parameters */
  100. DMA_HandleTypeDef *hdmarx; /* SWPMI Rx DMA Handle parameters */
  101. HAL_LockTypeDef Lock; /* SWPMI object */
  102. __IO HAL_SWPMI_StateTypeDef State; /* SWPMI communication state */
  103. __IO uint32_t ErrorCode; /* SWPMI Error code */
  104. }SWPMI_HandleTypeDef;
  105. /**
  106. * @}
  107. */
  108. /* Exported constants --------------------------------------------------------*/
  109. /** @defgroup SWPMI_Exported_Constants SWPMI Exported Constants
  110. * @{
  111. */
  112. /**
  113. * @defgroup SWPMI_Error_Code SWPMI Error Code Bitmap
  114. * @{
  115. */
  116. #define HAL_SWPMI_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */
  117. #define HAL_SWPMI_ERROR_CRC ((uint32_t)0x00000004) /*!< frame error */
  118. #define HAL_SWPMI_ERROR_OVR ((uint32_t)0x00000008) /*!< Overrun error */
  119. #define HAL_SWPMI_ERROR_UDR ((uint32_t)0x0000000C) /*!< Underrun error */
  120. #define HAL_SWPMI_ERROR_DMA ((uint32_t)0x00000010) /*!< DMA transfer error */
  121. /**
  122. * @}
  123. */
  124. /** @defgroup SWPMI_Voltage_Class SWPMI Voltage Class
  125. * @{
  126. */
  127. #define SWPMI_VOLTAGE_CLASS_C ((uint32_t)0x00000000)
  128. #define SWPMI_VOLTAGE_CLASS_B SWPMI_OR_CLASS
  129. /**
  130. * @}
  131. */
  132. /** @defgroup SWPMI_Tx_Buffering_Mode SWPMI Tx Buffering Mode
  133. * @{
  134. */
  135. #define SWPMI_TX_NO_SOFTWAREBUFFER ((uint32_t)0x00000000)
  136. #define SWPMI_TX_SINGLE_SOFTWAREBUFFER ((uint32_t)0x00000000)
  137. #define SWPMI_TX_MULTI_SOFTWAREBUFFER SWPMI_CR_TXMODE
  138. /**
  139. * @}
  140. */
  141. /** @defgroup SWPMI_Rx_Buffering_Mode SWPMI Rx Buffering Mode
  142. * @{
  143. */
  144. #define SWPMI_RX_NO_SOFTWAREBUFFER ((uint32_t)0x00000000)
  145. #define SWPMI_RX_SINGLE_SOFTWAREBUFFER ((uint32_t)0x00000000)
  146. #define SWPMI_RX_MULTI_SOFTWAREBUFFER SWPMI_CR_RXMODE
  147. /**
  148. * @}
  149. */
  150. /** @defgroup SWPMI_Flags SWPMI Status Flags
  151. * Elements values convention: 0xXXXXXXXX
  152. * - 0xXXXXXXXX : Flag mask in the ISR register
  153. * @{
  154. */
  155. #define SWPMI_FLAG_RXBFF SWPMI_ISR_RXBFF
  156. #define SWPMI_FLAG_TXBEF SWPMI_ISR_TXBEF
  157. #define SWPMI_FLAG_RXBERF SWPMI_ISR_RXBERF
  158. #define SWPMI_FLAG_RXOVRF SWPMI_ISR_RXOVRF
  159. #define SWPMI_FLAG_TXUNRF SWPMI_ISR_TXUNRF
  160. #define SWPMI_FLAG_RXNE SWPMI_ISR_RXNE
  161. #define SWPMI_FLAG_TXE SWPMI_ISR_TXE
  162. #define SWPMI_FLAG_TCF SWPMI_ISR_TCF
  163. #define SWPMI_FLAG_SRF SWPMI_ISR_SRF
  164. #define SWPMI_FLAG_SUSP SWPMI_ISR_SUSP
  165. #define SWPMI_FLAG_DEACTF SWPMI_ISR_DEACTF
  166. #define SWPMI_FLAG_RDYF SWPMI_ISR_RDYF
  167. /**
  168. * @}
  169. */
  170. /** @defgroup SWPMI_Interrupt_definition SWPMI Interrupts Definition
  171. * Elements values convention: 0xXXXX
  172. * - 0xXXXX : Flag mask in the IER register
  173. * @{
  174. */
  175. #define SWPMI_IT_RDYIE SWPMI_IER_RDYIE
  176. #define SWPMI_IT_SRIE SWPMI_IER_SRIE
  177. #define SWPMI_IT_TCIE SWPMI_IER_TCIE
  178. #define SWPMI_IT_TIE SWPMI_IER_TIE
  179. #define SWPMI_IT_RIE SWPMI_IER_RIE
  180. #define SWPMI_IT_TXUNRIE SWPMI_IER_TXUNRIE
  181. #define SWPMI_IT_RXOVRIE SWPMI_IER_RXOVRIE
  182. #define SWPMI_IT_RXBERIE SWPMI_IER_RXBERIE
  183. #define SWPMI_IT_TXBEIE SWPMI_IER_TXBEIE
  184. #define SWPMI_IT_RXBFIE SWPMI_IER_RXBFIE
  185. /**
  186. * @}
  187. */
  188. /**
  189. * @}
  190. */
  191. /* Exported macros -----------------------------------------------------------*/
  192. /** @defgroup SWPMI_Exported_Macros SWPMI Exported Macros
  193. * @{
  194. */
  195. /** @brief Reset SWPMI handle state.
  196. * @param __HANDLE__: specifies the SWPMI Handle.
  197. * @retval None
  198. */
  199. #define __HAL_SWPMI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SWPMI_STATE_RESET)
  200. /**
  201. * @brief Enable the SWPMI peripheral.
  202. * @param __HANDLE__: SWPMI handle
  203. * @retval None
  204. */
  205. #define __HAL_SWPMI_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR, SWPMI_CR_SWPACT)
  206. /**
  207. * @brief Disable the SWPMI peripheral.
  208. * @param __HANDLE__: SWPMI handle
  209. * @retval None
  210. */
  211. #define __HAL_SWPMI_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CR, SWPMI_CR_SWPACT)
  212. /**
  213. * @brief Enable/Disable the SWPMI transceiver.
  214. * @param __HANDLE__: SWPMI handle
  215. * @retval None
  216. */
  217. #define __HAL_SWPMI_TRANSCEIVER_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR, SWPMI_CR_SWPEN)
  218. #define __HAL_SWPMI_TRANSCEIVER_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CR, SWPMI_CR_SWPEN)
  219. /** @brief Check whether the specified SWPMI flag is set or not.
  220. * @param __HANDLE__: specifies the SWPMI Handle.
  221. * @param __FLAG__: specifies the flag to check.
  222. * This parameter can be one of the following values:
  223. * @arg SWPMI_FLAG_RXBFF : Receive buffer full flag.
  224. * @arg SWPMI_FLAG_TXBEF : Transmit buffer empty flag.
  225. * @arg SWPMI_FLAG_RXBERF : Receive CRC error flag.
  226. * @arg SWPMI_FLAG_RXOVRF : Receive overrun error flag.
  227. * @arg SWPMI_FLAG_TXUNRF : Transmit underrun error flag.
  228. * @arg SWPMI_FLAG_RXNE : Receive data register not empty.
  229. * @arg SWPMI_FLAG_TXE : Transmit data register empty.
  230. * @arg SWPMI_FLAG_TCF : Transfer complete flag.
  231. * @arg SWPMI_FLAG_SRF : Slave resume flag.
  232. * @arg SWPMI_FLAG_SUSP : SUSPEND flag.
  233. * @arg SWPMI_FLAG_DEACTF : DEACTIVATED flag.
  234. * @retval The new state of __FLAG__ (TRUE or FALSE).
  235. */
  236. #define __HAL_SWPMI_GET_FLAG(__HANDLE__, __FLAG__) (READ_BIT((__HANDLE__)->Instance->ISR, (__FLAG__)) == (__FLAG__))
  237. /** @brief Clear the specified SWPMI ISR flag.
  238. * @param __HANDLE__: specifies the SWPMI Handle.
  239. * @param __FLAG__: specifies the flag to clear.
  240. * This parameter can be one of the following values:
  241. * @arg SWPMI_FLAG_RXBFF : Receive buffer full flag.
  242. * @arg SWPMI_FLAG_TXBEF : Transmit buffer empty flag.
  243. * @arg SWPMI_FLAG_RXBERF : Receive CRC error flag.
  244. * @arg SWPMI_FLAG_RXOVRF : Receive overrun error flag.
  245. * @arg SWPMI_FLAG_TXUNRF : Transmit underrun error flag.
  246. * @arg SWPMI_FLAG_TCF : Transfer complete flag.
  247. * @arg SWPMI_FLAG_SRF : Slave resume flag.
  248. * @arg SWPMI_FLAG_RDYF: Transceiver ready flag
  249. * @retval None
  250. */
  251. #define __HAL_SWPMI_CLEAR_FLAG(__HANDLE__, __FLAG__) WRITE_REG((__HANDLE__)->Instance->ICR, (__FLAG__))
  252. /** @brief Enable the specified SWPMI interrupt.
  253. * @param __HANDLE__: specifies the SWPMI Handle.
  254. * @param __INTERRUPT__: specifies the SWPMI interrupt source to enable.
  255. * This parameter can be one of the following values:
  256. * @arg SWPMI_IT_SRIE : Slave resume interrupt.
  257. * @arg SWPMI_IT_TCIE : Transmit complete interrupt.
  258. * @arg SWPMI_IT_TIE : Transmit interrupt.
  259. * @arg SWPMI_IT_RIE : Receive interrupt.
  260. * @arg SWPMI_IT_TXUNRIE : Transmit underrun error interrupt.
  261. * @arg SWPMI_IT_RXOVRIE : Receive overrun error interrupt.
  262. * @arg SWPMI_IT_RXBEIE : Receive CRC error interrupt.
  263. * @arg SWPMI_IT_TXBEIE : Transmit buffer empty interrupt.
  264. * @arg SWPMI_IT_RXBFIE : Receive buffer full interrupt.
  265. * @retval None
  266. */
  267. #define __HAL_SWPMI_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->IER, (__INTERRUPT__))
  268. /** @brief Disable the specified SWPMI interrupt.
  269. * @param __HANDLE__: specifies the SWPMI Handle.
  270. * @param __INTERRUPT__: specifies the SWPMI interrupt source to disable.
  271. * This parameter can be one of the following values:
  272. * @arg SWPMI_IT_SRIE : Slave resume interrupt.
  273. * @arg SWPMI_IT_TCIE : Transmit complete interrupt.
  274. * @arg SWPMI_IT_TIE : Transmit interrupt.
  275. * @arg SWPMI_IT_RIE : Receive interrupt.
  276. * @arg SWPMI_IT_TXUNRIE : Transmit underrun error interrupt.
  277. * @arg SWPMI_IT_RXOVRIE : Receive overrun error interrupt.
  278. * @arg SWPMI_IT_RXBEIE : Receive CRC error interrupt.
  279. * @arg SWPMI_IT_TXBEIE : Transmit buffer empty interrupt.
  280. * @arg SWPMI_IT_RXBFIE : Receive buffer full interrupt.
  281. * @retval None
  282. */
  283. #define __HAL_SWPMI_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT((__HANDLE__)->Instance->IER, (__INTERRUPT__))
  284. /** @brief Check whether the specified SWPMI interrupt has occurred or not.
  285. * @param __HANDLE__: specifies the SWPMI Handle.
  286. * @param __IT__: specifies the SWPMI interrupt to check.
  287. * This parameter can be one of the following values:
  288. * @arg SWPMI_IT_SRIE : Slave resume interrupt.
  289. * @arg SWPMI_IT_TCIE : Transmit complete interrupt.
  290. * @arg SWPMI_IT_TIE : Transmit interrupt.
  291. * @arg SWPMI_IT_RIE : Receive interrupt.
  292. * @arg SWPMI_IT_TXUNRIE : Transmit underrun error interrupt.
  293. * @arg SWPMI_IT_RXOVRIE : Receive overrun error interrupt.
  294. * @arg SWPMI_IT_RXBERIE : Receive CRC error interrupt.
  295. * @arg SWPMI_IT_TXBEIE : Transmit buffer empty interrupt.
  296. * @arg SWPMI_IT_RXBFIE : Receive buffer full interrupt.
  297. * @retval The new state of __IT__ (TRUE or FALSE).
  298. */
  299. #define __HAL_SWPMI_GET_IT(__HANDLE__, __IT__) (READ_BIT((__HANDLE__)->Instance->ISR,(__IT__)) == (__IT__))
  300. /** @brief Check whether the specified SWPMI interrupt source is enabled or not.
  301. * @param __HANDLE__: specifies the SWPMI Handle.
  302. * @param __IT__: specifies the SWPMI interrupt source to check.
  303. * This parameter can be one of the following values:
  304. * @arg SWPMI_IT_SRIE : Slave resume interrupt.
  305. * @arg SWPMI_IT_TCIE : Transmit complete interrupt.
  306. * @arg SWPMI_IT_TIE : Transmit interrupt.
  307. * @arg SWPMI_IT_RIE : Receive interrupt.
  308. * @arg SWPMI_IT_TXUNRIE : Transmit underrun error interrupt.
  309. * @arg SWPMI_IT_RXOVRIE : Receive overrun error interrupt.
  310. * @arg SWPMI_IT_RXBERIE : Receive CRC error interrupt.
  311. * @arg SWPMI_IT_TXBEIE : Transmit buffer empty interrupt.
  312. * @arg SWPMI_IT_RXBFIE : Receive buffer full interrupt.
  313. * @retval The new state of __IT__ (TRUE or FALSE).
  314. */
  315. #define __HAL_SWPMI_GET_IT_SOURCE(__HANDLE__, __IT__) ((READ_BIT((__HANDLE__)->Instance->IER, (__IT__)) == (__IT__)) ? SET : RESET)
  316. /**
  317. * @}
  318. */
  319. /* Exported functions --------------------------------------------------------*/
  320. /** @defgroup SWPMI_Exported_Functions SWPMI Exported Functions
  321. * @{
  322. */
  323. /* Initialization/de-initialization functions ********************************/
  324. HAL_StatusTypeDef HAL_SWPMI_Init(SWPMI_HandleTypeDef *hswpmi);
  325. HAL_StatusTypeDef HAL_SWPMI_DeInit(SWPMI_HandleTypeDef *hswpmi);
  326. void HAL_SWPMI_MspInit(SWPMI_HandleTypeDef *hswpmi);
  327. void HAL_SWPMI_MspDeInit(SWPMI_HandleTypeDef *hswpmi);
  328. /* IO operation functions *****************************************************/
  329. HAL_StatusTypeDef HAL_SWPMI_Transmit(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size, uint32_t Timeout);
  330. HAL_StatusTypeDef HAL_SWPMI_Receive(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size, uint32_t Timeout);
  331. HAL_StatusTypeDef HAL_SWPMI_Transmit_IT(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size);
  332. HAL_StatusTypeDef HAL_SWPMI_Receive_IT(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size);
  333. HAL_StatusTypeDef HAL_SWPMI_Transmit_DMA(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size);
  334. HAL_StatusTypeDef HAL_SWPMI_Receive_DMA(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size);
  335. HAL_StatusTypeDef HAL_SWPMI_DMAStop(SWPMI_HandleTypeDef *hswpmi);
  336. HAL_StatusTypeDef HAL_SWPMI_EnableLoopback(SWPMI_HandleTypeDef *hswpmi);
  337. HAL_StatusTypeDef HAL_SWPMI_DisableLoopback(SWPMI_HandleTypeDef *hswpmi);
  338. void HAL_SWPMI_IRQHandler(SWPMI_HandleTypeDef *hswpmi);
  339. void HAL_SWPMI_TxCpltCallback(SWPMI_HandleTypeDef *hswpmi);
  340. void HAL_SWPMI_TxHalfCpltCallback(SWPMI_HandleTypeDef *hswpmi);
  341. void HAL_SWPMI_RxCpltCallback(SWPMI_HandleTypeDef *hswpmi);
  342. void HAL_SWPMI_RxHalfCpltCallback(SWPMI_HandleTypeDef *hswpmi);
  343. void HAL_SWPMI_ErrorCallback(SWPMI_HandleTypeDef *hswpmi);
  344. /* Peripheral Control and State functions ************************************/
  345. HAL_SWPMI_StateTypeDef HAL_SWPMI_GetState(SWPMI_HandleTypeDef *hswpmi);
  346. uint32_t HAL_SWPMI_GetError(SWPMI_HandleTypeDef *hswpmi);
  347. /**
  348. * @}
  349. */
  350. /* Private types -------------------------------------------------------------*/
  351. /** @defgroup SWPMI_Private_Types SWPMI Private Types
  352. * @{
  353. */
  354. /**
  355. * @}
  356. */
  357. /* Private variables ---------------------------------------------------------*/
  358. /** @defgroup SWPMI_Private_Variables SWPMI Private Variables
  359. * @{
  360. */
  361. /**
  362. * @}
  363. */
  364. /* Private constants ---------------------------------------------------------*/
  365. /** @defgroup SWPMI_Private_Constants SWPMI Private Constants
  366. * @{
  367. */
  368. /**
  369. * @}
  370. */
  371. /* Private macros ------------------------------------------------------------*/
  372. /** @defgroup SWPMI_Private_Macros SWPMI Private Macros
  373. * @{
  374. */
  375. #define IS_SWPMI_VOLTAGE_CLASS(__CLASS__) (((__CLASS__) == SWPMI_VOLTAGE_CLASS_C) || \
  376. ((__CLASS__) == SWPMI_VOLTAGE_CLASS_B))
  377. #define IS_SWPMI_BITRATE_VALUE(__VALUE__) (((__VALUE__) <= 63))
  378. #define IS_SWPMI_TX_BUFFERING_MODE(__MODE__) (((__MODE__) == SWPMI_TX_NO_SOFTWAREBUFFER) || \
  379. ((__MODE__) == SWPMI_TX_MULTI_SOFTWAREBUFFER))
  380. #define IS_SWPMI_RX_BUFFERING_MODE(__MODE__) (((__MODE__) == SWPMI_RX_NO_SOFTWAREBUFFER) || \
  381. ((__MODE__) == SWPMI_RX_MULTI_SOFTWAREBUFFER))
  382. /**
  383. * @}
  384. */
  385. /**
  386. * @}
  387. */
  388. /**
  389. * @}
  390. */
  391. #ifdef __cplusplus
  392. }
  393. #endif
  394. #endif /* __STM32H7xx_HAL_SWPMI_H */
  395. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/