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