STM32H735xx HAL User Manual
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32h7xx_ll_swpmi.h 00004 * @author MCD Application Team 00005 * @brief Header file of SWPMI LL 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_LL_SWPMI_H 00021 #define STM32H7xx_LL_SWPMI_H 00022 00023 #ifdef __cplusplus 00024 extern "C" { 00025 #endif 00026 00027 /* Includes ------------------------------------------------------------------*/ 00028 #include "stm32h7xx.h" 00029 00030 /** @addtogroup STM32H7xx_LL_Driver 00031 * @{ 00032 */ 00033 00034 00035 /** @defgroup SWPMI_LL SWPMI 00036 * @{ 00037 */ 00038 00039 /* Private types -------------------------------------------------------------*/ 00040 /* Private variables ---------------------------------------------------------*/ 00041 /* Private constants ---------------------------------------------------------*/ 00042 /* Private macros ------------------------------------------------------------*/ 00043 #if defined(USE_FULL_LL_DRIVER) 00044 /** @defgroup SWPMI_LL_Private_Macros SWPMI Private Macros 00045 * @{ 00046 */ 00047 /** 00048 * @} 00049 */ 00050 #endif /*USE_FULL_LL_DRIVER*/ 00051 00052 /* Exported types ------------------------------------------------------------*/ 00053 #if defined(USE_FULL_LL_DRIVER) 00054 /** @defgroup SWPMI_LL_ES_INIT SWPMI Exported Init structure 00055 * @{ 00056 */ 00057 00058 /** 00059 * @brief SWPMI Init structures definition 00060 */ 00061 typedef struct 00062 { 00063 uint32_t VoltageClass; /*!< Specifies the SWP Voltage Class. 00064 This parameter can be a value of @ref SWPMI_LL_EC_VOLTAGE_CLASS 00065 00066 This feature can be modified afterwards using unitary function @ref LL_SWPMI_SetVoltageClass. */ 00067 00068 uint32_t BitRatePrescaler; /*!< Specifies the SWPMI bitrate prescaler. 00069 This parameter must be a number between Min_Data=0 and Max_Data=255U. 00070 00071 The value can be calculated thanks to helper macro @ref __LL_SWPMI_CALC_BITRATE_PRESCALER 00072 00073 This feature can be modified afterwards using unitary function @ref LL_SWPMI_SetBitRatePrescaler. */ 00074 00075 uint32_t TxBufferingMode; /*!< Specifies the transmission buffering mode. 00076 This parameter can be a value of @ref SWPMI_LL_EC_SW_BUFFER_TX 00077 00078 This feature can be modified afterwards using unitary function @ref LL_SWPMI_SetTransmissionMode. */ 00079 00080 uint32_t RxBufferingMode; /*!< Specifies the reception buffering mode. 00081 This parameter can be a value of @ref SWPMI_LL_EC_SW_BUFFER_RX 00082 00083 This feature can be modified afterwards using unitary function @ref LL_SWPMI_SetReceptionMode. */ 00084 } LL_SWPMI_InitTypeDef; 00085 00086 /** 00087 * @} 00088 */ 00089 #endif /* USE_FULL_LL_DRIVER */ 00090 00091 /* Exported constants --------------------------------------------------------*/ 00092 /** @defgroup SWPMI_LL_Exported_Constants SWPMI Exported Constants 00093 * @{ 00094 */ 00095 00096 /** @defgroup SWPMI_LL_EC_CLEAR_FLAG Clear Flags Defines 00097 * @brief Flags defines which can be used with LL_SWPMI_WriteReg function 00098 * @{ 00099 */ 00100 #define LL_SWPMI_ICR_CRXBFF SWPMI_ICR_CRXBFF /*!< Clear receive buffer full flag */ 00101 #define LL_SWPMI_ICR_CTXBEF SWPMI_ICR_CTXBEF /*!< Clear transmit buffer empty flag */ 00102 #define LL_SWPMI_ICR_CRXBERF SWPMI_ICR_CRXBERF /*!< Clear receive CRC error flag */ 00103 #define LL_SWPMI_ICR_CRXOVRF SWPMI_ICR_CRXOVRF /*!< Clear receive overrun error flag */ 00104 #define LL_SWPMI_ICR_CTXUNRF SWPMI_ICR_CTXUNRF /*!< Clear transmit underrun error flag */ 00105 #define LL_SWPMI_ICR_CTCF SWPMI_ICR_CTCF /*!< Clear transfer complete flag */ 00106 #define LL_SWPMI_ICR_CSRF SWPMI_ICR_CSRF /*!< Clear slave resume flag */ 00107 /** 00108 * @} 00109 */ 00110 00111 /** @defgroup SWPMI_LL_EC_GET_FLAG Get Flags Defines 00112 * @brief Flags defines which can be used with LL_SWPMI_ReadReg function 00113 * @{ 00114 */ 00115 #define LL_SWPMI_ISR_RXBFF SWPMI_ISR_RXBFF /*!< Receive buffer full flag */ 00116 #define LL_SWPMI_ISR_TXBEF SWPMI_ISR_TXBEF /*!< Transmit buffer empty flag */ 00117 #define LL_SWPMI_ISR_RXBERF SWPMI_ISR_RXBERF /*!< Receive CRC error flag */ 00118 #define LL_SWPMI_ISR_RXOVRF SWPMI_ISR_RXOVRF /*!< Receive overrun error flag */ 00119 #define LL_SWPMI_ISR_TXUNRF SWPMI_ISR_TXUNRF /*!< Transmit underrun error flag */ 00120 #define LL_SWPMI_ISR_RXNE SWPMI_ISR_RXNE /*!< Receive data register not empty */ 00121 #define LL_SWPMI_ISR_TXE SWPMI_ISR_TXE /*!< Transmit data register empty */ 00122 #define LL_SWPMI_ISR_TCF SWPMI_ISR_TCF /*!< Transfer complete flag */ 00123 #define LL_SWPMI_ISR_SRF SWPMI_ISR_SRF /*!< Slave resume flag */ 00124 #define LL_SWPMI_ISR_SUSP SWPMI_ISR_SUSP /*!< SUSPEND flag */ 00125 #define LL_SWPMI_ISR_DEACTF SWPMI_ISR_DEACTF /*!< DEACTIVATED flag */ 00126 /** 00127 * @} 00128 */ 00129 00130 /** @defgroup SWPMI_LL_EC_IT IT Defines 00131 * @brief IT defines which can be used with LL_SWPMI_ReadReg and LL_SWPMI_WriteReg functions 00132 * @{ 00133 */ 00134 #define LL_SWPMI_IER_SRIE SWPMI_IER_SRIE /*!< Slave resume interrupt enable */ 00135 #define LL_SWPMI_IER_TCIE SWPMI_IER_TCIE /*!< Transmit complete interrupt enable */ 00136 #define LL_SWPMI_IER_TIE SWPMI_IER_TIE /*!< Transmit interrupt enable */ 00137 #define LL_SWPMI_IER_RIE SWPMI_IER_RIE /*!< Receive interrupt enable */ 00138 #define LL_SWPMI_IER_TXUNRIE SWPMI_IER_TXUNRIE /*!< Transmit underrun error interrupt enable */ 00139 #define LL_SWPMI_IER_RXOVRIE SWPMI_IER_RXOVRIE /*!< Receive overrun error interrupt enable */ 00140 #define LL_SWPMI_IER_RXBERIE SWPMI_IER_RXBERIE /*!< Receive CRC error interrupt enable */ 00141 #define LL_SWPMI_IER_TXBEIE SWPMI_IER_TXBEIE /*!< Transmit buffer empty interrupt enable */ 00142 #define LL_SWPMI_IER_RXBFIE SWPMI_IER_RXBFIE /*!< Receive buffer full interrupt enable */ 00143 /** 00144 * @} 00145 */ 00146 00147 /** @defgroup SWPMI_LL_EC_SW_BUFFER_RX SW BUFFER RX 00148 * @{ 00149 */ 00150 #define LL_SWPMI_SW_BUFFER_RX_SINGLE ((uint32_t)0x00000000) /*!< Single software buffer mode for reception */ 00151 #define LL_SWPMI_SW_BUFFER_RX_MULTI SWPMI_CR_RXMODE /*!< Multi software buffermode for reception */ 00152 /** 00153 * @} 00154 */ 00155 00156 /** @defgroup SWPMI_LL_EC_SW_BUFFER_TX SW BUFFER TX 00157 * @{ 00158 */ 00159 #define LL_SWPMI_SW_BUFFER_TX_SINGLE ((uint32_t)0x00000000) /*!< Single software buffer mode for transmission */ 00160 #define LL_SWPMI_SW_BUFFER_TX_MULTI SWPMI_CR_TXMODE /*!< Multi software buffermode for transmission */ 00161 /** 00162 * @} 00163 */ 00164 00165 /** @defgroup SWPMI_LL_EC_VOLTAGE_CLASS VOLTAGE CLASS 00166 * @{ 00167 */ 00168 #define LL_SWPMI_VOLTAGE_CLASS_C ((uint32_t)0x00000000) /*!< SWPMI_IO uses directly VDD voltage to operate in class C */ 00169 #define LL_SWPMI_VOLTAGE_CLASS_B SWPMI_OR_CLASS /*!< SWPMI_IO uses an internal voltage regulator to operate in class B */ 00170 /** 00171 * @} 00172 */ 00173 00174 /** @defgroup SWPMI_LL_EC_DMA_REG_DATA DMA register data 00175 * @{ 00176 */ 00177 #define LL_SWPMI_DMA_REG_DATA_TRANSMIT (uint32_t)0 /*!< Get address of data register used for transmission */ 00178 #define LL_SWPMI_DMA_REG_DATA_RECEIVE (uint32_t)1 /*!< Get address of data register used for reception */ 00179 /** 00180 * @} 00181 */ 00182 00183 /** 00184 * @} 00185 */ 00186 00187 /* Exported macro ------------------------------------------------------------*/ 00188 /** @defgroup SWPMI_LL_Exported_Macros SWPMI Exported Macros 00189 * @{ 00190 */ 00191 00192 /** @defgroup SWPMI_LL_EM_WRITE_READ Common Write and read registers Macros 00193 * @{ 00194 */ 00195 00196 /** 00197 * @brief Write a value in SWPMI register 00198 * @param __INSTANCE__ SWPMI Instance 00199 * @param __REG__ Register to be written 00200 * @param __VALUE__ Value to be written in the register 00201 * @retval None 00202 */ 00203 #define LL_SWPMI_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__)) 00204 00205 /** 00206 * @brief Read a value in SWPMI register 00207 * @param __INSTANCE__ SWPMI Instance 00208 * @param __REG__ Register to be read 00209 * @retval Register value 00210 */ 00211 #define LL_SWPMI_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__) 00212 /** 00213 * @} 00214 */ 00215 00216 /** @defgroup SWPMI_LL_EM_BitRate Bit rate calculation helper Macros 00217 * @{ 00218 */ 00219 00220 /** 00221 * @brief Helper macro to calculate bit rate value to set in BRR register (@ref LL_SWPMI_SetBitRatePrescaler function) 00222 * @note ex: @ref __LL_SWPMI_CALC_BITRATE_PRESCALER(2000000, 80000000); 00223 * @param __FSWP__ Within the following range: from 100 Kbit/s up to 2Mbit/s (in bit/s) 00224 * @param __FSWPCLK__ PCLK or HSI frequency (in Hz) 00225 * @retval Bitrate prescaler (BRR register) 00226 */ 00227 #define __LL_SWPMI_CALC_BITRATE_PRESCALER(__FSWP__, __FSWPCLK__) ((uint32_t)(((__FSWPCLK__) / ((__FSWP__) * 4)) - 1)) 00228 00229 /** 00230 * @} 00231 */ 00232 00233 /** 00234 * @} 00235 */ 00236 00237 /* Exported functions --------------------------------------------------------*/ 00238 /** @defgroup SWPMI_LL_Exported_Functions SWPMI Exported Functions 00239 * @{ 00240 */ 00241 00242 /** @defgroup SWPMI_LL_EF_Configuration Configuration 00243 * @{ 00244 */ 00245 00246 /** 00247 * @brief Set Reception buffering mode 00248 * @note If Multi software buffer mode is chosen, RXDMA bits must also be set. 00249 * @rmtoll CR RXMODE LL_SWPMI_SetReceptionMode 00250 * @param SWPMIx SWPMI Instance 00251 * @param RxBufferingMode This parameter can be one of the following values: 00252 * @arg @ref LL_SWPMI_SW_BUFFER_RX_SINGLE 00253 * @arg @ref LL_SWPMI_SW_BUFFER_RX_MULTI 00254 * @retval None 00255 */ 00256 __STATIC_INLINE void LL_SWPMI_SetReceptionMode(SWPMI_TypeDef *SWPMIx, uint32_t RxBufferingMode) 00257 { 00258 MODIFY_REG(SWPMIx->CR, SWPMI_CR_RXMODE, RxBufferingMode); 00259 } 00260 00261 /** 00262 * @brief Get Reception buffering mode 00263 * @rmtoll CR RXMODE LL_SWPMI_GetReceptionMode 00264 * @param SWPMIx SWPMI Instance 00265 * @retval Returned value can be one of the following values: 00266 * @arg @ref LL_SWPMI_SW_BUFFER_RX_SINGLE 00267 * @arg @ref LL_SWPMI_SW_BUFFER_RX_MULTI 00268 */ 00269 __STATIC_INLINE uint32_t LL_SWPMI_GetReceptionMode(SWPMI_TypeDef *SWPMIx) 00270 { 00271 return (uint32_t)(READ_BIT(SWPMIx->CR, SWPMI_CR_RXMODE)); 00272 } 00273 00274 /** 00275 * @brief Set Transmission buffering mode 00276 * @note If Multi software buffer mode is chosen, TXDMA bits must also be set. 00277 * @rmtoll CR TXMODE LL_SWPMI_SetTransmissionMode 00278 * @param SWPMIx SWPMI Instance 00279 * @param TxBufferingMode This parameter can be one of the following values: 00280 * @arg @ref LL_SWPMI_SW_BUFFER_TX_SINGLE 00281 * @arg @ref LL_SWPMI_SW_BUFFER_TX_MULTI 00282 * @retval None 00283 */ 00284 __STATIC_INLINE void LL_SWPMI_SetTransmissionMode(SWPMI_TypeDef *SWPMIx, uint32_t TxBufferingMode) 00285 { 00286 MODIFY_REG(SWPMIx->CR, SWPMI_CR_TXMODE, TxBufferingMode); 00287 } 00288 00289 /** 00290 * @brief Get Transmission buffering mode 00291 * @rmtoll CR TXMODE LL_SWPMI_GetTransmissionMode 00292 * @param SWPMIx SWPMI Instance 00293 * @retval Returned value can be one of the following values: 00294 * @arg @ref LL_SWPMI_SW_BUFFER_TX_SINGLE 00295 * @arg @ref LL_SWPMI_SW_BUFFER_TX_MULTI 00296 */ 00297 __STATIC_INLINE uint32_t LL_SWPMI_GetTransmissionMode(SWPMI_TypeDef *SWPMIx) 00298 { 00299 return (uint32_t)(READ_BIT(SWPMIx->CR, SWPMI_CR_TXMODE)); 00300 } 00301 00302 /** 00303 * @brief Enable loopback mode 00304 * @rmtoll CR LPBK LL_SWPMI_EnableLoopback 00305 * @param SWPMIx SWPMI Instance 00306 * @retval None 00307 */ 00308 __STATIC_INLINE void LL_SWPMI_EnableLoopback(SWPMI_TypeDef *SWPMIx) 00309 { 00310 SET_BIT(SWPMIx->CR, SWPMI_CR_LPBK); 00311 } 00312 00313 /** 00314 * @brief Disable loopback mode 00315 * @rmtoll CR LPBK LL_SWPMI_DisableLoopback 00316 * @param SWPMIx SWPMI Instance 00317 * @retval None 00318 */ 00319 __STATIC_INLINE void LL_SWPMI_DisableLoopback(SWPMI_TypeDef *SWPMIx) 00320 { 00321 CLEAR_BIT(SWPMIx->CR, SWPMI_CR_LPBK); 00322 } 00323 00324 /** 00325 * @brief Enable SWPMI transceiver 00326 * @note SWPMI_IO pin is controlled by SWPMI 00327 * @rmtoll CR SWPEN LL_SWPMI_EnableTransceiver 00328 * @param SWPMIx SWPMI Instance 00329 * @retval None 00330 */ 00331 __STATIC_INLINE void LL_SWPMI_EnableTransceiver(SWPMI_TypeDef *SWPMIx) 00332 { 00333 SET_BIT(SWPMIx->CR, SWPMI_CR_SWPEN); 00334 } 00335 00336 /** 00337 * @brief Disable SWPMI transceiver 00338 * @note SWPMI_IO pin is controlled by GPIO controller 00339 * @rmtoll CR SWPEN LL_SWPMI_DisableTransceiver 00340 * @param SWPMIx SWPMI Instance 00341 * @retval None 00342 */ 00343 __STATIC_INLINE void LL_SWPMI_DisableTransceiver(SWPMI_TypeDef *SWPMIx) 00344 { 00345 CLEAR_BIT(SWPMIx->CR, SWPMI_CR_SWPEN); 00346 } 00347 00348 /** 00349 * @brief Check if SWPMI transceiver is enabled 00350 * @rmtoll CR SWPEN LL_SWPMI_IsEnabledTransceiver 00351 * @param SWPMIx SWPMI Instance 00352 * @retval State of bit (1 or 0). 00353 */ 00354 __STATIC_INLINE uint32_t LL_SWPMI_IsEnabledTransceiver(SWPMI_TypeDef *SWPMIx) 00355 { 00356 return ((READ_BIT(SWPMIx->CR, SWPMI_CR_SWPEN) == (SWPMI_CR_SWPEN)) ? 1UL : 0UL); 00357 } 00358 00359 /** 00360 * @brief Activate Single wire protocol bus (SUSPENDED or ACTIVATED state) 00361 * @note SWP bus stays in the ACTIVATED state as long as there is a communication 00362 * with the slave, either in transmission or in reception. The SWP bus switches back 00363 * to the SUSPENDED state as soon as there is no more transmission or reception 00364 * activity, after 7 idle bits. 00365 * @rmtoll CR SWPACT LL_SWPMI_Activate 00366 * @param SWPMIx SWPMI Instance 00367 * @retval None 00368 */ 00369 __STATIC_INLINE void LL_SWPMI_Activate(SWPMI_TypeDef *SWPMIx) 00370 { 00371 /* In order to activate SWP again, the software must clear DEACT bit*/ 00372 CLEAR_BIT(SWPMIx->CR, SWPMI_CR_DEACT); 00373 00374 /* Set SWACT bit */ 00375 SET_BIT(SWPMIx->CR, SWPMI_CR_SWPACT); 00376 } 00377 00378 /** 00379 * @brief Check if Single wire protocol bus is in ACTIVATED state. 00380 * @rmtoll CR SWPACT LL_SWPMI_Activate 00381 * @param SWPMIx SWPMI Instance 00382 * @retval State of bit (1 or 0). 00383 */ 00384 __STATIC_INLINE uint32_t LL_SWPMI_IsActivated(SWPMI_TypeDef *SWPMIx) 00385 { 00386 return ((READ_BIT(SWPMIx->CR, SWPMI_CR_SWPACT) == (SWPMI_CR_SWPACT)) ? 1UL : 0UL); 00387 } 00388 00389 /** 00390 * @brief Deactivate immediately Single wire protocol bus (immediate transition to 00391 * DEACTIVATED state) 00392 * @rmtoll CR SWPACT LL_SWPMI_Deactivate 00393 * @param SWPMIx SWPMI Instance 00394 * @retval None 00395 */ 00396 __STATIC_INLINE void LL_SWPMI_Deactivate(SWPMI_TypeDef *SWPMIx) 00397 { 00398 CLEAR_BIT(SWPMIx->CR, SWPMI_CR_SWPACT); 00399 } 00400 00401 /** 00402 * @brief Request a deactivation of Single wire protocol bus (request to go in DEACTIVATED 00403 * state if no resume from slave) 00404 * @rmtoll CR DEACT LL_SWPMI_RequestDeactivation 00405 * @param SWPMIx SWPMI Instance 00406 * @retval None 00407 */ 00408 __STATIC_INLINE void LL_SWPMI_RequestDeactivation(SWPMI_TypeDef *SWPMIx) 00409 { 00410 SET_BIT(SWPMIx->CR, SWPMI_CR_DEACT); 00411 } 00412 00413 /** 00414 * @brief Set Bitrate prescaler SWPMI_freq = SWPMI_clk / (((BitRate) + 1) * 4) 00415 * @rmtoll BRR BR LL_SWPMI_SetBitRatePrescaler 00416 * @param SWPMIx SWPMI Instance 00417 * @param BitRatePrescaler A number between Min_Data=0 and Max_Data=255U 00418 * @retval None 00419 */ 00420 __STATIC_INLINE void LL_SWPMI_SetBitRatePrescaler(SWPMI_TypeDef *SWPMIx, uint32_t BitRatePrescaler) 00421 { 00422 WRITE_REG(SWPMIx->BRR, BitRatePrescaler); 00423 } 00424 00425 /** 00426 * @brief Get Bitrate prescaler 00427 * @rmtoll BRR BR LL_SWPMI_GetBitRatePrescaler 00428 * @param SWPMIx SWPMI Instance 00429 * @retval A number between Min_Data=0 and Max_Data=255U 00430 */ 00431 __STATIC_INLINE uint32_t LL_SWPMI_GetBitRatePrescaler(SWPMI_TypeDef *SWPMIx) 00432 { 00433 return (uint32_t)(READ_BIT(SWPMIx->BRR, SWPMI_BRR_BR)); 00434 } 00435 00436 /** 00437 * @brief Set SWP Voltage Class 00438 * @rmtoll OR CLASS LL_SWPMI_SetVoltageClass 00439 * @param SWPMIx SWPMI Instance 00440 * @param VoltageClass This parameter can be one of the following values: 00441 * @arg @ref LL_SWPMI_VOLTAGE_CLASS_C 00442 * @arg @ref LL_SWPMI_VOLTAGE_CLASS_B 00443 * @retval None 00444 */ 00445 __STATIC_INLINE void LL_SWPMI_SetVoltageClass(SWPMI_TypeDef *SWPMIx, uint32_t VoltageClass) 00446 { 00447 MODIFY_REG(SWPMIx->OR, SWPMI_OR_CLASS, VoltageClass); 00448 } 00449 00450 /** 00451 * @brief Get SWP Voltage Class 00452 * @rmtoll OR CLASS LL_SWPMI_GetVoltageClass 00453 * @param SWPMIx SWPMI Instance 00454 * @retval Returned value can be one of the following values: 00455 * @arg @ref LL_SWPMI_VOLTAGE_CLASS_C 00456 * @arg @ref LL_SWPMI_VOLTAGE_CLASS_B 00457 */ 00458 __STATIC_INLINE uint32_t LL_SWPMI_GetVoltageClass(SWPMI_TypeDef *SWPMIx) 00459 { 00460 return (uint32_t)(READ_BIT(SWPMIx->OR, SWPMI_OR_CLASS)); 00461 } 00462 00463 /** 00464 * @} 00465 */ 00466 00467 /** @defgroup SWPMI_LL_EF_FLAG_Management FLAG_Management 00468 * @{ 00469 */ 00470 00471 /** 00472 * @brief Check if the last word of the frame under reception has arrived in SWPMI_RDR. 00473 * @rmtoll ISR RXBFF LL_SWPMI_IsActiveFlag_RXBF 00474 * @param SWPMIx SWPMI Instance 00475 * @retval State of bit (1 or 0). 00476 */ 00477 __STATIC_INLINE uint32_t LL_SWPMI_IsActiveFlag_RXBF(SWPMI_TypeDef *SWPMIx) 00478 { 00479 return ((READ_BIT(SWPMIx->ISR, SWPMI_ISR_RXBFF) == (SWPMI_ISR_RXBFF)) ? 1UL : 0UL); 00480 } 00481 00482 /** 00483 * @brief Check if Frame transmission buffer has been emptied 00484 * @rmtoll ISR TXBEF LL_SWPMI_IsActiveFlag_TXBE 00485 * @param SWPMIx SWPMI Instance 00486 * @retval State of bit (1 or 0). 00487 */ 00488 __STATIC_INLINE uint32_t LL_SWPMI_IsActiveFlag_TXBE(SWPMI_TypeDef *SWPMIx) 00489 { 00490 return ((READ_BIT(SWPMIx->ISR, SWPMI_ISR_TXBEF) == (SWPMI_ISR_TXBEF)) ? 1UL : 0UL); 00491 } 00492 00493 /** 00494 * @brief Check if CRC error in reception has been detected 00495 * @rmtoll ISR RXBERF LL_SWPMI_IsActiveFlag_RXBER 00496 * @param SWPMIx SWPMI Instance 00497 * @retval State of bit (1 or 0). 00498 */ 00499 __STATIC_INLINE uint32_t LL_SWPMI_IsActiveFlag_RXBER(SWPMI_TypeDef *SWPMIx) 00500 { 00501 return ((READ_BIT(SWPMIx->ISR, SWPMI_ISR_RXBERF) == (SWPMI_ISR_RXBERF)) ? 1UL : 0UL); 00502 } 00503 00504 /** 00505 * @brief Check if Overrun in reception has been detected 00506 * @rmtoll ISR RXOVRF LL_SWPMI_IsActiveFlag_RXOVR 00507 * @param SWPMIx SWPMI Instance 00508 * @retval State of bit (1 or 0). 00509 */ 00510 __STATIC_INLINE uint32_t LL_SWPMI_IsActiveFlag_RXOVR(SWPMI_TypeDef *SWPMIx) 00511 { 00512 return ((READ_BIT(SWPMIx->ISR, SWPMI_ISR_RXOVRF) == (SWPMI_ISR_RXOVRF)) ? 1UL : 0UL); 00513 } 00514 00515 /** 00516 * @brief Check if underrun error in transmission has been detected 00517 * @rmtoll ISR TXUNRF LL_SWPMI_IsActiveFlag_TXUNR 00518 * @param SWPMIx SWPMI Instance 00519 * @retval State of bit (1 or 0). 00520 */ 00521 __STATIC_INLINE uint32_t LL_SWPMI_IsActiveFlag_TXUNR(SWPMI_TypeDef *SWPMIx) 00522 { 00523 return ((READ_BIT(SWPMIx->ISR, SWPMI_ISR_TXUNRF) == (SWPMI_ISR_TXUNRF)) ? 1UL : 0UL); 00524 } 00525 00526 /** 00527 * @brief Check if Receive data register not empty (it means that Received data is ready 00528 * to be read in the SWPMI_RDR register) 00529 * @rmtoll ISR RXNE LL_SWPMI_IsActiveFlag_RXNE 00530 * @param SWPMIx SWPMI Instance 00531 * @retval State of bit (1 or 0). 00532 */ 00533 __STATIC_INLINE uint32_t LL_SWPMI_IsActiveFlag_RXNE(SWPMI_TypeDef *SWPMIx) 00534 { 00535 return ((READ_BIT(SWPMIx->ISR, SWPMI_ISR_RXNE) == (SWPMI_ISR_RXNE)) ? 1UL : 0UL); 00536 } 00537 00538 /** 00539 * @brief Check if Transmit data register is empty (it means that Data written in transmit 00540 * data register SWPMI_TDR has been transmitted and SWPMI_TDR can be written to again) 00541 * @rmtoll ISR TXE LL_SWPMI_IsActiveFlag_TXE 00542 * @param SWPMIx SWPMI Instance 00543 * @retval State of bit (1 or 0). 00544 */ 00545 __STATIC_INLINE uint32_t LL_SWPMI_IsActiveFlag_TXE(SWPMI_TypeDef *SWPMIx) 00546 { 00547 return ((READ_BIT(SWPMIx->ISR, SWPMI_ISR_TXE) == (SWPMI_ISR_TXE)) ? 1UL : 0UL); 00548 } 00549 00550 /** 00551 * @brief Check if Both transmission and reception are completed and SWP is switched to 00552 * the SUSPENDED state 00553 * @rmtoll ISR TCF LL_SWPMI_IsActiveFlag_TC 00554 * @param SWPMIx SWPMI Instance 00555 * @retval State of bit (1 or 0). 00556 */ 00557 __STATIC_INLINE uint32_t LL_SWPMI_IsActiveFlag_TC(SWPMI_TypeDef *SWPMIx) 00558 { 00559 return ((READ_BIT(SWPMIx->ISR, SWPMI_ISR_TCF) == (SWPMI_ISR_TCF)) ? 1UL : 0UL); 00560 } 00561 00562 /** 00563 * @brief Check if a Resume by slave state has been detected during the SWP bus SUSPENDED 00564 * state 00565 * @rmtoll ISR SRF LL_SWPMI_IsActiveFlag_SR 00566 * @param SWPMIx SWPMI Instance 00567 * @retval State of bit (1 or 0). 00568 */ 00569 __STATIC_INLINE uint32_t LL_SWPMI_IsActiveFlag_SR(SWPMI_TypeDef *SWPMIx) 00570 { 00571 return ((READ_BIT(SWPMIx->ISR, SWPMI_ISR_SRF) == (SWPMI_ISR_SRF)) ? 1UL : 0UL); 00572 } 00573 00574 /** 00575 * @brief Check if SWP bus is in SUSPENDED or DEACTIVATED state 00576 * @rmtoll ISR SUSP LL_SWPMI_IsActiveFlag_SUSP 00577 * @param SWPMIx SWPMI Instance 00578 * @retval State of bit (1 or 0). 00579 */ 00580 __STATIC_INLINE uint32_t LL_SWPMI_IsActiveFlag_SUSP(SWPMI_TypeDef *SWPMIx) 00581 { 00582 return ((READ_BIT(SWPMIx->ISR, SWPMI_ISR_SUSP) == (SWPMI_ISR_SUSP)) ? 1UL : 0UL); 00583 } 00584 00585 /** 00586 * @brief Check if SWP bus is in DEACTIVATED state 00587 * @rmtoll ISR DEACTF LL_SWPMI_IsActiveFlag_DEACT 00588 * @param SWPMIx SWPMI Instance 00589 * @retval State of bit (1 or 0). 00590 */ 00591 __STATIC_INLINE uint32_t LL_SWPMI_IsActiveFlag_DEACT(SWPMI_TypeDef *SWPMIx) 00592 { 00593 return ((READ_BIT(SWPMIx->ISR, SWPMI_ISR_DEACTF) == (SWPMI_ISR_DEACTF)) ? 1UL : 0UL); 00594 } 00595 00596 /** 00597 * @brief Check if SWPMI transceiver is ready 00598 * @rmtoll ISR RDYF LL_SWPMI_IsActiveFlag_RDYF 00599 * @param SWPMIx SWPMI Instance 00600 * @retval State of bit (1 or 0). 00601 */ 00602 __STATIC_INLINE uint32_t LL_SWPMI_IsActiveFlag_RDYF(SWPMI_TypeDef *SWPMIx) 00603 { 00604 return ((READ_BIT(SWPMIx->ISR, SWPMI_ISR_RDYF) == (SWPMI_ISR_RDYF)) ? 1UL : 0UL); 00605 } 00606 00607 /** 00608 * @brief Clear receive buffer full flag 00609 * @rmtoll ICR CRXBFF LL_SWPMI_ClearFlag_RXBF 00610 * @param SWPMIx SWPMI Instance 00611 * @retval None 00612 */ 00613 __STATIC_INLINE void LL_SWPMI_ClearFlag_RXBF(SWPMI_TypeDef *SWPMIx) 00614 { 00615 WRITE_REG(SWPMIx->ICR, SWPMI_ICR_CRXBFF); 00616 } 00617 00618 /** 00619 * @brief Clear transmit buffer empty flag 00620 * @rmtoll ICR CTXBEF LL_SWPMI_ClearFlag_TXBE 00621 * @param SWPMIx SWPMI Instance 00622 * @retval None 00623 */ 00624 __STATIC_INLINE void LL_SWPMI_ClearFlag_TXBE(SWPMI_TypeDef *SWPMIx) 00625 { 00626 WRITE_REG(SWPMIx->ICR, SWPMI_ICR_CTXBEF); 00627 } 00628 00629 /** 00630 * @brief Clear receive CRC error flag 00631 * @rmtoll ICR CRXBERF LL_SWPMI_ClearFlag_RXBER 00632 * @param SWPMIx SWPMI Instance 00633 * @retval None 00634 */ 00635 __STATIC_INLINE void LL_SWPMI_ClearFlag_RXBER(SWPMI_TypeDef *SWPMIx) 00636 { 00637 WRITE_REG(SWPMIx->ICR, SWPMI_ICR_CRXBERF); 00638 } 00639 00640 /** 00641 * @brief Clear receive overrun error flag 00642 * @rmtoll ICR CRXOVRF LL_SWPMI_ClearFlag_RXOVR 00643 * @param SWPMIx SWPMI Instance 00644 * @retval None 00645 */ 00646 __STATIC_INLINE void LL_SWPMI_ClearFlag_RXOVR(SWPMI_TypeDef *SWPMIx) 00647 { 00648 WRITE_REG(SWPMIx->ICR, SWPMI_ICR_CRXOVRF); 00649 } 00650 00651 /** 00652 * @brief Clear transmit underrun error flag 00653 * @rmtoll ICR CTXUNRF LL_SWPMI_ClearFlag_TXUNR 00654 * @param SWPMIx SWPMI Instance 00655 * @retval None 00656 */ 00657 __STATIC_INLINE void LL_SWPMI_ClearFlag_TXUNR(SWPMI_TypeDef *SWPMIx) 00658 { 00659 WRITE_REG(SWPMIx->ICR, SWPMI_ICR_CTXUNRF); 00660 } 00661 00662 /** 00663 * @brief Clear transfer complete flag 00664 * @rmtoll ICR CTCF LL_SWPMI_ClearFlag_TC 00665 * @param SWPMIx SWPMI Instance 00666 * @retval None 00667 */ 00668 __STATIC_INLINE void LL_SWPMI_ClearFlag_TC(SWPMI_TypeDef *SWPMIx) 00669 { 00670 WRITE_REG(SWPMIx->ICR, SWPMI_ICR_CTCF); 00671 } 00672 00673 /** 00674 * @brief Clear slave resume flag 00675 * @rmtoll ICR CSRF LL_SWPMI_ClearFlag_SR 00676 * @param SWPMIx SWPMI Instance 00677 * @retval None 00678 */ 00679 __STATIC_INLINE void LL_SWPMI_ClearFlag_SR(SWPMI_TypeDef *SWPMIx) 00680 { 00681 WRITE_REG(SWPMIx->ICR, SWPMI_ICR_CSRF); 00682 } 00683 00684 /** 00685 * @brief Clear SWPMI transceiver ready flag 00686 * @rmtoll ISR CRDYF LL_SWPMI_ClearFlag_RDY 00687 * @param SWPMIx SWPMI Instance 00688 * @retval None 00689 */ 00690 __STATIC_INLINE void LL_SWPMI_ClearFlag_RDY(SWPMI_TypeDef *SWPMIx) 00691 { 00692 WRITE_REG(SWPMIx->ICR, SWPMI_ICR_CRDYF); 00693 } 00694 00695 /** 00696 * @} 00697 */ 00698 00699 /** @defgroup SWPMI_LL_EF_IT_Management IT_Management 00700 * @{ 00701 */ 00702 00703 /** 00704 * @brief Enable SWPMI transceiver ready interrupt 00705 * @rmtoll IER RDYIE LL_SWPMI_EnableIT_RDY 00706 * @param SWPMIx SWPMI Instance 00707 * @retval None 00708 */ 00709 __STATIC_INLINE void LL_SWPMI_EnableIT_RDY(SWPMI_TypeDef *SWPMIx) 00710 { 00711 SET_BIT(SWPMIx->IER, SWPMI_IER_RDYIE); 00712 } 00713 00714 /** 00715 * @brief Enable Slave resume interrupt 00716 * @rmtoll IER SRIE LL_SWPMI_EnableIT_SR 00717 * @param SWPMIx SWPMI Instance 00718 * @retval None 00719 */ 00720 __STATIC_INLINE void LL_SWPMI_EnableIT_SR(SWPMI_TypeDef *SWPMIx) 00721 { 00722 SET_BIT(SWPMIx->IER, SWPMI_IER_SRIE); 00723 } 00724 00725 /** 00726 * @brief Enable Transmit complete interrupt 00727 * @rmtoll IER TCIE LL_SWPMI_EnableIT_TC 00728 * @param SWPMIx SWPMI Instance 00729 * @retval None 00730 */ 00731 __STATIC_INLINE void LL_SWPMI_EnableIT_TC(SWPMI_TypeDef *SWPMIx) 00732 { 00733 SET_BIT(SWPMIx->IER, SWPMI_IER_TCIE); 00734 } 00735 00736 /** 00737 * @brief Enable Transmit interrupt 00738 * @rmtoll IER TIE LL_SWPMI_EnableIT_TX 00739 * @param SWPMIx SWPMI Instance 00740 * @retval None 00741 */ 00742 __STATIC_INLINE void LL_SWPMI_EnableIT_TX(SWPMI_TypeDef *SWPMIx) 00743 { 00744 SET_BIT(SWPMIx->IER, SWPMI_IER_TIE); 00745 } 00746 00747 /** 00748 * @brief Enable Receive interrupt 00749 * @rmtoll IER RIE LL_SWPMI_EnableIT_RX 00750 * @param SWPMIx SWPMI Instance 00751 * @retval None 00752 */ 00753 __STATIC_INLINE void LL_SWPMI_EnableIT_RX(SWPMI_TypeDef *SWPMIx) 00754 { 00755 SET_BIT(SWPMIx->IER, SWPMI_IER_RIE); 00756 } 00757 00758 /** 00759 * @brief Enable Transmit underrun error interrupt 00760 * @rmtoll IER TXUNRIE LL_SWPMI_EnableIT_TXUNR 00761 * @param SWPMIx SWPMI Instance 00762 * @retval None 00763 */ 00764 __STATIC_INLINE void LL_SWPMI_EnableIT_TXUNR(SWPMI_TypeDef *SWPMIx) 00765 { 00766 SET_BIT(SWPMIx->IER, SWPMI_IER_TXUNRIE); 00767 } 00768 00769 /** 00770 * @brief Enable Receive overrun error interrupt 00771 * @rmtoll IER RXOVRIE LL_SWPMI_EnableIT_RXOVR 00772 * @param SWPMIx SWPMI Instance 00773 * @retval None 00774 */ 00775 __STATIC_INLINE void LL_SWPMI_EnableIT_RXOVR(SWPMI_TypeDef *SWPMIx) 00776 { 00777 SET_BIT(SWPMIx->IER, SWPMI_IER_RXOVRIE); 00778 } 00779 00780 /** 00781 * @brief Enable Receive CRC error interrupt 00782 * @rmtoll IER RXBERIE LL_SWPMI_EnableIT_RXBER 00783 * @param SWPMIx SWPMI Instance 00784 * @retval None 00785 */ 00786 __STATIC_INLINE void LL_SWPMI_EnableIT_RXBER(SWPMI_TypeDef *SWPMIx) 00787 { 00788 SET_BIT(SWPMIx->IER, SWPMI_IER_RXBERIE); 00789 } 00790 00791 /** 00792 * @brief Enable Transmit buffer empty interrupt 00793 * @rmtoll IER TXBEIE LL_SWPMI_EnableIT_TXBE 00794 * @param SWPMIx SWPMI Instance 00795 * @retval None 00796 */ 00797 __STATIC_INLINE void LL_SWPMI_EnableIT_TXBE(SWPMI_TypeDef *SWPMIx) 00798 { 00799 SET_BIT(SWPMIx->IER, SWPMI_IER_TXBEIE); 00800 } 00801 00802 /** 00803 * @brief Enable Receive buffer full interrupt 00804 * @rmtoll IER RXBFIE LL_SWPMI_EnableIT_RXBF 00805 * @param SWPMIx SWPMI Instance 00806 * @retval None 00807 */ 00808 __STATIC_INLINE void LL_SWPMI_EnableIT_RXBF(SWPMI_TypeDef *SWPMIx) 00809 { 00810 SET_BIT(SWPMIx->IER, SWPMI_IER_RXBFIE); 00811 } 00812 00813 /** 00814 * @brief Disable SWPMI transceiver ready interrupt 00815 * @rmtoll IER RDYIE LL_SWPMI_DisableIT_RDY 00816 * @param SWPMIx SWPMI Instance 00817 * @retval None 00818 */ 00819 __STATIC_INLINE void LL_SWPMI_DisableIT_RDY(SWPMI_TypeDef *SWPMIx) 00820 { 00821 CLEAR_BIT(SWPMIx->IER, SWPMI_IER_RDYIE); 00822 } 00823 00824 /** 00825 * @brief Disable Slave resume interrupt 00826 * @rmtoll IER SRIE LL_SWPMI_DisableIT_SR 00827 * @param SWPMIx SWPMI Instance 00828 * @retval None 00829 */ 00830 __STATIC_INLINE void LL_SWPMI_DisableIT_SR(SWPMI_TypeDef *SWPMIx) 00831 { 00832 CLEAR_BIT(SWPMIx->IER, SWPMI_IER_SRIE); 00833 } 00834 00835 /** 00836 * @brief Disable Transmit complete interrupt 00837 * @rmtoll IER TCIE LL_SWPMI_DisableIT_TC 00838 * @param SWPMIx SWPMI Instance 00839 * @retval None 00840 */ 00841 __STATIC_INLINE void LL_SWPMI_DisableIT_TC(SWPMI_TypeDef *SWPMIx) 00842 { 00843 CLEAR_BIT(SWPMIx->IER, SWPMI_IER_TCIE); 00844 } 00845 00846 /** 00847 * @brief Disable Transmit interrupt 00848 * @rmtoll IER TIE LL_SWPMI_DisableIT_TX 00849 * @param SWPMIx SWPMI Instance 00850 * @retval None 00851 */ 00852 __STATIC_INLINE void LL_SWPMI_DisableIT_TX(SWPMI_TypeDef *SWPMIx) 00853 { 00854 CLEAR_BIT(SWPMIx->IER, SWPMI_IER_TIE); 00855 } 00856 00857 /** 00858 * @brief Disable Receive interrupt 00859 * @rmtoll IER RIE LL_SWPMI_DisableIT_RX 00860 * @param SWPMIx SWPMI Instance 00861 * @retval None 00862 */ 00863 __STATIC_INLINE void LL_SWPMI_DisableIT_RX(SWPMI_TypeDef *SWPMIx) 00864 { 00865 CLEAR_BIT(SWPMIx->IER, SWPMI_IER_RIE); 00866 } 00867 00868 /** 00869 * @brief Disable Transmit underrun error interrupt 00870 * @rmtoll IER TXUNRIE LL_SWPMI_DisableIT_TXUNR 00871 * @param SWPMIx SWPMI Instance 00872 * @retval None 00873 */ 00874 __STATIC_INLINE void LL_SWPMI_DisableIT_TXUNR(SWPMI_TypeDef *SWPMIx) 00875 { 00876 CLEAR_BIT(SWPMIx->IER, SWPMI_IER_TXUNRIE); 00877 } 00878 00879 /** 00880 * @brief Disable Receive overrun error interrupt 00881 * @rmtoll IER RXOVRIE LL_SWPMI_DisableIT_RXOVR 00882 * @param SWPMIx SWPMI Instance 00883 * @retval None 00884 */ 00885 __STATIC_INLINE void LL_SWPMI_DisableIT_RXOVR(SWPMI_TypeDef *SWPMIx) 00886 { 00887 CLEAR_BIT(SWPMIx->IER, SWPMI_IER_RXOVRIE); 00888 } 00889 00890 /** 00891 * @brief Disable Receive CRC error interrupt 00892 * @rmtoll IER RXBERIE LL_SWPMI_DisableIT_RXBER 00893 * @param SWPMIx SWPMI Instance 00894 * @retval None 00895 */ 00896 __STATIC_INLINE void LL_SWPMI_DisableIT_RXBER(SWPMI_TypeDef *SWPMIx) 00897 { 00898 CLEAR_BIT(SWPMIx->IER, SWPMI_IER_RXBERIE); 00899 } 00900 00901 /** 00902 * @brief Disable Transmit buffer empty interrupt 00903 * @rmtoll IER TXBEIE LL_SWPMI_DisableIT_TXBE 00904 * @param SWPMIx SWPMI Instance 00905 * @retval None 00906 */ 00907 __STATIC_INLINE void LL_SWPMI_DisableIT_TXBE(SWPMI_TypeDef *SWPMIx) 00908 { 00909 CLEAR_BIT(SWPMIx->IER, SWPMI_IER_TXBEIE); 00910 } 00911 00912 /** 00913 * @brief Disable Receive buffer full interrupt 00914 * @rmtoll IER RXBFIE LL_SWPMI_DisableIT_RXBF 00915 * @param SWPMIx SWPMI Instance 00916 * @retval None 00917 */ 00918 __STATIC_INLINE void LL_SWPMI_DisableIT_RXBF(SWPMI_TypeDef *SWPMIx) 00919 { 00920 CLEAR_BIT(SWPMIx->IER, SWPMI_IER_RXBFIE); 00921 } 00922 00923 /** 00924 * @brief Check if SWPMI transceiver ready interrupt is enabled 00925 * @rmtoll IER RDYIE LL_SWPMI_IsEnabledIT_RDY 00926 * @param SWPMIx SWPMI Instance 00927 * @retval State of bit (1 or 0). 00928 */ 00929 __STATIC_INLINE uint32_t LL_SWPMI_IsEnabledIT_RDY(SWPMI_TypeDef *SWPMIx) 00930 { 00931 return ((READ_BIT(SWPMIx->IER, SWPMI_IER_RDYIE) == (SWPMI_IER_RDYIE)) ? 1UL : 0UL); 00932 } 00933 00934 /** 00935 * @brief Check if Slave resume interrupt is enabled 00936 * @rmtoll IER SRIE LL_SWPMI_IsEnabledIT_SR 00937 * @param SWPMIx SWPMI Instance 00938 * @retval State of bit (1 or 0). 00939 */ 00940 __STATIC_INLINE uint32_t LL_SWPMI_IsEnabledIT_SR(SWPMI_TypeDef *SWPMIx) 00941 { 00942 return ((READ_BIT(SWPMIx->IER, SWPMI_IER_SRIE) == (SWPMI_IER_SRIE)) ? 1UL : 0UL); 00943 } 00944 00945 /** 00946 * @brief Check if Transmit complete interrupt is enabled 00947 * @rmtoll IER TCIE LL_SWPMI_IsEnabledIT_TC 00948 * @param SWPMIx SWPMI Instance 00949 * @retval State of bit (1 or 0). 00950 */ 00951 __STATIC_INLINE uint32_t LL_SWPMI_IsEnabledIT_TC(SWPMI_TypeDef *SWPMIx) 00952 { 00953 return ((READ_BIT(SWPMIx->IER, SWPMI_IER_TCIE) == (SWPMI_IER_TCIE)) ? 1UL : 0UL); 00954 } 00955 00956 /** 00957 * @brief Check if Transmit interrupt is enabled 00958 * @rmtoll IER TIE LL_SWPMI_IsEnabledIT_TX 00959 * @param SWPMIx SWPMI Instance 00960 * @retval State of bit (1 or 0). 00961 */ 00962 __STATIC_INLINE uint32_t LL_SWPMI_IsEnabledIT_TX(SWPMI_TypeDef *SWPMIx) 00963 { 00964 return ((READ_BIT(SWPMIx->IER, SWPMI_IER_TIE) == (SWPMI_IER_TIE)) ? 1UL : 0UL); 00965 } 00966 00967 /** 00968 * @brief Check if Receive interrupt is enabled 00969 * @rmtoll IER RIE LL_SWPMI_IsEnabledIT_RX 00970 * @param SWPMIx SWPMI Instance 00971 * @retval State of bit (1 or 0). 00972 */ 00973 __STATIC_INLINE uint32_t LL_SWPMI_IsEnabledIT_RX(SWPMI_TypeDef *SWPMIx) 00974 { 00975 return ((READ_BIT(SWPMIx->IER, SWPMI_IER_RIE) == (SWPMI_IER_RIE)) ? 1UL : 0UL); 00976 } 00977 00978 /** 00979 * @brief Check if Transmit underrun error interrupt is enabled 00980 * @rmtoll IER TXUNRIE LL_SWPMI_IsEnabledIT_TXUNR 00981 * @param SWPMIx SWPMI Instance 00982 * @retval State of bit (1 or 0). 00983 */ 00984 __STATIC_INLINE uint32_t LL_SWPMI_IsEnabledIT_TXUNR(SWPMI_TypeDef *SWPMIx) 00985 { 00986 return ((READ_BIT(SWPMIx->IER, SWPMI_IER_TXUNRIE) == (SWPMI_IER_TXUNRIE)) ? 1UL : 0UL); 00987 } 00988 00989 /** 00990 * @brief Check if Receive overrun error interrupt is enabled 00991 * @rmtoll IER RXOVRIE LL_SWPMI_IsEnabledIT_RXOVR 00992 * @param SWPMIx SWPMI Instance 00993 * @retval State of bit (1 or 0). 00994 */ 00995 __STATIC_INLINE uint32_t LL_SWPMI_IsEnabledIT_RXOVR(SWPMI_TypeDef *SWPMIx) 00996 { 00997 return ((READ_BIT(SWPMIx->IER, SWPMI_IER_RXOVRIE) == (SWPMI_IER_RXOVRIE)) ? 1UL : 0UL); 00998 } 00999 01000 /** 01001 * @brief Check if Receive CRC error interrupt is enabled 01002 * @rmtoll IER RXBERIE LL_SWPMI_IsEnabledIT_RXBER 01003 * @param SWPMIx SWPMI Instance 01004 * @retval State of bit (1 or 0). 01005 */ 01006 __STATIC_INLINE uint32_t LL_SWPMI_IsEnabledIT_RXBER(SWPMI_TypeDef *SWPMIx) 01007 { 01008 return ((READ_BIT(SWPMIx->IER, SWPMI_IER_RXBERIE) == (SWPMI_IER_RXBERIE)) ? 1UL : 0UL); 01009 } 01010 01011 /** 01012 * @brief Check if Transmit buffer empty interrupt is enabled 01013 * @rmtoll IER TXBEIE LL_SWPMI_IsEnabledIT_TXBE 01014 * @param SWPMIx SWPMI Instance 01015 * @retval State of bit (1 or 0). 01016 */ 01017 __STATIC_INLINE uint32_t LL_SWPMI_IsEnabledIT_TXBE(SWPMI_TypeDef *SWPMIx) 01018 { 01019 return ((READ_BIT(SWPMIx->IER, SWPMI_IER_TXBEIE) == (SWPMI_IER_TXBEIE)) ? 1UL : 0UL); 01020 } 01021 01022 /** 01023 * @brief Check if Receive buffer full interrupt is enabled 01024 * @rmtoll IER RXBFIE LL_SWPMI_IsEnabledIT_RXBF 01025 * @param SWPMIx SWPMI Instance 01026 * @retval State of bit (1 or 0). 01027 */ 01028 __STATIC_INLINE uint32_t LL_SWPMI_IsEnabledIT_RXBF(SWPMI_TypeDef *SWPMIx) 01029 { 01030 return ((READ_BIT(SWPMIx->IER, SWPMI_IER_RXBFIE) == (SWPMI_IER_RXBFIE)) ? 1UL : 0UL); 01031 } 01032 01033 /** 01034 * @} 01035 */ 01036 01037 /** @defgroup SWPMI_LL_EF_DMA_Management DMA_Management 01038 * @{ 01039 */ 01040 01041 /** 01042 * @brief Enable DMA mode for reception 01043 * @rmtoll CR RXDMA LL_SWPMI_EnableDMAReq_RX 01044 * @param SWPMIx SWPMI Instance 01045 * @retval None 01046 */ 01047 __STATIC_INLINE void LL_SWPMI_EnableDMAReq_RX(SWPMI_TypeDef *SWPMIx) 01048 { 01049 SET_BIT(SWPMIx->CR, SWPMI_CR_RXDMA); 01050 } 01051 01052 /** 01053 * @brief Disable DMA mode for reception 01054 * @rmtoll CR RXDMA LL_SWPMI_DisableDMAReq_RX 01055 * @param SWPMIx SWPMI Instance 01056 * @retval None 01057 */ 01058 __STATIC_INLINE void LL_SWPMI_DisableDMAReq_RX(SWPMI_TypeDef *SWPMIx) 01059 { 01060 CLEAR_BIT(SWPMIx->CR, SWPMI_CR_RXDMA); 01061 } 01062 01063 /** 01064 * @brief Check if DMA mode for reception is enabled 01065 * @rmtoll CR RXDMA LL_SWPMI_IsEnabledDMAReq_RX 01066 * @param SWPMIx SWPMI Instance 01067 * @retval State of bit (1 or 0). 01068 */ 01069 __STATIC_INLINE uint32_t LL_SWPMI_IsEnabledDMAReq_RX(SWPMI_TypeDef *SWPMIx) 01070 { 01071 return ((READ_BIT(SWPMIx->CR, SWPMI_CR_RXDMA) == (SWPMI_CR_RXDMA)) ? 1UL : 0UL); 01072 } 01073 01074 /** 01075 * @brief Enable DMA mode for transmission 01076 * @rmtoll CR TXDMA LL_SWPMI_EnableDMAReq_TX 01077 * @param SWPMIx SWPMI Instance 01078 * @retval None 01079 */ 01080 __STATIC_INLINE void LL_SWPMI_EnableDMAReq_TX(SWPMI_TypeDef *SWPMIx) 01081 { 01082 SET_BIT(SWPMIx->CR, SWPMI_CR_TXDMA); 01083 } 01084 01085 /** 01086 * @brief Disable DMA mode for transmission 01087 * @rmtoll CR TXDMA LL_SWPMI_DisableDMAReq_TX 01088 * @param SWPMIx SWPMI Instance 01089 * @retval None 01090 */ 01091 __STATIC_INLINE void LL_SWPMI_DisableDMAReq_TX(SWPMI_TypeDef *SWPMIx) 01092 { 01093 CLEAR_BIT(SWPMIx->CR, SWPMI_CR_TXDMA); 01094 } 01095 01096 /** 01097 * @brief Check if DMA mode for transmission is enabled 01098 * @rmtoll CR TXDMA LL_SWPMI_IsEnabledDMAReq_TX 01099 * @param SWPMIx SWPMI Instance 01100 * @retval State of bit (1 or 0). 01101 */ 01102 __STATIC_INLINE uint32_t LL_SWPMI_IsEnabledDMAReq_TX(SWPMI_TypeDef *SWPMIx) 01103 { 01104 return ((READ_BIT(SWPMIx->CR, SWPMI_CR_TXDMA) == (SWPMI_CR_TXDMA)) ? 1UL : 0UL); 01105 } 01106 01107 /** 01108 * @brief Get the data register address used for DMA transfer 01109 * @rmtoll TDR TD LL_SWPMI_DMA_GetRegAddr\n 01110 * RDR RD LL_SWPMI_DMA_GetRegAddr 01111 * @param SWPMIx SWPMI Instance 01112 * @param Direction This parameter can be one of the following values: 01113 * @arg @ref LL_SWPMI_DMA_REG_DATA_TRANSMIT 01114 * @arg @ref LL_SWPMI_DMA_REG_DATA_RECEIVE 01115 * @retval Address of data register 01116 */ 01117 __STATIC_INLINE uint32_t LL_SWPMI_DMA_GetRegAddr(SWPMI_TypeDef *SWPMIx, uint32_t Direction) 01118 { 01119 uint32_t data_reg_addr; 01120 01121 if (Direction == LL_SWPMI_DMA_REG_DATA_TRANSMIT) 01122 { 01123 /* return address of TDR register */ 01124 data_reg_addr = (uint32_t)&(SWPMIx->TDR); 01125 } 01126 else 01127 { 01128 /* return address of RDR register */ 01129 data_reg_addr = (uint32_t)&(SWPMIx->RDR); 01130 } 01131 01132 return data_reg_addr; 01133 } 01134 01135 /** 01136 * @} 01137 */ 01138 01139 /** @defgroup SWPMI_LL_EF_Data_Management Data_Management 01140 * @{ 01141 */ 01142 01143 /** 01144 * @brief Retrieve number of data bytes present in payload of received frame 01145 * @rmtoll RFL RFL LL_SWPMI_GetReceiveFrameLength 01146 * @param SWPMIx SWPMI Instance 01147 * @retval Value between Min_Data=0x00 and Max_Data=0x1F 01148 */ 01149 __STATIC_INLINE uint32_t LL_SWPMI_GetReceiveFrameLength(SWPMI_TypeDef *SWPMIx) 01150 { 01151 return (uint32_t)(READ_BIT(SWPMIx->RFL, SWPMI_RFL_RFL)); 01152 } 01153 01154 /** 01155 * @brief Transmit Data Register 01156 * @rmtoll TDR TD LL_SWPMI_TransmitData32 01157 * @param SWPMIx SWPMI Instance 01158 * @param TxData Value between Min_Data=0x00000000 and Max_Data=0xFFFFFFFF 01159 * @retval None 01160 */ 01161 __STATIC_INLINE void LL_SWPMI_TransmitData32(SWPMI_TypeDef *SWPMIx, uint32_t TxData) 01162 { 01163 WRITE_REG(SWPMIx->TDR, TxData); 01164 } 01165 01166 /** 01167 * @brief Receive Data Register 01168 * @rmtoll RDR RD LL_SWPMI_ReceiveData32 01169 * @param SWPMIx SWPMI Instance 01170 * @retval Value between Min_Data=0x00000000 and Max_Data=0xFFFFFFFF 01171 */ 01172 __STATIC_INLINE uint32_t LL_SWPMI_ReceiveData32(SWPMI_TypeDef *SWPMIx) 01173 { 01174 return (uint32_t)(READ_BIT(SWPMIx->RDR, SWPMI_RDR_RD)); 01175 } 01176 01177 /** 01178 * @brief Enable SWP Transceiver Bypass 01179 * @note The external interface for SWPMI is SWPMI_IO 01180 * (SWPMI_RX, SWPMI_TX and SWPMI_SUSPEND signals are not available on GPIOs) 01181 * @rmtoll OR TBYP LL_SWPMI_EnableTXBypass 01182 * @param SWPMIx SWPMI Instance 01183 * @retval None 01184 */ 01185 __STATIC_INLINE void LL_SWPMI_EnableTXBypass(SWPMI_TypeDef *SWPMIx) 01186 { 01187 CLEAR_BIT(SWPMIx->OR, SWPMI_OR_TBYP); 01188 } 01189 01190 /** 01191 * @brief Disable SWP Transceiver Bypass 01192 * @note SWPMI_RX, SWPMI_TX and SWPMI_SUSPEND signals are available as alternate 01193 * function on GPIOs. This configuration is selected to connect an external transceiver 01194 * @note In SWPMI_IO bypass mode, SWPEN bit in SWPMI_CR register must be kept cleared 01195 * @rmtoll OR TBYP LL_SWPMI_DisableTXBypass 01196 * @param SWPMIx SWPMI Instance 01197 * @retval None 01198 */ 01199 __STATIC_INLINE void LL_SWPMI_DisableTXBypass(SWPMI_TypeDef *SWPMIx) 01200 { 01201 SET_BIT(SWPMIx->OR, SWPMI_OR_TBYP); 01202 } 01203 01204 /** 01205 * @} 01206 */ 01207 01208 #if defined(USE_FULL_LL_DRIVER) 01209 /** @defgroup SWPMI_LL_EF_Init Initialization and de-initialization functions 01210 * @{ 01211 */ 01212 01213 ErrorStatus LL_SWPMI_DeInit(SWPMI_TypeDef *SWPMIx); 01214 ErrorStatus LL_SWPMI_Init(SWPMI_TypeDef *SWPMIx, LL_SWPMI_InitTypeDef *SWPMI_InitStruct); 01215 void LL_SWPMI_StructInit(LL_SWPMI_InitTypeDef *SWPMI_InitStruct); 01216 01217 /** 01218 * @} 01219 */ 01220 #endif /*USE_FULL_LL_DRIVER*/ 01221 01222 /** 01223 * @} 01224 */ 01225 01226 /** 01227 * @} 01228 */ 01229 01230 01231 /** 01232 * @} 01233 */ 01234 01235 #ifdef __cplusplus 01236 } 01237 #endif 01238 01239 #endif /* STM32H7xx_LL_SWPMI_H */