1 /**
2   ******************************************************************************
3   * @file    stm32h7xx_hal_swpmi.h
4   * @author  MCD Application Team
5   * @brief   Header file of SWPMI HAL module.
6   ******************************************************************************
7   * @attention
8   *
9   * Copyright (c) 2017 STMicroelectronics.
10   * All rights reserved.
11   *
12   * This software is licensed under terms that can be found in the LICENSE file
13   * in the root directory of this software component.
14   * If no LICENSE file comes with this software, it is provided AS-IS.
15   *
16   ******************************************************************************
17   */
18 
19 /* Define to prevent recursive inclusion -------------------------------------*/
20 #ifndef STM32H7xx_HAL_SWPMI_H
21 #define STM32H7xx_HAL_SWPMI_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32h7xx_hal_def.h"
29 
30 /** @addtogroup STM32H7xx_HAL_Driver
31   * @{
32   */
33 
34 
35 /** @addtogroup SWPMI
36   * @{
37   */
38 
39 /* Exported types ------------------------------------------------------------*/
40 /** @defgroup SWPMI_Exported_Types SWPMI Exported Types
41   * @{
42   */
43 
44 /**
45   * @brief SWPMI Init Structure definition
46   */
47 typedef struct
48 {
49   uint32_t VoltageClass;             /*!< Specifies the SWP Voltage Class.
50                                           This parameter can be a value of @ref SWPMI_Voltage_Class */
51 
52   uint32_t BitRate;                  /*!< Specifies the SWPMI Bitrate.
53                                           This parameter must be a number between 0 and 255U.
54                                           The Bitrate is computed using the following formula:
55                                           SWPMI_freq = SWPMI_clk / (((BitRate) + 1)  * 4)
56                                           */
57 
58   uint32_t TxBufferingMode;          /*!< Specifies the transmission buffering mode.
59                                           This parameter can be a value of @ref SWPMI_Tx_Buffering_Mode */
60 
61   uint32_t RxBufferingMode;          /*!< Specifies the reception buffering mode.
62                                           This parameter can be a value of @ref SWPMI_Rx_Buffering_Mode */
63 
64 } SWPMI_InitTypeDef;
65 
66 
67 /**
68   * @brief HAL SWPMI State structures definition
69   */
70 typedef enum
71 {
72   HAL_SWPMI_STATE_RESET             = 0x00,    /*!< Peripheral Reset state                             */
73   HAL_SWPMI_STATE_READY             = 0x01,    /*!< Peripheral Initialized and ready for use           */
74   HAL_SWPMI_STATE_BUSY              = 0x02,    /*!< an internal process is ongoing                     */
75   HAL_SWPMI_STATE_BUSY_TX           = 0x12,    /*!< Data Transmission process is ongoing               */
76   HAL_SWPMI_STATE_BUSY_RX           = 0x22,    /*!< Data Reception process is ongoing                  */
77   HAL_SWPMI_STATE_BUSY_TX_RX        = 0x32,    /*!< Data Transmission and Reception process is ongoing */
78   HAL_SWPMI_STATE_TIMEOUT           = 0x03,    /*!< Timeout state                                      */
79   HAL_SWPMI_STATE_ERROR             = 0x04     /*!< Error                                              */
80 } HAL_SWPMI_StateTypeDef;
81 
82 /**
83   * @brief  SWPMI handle Structure definition
84   */
85 #if (USE_HAL_SWPMI_REGISTER_CALLBACKS == 1)
86 typedef struct __SWPMI_HandleTypeDef
87 #else
88 typedef struct
89 #endif /* USE_HAL_SWPMI_REGISTER_CALLBACKS */
90 {
91   SWPMI_TypeDef                  *Instance;     /*!< SWPMI registers base address         */
92 
93   SWPMI_InitTypeDef              Init;          /*!< SWPMI communication parameters       */
94 
95   uint32_t                       *pTxBuffPtr;   /*!< Pointer to SWPMI Tx transfer Buffer  */
96 
97   uint32_t                       TxXferSize;    /*!< SWPMI Tx Transfer size               */
98 
99   uint32_t                       TxXferCount;   /*!< SWPMI Tx Transfer Counter            */
100 
101   uint32_t                       *pRxBuffPtr;   /*!< Pointer to SWPMI Rx transfer Buffer  */
102 
103   uint32_t                       RxXferSize;    /*!< SWPMI Rx Transfer size               */
104 
105   uint32_t                       RxXferCount;   /*!< SWPMI Rx Transfer Counter            */
106 
107   DMA_HandleTypeDef              *hdmatx;       /*!< SWPMI Tx DMA Handle parameters       */
108 
109   DMA_HandleTypeDef              *hdmarx;       /*!< SWPMI Rx DMA Handle parameters       */
110 
111   HAL_LockTypeDef                Lock;          /*!< SWPMI object                         */
112 
113   __IO HAL_SWPMI_StateTypeDef    State;         /*!< SWPMI communication state            */
114 
115   __IO uint32_t                  ErrorCode;     /*!< SWPMI Error code                     */
116 
117 #if (USE_HAL_SWPMI_REGISTER_CALLBACKS == 1)
118   void (*RxCpltCallback)(struct __SWPMI_HandleTypeDef *hswpmi);      /*!< SWPMI receive complete callback */
119   void (*RxHalfCpltCallback)(struct __SWPMI_HandleTypeDef *hswpmi);  /*!< SWPMI receive half complete callback */
120   void (*TxCpltCallback)(struct __SWPMI_HandleTypeDef *hswpmi);      /*!< SWPMI transmit complete callback */
121   void (*TxHalfCpltCallback)(struct __SWPMI_HandleTypeDef *hswpmi);  /*!< SWPMI transmit half complete callback */
122   void (*ErrorCallback)(struct __SWPMI_HandleTypeDef *hswpmi);       /*!< SWPMI error callback */
123   void (*MspInitCallback)(struct __SWPMI_HandleTypeDef *hswpmi);     /*!< SWPMI MSP init callback */
124   void (*MspDeInitCallback)(struct __SWPMI_HandleTypeDef *hswpmi);   /*!< SWPMI MSP de-init callback */
125 #endif
126 
127 } SWPMI_HandleTypeDef;
128 
129 #if (USE_HAL_SWPMI_REGISTER_CALLBACKS == 1)
130 /**
131   * @brief  SWPMI callback ID enumeration definition
132   */
133 typedef enum
134 {
135   HAL_SWPMI_RX_COMPLETE_CB_ID     = 0x00U, /*!< SWPMI receive complete callback ID */
136   HAL_SWPMI_RX_HALFCOMPLETE_CB_ID = 0x01U, /*!< SWPMI receive half complete callback ID */
137   HAL_SWPMI_TX_COMPLETE_CB_ID     = 0x02U, /*!< SWPMI transmit complete callback ID */
138   HAL_SWPMI_TX_HALFCOMPLETE_CB_ID = 0x03U, /*!< SWPMI transmit half complete callback ID */
139   HAL_SWPMI_ERROR_CB_ID           = 0x04U, /*!< SWPMI error callback ID */
140   HAL_SWPMI_MSPINIT_CB_ID         = 0x05U, /*!< SWPMI MSP init callback ID */
141   HAL_SWPMI_MSPDEINIT_CB_ID       = 0x06U  /*!< SWPMI MSP de-init callback ID */
142 } HAL_SWPMI_CallbackIDTypeDef;
143 
144 /**
145   * @brief  SWPMI callback pointer definition
146   */
147 typedef void (*pSWPMI_CallbackTypeDef)(SWPMI_HandleTypeDef *hswpmi);
148 #endif
149 
150 /**
151   * @}
152   */
153 
154 /* Exported constants --------------------------------------------------------*/
155 /** @defgroup SWPMI_Exported_Constants SWPMI Exported Constants
156   * @{
157   */
158 
159 /**
160   * @defgroup SWPMI_Error_Code SWPMI Error Code Bitmap
161   * @{
162   */
163 #define HAL_SWPMI_ERROR_NONE                  ((uint32_t)0x00000000) /*!< No error              */
164 #define HAL_SWPMI_ERROR_CRC                   ((uint32_t)0x00000004) /*!< frame error           */
165 #define HAL_SWPMI_ERROR_OVR                   ((uint32_t)0x00000008) /*!< Overrun error         */
166 #define HAL_SWPMI_ERROR_UDR                   ((uint32_t)0x0000000C) /*!< Underrun error        */
167 #define HAL_SWPMI_ERROR_DMA                   ((uint32_t)0x00000010) /*!< DMA transfer error    */
168 #define HAL_SWPMI_ERROR_TIMEOUT               ((uint32_t)0x00000020) /*!< Transfer timeout      */
169 #define HAL_SWPMI_ERROR_TXBEF_TIMEOUT         ((uint32_t)0x00000040) /*!< End Tx buffer timeout */
170 #define HAL_SWPMI_ERROR_TRANSCEIVER_NOT_READY ((uint32_t)0x00000080) /*!< Transceiver not ready */
171 #if (USE_HAL_SWPMI_REGISTER_CALLBACKS == 1)
172 #define HAL_SWPMI_ERROR_INVALID_CALLBACK      ((uint32_t)0x00000100) /*!< Invalid callback error */
173 #endif
174 /**
175   * @}
176   */
177 
178 /** @defgroup SWPMI_Voltage_Class SWPMI Voltage Class
179   * @{
180   */
181 #define SWPMI_VOLTAGE_CLASS_C                ((uint32_t)0x00000000)
182 #define SWPMI_VOLTAGE_CLASS_B                SWPMI_OR_CLASS
183 /**
184   * @}
185   */
186 
187 /** @defgroup SWPMI_Tx_Buffering_Mode SWPMI Tx Buffering Mode
188   * @{
189   */
190 #define SWPMI_TX_NO_SOFTWAREBUFFER           ((uint32_t)0x00000000)
191 #define SWPMI_TX_SINGLE_SOFTWAREBUFFER       ((uint32_t)0x00000000)
192 #define SWPMI_TX_MULTI_SOFTWAREBUFFER        SWPMI_CR_TXMODE
193 /**
194   * @}
195   */
196 
197 /** @defgroup SWPMI_Rx_Buffering_Mode SWPMI Rx Buffering Mode
198   * @{
199   */
200 #define SWPMI_RX_NO_SOFTWAREBUFFER           ((uint32_t)0x00000000)
201 #define SWPMI_RX_SINGLE_SOFTWAREBUFFER       ((uint32_t)0x00000000)
202 #define SWPMI_RX_MULTI_SOFTWAREBUFFER        SWPMI_CR_RXMODE
203 /**
204   * @}
205   */
206 
207 /** @defgroup SWPMI_Flags SWPMI Status Flags
208   *        Elements values convention: 0xXXXXXXXX
209   *           - 0xXXXXXXXX  : Flag mask in the ISR register
210   * @{
211   */
212 #define SWPMI_FLAG_RXBFF                 SWPMI_ISR_RXBFF
213 #define SWPMI_FLAG_TXBEF                 SWPMI_ISR_TXBEF
214 #define SWPMI_FLAG_RXBERF                SWPMI_ISR_RXBERF
215 #define SWPMI_FLAG_RXOVRF                SWPMI_ISR_RXOVRF
216 #define SWPMI_FLAG_TXUNRF                SWPMI_ISR_TXUNRF
217 #define SWPMI_FLAG_RXNE                  SWPMI_ISR_RXNE
218 #define SWPMI_FLAG_TXE                   SWPMI_ISR_TXE
219 #define SWPMI_FLAG_TCF                   SWPMI_ISR_TCF
220 #define SWPMI_FLAG_SRF                   SWPMI_ISR_SRF
221 #define SWPMI_FLAG_SUSP                  SWPMI_ISR_SUSP
222 #define SWPMI_FLAG_DEACTF                SWPMI_ISR_DEACTF
223 #define SWPMI_FLAG_RDYF                  SWPMI_ISR_RDYF
224 /**
225   * @}
226   */
227 
228 /** @defgroup SWPMI_Interrupt_definition SWPMI Interrupts Definition
229   *        Elements values convention: 0xXXXX
230   *           - 0xXXXX  : Flag mask in the IER register
231   * @{
232   */
233 #define SWPMI_IT_RDYIE                   SWPMI_IER_RDYIE
234 #define SWPMI_IT_SRIE                    SWPMI_IER_SRIE
235 #define SWPMI_IT_TCIE                    SWPMI_IER_TCIE
236 #define SWPMI_IT_TIE                     SWPMI_IER_TIE
237 #define SWPMI_IT_RIE                     SWPMI_IER_RIE
238 #define SWPMI_IT_TXUNRIE                 SWPMI_IER_TXUNRIE
239 #define SWPMI_IT_RXOVRIE                 SWPMI_IER_RXOVRIE
240 #define SWPMI_IT_RXBERIE                 SWPMI_IER_RXBERIE
241 #define SWPMI_IT_TXBEIE                  SWPMI_IER_TXBEIE
242 #define SWPMI_IT_RXBFIE                  SWPMI_IER_RXBFIE
243 /**
244   * @}
245   */
246 
247 /**
248   * @}
249   */
250 
251 /* Exported macros -----------------------------------------------------------*/
252 /** @defgroup SWPMI_Exported_Macros SWPMI Exported Macros
253   * @{
254   */
255 
256 /** @brief Reset SWPMI handle state.
257   * @param  __HANDLE__ specifies the SWPMI Handle.
258   * @retval None
259   */
260 #if (USE_HAL_SWPMI_REGISTER_CALLBACKS == 1)
261 #define __HAL_SWPMI_RESET_HANDLE_STATE(__HANDLE__) do{                                            \
262                                                      (__HANDLE__)->State = HAL_SWPMI_STATE_RESET; \
263                                                      (__HANDLE__)->MspInitCallback = NULL;        \
264                                                      (__HANDLE__)->MspDeInitCallback = NULL;      \
265                                                    } while(0)
266 #else
267 #define __HAL_SWPMI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SWPMI_STATE_RESET)
268 #endif
269 
270 /**
271   * @brief  Enable the SWPMI peripheral.
272   * @param  __HANDLE__ SWPMI handle
273   * @retval None
274   */
275 #define __HAL_SWPMI_ENABLE(__HANDLE__)   SET_BIT((__HANDLE__)->Instance->CR, SWPMI_CR_SWPACT)
276 
277 /**
278   * @brief  Disable the SWPMI peripheral.
279   * @param  __HANDLE__ SWPMI handle
280   * @retval None
281   */
282 #define __HAL_SWPMI_DISABLE(__HANDLE__)  CLEAR_BIT((__HANDLE__)->Instance->CR, SWPMI_CR_SWPACT)
283 
284 /**
285   * @brief  Enable the SWPMI transceiver.
286   * @param  __HANDLE__ SWPMI handle
287   * @retval None
288   */
289 #define __HAL_SWPMI_TRANSCEIVER_ENABLE(__HANDLE__)   SET_BIT((__HANDLE__)->Instance->CR, SWPMI_CR_SWPEN)
290 
291 /**
292   * @brief  Disable the SWPMI transceiver.
293   * @param  __HANDLE__ SWPMI handle
294   * @retval None
295   */
296 #define __HAL_SWPMI_TRANSCEIVER_DISABLE(__HANDLE__)  CLEAR_BIT((__HANDLE__)->Instance->CR, SWPMI_CR_SWPEN)
297 
298 /** @brief  Check whether the specified SWPMI flag is set or not.
299   * @param  __HANDLE__ specifies the SWPMI Handle.
300   * @param  __FLAG__ specifies the flag to check.
301   *        This parameter can be one of the following values:
302   *            @arg SWPMI_FLAG_RXBFF  Receive buffer full flag.
303   *            @arg SWPMI_FLAG_TXBEF  Transmit buffer empty flag.
304   *            @arg SWPMI_FLAG_RXBERF  Receive CRC error flag.
305   *            @arg SWPMI_FLAG_RXOVRF  Receive overrun error flag.
306   *            @arg SWPMI_FLAG_TXUNRF  Transmit underrun error flag.
307   *            @arg SWPMI_FLAG_RXNE  Receive data register not empty.
308   *            @arg SWPMI_FLAG_TXE  Transmit data register empty.
309   *            @arg SWPMI_FLAG_TCF  Transfer complete flag.
310   *            @arg SWPMI_FLAG_SRF  Slave resume flag.
311   *            @arg SWPMI_FLAG_SUSP  SUSPEND flag.
312   *            @arg SWPMI_FLAG_DEACTF  DEACTIVATED flag.
313   *            @arg SWPMI_FLAG_RDYF  Transceiver ready flag.
314   * @retval The new state of __FLAG__ (TRUE or FALSE).
315   */
316 #define __HAL_SWPMI_GET_FLAG(__HANDLE__, __FLAG__) (READ_BIT((__HANDLE__)->Instance->ISR, (__FLAG__)) == (__FLAG__))
317 
318 /** @brief  Clear the specified SWPMI ISR flag.
319   * @param  __HANDLE__ specifies the SWPMI Handle.
320   * @param  __FLAG__ specifies the flag to clear.
321   *        This parameter can be one of the following values:
322   *            @arg SWPMI_FLAG_RXBFF  Receive buffer full flag.
323   *            @arg SWPMI_FLAG_TXBEF  Transmit buffer empty flag.
324   *            @arg SWPMI_FLAG_RXBERF  Receive CRC error flag.
325   *            @arg SWPMI_FLAG_RXOVRF  Receive overrun error flag.
326   *            @arg SWPMI_FLAG_TXUNRF  Transmit underrun error flag.
327   *            @arg SWPMI_FLAG_TCF  Transfer complete flag.
328   *            @arg SWPMI_FLAG_SRF  Slave resume flag.
329   *            @arg SWPMI_FLAG_RDYF  Transceiver ready flag.
330   * @retval None
331   */
332 #define __HAL_SWPMI_CLEAR_FLAG(__HANDLE__, __FLAG__) WRITE_REG((__HANDLE__)->Instance->ICR, (__FLAG__))
333 
334 /** @brief  Enable the specified SWPMI interrupt.
335   * @param  __HANDLE__ specifies the SWPMI Handle.
336   * @param  __INTERRUPT__ specifies the SWPMI interrupt source to enable.
337   *          This parameter can be one of the following values:
338   *            @arg SWPMI_IT_RDYIE  Transceiver ready interrupt.
339   *            @arg SWPMI_IT_SRIE  Slave resume interrupt.
340   *            @arg SWPMI_IT_TCIE  Transmit complete interrupt.
341   *            @arg SWPMI_IT_TIE   Transmit interrupt.
342   *            @arg SWPMI_IT_RIE   Receive interrupt.
343   *            @arg SWPMI_IT_TXUNRIE  Transmit underrun error interrupt.
344   *            @arg SWPMI_IT_RXOVRIE  Receive overrun error interrupt.
345   *            @arg SWPMI_IT_RXBEIE  Receive CRC error interrupt.
346   *            @arg SWPMI_IT_TXBEIE   Transmit buffer empty interrupt.
347   *            @arg SWPMI_IT_RXBFIE   Receive buffer full interrupt.
348   * @retval None
349   */
350 #define __HAL_SWPMI_ENABLE_IT(__HANDLE__, __INTERRUPT__)   SET_BIT((__HANDLE__)->Instance->IER, (__INTERRUPT__))
351 
352 /** @brief  Disable the specified SWPMI interrupt.
353   * @param  __HANDLE__ specifies the SWPMI Handle.
354   * @param  __INTERRUPT__ specifies the SWPMI interrupt source to disable.
355   *          This parameter can be one of the following values:
356   *            @arg SWPMI_IT_RDYIE  Transceiver ready interrupt.
357   *            @arg SWPMI_IT_SRIE  Slave resume interrupt.
358   *            @arg SWPMI_IT_TCIE  Transmit complete interrupt.
359   *            @arg SWPMI_IT_TIE   Transmit interrupt.
360   *            @arg SWPMI_IT_RIE   Receive interrupt.
361   *            @arg SWPMI_IT_TXUNRIE  Transmit underrun error interrupt.
362   *            @arg SWPMI_IT_RXOVRIE  Receive overrun error interrupt.
363   *            @arg SWPMI_IT_RXBEIE  Receive CRC error interrupt.
364   *            @arg SWPMI_IT_TXBEIE   Transmit buffer empty interrupt.
365   *            @arg SWPMI_IT_RXBFIE   Receive buffer full interrupt.
366   * @retval None
367   */
368 #define __HAL_SWPMI_DISABLE_IT(__HANDLE__, __INTERRUPT__)  CLEAR_BIT((__HANDLE__)->Instance->IER, (__INTERRUPT__))
369 
370 /** @brief  Check whether the specified SWPMI interrupt has occurred or not.
371   * @param  __HANDLE__ specifies the SWPMI Handle.
372   * @param  __IT__ specifies the SWPMI interrupt to check.
373   *          This parameter can be one of the following values:
374   *            @arg SWPMI_IT_RDYIE  Transceiver ready interrupt.
375   *            @arg SWPMI_IT_SRIE  Slave resume interrupt.
376   *            @arg SWPMI_IT_TCIE  Transmit complete interrupt.
377   *            @arg SWPMI_IT_TIE   Transmit interrupt.
378   *            @arg SWPMI_IT_RIE   Receive interrupt.
379   *            @arg SWPMI_IT_TXUNRIE  Transmit underrun error interrupt.
380   *            @arg SWPMI_IT_RXOVRIE  Receive overrun error interrupt.
381   *            @arg SWPMI_IT_RXBERIE  Receive CRC error interrupt.
382   *            @arg SWPMI_IT_TXBEIE   Transmit buffer empty interrupt.
383   *            @arg SWPMI_IT_RXBFIE   Receive buffer full interrupt.
384   * @retval The new state of __IT__ (TRUE or FALSE).
385   */
386 #define __HAL_SWPMI_GET_IT(__HANDLE__, __IT__)  (READ_BIT((__HANDLE__)->Instance->ISR,(__IT__)) == (__IT__))
387 
388 /** @brief  Check whether the specified SWPMI interrupt source is enabled or not.
389   * @param  __HANDLE__ specifies the SWPMI Handle.
390   * @param  __IT__ specifies the SWPMI interrupt source to check.
391   *          This parameter can be one of the following values:
392   *            @arg SWPMI_IT_RDYIE  Transceiver ready interrupt.
393   *            @arg SWPMI_IT_SRIE  Slave resume interrupt.
394   *            @arg SWPMI_IT_TCIE  Transmit complete interrupt.
395   *            @arg SWPMI_IT_TIE   Transmit interrupt.
396   *            @arg SWPMI_IT_RIE   Receive interrupt.
397   *            @arg SWPMI_IT_TXUNRIE  Transmit underrun error interrupt.
398   *            @arg SWPMI_IT_RXOVRIE  Receive overrun error interrupt.
399   *            @arg SWPMI_IT_RXBERIE  Receive CRC error interrupt.
400   *            @arg SWPMI_IT_TXBEIE   Transmit buffer empty interrupt.
401   *            @arg SWPMI_IT_RXBFIE   Receive buffer full interrupt.
402   * @retval The new state of __IT__ (TRUE or FALSE).
403   */
404 #define __HAL_SWPMI_GET_IT_SOURCE(__HANDLE__, __IT__) ((READ_BIT((__HANDLE__)->Instance->IER, (__IT__)) == (__IT__)) ? SET : RESET)
405 
406 /**
407   * @}
408   */
409 
410 /* Exported functions --------------------------------------------------------*/
411 /** @defgroup SWPMI_Exported_Functions SWPMI Exported Functions
412   * @{
413   */
414 /* Initialization/de-initialization functions  ********************************/
415 HAL_StatusTypeDef HAL_SWPMI_Init(SWPMI_HandleTypeDef *hswpmi);
416 HAL_StatusTypeDef HAL_SWPMI_DeInit(SWPMI_HandleTypeDef *hswpmi);
417 void              HAL_SWPMI_MspInit(SWPMI_HandleTypeDef *hswpmi);
418 void              HAL_SWPMI_MspDeInit(SWPMI_HandleTypeDef *hswpmi);
419 
420 #if (USE_HAL_SWPMI_REGISTER_CALLBACKS == 1)
421 /* SWPMI callbacks register/unregister functions ********************************/
422 HAL_StatusTypeDef HAL_SWPMI_RegisterCallback(SWPMI_HandleTypeDef        *hswpmi,
423                                              HAL_SWPMI_CallbackIDTypeDef CallbackID,
424                                              pSWPMI_CallbackTypeDef      pCallback);
425 HAL_StatusTypeDef HAL_SWPMI_UnRegisterCallback(SWPMI_HandleTypeDef        *hswpmi,
426                                                HAL_SWPMI_CallbackIDTypeDef CallbackID);
427 #endif
428 
429 /* IO operation functions *****************************************************/
430 HAL_StatusTypeDef HAL_SWPMI_Transmit(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size, uint32_t Timeout);
431 HAL_StatusTypeDef HAL_SWPMI_Receive(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size, uint32_t Timeout);
432 HAL_StatusTypeDef HAL_SWPMI_Transmit_IT(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size);
433 HAL_StatusTypeDef HAL_SWPMI_Receive_IT(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size);
434 HAL_StatusTypeDef HAL_SWPMI_Transmit_DMA(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size);
435 HAL_StatusTypeDef HAL_SWPMI_Receive_DMA(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size);
436 HAL_StatusTypeDef HAL_SWPMI_DMAStop(SWPMI_HandleTypeDef *hswpmi);
437 HAL_StatusTypeDef HAL_SWPMI_EnableLoopback(SWPMI_HandleTypeDef *hswpmi);
438 HAL_StatusTypeDef HAL_SWPMI_DisableLoopback(SWPMI_HandleTypeDef *hswpmi);
439 void              HAL_SWPMI_IRQHandler(SWPMI_HandleTypeDef *hswpmi);
440 void              HAL_SWPMI_TxCpltCallback(SWPMI_HandleTypeDef *hswpmi);
441 void              HAL_SWPMI_TxHalfCpltCallback(SWPMI_HandleTypeDef *hswpmi);
442 void              HAL_SWPMI_RxCpltCallback(SWPMI_HandleTypeDef *hswpmi);
443 void              HAL_SWPMI_RxHalfCpltCallback(SWPMI_HandleTypeDef *hswpmi);
444 void              HAL_SWPMI_ErrorCallback(SWPMI_HandleTypeDef *hswpmi);
445 
446 /* Peripheral Control and State functions  ************************************/
447 HAL_SWPMI_StateTypeDef HAL_SWPMI_GetState(SWPMI_HandleTypeDef *hswpmi);
448 uint32_t               HAL_SWPMI_GetError(SWPMI_HandleTypeDef *hswpmi);
449 
450 /**
451   * @}
452   */
453 
454 /* Private types -------------------------------------------------------------*/
455 /** @defgroup SWPMI_Private_Types SWPMI Private Types
456   * @{
457   */
458 
459 /**
460   * @}
461   */
462 
463 /* Private variables ---------------------------------------------------------*/
464 /** @defgroup SWPMI_Private_Variables SWPMI Private Variables
465   * @{
466   */
467 
468 /**
469   * @}
470   */
471 
472 /* Private constants ---------------------------------------------------------*/
473 /** @defgroup SWPMI_Private_Constants SWPMI Private Constants
474   * @{
475   */
476 
477 /**
478   * @}
479   */
480 
481 /* Private macros ------------------------------------------------------------*/
482 /** @defgroup SWPMI_Private_Macros SWPMI Private Macros
483   * @{
484   */
485 
486 
487 #define IS_SWPMI_VOLTAGE_CLASS(__CLASS__)    (((__CLASS__) == SWPMI_VOLTAGE_CLASS_C) || \
488                                               ((__CLASS__) == SWPMI_VOLTAGE_CLASS_B))
489 
490 #define IS_SWPMI_BITRATE_VALUE(__VALUE__)    (((__VALUE__) <= 255U))
491 
492 
493 #define IS_SWPMI_TX_BUFFERING_MODE(__MODE__) (((__MODE__) == SWPMI_TX_NO_SOFTWAREBUFFER) || \
494                                               ((__MODE__) == SWPMI_TX_MULTI_SOFTWAREBUFFER))
495 
496 
497 #define IS_SWPMI_RX_BUFFERING_MODE(__MODE__) (((__MODE__) == SWPMI_RX_NO_SOFTWAREBUFFER) || \
498                                               ((__MODE__) == SWPMI_RX_MULTI_SOFTWAREBUFFER))
499 
500 /**
501   * @}
502   */
503 
504 /**
505   * @}
506   */
507 
508 
509 /**
510   * @}
511   */
512 
513 #ifdef __cplusplus
514 }
515 #endif
516 
517 #endif /* STM32H7xx_HAL_SWPMI_H */
518