STM32H735xx HAL User Manual
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32h7xx_hal_swpmi.h 00004 * @author MCD Application Team 00005 * @brief Header file of SWPMI HAL module. 00006 ****************************************************************************** 00007 * @attention 00008 * 00009 * Copyright (c) 2017 STMicroelectronics. 00010 * All rights reserved. 00011 * 00012 * This software is licensed under terms that can be found in the LICENSE file 00013 * in the root directory of this software component. 00014 * If no LICENSE file comes with this software, it is provided AS-IS. 00015 * 00016 ****************************************************************************** 00017 */ 00018 00019 /* Define to prevent recursive inclusion -------------------------------------*/ 00020 #ifndef STM32H7xx_HAL_SWPMI_H 00021 #define STM32H7xx_HAL_SWPMI_H 00022 00023 #ifdef __cplusplus 00024 extern "C" { 00025 #endif 00026 00027 /* Includes ------------------------------------------------------------------*/ 00028 #include "stm32h7xx_hal_def.h" 00029 00030 /** @addtogroup STM32H7xx_HAL_Driver 00031 * @{ 00032 */ 00033 00034 00035 /** @addtogroup SWPMI 00036 * @{ 00037 */ 00038 00039 /* Exported types ------------------------------------------------------------*/ 00040 /** @defgroup SWPMI_Exported_Types SWPMI Exported Types 00041 * @{ 00042 */ 00043 00044 /** 00045 * @brief SWPMI Init Structure definition 00046 */ 00047 typedef struct 00048 { 00049 uint32_t VoltageClass; /*!< Specifies the SWP Voltage Class. 00050 This parameter can be a value of @ref SWPMI_Voltage_Class */ 00051 00052 uint32_t BitRate; /*!< Specifies the SWPMI Bitrate. 00053 This parameter must be a number between 0 and 255U. 00054 The Bitrate is computed using the following formula: 00055 SWPMI_freq = SWPMI_clk / (((BitRate) + 1) * 4) 00056 */ 00057 00058 uint32_t TxBufferingMode; /*!< Specifies the transmission buffering mode. 00059 This parameter can be a value of @ref SWPMI_Tx_Buffering_Mode */ 00060 00061 uint32_t RxBufferingMode; /*!< Specifies the reception buffering mode. 00062 This parameter can be a value of @ref SWPMI_Rx_Buffering_Mode */ 00063 00064 } SWPMI_InitTypeDef; 00065 00066 00067 /** 00068 * @brief HAL SWPMI State structures definition 00069 */ 00070 typedef enum 00071 { 00072 HAL_SWPMI_STATE_RESET = 0x00, /*!< Peripheral Reset state */ 00073 HAL_SWPMI_STATE_READY = 0x01, /*!< Peripheral Initialized and ready for use */ 00074 HAL_SWPMI_STATE_BUSY = 0x02, /*!< an internal process is ongoing */ 00075 HAL_SWPMI_STATE_BUSY_TX = 0x12, /*!< Data Transmission process is ongoing */ 00076 HAL_SWPMI_STATE_BUSY_RX = 0x22, /*!< Data Reception process is ongoing */ 00077 HAL_SWPMI_STATE_BUSY_TX_RX = 0x32, /*!< Data Transmission and Reception process is ongoing */ 00078 HAL_SWPMI_STATE_TIMEOUT = 0x03, /*!< Timeout state */ 00079 HAL_SWPMI_STATE_ERROR = 0x04 /*!< Error */ 00080 } HAL_SWPMI_StateTypeDef; 00081 00082 /** 00083 * @brief SWPMI handle Structure definition 00084 */ 00085 #if (USE_HAL_SWPMI_REGISTER_CALLBACKS == 1) 00086 typedef struct __SWPMI_HandleTypeDef 00087 #else 00088 typedef struct 00089 #endif /* USE_HAL_SWPMI_REGISTER_CALLBACKS */ 00090 { 00091 SWPMI_TypeDef *Instance; /*!< SWPMI registers base address */ 00092 00093 SWPMI_InitTypeDef Init; /*!< SWPMI communication parameters */ 00094 00095 uint32_t *pTxBuffPtr; /*!< Pointer to SWPMI Tx transfer Buffer */ 00096 00097 uint32_t TxXferSize; /*!< SWPMI Tx Transfer size */ 00098 00099 uint32_t TxXferCount; /*!< SWPMI Tx Transfer Counter */ 00100 00101 uint32_t *pRxBuffPtr; /*!< Pointer to SWPMI Rx transfer Buffer */ 00102 00103 uint32_t RxXferSize; /*!< SWPMI Rx Transfer size */ 00104 00105 uint32_t RxXferCount; /*!< SWPMI Rx Transfer Counter */ 00106 00107 DMA_HandleTypeDef *hdmatx; /*!< SWPMI Tx DMA Handle parameters */ 00108 00109 DMA_HandleTypeDef *hdmarx; /*!< SWPMI Rx DMA Handle parameters */ 00110 00111 HAL_LockTypeDef Lock; /*!< SWPMI object */ 00112 00113 __IO HAL_SWPMI_StateTypeDef State; /*!< SWPMI communication state */ 00114 00115 __IO uint32_t ErrorCode; /*!< SWPMI Error code */ 00116 00117 #if (USE_HAL_SWPMI_REGISTER_CALLBACKS == 1) 00118 void (*RxCpltCallback)(struct __SWPMI_HandleTypeDef *hswpmi); /*!< SWPMI receive complete callback */ 00119 void (*RxHalfCpltCallback)(struct __SWPMI_HandleTypeDef *hswpmi); /*!< SWPMI receive half complete callback */ 00120 void (*TxCpltCallback)(struct __SWPMI_HandleTypeDef *hswpmi); /*!< SWPMI transmit complete callback */ 00121 void (*TxHalfCpltCallback)(struct __SWPMI_HandleTypeDef *hswpmi); /*!< SWPMI transmit half complete callback */ 00122 void (*ErrorCallback)(struct __SWPMI_HandleTypeDef *hswpmi); /*!< SWPMI error callback */ 00123 void (*MspInitCallback)(struct __SWPMI_HandleTypeDef *hswpmi); /*!< SWPMI MSP init callback */ 00124 void (*MspDeInitCallback)(struct __SWPMI_HandleTypeDef *hswpmi); /*!< SWPMI MSP de-init callback */ 00125 #endif 00126 00127 } SWPMI_HandleTypeDef; 00128 00129 #if (USE_HAL_SWPMI_REGISTER_CALLBACKS == 1) 00130 /** 00131 * @brief SWPMI callback ID enumeration definition 00132 */ 00133 typedef enum 00134 { 00135 HAL_SWPMI_RX_COMPLETE_CB_ID = 0x00U, /*!< SWPMI receive complete callback ID */ 00136 HAL_SWPMI_RX_HALFCOMPLETE_CB_ID = 0x01U, /*!< SWPMI receive half complete callback ID */ 00137 HAL_SWPMI_TX_COMPLETE_CB_ID = 0x02U, /*!< SWPMI transmit complete callback ID */ 00138 HAL_SWPMI_TX_HALFCOMPLETE_CB_ID = 0x03U, /*!< SWPMI transmit half complete callback ID */ 00139 HAL_SWPMI_ERROR_CB_ID = 0x04U, /*!< SWPMI error callback ID */ 00140 HAL_SWPMI_MSPINIT_CB_ID = 0x05U, /*!< SWPMI MSP init callback ID */ 00141 HAL_SWPMI_MSPDEINIT_CB_ID = 0x06U /*!< SWPMI MSP de-init callback ID */ 00142 } HAL_SWPMI_CallbackIDTypeDef; 00143 00144 /** 00145 * @brief SWPMI callback pointer definition 00146 */ 00147 typedef void (*pSWPMI_CallbackTypeDef)(SWPMI_HandleTypeDef *hswpmi); 00148 #endif 00149 00150 /** 00151 * @} 00152 */ 00153 00154 /* Exported constants --------------------------------------------------------*/ 00155 /** @defgroup SWPMI_Exported_Constants SWPMI Exported Constants 00156 * @{ 00157 */ 00158 00159 /** 00160 * @defgroup SWPMI_Error_Code SWPMI Error Code Bitmap 00161 * @{ 00162 */ 00163 #define HAL_SWPMI_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ 00164 #define HAL_SWPMI_ERROR_CRC ((uint32_t)0x00000004) /*!< frame error */ 00165 #define HAL_SWPMI_ERROR_OVR ((uint32_t)0x00000008) /*!< Overrun error */ 00166 #define HAL_SWPMI_ERROR_UDR ((uint32_t)0x0000000C) /*!< Underrun error */ 00167 #define HAL_SWPMI_ERROR_DMA ((uint32_t)0x00000010) /*!< DMA transfer error */ 00168 #define HAL_SWPMI_ERROR_TIMEOUT ((uint32_t)0x00000020) /*!< Transfer timeout */ 00169 #define HAL_SWPMI_ERROR_TXBEF_TIMEOUT ((uint32_t)0x00000040) /*!< End Tx buffer timeout */ 00170 #define HAL_SWPMI_ERROR_TRANSCEIVER_NOT_READY ((uint32_t)0x00000080) /*!< Transceiver not ready */ 00171 #if (USE_HAL_SWPMI_REGISTER_CALLBACKS == 1) 00172 #define HAL_SWPMI_ERROR_INVALID_CALLBACK ((uint32_t)0x00000100) /*!< Invalid callback error */ 00173 #endif 00174 /** 00175 * @} 00176 */ 00177 00178 /** @defgroup SWPMI_Voltage_Class SWPMI Voltage Class 00179 * @{ 00180 */ 00181 #define SWPMI_VOLTAGE_CLASS_C ((uint32_t)0x00000000) 00182 #define SWPMI_VOLTAGE_CLASS_B SWPMI_OR_CLASS 00183 /** 00184 * @} 00185 */ 00186 00187 /** @defgroup SWPMI_Tx_Buffering_Mode SWPMI Tx Buffering Mode 00188 * @{ 00189 */ 00190 #define SWPMI_TX_NO_SOFTWAREBUFFER ((uint32_t)0x00000000) 00191 #define SWPMI_TX_SINGLE_SOFTWAREBUFFER ((uint32_t)0x00000000) 00192 #define SWPMI_TX_MULTI_SOFTWAREBUFFER SWPMI_CR_TXMODE 00193 /** 00194 * @} 00195 */ 00196 00197 /** @defgroup SWPMI_Rx_Buffering_Mode SWPMI Rx Buffering Mode 00198 * @{ 00199 */ 00200 #define SWPMI_RX_NO_SOFTWAREBUFFER ((uint32_t)0x00000000) 00201 #define SWPMI_RX_SINGLE_SOFTWAREBUFFER ((uint32_t)0x00000000) 00202 #define SWPMI_RX_MULTI_SOFTWAREBUFFER SWPMI_CR_RXMODE 00203 /** 00204 * @} 00205 */ 00206 00207 /** @defgroup SWPMI_Flags SWPMI Status Flags 00208 * Elements values convention: 0xXXXXXXXX 00209 * - 0xXXXXXXXX : Flag mask in the ISR register 00210 * @{ 00211 */ 00212 #define SWPMI_FLAG_RXBFF SWPMI_ISR_RXBFF 00213 #define SWPMI_FLAG_TXBEF SWPMI_ISR_TXBEF 00214 #define SWPMI_FLAG_RXBERF SWPMI_ISR_RXBERF 00215 #define SWPMI_FLAG_RXOVRF SWPMI_ISR_RXOVRF 00216 #define SWPMI_FLAG_TXUNRF SWPMI_ISR_TXUNRF 00217 #define SWPMI_FLAG_RXNE SWPMI_ISR_RXNE 00218 #define SWPMI_FLAG_TXE SWPMI_ISR_TXE 00219 #define SWPMI_FLAG_TCF SWPMI_ISR_TCF 00220 #define SWPMI_FLAG_SRF SWPMI_ISR_SRF 00221 #define SWPMI_FLAG_SUSP SWPMI_ISR_SUSP 00222 #define SWPMI_FLAG_DEACTF SWPMI_ISR_DEACTF 00223 #define SWPMI_FLAG_RDYF SWPMI_ISR_RDYF 00224 /** 00225 * @} 00226 */ 00227 00228 /** @defgroup SWPMI_Interrupt_definition SWPMI Interrupts Definition 00229 * Elements values convention: 0xXXXX 00230 * - 0xXXXX : Flag mask in the IER register 00231 * @{ 00232 */ 00233 #define SWPMI_IT_RDYIE SWPMI_IER_RDYIE 00234 #define SWPMI_IT_SRIE SWPMI_IER_SRIE 00235 #define SWPMI_IT_TCIE SWPMI_IER_TCIE 00236 #define SWPMI_IT_TIE SWPMI_IER_TIE 00237 #define SWPMI_IT_RIE SWPMI_IER_RIE 00238 #define SWPMI_IT_TXUNRIE SWPMI_IER_TXUNRIE 00239 #define SWPMI_IT_RXOVRIE SWPMI_IER_RXOVRIE 00240 #define SWPMI_IT_RXBERIE SWPMI_IER_RXBERIE 00241 #define SWPMI_IT_TXBEIE SWPMI_IER_TXBEIE 00242 #define SWPMI_IT_RXBFIE SWPMI_IER_RXBFIE 00243 /** 00244 * @} 00245 */ 00246 00247 /** 00248 * @} 00249 */ 00250 00251 /* Exported macros -----------------------------------------------------------*/ 00252 /** @defgroup SWPMI_Exported_Macros SWPMI Exported Macros 00253 * @{ 00254 */ 00255 00256 /** @brief Reset SWPMI handle state. 00257 * @param __HANDLE__ specifies the SWPMI Handle. 00258 * @retval None 00259 */ 00260 #if (USE_HAL_SWPMI_REGISTER_CALLBACKS == 1) 00261 #define __HAL_SWPMI_RESET_HANDLE_STATE(__HANDLE__) do{ \ 00262 (__HANDLE__)->State = HAL_SWPMI_STATE_RESET; \ 00263 (__HANDLE__)->MspInitCallback = NULL; \ 00264 (__HANDLE__)->MspDeInitCallback = NULL; \ 00265 } while(0) 00266 #else 00267 #define __HAL_SWPMI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SWPMI_STATE_RESET) 00268 #endif 00269 00270 /** 00271 * @brief Enable the SWPMI peripheral. 00272 * @param __HANDLE__ SWPMI handle 00273 * @retval None 00274 */ 00275 #define __HAL_SWPMI_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR, SWPMI_CR_SWPACT) 00276 00277 /** 00278 * @brief Disable the SWPMI peripheral. 00279 * @param __HANDLE__ SWPMI handle 00280 * @retval None 00281 */ 00282 #define __HAL_SWPMI_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CR, SWPMI_CR_SWPACT) 00283 00284 /** 00285 * @brief Enable the SWPMI transceiver. 00286 * @param __HANDLE__ SWPMI handle 00287 * @retval None 00288 */ 00289 #define __HAL_SWPMI_TRANSCEIVER_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR, SWPMI_CR_SWPEN) 00290 00291 /** 00292 * @brief Disable the SWPMI transceiver. 00293 * @param __HANDLE__ SWPMI handle 00294 * @retval None 00295 */ 00296 #define __HAL_SWPMI_TRANSCEIVER_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CR, SWPMI_CR_SWPEN) 00297 00298 /** @brief Check whether the specified SWPMI flag is set or not. 00299 * @param __HANDLE__ specifies the SWPMI Handle. 00300 * @param __FLAG__ specifies the flag to check. 00301 * This parameter can be one of the following values: 00302 * @arg SWPMI_FLAG_RXBFF Receive buffer full flag. 00303 * @arg SWPMI_FLAG_TXBEF Transmit buffer empty flag. 00304 * @arg SWPMI_FLAG_RXBERF Receive CRC error flag. 00305 * @arg SWPMI_FLAG_RXOVRF Receive overrun error flag. 00306 * @arg SWPMI_FLAG_TXUNRF Transmit underrun error flag. 00307 * @arg SWPMI_FLAG_RXNE Receive data register not empty. 00308 * @arg SWPMI_FLAG_TXE Transmit data register empty. 00309 * @arg SWPMI_FLAG_TCF Transfer complete flag. 00310 * @arg SWPMI_FLAG_SRF Slave resume flag. 00311 * @arg SWPMI_FLAG_SUSP SUSPEND flag. 00312 * @arg SWPMI_FLAG_DEACTF DEACTIVATED flag. 00313 * @arg SWPMI_FLAG_RDYF Transceiver ready flag. 00314 * @retval The new state of __FLAG__ (TRUE or FALSE). 00315 */ 00316 #define __HAL_SWPMI_GET_FLAG(__HANDLE__, __FLAG__) (READ_BIT((__HANDLE__)->Instance->ISR, (__FLAG__)) == (__FLAG__)) 00317 00318 /** @brief Clear the specified SWPMI ISR flag. 00319 * @param __HANDLE__ specifies the SWPMI Handle. 00320 * @param __FLAG__ specifies the flag to clear. 00321 * This parameter can be one of the following values: 00322 * @arg SWPMI_FLAG_RXBFF Receive buffer full flag. 00323 * @arg SWPMI_FLAG_TXBEF Transmit buffer empty flag. 00324 * @arg SWPMI_FLAG_RXBERF Receive CRC error flag. 00325 * @arg SWPMI_FLAG_RXOVRF Receive overrun error flag. 00326 * @arg SWPMI_FLAG_TXUNRF Transmit underrun error flag. 00327 * @arg SWPMI_FLAG_TCF Transfer complete flag. 00328 * @arg SWPMI_FLAG_SRF Slave resume flag. 00329 * @arg SWPMI_FLAG_RDYF Transceiver ready flag. 00330 * @retval None 00331 */ 00332 #define __HAL_SWPMI_CLEAR_FLAG(__HANDLE__, __FLAG__) WRITE_REG((__HANDLE__)->Instance->ICR, (__FLAG__)) 00333 00334 /** @brief Enable the specified SWPMI interrupt. 00335 * @param __HANDLE__ specifies the SWPMI Handle. 00336 * @param __INTERRUPT__ specifies the SWPMI interrupt source to enable. 00337 * This parameter can be one of the following values: 00338 * @arg SWPMI_IT_RDYIE Transceiver ready interrupt. 00339 * @arg SWPMI_IT_SRIE Slave resume interrupt. 00340 * @arg SWPMI_IT_TCIE Transmit complete interrupt. 00341 * @arg SWPMI_IT_TIE Transmit interrupt. 00342 * @arg SWPMI_IT_RIE Receive interrupt. 00343 * @arg SWPMI_IT_TXUNRIE Transmit underrun error interrupt. 00344 * @arg SWPMI_IT_RXOVRIE Receive overrun error interrupt. 00345 * @arg SWPMI_IT_RXBEIE Receive CRC error interrupt. 00346 * @arg SWPMI_IT_TXBEIE Transmit buffer empty interrupt. 00347 * @arg SWPMI_IT_RXBFIE Receive buffer full interrupt. 00348 * @retval None 00349 */ 00350 #define __HAL_SWPMI_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->IER, (__INTERRUPT__)) 00351 00352 /** @brief Disable the specified SWPMI interrupt. 00353 * @param __HANDLE__ specifies the SWPMI Handle. 00354 * @param __INTERRUPT__ specifies the SWPMI interrupt source to disable. 00355 * This parameter can be one of the following values: 00356 * @arg SWPMI_IT_RDYIE Transceiver ready interrupt. 00357 * @arg SWPMI_IT_SRIE Slave resume interrupt. 00358 * @arg SWPMI_IT_TCIE Transmit complete interrupt. 00359 * @arg SWPMI_IT_TIE Transmit interrupt. 00360 * @arg SWPMI_IT_RIE Receive interrupt. 00361 * @arg SWPMI_IT_TXUNRIE Transmit underrun error interrupt. 00362 * @arg SWPMI_IT_RXOVRIE Receive overrun error interrupt. 00363 * @arg SWPMI_IT_RXBEIE Receive CRC error interrupt. 00364 * @arg SWPMI_IT_TXBEIE Transmit buffer empty interrupt. 00365 * @arg SWPMI_IT_RXBFIE Receive buffer full interrupt. 00366 * @retval None 00367 */ 00368 #define __HAL_SWPMI_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT((__HANDLE__)->Instance->IER, (__INTERRUPT__)) 00369 00370 /** @brief Check whether the specified SWPMI interrupt has occurred or not. 00371 * @param __HANDLE__ specifies the SWPMI Handle. 00372 * @param __IT__ specifies the SWPMI interrupt to check. 00373 * This parameter can be one of the following values: 00374 * @arg SWPMI_IT_RDYIE Transceiver ready interrupt. 00375 * @arg SWPMI_IT_SRIE Slave resume interrupt. 00376 * @arg SWPMI_IT_TCIE Transmit complete interrupt. 00377 * @arg SWPMI_IT_TIE Transmit interrupt. 00378 * @arg SWPMI_IT_RIE Receive interrupt. 00379 * @arg SWPMI_IT_TXUNRIE Transmit underrun error interrupt. 00380 * @arg SWPMI_IT_RXOVRIE Receive overrun error interrupt. 00381 * @arg SWPMI_IT_RXBERIE Receive CRC error interrupt. 00382 * @arg SWPMI_IT_TXBEIE Transmit buffer empty interrupt. 00383 * @arg SWPMI_IT_RXBFIE Receive buffer full interrupt. 00384 * @retval The new state of __IT__ (TRUE or FALSE). 00385 */ 00386 #define __HAL_SWPMI_GET_IT(__HANDLE__, __IT__) (READ_BIT((__HANDLE__)->Instance->ISR,(__IT__)) == (__IT__)) 00387 00388 /** @brief Check whether the specified SWPMI interrupt source is enabled or not. 00389 * @param __HANDLE__ specifies the SWPMI Handle. 00390 * @param __IT__ specifies the SWPMI interrupt source to check. 00391 * This parameter can be one of the following values: 00392 * @arg SWPMI_IT_RDYIE Transceiver ready interrupt. 00393 * @arg SWPMI_IT_SRIE Slave resume interrupt. 00394 * @arg SWPMI_IT_TCIE Transmit complete interrupt. 00395 * @arg SWPMI_IT_TIE Transmit interrupt. 00396 * @arg SWPMI_IT_RIE Receive interrupt. 00397 * @arg SWPMI_IT_TXUNRIE Transmit underrun error interrupt. 00398 * @arg SWPMI_IT_RXOVRIE Receive overrun error interrupt. 00399 * @arg SWPMI_IT_RXBERIE Receive CRC error interrupt. 00400 * @arg SWPMI_IT_TXBEIE Transmit buffer empty interrupt. 00401 * @arg SWPMI_IT_RXBFIE Receive buffer full interrupt. 00402 * @retval The new state of __IT__ (TRUE or FALSE). 00403 */ 00404 #define __HAL_SWPMI_GET_IT_SOURCE(__HANDLE__, __IT__) ((READ_BIT((__HANDLE__)->Instance->IER, (__IT__)) == (__IT__)) ? SET : RESET) 00405 00406 /** 00407 * @} 00408 */ 00409 00410 /* Exported functions --------------------------------------------------------*/ 00411 /** @defgroup SWPMI_Exported_Functions SWPMI Exported Functions 00412 * @{ 00413 */ 00414 /* Initialization/de-initialization functions ********************************/ 00415 HAL_StatusTypeDef HAL_SWPMI_Init(SWPMI_HandleTypeDef *hswpmi); 00416 HAL_StatusTypeDef HAL_SWPMI_DeInit(SWPMI_HandleTypeDef *hswpmi); 00417 void HAL_SWPMI_MspInit(SWPMI_HandleTypeDef *hswpmi); 00418 void HAL_SWPMI_MspDeInit(SWPMI_HandleTypeDef *hswpmi); 00419 00420 #if (USE_HAL_SWPMI_REGISTER_CALLBACKS == 1) 00421 /* SWPMI callbacks register/unregister functions ********************************/ 00422 HAL_StatusTypeDef HAL_SWPMI_RegisterCallback(SWPMI_HandleTypeDef *hswpmi, 00423 HAL_SWPMI_CallbackIDTypeDef CallbackID, 00424 pSWPMI_CallbackTypeDef pCallback); 00425 HAL_StatusTypeDef HAL_SWPMI_UnRegisterCallback(SWPMI_HandleTypeDef *hswpmi, 00426 HAL_SWPMI_CallbackIDTypeDef CallbackID); 00427 #endif 00428 00429 /* IO operation functions *****************************************************/ 00430 HAL_StatusTypeDef HAL_SWPMI_Transmit(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size, uint32_t Timeout); 00431 HAL_StatusTypeDef HAL_SWPMI_Receive(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size, uint32_t Timeout); 00432 HAL_StatusTypeDef HAL_SWPMI_Transmit_IT(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size); 00433 HAL_StatusTypeDef HAL_SWPMI_Receive_IT(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size); 00434 HAL_StatusTypeDef HAL_SWPMI_Transmit_DMA(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size); 00435 HAL_StatusTypeDef HAL_SWPMI_Receive_DMA(SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size); 00436 HAL_StatusTypeDef HAL_SWPMI_DMAStop(SWPMI_HandleTypeDef *hswpmi); 00437 HAL_StatusTypeDef HAL_SWPMI_EnableLoopback(SWPMI_HandleTypeDef *hswpmi); 00438 HAL_StatusTypeDef HAL_SWPMI_DisableLoopback(SWPMI_HandleTypeDef *hswpmi); 00439 void HAL_SWPMI_IRQHandler(SWPMI_HandleTypeDef *hswpmi); 00440 void HAL_SWPMI_TxCpltCallback(SWPMI_HandleTypeDef *hswpmi); 00441 void HAL_SWPMI_TxHalfCpltCallback(SWPMI_HandleTypeDef *hswpmi); 00442 void HAL_SWPMI_RxCpltCallback(SWPMI_HandleTypeDef *hswpmi); 00443 void HAL_SWPMI_RxHalfCpltCallback(SWPMI_HandleTypeDef *hswpmi); 00444 void HAL_SWPMI_ErrorCallback(SWPMI_HandleTypeDef *hswpmi); 00445 00446 /* Peripheral Control and State functions ************************************/ 00447 HAL_SWPMI_StateTypeDef HAL_SWPMI_GetState(SWPMI_HandleTypeDef *hswpmi); 00448 uint32_t HAL_SWPMI_GetError(SWPMI_HandleTypeDef *hswpmi); 00449 00450 /** 00451 * @} 00452 */ 00453 00454 /* Private types -------------------------------------------------------------*/ 00455 /** @defgroup SWPMI_Private_Types SWPMI Private Types 00456 * @{ 00457 */ 00458 00459 /** 00460 * @} 00461 */ 00462 00463 /* Private variables ---------------------------------------------------------*/ 00464 /** @defgroup SWPMI_Private_Variables SWPMI Private Variables 00465 * @{ 00466 */ 00467 00468 /** 00469 * @} 00470 */ 00471 00472 /* Private constants ---------------------------------------------------------*/ 00473 /** @defgroup SWPMI_Private_Constants SWPMI Private Constants 00474 * @{ 00475 */ 00476 00477 /** 00478 * @} 00479 */ 00480 00481 /* Private macros ------------------------------------------------------------*/ 00482 /** @defgroup SWPMI_Private_Macros SWPMI Private Macros 00483 * @{ 00484 */ 00485 00486 00487 #define IS_SWPMI_VOLTAGE_CLASS(__CLASS__) (((__CLASS__) == SWPMI_VOLTAGE_CLASS_C) || \ 00488 ((__CLASS__) == SWPMI_VOLTAGE_CLASS_B)) 00489 00490 #define IS_SWPMI_BITRATE_VALUE(__VALUE__) (((__VALUE__) <= 255U)) 00491 00492 00493 #define IS_SWPMI_TX_BUFFERING_MODE(__MODE__) (((__MODE__) == SWPMI_TX_NO_SOFTWAREBUFFER) || \ 00494 ((__MODE__) == SWPMI_TX_MULTI_SOFTWAREBUFFER)) 00495 00496 00497 #define IS_SWPMI_RX_BUFFERING_MODE(__MODE__) (((__MODE__) == SWPMI_RX_NO_SOFTWAREBUFFER) || \ 00498 ((__MODE__) == SWPMI_RX_MULTI_SOFTWAREBUFFER)) 00499 00500 /** 00501 * @} 00502 */ 00503 00504 /** 00505 * @} 00506 */ 00507 00508 00509 /** 00510 * @} 00511 */ 00512 00513 #ifdef __cplusplus 00514 } 00515 #endif 00516 00517 #endif /* STM32H7xx_HAL_SWPMI_H */