stm32l4xx_hal_swpmi.h 20 KB

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