stm32l4xx_hal_swpmi.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. /**
  2. ******************************************************************************
  3. * @file stm32l4xx_hal_swpmi.h
  4. * @author MCD Application Team
  5. * @version V1.7.2
  6. * @date 16-June-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 __STM32L4xx_HAL_SWPMI_H
  39. #define __STM32L4xx_HAL_SWPMI_H
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. #if defined(STM32L431xx) || defined(STM32L432xx) || defined(STM32L433xx) || defined(STM32L442xx) || defined(STM32L443xx) || \
  44. defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) || \
  45. defined(STM32L496xx) || defined(STM32L4A6xx)
  46. /* Includes ------------------------------------------------------------------*/
  47. #include "stm32l4xx_hal_def.h"
  48. /** @addtogroup STM32L4xx_HAL_Driver
  49. * @{
  50. */
  51. /** @addtogroup SWPMI
  52. * @{
  53. */
  54. /* Exported types ------------------------------------------------------------*/
  55. /** @defgroup SWPMI_Exported_Types SWPMI Exported Types
  56. * @{
  57. */
  58. /**
  59. * @brief SWPMI Init Structure definition
  60. */
  61. typedef struct
  62. {
  63. uint32_t VoltageClass; /*!< Specifies the SWP Voltage Class.
  64. This parameter can be a value of @ref SWPMI_Voltage_Class */
  65. uint32_t BitRate; /*!< Specifies the SWPMI Bitrate.
  66. This parameter must be a number between 0 and 63.
  67. The Bitrate is computed using the following formula:
  68. SWPMI_freq = SWPMI_clk / (((BitRate) + 1) * 4)
  69. */
  70. uint32_t TxBufferingMode; /*!< Specifies the transmission buffering mode.
  71. This parameter can be a value of @ref SWPMI_Tx_Buffering_Mode */
  72. uint32_t RxBufferingMode; /*!< Specifies the reception buffering mode.
  73. This parameter can be a value of @ref SWPMI_Rx_Buffering_Mode */
  74. }SWPMI_InitTypeDef;
  75. /**
  76. * @brief HAL SWPMI State structures definition
  77. */
  78. typedef enum
  79. {
  80. HAL_SWPMI_STATE_RESET = 0x00, /*!< Peripheral Reset state */
  81. HAL_SWPMI_STATE_READY = 0x01, /*!< Peripheral Initialized and ready for use */
  82. HAL_SWPMI_STATE_BUSY = 0x02, /*!< an internal process is ongoing */
  83. HAL_SWPMI_STATE_BUSY_TX = 0x12, /*!< Data Transmission process is ongoing */
  84. HAL_SWPMI_STATE_BUSY_RX = 0x22, /*!< Data Reception process is ongoing */
  85. HAL_SWPMI_STATE_BUSY_TX_RX = 0x32, /*!< Data Transmission and Reception process is ongoing */
  86. HAL_SWPMI_STATE_TIMEOUT = 0x03, /*!< Timeout state */
  87. HAL_SWPMI_STATE_ERROR = 0x04 /*!< Error */
  88. }HAL_SWPMI_StateTypeDef;
  89. /**
  90. * @brief SWPMI handle Structure definition
  91. */
  92. typedef struct
  93. {
  94. SWPMI_TypeDef *Instance; /* SWPMI registers base address */
  95. SWPMI_InitTypeDef Init; /* SWMPI communication parameters */
  96. uint32_t *pTxBuffPtr; /* Pointer to SWPMI Tx transfer Buffer */
  97. uint32_t TxXferSize; /* SWPMI Tx Transfer size */
  98. uint32_t TxXferCount; /* SWPMI Tx Transfer Counter */
  99. uint32_t *pRxBuffPtr; /* Pointer to SWPMI Rx transfer Buffer */
  100. uint32_t RxXferSize; /* SWPMI Rx Transfer size */
  101. uint32_t RxXferCount; /* SWPMI Rx Transfer Counter */
  102. DMA_HandleTypeDef *hdmatx; /* SWPMI Tx DMA Handle parameters */
  103. DMA_HandleTypeDef *hdmarx; /* SWPMI Rx DMA Handle parameters */
  104. HAL_LockTypeDef Lock; /* SWPMI object */
  105. __IO HAL_SWPMI_StateTypeDef State; /* SWPMI communication state */
  106. __IO uint32_t ErrorCode; /* SWPMI Error code */
  107. }SWPMI_HandleTypeDef;
  108. /**
  109. * @}
  110. */
  111. /* Exported constants --------------------------------------------------------*/
  112. /** @defgroup SWPMI_Exported_Constants SWPMI Exported Constants
  113. * @{
  114. */
  115. /**
  116. * @defgroup SWPMI_Error_Code SWPMI Error Code Bitmap
  117. * @{
  118. */
  119. #define HAL_SWPMI_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */
  120. #define HAL_SWPMI_ERROR_CRC ((uint32_t)0x00000004) /*!< frame error */
  121. #define HAL_SWPMI_ERROR_OVR ((uint32_t)0x00000008) /*!< Overrun error */
  122. #define HAL_SWPMI_ERROR_UDR ((uint32_t)0x0000000C) /*!< Underrun error */
  123. #define HAL_SWPMI_ERROR_DMA ((uint32_t)0x00000010) /*!< DMA transfer error */
  124. /**
  125. * @}
  126. */
  127. /** @defgroup SWPMI_Voltage_Class SWPMI Voltage Class
  128. * @{
  129. */
  130. #define SWPMI_VOLTAGE_CLASS_C ((uint32_t)0x00000000)
  131. #define SWPMI_VOLTAGE_CLASS_B SWPMI_OR_CLASS
  132. /**
  133. * @}
  134. */
  135. /** @defgroup SWPMI_Tx_Buffering_Mode SWPMI Tx Buffering Mode
  136. * @{
  137. */
  138. #define SWPMI_TX_NO_SOFTWAREBUFFER ((uint32_t)0x00000000)
  139. #define SWPMI_TX_SINGLE_SOFTWAREBUFFER ((uint32_t)0x00000000)
  140. #define SWPMI_TX_MULTI_SOFTWAREBUFFER SWPMI_CR_TXMODE
  141. /**
  142. * @}
  143. */
  144. /** @defgroup SWPMI_Rx_Buffering_Mode SWPMI Rx Buffering Mode
  145. * @{
  146. */
  147. #define SWPMI_RX_NO_SOFTWAREBUFFER ((uint32_t)0x00000000)
  148. #define SWPMI_RX_SINGLE_SOFTWAREBUFFER ((uint32_t)0x00000000)
  149. #define SWPMI_RX_MULTI_SOFTWAREBUFFER SWPMI_CR_RXMODE
  150. /**
  151. * @}
  152. */
  153. /** @defgroup SWPMI_Flags SWPMI Status Flags
  154. * Elements values convention: 0xXXXXXXXX
  155. * - 0xXXXXXXXX : Flag mask in the ISR register
  156. * @{
  157. */
  158. #define SWPMI_FLAG_RXBFF SWPMI_ISR_RXBFF
  159. #define SWPMI_FLAG_TXBEF SWPMI_ISR_TXBEF
  160. #define SWPMI_FLAG_RXBERF SWPMI_ISR_RXBERF
  161. #define SWPMI_FLAG_RXOVRF SWPMI_ISR_RXOVRF
  162. #define SWPMI_FLAG_TXUNRF SWPMI_ISR_TXUNRF
  163. #define SWPMI_FLAG_RXNE SWPMI_ISR_RXNE
  164. #define SWPMI_FLAG_TXE SWPMI_ISR_TXE
  165. #define SWPMI_FLAG_TCF SWPMI_ISR_TCF
  166. #define SWPMI_FLAG_SRF SWPMI_ISR_SRF
  167. #define SWPMI_FLAG_SUSP SWPMI_ISR_SUSP
  168. #define SWPMI_FLAG_DEACTF SWPMI_ISR_DEACTF
  169. /**
  170. * @}
  171. */
  172. /** @defgroup SWPMI_Interrupt_definition SWPMI Interrupts Definition
  173. * Elements values convention: 0xXXXX
  174. * - 0xXXXX : Flag mask in the IER register
  175. * @{
  176. */
  177. #define SWPMI_IT_SRIE SWPMI_IER_SRIE
  178. #define SWPMI_IT_TCIE SWPMI_IER_TCIE
  179. #define SWPMI_IT_TIE SWPMI_IER_TIE
  180. #define SWPMI_IT_RIE SWPMI_IER_RIE
  181. #define SWPMI_IT_TXUNRIE SWPMI_IER_TXUNRIE
  182. #define SWPMI_IT_RXOVRIE SWPMI_IER_RXOVRIE
  183. #define SWPMI_IT_RXBERIE SWPMI_IER_RXBERIE
  184. #define SWPMI_IT_TXBEIE SWPMI_IER_TXBEIE
  185. #define SWPMI_IT_RXBFIE SWPMI_IER_RXBFIE
  186. /**
  187. * @}
  188. */
  189. /**
  190. * @}
  191. */
  192. /* Exported macros -----------------------------------------------------------*/
  193. /** @defgroup SWPMI_Exported_Macros SWPMI Exported Macros
  194. * @{
  195. */
  196. /** @brief Reset SWPMI handle state.
  197. * @param __HANDLE__: specifies the SWPMI Handle.
  198. * @retval None
  199. */
  200. #define __HAL_SWPMI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SWPMI_STATE_RESET)
  201. /**
  202. * @brief Enable the SWPMI peripheral.
  203. * @param __HANDLE__: SWPMI handle
  204. * @retval None
  205. */
  206. #define __HAL_SWPMI_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR, SWPMI_CR_SWPACT)
  207. /**
  208. * @brief Disable the SWPMI peripheral.
  209. * @param __HANDLE__: SWPMI handle
  210. * @retval None
  211. */
  212. #define __HAL_SWPMI_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CR, SWPMI_CR_SWPACT)
  213. /** @brief Check whether the specified SWPMI flag is set or not.
  214. * @param __HANDLE__: specifies the SWPMI Handle.
  215. * @param __FLAG__: specifies the flag to check.
  216. * This parameter can be one of the following values:
  217. * @arg SWPMI_FLAG_RXBFF : Receive buffer full flag.
  218. * @arg SWPMI_FLAG_TXBEF : Transmit buffer empty flag.
  219. * @arg SWPMI_FLAG_RXBERF : Receive CRC error flag.
  220. * @arg SWPMI_FLAG_RXOVRF : Receive overrun error flag.
  221. * @arg SWPMI_FLAG_TXUNRF : Transmit underrun error flag.
  222. * @arg SWPMI_FLAG_RXNE : Receive data register not empty.
  223. * @arg SWPMI_FLAG_TXE : Transmit data register empty.
  224. * @arg SWPMI_FLAG_TCF : Transfer complete flag.
  225. * @arg SWPMI_FLAG_SRF : Slave resume flag.
  226. * @arg SWPMI_FLAG_SUSP : SUSPEND flag.
  227. * @arg SWPMI_FLAG_DEACTF : DEACTIVATED flag.
  228. * @retval The new state of __FLAG__ (TRUE or FALSE).
  229. */
  230. #define __HAL_SWPMI_GET_FLAG(__HANDLE__, __FLAG__) (READ_BIT((__HANDLE__)->Instance->ISR, (__FLAG__)) == (__FLAG__))
  231. /** @brief Clear the specified SWPMI ISR flag.
  232. * @param __HANDLE__: specifies the SWPMI Handle.
  233. * @param __FLAG__: specifies the flag to clear.
  234. * This parameter can be one of the following values:
  235. * @arg SWPMI_FLAG_RXBFF : Receive buffer full flag.
  236. * @arg SWPMI_FLAG_TXBEF : Transmit buffer empty flag.
  237. * @arg SWPMI_FLAG_RXBERF : Receive CRC error flag.
  238. * @arg SWPMI_FLAG_RXOVRF : Receive overrun error flag.
  239. * @arg SWPMI_FLAG_TXUNRF : Transmit underrun error flag.
  240. * @arg SWPMI_FLAG_TCF : Transfer complete flag.
  241. * @arg SWPMI_FLAG_SRF : Slave resume flag.
  242. * @retval None
  243. */
  244. #define __HAL_SWPMI_CLEAR_FLAG(__HANDLE__, __FLAG__) WRITE_REG((__HANDLE__)->Instance->ICR, (__FLAG__))
  245. /** @brief Enable the specified SWPMI interrupt.
  246. * @param __HANDLE__: specifies the SWPMI Handle.
  247. * @param __INTERRUPT__: specifies the SWPMI interrupt source to enable.
  248. * This parameter can be one of the following values:
  249. * @arg SWPMI_IT_SRIE : Slave resume interrupt.
  250. * @arg SWPMI_IT_TCIE : Transmit complete interrupt.
  251. * @arg SWPMI_IT_TIE : Transmit interrupt.
  252. * @arg SWPMI_IT_RIE : Receive interrupt.
  253. * @arg SWPMI_IT_TXUNRIE : Transmit underrun error interrupt.
  254. * @arg SWPMI_IT_RXOVRIE : Receive overrun error interrupt.
  255. * @arg SWPMI_IT_RXBEIE : Receive CRC error interrupt.
  256. * @arg SWPMI_IT_TXBEIE : Transmit buffer empty interrupt.
  257. * @arg SWPMI_IT_RXBFIE : Receive buffer full interrupt.
  258. * @retval None
  259. */
  260. #define __HAL_SWPMI_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->IER, (__INTERRUPT__))
  261. /** @brief Disable the specified SWPMI interrupt.
  262. * @param __HANDLE__: specifies the SWPMI Handle.
  263. * @param __INTERRUPT__: specifies the SWPMI interrupt source to disable.
  264. * This parameter can be one of the following values:
  265. * @arg SWPMI_IT_SRIE : Slave resume interrupt.
  266. * @arg SWPMI_IT_TCIE : Transmit complete interrupt.
  267. * @arg SWPMI_IT_TIE : Transmit interrupt.
  268. * @arg SWPMI_IT_RIE : Receive interrupt.
  269. * @arg SWPMI_IT_TXUNRIE : Transmit underrun error interrupt.
  270. * @arg SWPMI_IT_RXOVRIE : Receive overrun error interrupt.
  271. * @arg SWPMI_IT_RXBEIE : Receive CRC error interrupt.
  272. * @arg SWPMI_IT_TXBEIE : Transmit buffer empty interrupt.
  273. * @arg SWPMI_IT_RXBFIE : Receive buffer full interrupt.
  274. * @retval None
  275. */
  276. #define __HAL_SWPMI_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT((__HANDLE__)->Instance->IER, (__INTERRUPT__))
  277. /** @brief Check whether the specified SWPMI interrupt has occurred or not.
  278. * @param __HANDLE__: specifies the SWPMI Handle.
  279. * @param __IT__: specifies the SWPMI interrupt to check.
  280. * This parameter can be one of the following values:
  281. * @arg SWPMI_IT_SRIE : Slave resume interrupt.
  282. * @arg SWPMI_IT_TCIE : Transmit complete interrupt.
  283. * @arg SWPMI_IT_TIE : Transmit interrupt.
  284. * @arg SWPMI_IT_RIE : Receive interrupt.
  285. * @arg SWPMI_IT_TXUNRIE : Transmit underrun error interrupt.
  286. * @arg SWPMI_IT_RXOVRIE : Receive overrun error interrupt.
  287. * @arg SWPMI_IT_RXBERIE : Receive CRC error interrupt.
  288. * @arg SWPMI_IT_TXBEIE : Transmit buffer empty interrupt.
  289. * @arg SWPMI_IT_RXBFIE : Receive buffer full interrupt.
  290. * @retval The new state of __IT__ (TRUE or FALSE).
  291. */
  292. #define __HAL_SWPMI_GET_IT(__HANDLE__, __IT__) (READ_BIT((__HANDLE__)->Instance->ISR,(__IT__)) == (__IT__))
  293. /** @brief Check whether the specified SWPMI interrupt source is enabled or not.
  294. * @param __HANDLE__: specifies the SWPMI Handle.
  295. * @param __IT__: specifies the SWPMI interrupt source to check.
  296. * This parameter can be one of the following values:
  297. * @arg SWPMI_IT_SRIE : Slave resume interrupt.
  298. * @arg SWPMI_IT_TCIE : Transmit complete interrupt.
  299. * @arg SWPMI_IT_TIE : Transmit interrupt.
  300. * @arg SWPMI_IT_RIE : Receive interrupt.
  301. * @arg SWPMI_IT_TXUNRIE : Transmit underrun error interrupt.
  302. * @arg SWPMI_IT_RXOVRIE : Receive overrun error interrupt.
  303. * @arg SWPMI_IT_RXBERIE : Receive CRC error interrupt.
  304. * @arg SWPMI_IT_TXBEIE : Transmit buffer empty interrupt.
  305. * @arg SWPMI_IT_RXBFIE : Receive buffer full interrupt.
  306. * @retval The new state of __IT__ (TRUE or FALSE).
  307. */
  308. #define __HAL_SWPMI_GET_IT_SOURCE(__HANDLE__, __IT__) ((READ_BIT((__HANDLE__)->Instance->IER, (__IT__)) == (__IT__)) ? SET : RESET)
  309. /**
  310. * @}
  311. */
  312. /* Exported functions --------------------------------------------------------*/
  313. /** @defgroup SWPMI_Exported_Functions SWPMI Exported Functions
  314. * @{
  315. */
  316. /* Initialization/de-initialization functions ********************************/
  317. HAL_StatusTypeDef HAL_SWPMI_Init(SWPMI_HandleTypeDef *hswpmi);
  318. HAL_StatusTypeDef HAL_SWPMI_DeInit(SWPMI_HandleTypeDef *hswpmi);
  319. void HAL_SWPMI_MspInit(SWPMI_HandleTypeDef *hswpmi);
  320. void HAL_SWPMI_MspDeInit(SWPMI_HandleTypeDef *hswpmi);
  321. /* IO operation functions *****************************************************/
  322. HAL_StatusTypeDef HAL_SWPMI_Transmit(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size, uint32_t Timeout);
  323. HAL_StatusTypeDef HAL_SWPMI_Receive(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size, uint32_t Timeout);
  324. HAL_StatusTypeDef HAL_SWPMI_Transmit_IT(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size);
  325. HAL_StatusTypeDef HAL_SWPMI_Receive_IT(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size);
  326. HAL_StatusTypeDef HAL_SWPMI_Transmit_DMA(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size);
  327. HAL_StatusTypeDef HAL_SWPMI_Receive_DMA(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size);
  328. HAL_StatusTypeDef HAL_SWPMI_DMAStop(SWPMI_HandleTypeDef *hswpmi);
  329. HAL_StatusTypeDef HAL_SWPMI_EnableLoopback(SWPMI_HandleTypeDef *hswpmi);
  330. HAL_StatusTypeDef HAL_SWPMI_DisableLoopback(SWPMI_HandleTypeDef *hswpmi);
  331. void HAL_SWPMI_IRQHandler(SWPMI_HandleTypeDef *hswpmi);
  332. void HAL_SWPMI_TxCpltCallback(SWPMI_HandleTypeDef *hswpmi);
  333. void HAL_SWPMI_TxHalfCpltCallback(SWPMI_HandleTypeDef *hswpmi);
  334. void HAL_SWPMI_RxCpltCallback(SWPMI_HandleTypeDef *hswpmi);
  335. void HAL_SWPMI_RxHalfCpltCallback(SWPMI_HandleTypeDef *hswpmi);
  336. void HAL_SWPMI_ErrorCallback(SWPMI_HandleTypeDef *hswpmi);
  337. /* Peripheral Control and State functions ************************************/
  338. HAL_SWPMI_StateTypeDef HAL_SWPMI_GetState(SWPMI_HandleTypeDef *hswpmi);
  339. uint32_t HAL_SWPMI_GetError(SWPMI_HandleTypeDef *hswpmi);
  340. /**
  341. * @}
  342. */
  343. /* Private types -------------------------------------------------------------*/
  344. /** @defgroup SWPMI_Private_Types SWPMI Private Types
  345. * @{
  346. */
  347. /**
  348. * @}
  349. */
  350. /* Private variables ---------------------------------------------------------*/
  351. /** @defgroup SWPMI_Private_Variables SWPMI Private Variables
  352. * @{
  353. */
  354. /**
  355. * @}
  356. */
  357. /* Private constants ---------------------------------------------------------*/
  358. /** @defgroup SWPMI_Private_Constants SWPMI Private Constants
  359. * @{
  360. */
  361. /**
  362. * @}
  363. */
  364. /* Private macros ------------------------------------------------------------*/
  365. /** @defgroup SWPMI_Private_Macros SWPMI Private Macros
  366. * @{
  367. */
  368. #define IS_SWPMI_VOLTAGE_CLASS(__CLASS__) (((__CLASS__) == SWPMI_VOLTAGE_CLASS_C) || \
  369. ((__CLASS__) == SWPMI_VOLTAGE_CLASS_B))
  370. #define IS_SWPMI_BITRATE_VALUE(__VALUE__) (((__VALUE__) <= 63))
  371. #define IS_SWPMI_TX_BUFFERING_MODE(__MODE__) (((__MODE__) == SWPMI_TX_NO_SOFTWAREBUFFER) || \
  372. ((__MODE__) == SWPMI_TX_MULTI_SOFTWAREBUFFER))
  373. #define IS_SWPMI_RX_BUFFERING_MODE(__MODE__) (((__MODE__) == SWPMI_RX_NO_SOFTWAREBUFFER) || \
  374. ((__MODE__) == SWPMI_RX_MULTI_SOFTWAREBUFFER))
  375. /**
  376. * @}
  377. */
  378. /**
  379. * @}
  380. */
  381. /**
  382. * @}
  383. */
  384. #endif /* STM32L431xx || STM32L432xx || STM32L433xx || STM32L442xx || STM32L443xx || */
  385. /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx || */
  386. /* STM32L496xx || STM32L4A6xx */
  387. #ifdef __cplusplus
  388. }
  389. #endif
  390. #endif /* __STM32L4xx_HAL_SWPMI_H */
  391. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/