Merge pull request #11189 from klutvott123/move-telemetry-displayport-init
[betaflight.git] / lib / main / STM32G4 / Drivers / STM32G4xx_HAL_Driver / Inc / stm32g4xx_ll_ucpd.h
blob7c5eecc1b263f9d710ba19c4eebbc90574484438
1 /**
2 ******************************************************************************
3 * @file stm32g4xx_ll_ucpd.h
4 * @author MCD Application Team
5 * @brief Header file of UCPD LL module.
6 ******************************************************************************
7 * @attention
9 * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
10 * All rights reserved.</center></h2>
12 * This software component is licensed by ST under BSD 3-Clause license,
13 * the "License"; You may not use this file except in compliance with the
14 * License. You may obtain a copy of the License at:
15 * opensource.org/licenses/BSD-3-Clause
17 ******************************************************************************
20 /* Define to prevent recursive inclusion -------------------------------------*/
21 #ifndef STM32G4xx_LL_UCPD_H
22 #define STM32G4xx_LL_UCPD_H
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32g4xx.h"
31 /** @addtogroup STM32G4xx_LL_Driver
32 * @{
35 #if defined (UCPD1)
37 /** @defgroup UCPD_LL UCPD
38 * @{
41 /* Private types -------------------------------------------------------------*/
42 /* Private variables ---------------------------------------------------------*/
43 /* Private macros ------------------------------------------------------------*/
45 /* Exported types ------------------------------------------------------------*/
46 #if defined(USE_FULL_LL_DRIVER)
47 /** @defgroup UCPD_LL_ES_INIT UCPD Exported Init structure
48 * @{
51 /**
52 * @brief UCPD Init structures definition
54 typedef struct
56 uint32_t psc_ucpdclk; /*!< Specifies the prescaler for the ucpd clock.
57 This parameter can be a value of @ref UCPD_LL_EC_PSC.
58 This feature can be modified afterwards using unitary function @ref LL_UCPD_SetPSCClk().*/
60 uint32_t transwin; /*!< Specifies the number of cycles (minus 1) of the half bit clock (see HBITCLKDIV) to achieve a legal
61 tTransitionWindow (set according to peripheral clock to define an interval of between 12 and 20 us).
62 This parameter can be a value between Min_Data=0x1 and Max_Data=0x1F
63 This value can be modified afterwards using unitary function @ref LL_UCPD_SetTransWin().*/
65 uint32_t IfrGap; /*!< Specifies the definition of the clock divider (minus 1) in order to generate tInterframeGap
66 from the peripheral clock.
67 This parameter can be a value between Min_Data=0x1 and Max_Data=0x1F
68 This feature can be modified afterwards using unitary function @ref LL_UCPD_SetIfrGap().*/
70 uint32_t HbitClockDiv; /*!< Specifies the number of cycles (minus one) at UCPD peripheral for a half bit clock e.g. program 3
71 for a bit clock that takes 8 cycles of the peripheral clock "UCPD1_CLK"..
72 This parameter can be a value between Min_Data=0x0 and Max_Data=0x3F.
73 This feature can be modified afterwards using unitary function @ref LL_UCPD_SetHbitClockDiv().*/
75 } LL_UCPD_InitTypeDef;
77 /**
78 * @}
80 #endif /* USE_FULL_LL_DRIVER */
82 /* Exported constants --------------------------------------------------------*/
83 /** @defgroup UCPD_LL_Exported_Constants UCPD Exported Constants
84 * @{
87 /** @defgroup UCPD_LL_EC_GET_FLAG Get Flags Defines
88 * @brief Flags defines which can be used with LL_ucpd_ReadReg function
89 * @{
91 #define LL_UCPD_SR_TXIS UCPD_SR_TXIS /*!< Transmit interrupt status */
92 #define LL_UCPD_SR_TXMSGDISC UCPD_SR_TXMSGDISC /*!< Transmit message discarded interrupt */
93 #define LL_UCPD_SR_TXMSGSENT UCPD_SR_TXMSGSENT /*!< Transmit message sent interrupt */
94 #define LL_UCPD_SR_TXMSGABT UCPD_SR_TXMSGABT /*!< Transmit message abort interrupt */
95 #define LL_UCPD_SR_HRSTDISC UCPD_SR_HRSTDISC /*!< HRST discarded interrupt */
96 #define LL_UCPD_SR_HRSTSENT UCPD_SR_HRSTSENT /*!< HRST sent interrupt */
97 #define LL_UCPD_SR_TXUND UCPD_SR_TXUND /*!< Tx data underrun condition interrupt */
98 #define LL_UCPD_SR_RXNE UCPD_SR_RXNE /*!< Receive data register not empty interrupt */
99 #define LL_UCPD_SR_RXORDDET UCPD_SR_RXORDDET /*!< Rx ordered set (4 K-codes) detected interrupt */
100 #define LL_UCPD_SR_RXHRSTDET UCPD_SR_RXHRSTDET /*!< Rx Hard Reset detect interrupt */
101 #define LL_UCPD_SR_RXOVR UCPD_SR_RXOVR /*!< Rx data overflow interrupt */
102 #define LL_UCPD_SR_RXMSGEND UCPD_SR_RXMSGEND /*!< Rx message received */
103 #define LL_UCPD_SR_RXERR UCPD_SR_RXERR /*!< Rx error */
104 #define LL_UCPD_SR_TYPECEVT1 UCPD_SR_TYPECEVT1 /*!< Type C voltage level event on CC1 */
105 #define LL_UCPD_SR_TYPECEVT2 UCPD_SR_TYPECEVT2 /*!< Type C voltage level event on CC2 */
106 #define LL_UCPD_SR_TYPEC_VSTATE_CC1 UCPD_SR_TYPEC_VSTATE_CC1 /*!<Status of DC level on CC1 pin */
107 #define LL_UCPD_SR_TYPEC_VSTATE_CC2 UCPD_SR_TYPEC_VSTATE_CC2 /*!<Status of DC level on CC2 pin */
108 #define LL_UCPD_SR_FRSEVT UCPD_SR_FRSEVT /*!<Fast Role Swap detection event */
111 * @}
114 /** @defgroup UCPD_LL_EC_IT IT Defines
115 * @brief IT defines which can be used with LL_UCPD_ReadReg and LL_UCPD_WriteReg functions
116 * @{
118 #define LL_UCPD_IMR_TXIS UCPD_IMR_TXISIE /*!< Enable transmit interrupt status */
119 #define LL_UCPD_IMR_TXMSGDISC UCPD_IMR_TXMSGDISCIE /*!< Enable transmit message discarded interrupt */
120 #define LL_UCPD_IMR_TXMSGSENT UCPD_IMR_TXMSGSENTIE /*!< Enable transmit message sent interrupt */
121 #define LL_UCPD_IMR_TXMSGABT UCPD_IMR_TXMSGABTIE /*!< Enable transmit message abort interrupt */
122 #define LL_UCPD_IMR_HRSTDISC UCPD_IMR_HRSTDISCIE /*!< Enable HRST discarded interrupt */
123 #define LL_UCPD_IMR_HRSTSENT UCPD_IMR_HRSTSENTIE /*!< Enable HRST sent interrupt */
124 #define LL_UCPD_IMR_TXUND UCPD_IMR_TXUNDIE /*!< Enable tx data underrun condition interrupt */
125 #define LL_UCPD_IMR_RXNE UCPD_IMR_RXNEIE /*!< Enable Receive data register not empty interrupt */
126 #define LL_UCPD_IMR_RXORDDET UCPD_IMR_RXORDDETIE /*!< Enable Rx ordered set (4 K-codes) detected interrupt */
127 #define LL_UCPD_IMR_RXHRSTDET UCPD_IMR_RXHRSTDETIE /*!< Enable Rx Hard Reset detect interrupt */
128 #define LL_UCPD_IMR_RXOVR UCPD_IMR_RXOVRIE /*!< Enable Rx data overflow interrupt */
129 #define LL_UCPD_IMR_RXMSGEND UCPD_IMR_RXMSGEND /*!< Enable Rx message received */
130 #define LL_UCPD_IMR_RXERR UCPD_IMR_RXMSGENDIE /*!< Enable Rx error */
131 #define LL_UCPD_IMR_TYPECEVT1 UCPD_IMR_TYPECEVT1IE /*!< Enable Type C voltage level event on CC1 */
132 #define LL_UCPD_IMR_TYPECEVT2 UCPD_IMR_TYPECEVT2IE /*!< Enable Type C voltage level event on CC2 */
133 #define LL_UCPD_IMR_FRSEVT UCPD_IMR_FRSEVTIE /*!< Enable fast Role Swap detection event */
135 * @}
138 /** @defgroup UCPD_LL_EC_ORDERSET orderset value
139 * @brief definition of the usual orderset
140 * @{
142 #define LL_UCPD_SYNC1 0x18u
143 #define LL_UCPD_SYNC2 0x11u
144 #define LL_UCPD_SYNC3 0x06u
145 #define LL_UCPD_RST1 0x07u
146 #define LL_UCPD_RST2 0x19u
147 #define LL_UCPD_EOP 0x0Du
149 #define LL_UCPD_ORDERED_SET_SOP (LL_UCPD_SYNC1 | (LL_UCPD_SYNC1<<5u) | (LL_UCPD_SYNC1<<10u) | (LL_UCPD_SYNC2<<15u))
150 #define LL_UCPD_ORDERED_SET_SOP1 (LL_UCPD_SYNC1 | (LL_UCPD_SYNC1<<5u) | (LL_UCPD_SYNC3<<10u) | (LL_UCPD_SYNC3<<15u))
151 #define LL_UCPD_ORDERED_SET_SOP2 (LL_UCPD_SYNC1 | (LL_UCPD_SYNC3<<5u) | (LL_UCPD_SYNC1<<10u) | (LL_UCPD_SYNC3<<15u))
152 #define LL_UCPD_ORDERED_SET_HARD_RESET (LL_UCPD_RST1 | (LL_UCPD_RST1<<5u) | (LL_UCPD_RST1<<10u) | (LL_UCPD_RST2<<15u ))
153 #define LL_UCPD_ORDERED_SET_CABLE_RESET (LL_UCPD_RST1 | (LL_UCPD_SYNC1<<5u) | (LL_UCPD_RST1<<10u) | (LL_UCPD_SYNC3<<15u))
154 #define LL_UCPD_ORDERED_SET_SOP1_DEBUG (LL_UCPD_SYNC1 | (LL_UCPD_RST2<<5u) | (LL_UCPD_RST2<<10u) | (LL_UCPD_SYNC3<<15u))
155 #define LL_UCPD_ORDERED_SET_SOP2_DEBUG (LL_UCPD_SYNC1 | (LL_UCPD_RST2<<5u) | (LL_UCPD_SYNC3<<10u) | (LL_UCPD_SYNC2<<15u))
157 * @}
160 /** @defgroup UCPD_LL_EC_MODE Role Mode
161 * @{
163 #define LL_UCPD_ROLE_SNK UCPD_CR_ANAMODE /*!< Mode SNK Rd */
164 #define LL_UCPD_ROLE_SRC 0x0U
166 * @}
169 /** @defgroup UCPD_LL_EC_RESISTOR resistor value
170 * @{
172 #define LL_UCPD_RESISTOR_DEFAULT UCPD_CR_ANASUBMODE_0 /*!< Rp default */
173 #define LL_UCPD_RESISTOR_1_5A UCPD_CR_ANASUBMODE_1 /*!< Rp 1.5 A */
174 #define LL_UCPD_RESISTOR_3_0A UCPD_CR_ANASUBMODE /*!< Rp 3.0 A */
175 #define LL_UCPD_RESISTOR_NONE 0x0U /*!< No resistor */
177 * @}
180 /** @defgroup UCPD_LL_EC_CFG1_ORDERSET orderset configuration
181 * @{
183 #define LL_UCPD_ORDERSET_SOP UCPD_CFG1_RXORDSETEN_0
184 #define LL_UCPD_ORDERSET_SOP1 UCPD_CFG1_RXORDSETEN_1
185 #define LL_UCPD_ORDERSET_SOP2 UCPD_CFG1_RXORDSETEN_2
186 #define LL_UCPD_ORDERSET_HARDRST UCPD_CFG1_RXORDSETEN_3
187 #define LL_UCPD_ORDERSET_CABLERST UCPD_CFG1_RXORDSETEN_4
188 #define LL_UCPD_ORDERSET_SOP1_DEBUG UCPD_CFG1_RXORDSETEN_5
189 #define LL_UCPD_ORDERSET_SOP2_DEBUG UCPD_CFG1_RXORDSETEN_6
190 #define LL_UCPD_ORDERSET_SOP_EXT1 UCPD_CFG1_RXORDSETEN_7
191 #define LL_UCPD_ORDERSET_SOP_EXT2 UCPD_CFG1_RXORDSETEN_8
193 * @}
196 /** @defgroup UCPD_LL_EC_CCxEVT ccxevt
197 * @{
199 #define LL_UCPD_SNK_CC1_VOPEN 0x00u
200 #define LL_UCPD_SNK_CC1_VRP UCPD_SR_TYPEC_VSTATE_CC1_0
201 #define LL_UCPD_SNK_CC1_VRP15A UCPD_SR_TYPEC_VSTATE_CC1_1
202 #define LL_UCPD_SNK_CC1_VRP30A (UCPD_SR_TYPEC_VSTATE_CC1_0 | UCPD_SR_TYPEC_VSTATE_CC1_1)
204 #define LL_UCPD_SNK_CC2_VOPEN 0x00u
205 #define LL_UCPD_SNK_CC2_VRP UCPD_SR_TYPEC_VSTATE_CC2_0
206 #define LL_UCPD_SNK_CC2_VRP15A UCPD_SR_TYPEC_VSTATE_CC2_1
207 #define LL_UCPD_SNK_CC2_VRP30A (UCPD_SR_TYPEC_VSTATE_CC2_0 | UCPD_SR_TYPEC_VSTATE_CC2_1)
209 #define LL_UCPD_SRC_CC1_VRA 0x0U
210 #define LL_UCPD_SRC_CC1_VRD UCPD_SR_TYPEC_VSTATE_CC1_0
211 #define LL_UCPD_SRC_CC1_OPEN UCPD_SR_TYPEC_VSTATE_CC1_1
213 #define LL_UCPD_SRC_CC2_VRA 0x0U
214 #define LL_UCPD_SRC_CC2_VRD UCPD_SR_TYPEC_VSTATE_CC2_0
215 #define LL_UCPD_SRC_CC2_OPEN UCPD_SR_TYPEC_VSTATE_CC2_1
217 * @}
220 /** @defgroup UCPD_LL_EC_PSC prescaler for UCPDCLK
221 * @{
223 #define LL_UCPD_PSC_DIV1 0x0u
224 #define LL_UCPD_PSC_DIV2 UCPD_CFG1_PSC_UCPDCLK_0
225 #define LL_UCPD_PSC_DIV4 UCPD_CFG1_PSC_UCPDCLK_1
226 #define LL_UCPD_PSC_DIV8 (UCPD_CFG1_PSC_UCPDCLK_1 | UCPD_CFG1_PSC_UCPDCLK_0)
227 #define LL_UCPD_PSC_DIV16 UCPD_CFG1_PSC_UCPDCLK_2
229 * @}
232 /** @defgroup UCPD_LL_EC_CCENABLE cc pin enable
233 * @{
235 #define LL_UCPD_CCENABLE_NONE 0x0U
236 #define LL_UCPD_CCENABLE_CC1 UCPD_CR_CCENABLE_0
237 #define LL_UCPD_CCENABLE_CC2 UCPD_CR_CCENABLE_1
238 #define LL_UCPD_CCENABLE_CC1CC2 (UCPD_CR_CCENABLE_0 | UCPD_CR_CCENABLE_1)
240 * @}
243 /** @defgroup UCPD_LL_EC_CCPIN cc pin selection
244 * @{
246 #define LL_UCPD_CCPIN_CC1 0x0U
247 #define LL_UCPD_CCPIN_CC2 UCPD_CR_PHYCCSEL
249 * @}
252 /** @defgroup UCPD_LL_EC_RXMODE rx mode
253 * @{
255 #define LL_UCPD_RXMODE_NORMAL 0x0U
256 #define LL_UCPD_RXMODE_BIST_TEST_DATA UCPD_CR_RXMODE
258 * @}
261 /** @defgroup UCPD_LL_EC_TXMODE tx mode
262 * @{
264 #define LL_UCPD_TXMODE_NORMAL 0x0U
265 #define LL_UCPD_TXMODE_CABLE_RESET UCPD_CR_TXMODE_0
266 #define LL_UCPD_TXMODE_BIST_CARRIER2 UCPD_CR_TXMODE_1
268 * @}
271 /** @defgroup UCPD_LL_EC_RXORDSET rx orderset
272 * @{
274 #define LL_UCPD_RXORDSET_SOP 0x0U
275 #define LL_UCPD_RXORDSET_SOP1 UCPD_RX_ORDSET_RXORDSET_0
276 #define LL_UCPD_RXORDSET_SOP2 UCPD_RX_ORDSET_RXORDSET_1
277 #define LL_UCPD_RXORDSET_SOP1_DEBUG (UCPD_RX_ORDSET_RXORDSET_0 | UCPD_RX_ORDSET_RXORDSET_1)
278 #define LL_UCPD_RXORDSET_SOP2_DEBUG UCPD_RX_ORDSET_RXORDSET_2
279 #define LL_UCPD_RXORDSET_CABLE_RESET (UCPD_RX_ORDSET_RXORDSET_2 | UCPD_RX_ORDSET_RXORDSET_0)
280 #define LL_UCPD_RXORDSET_SOPEXT1 (UCPD_RX_ORDSET_RXORDSET_2 | UCPD_RX_ORDSET_RXORDSET_1)
281 #define LL_UCPD_RXORDSET_SOPEXT2 (UCPD_RX_ORDSET_RXORDSET_2 | UCPD_RX_ORDSET_RXORDSET_1 | UCPD_RX_ORDSET_RXORDSET_0)
283 * @}
287 * @}
290 /* Exported macro ------------------------------------------------------------*/
291 /** @defgroup UCPD_LL_Exported_Macros UCPD Exported Macros
292 * @{
295 /** @defgroup UCPD_LL_EM_WRITE_READ Common Write and read registers Macros
296 * @{
300 * @brief Write a value in UCPD register
301 * @param __INSTANCE__ UCPD Instance
302 * @param __REG__ Register to be written
303 * @param __VALUE__ Value to be written in the register
304 * @retval None
306 #define LL_UCPD_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG((__INSTANCE__)->__REG__, (__VALUE__))
309 * @brief Read a value in UCPD register
310 * @param __INSTANCE__ UCPD Instance
311 * @param __REG__ Register to be read
312 * @retval Register value
314 #define LL_UCPD_ReadReg(__INSTANCE__, __REG__) READ_REG((__INSTANCE__)->__REG__)
316 * @}
320 * @}
323 /* Exported functions --------------------------------------------------------*/
324 /** @defgroup UCPD_LL_Exported_Functions UCPD Exported Functions
325 * @{
328 /** @defgroup UCPD_LL_EF_Configuration Configuration
329 * @{
332 /** @defgroup UCPD_LL_EF_CFG1 CFG1 register
333 * @{
336 * @brief Enable UCPD peripheral
337 * @rmtoll CFG1 UCPDEN LL_UCPD_Enable
338 * @param UCPDx UCPD Instance
339 * @retval None
341 __STATIC_INLINE void LL_UCPD_Enable(UCPD_TypeDef *UCPDx)
343 SET_BIT(UCPDx->CFG1, UCPD_CFG1_UCPDEN);
347 * @brief Disable UCPD peripheral
348 * @note When disabling the UCPD, follow the procedure described in the Reference Manual.
349 * @rmtoll CFG1 UCPDEN LL_UCPD_Disable
350 * @param UCPDx UCPD Instance
351 * @retval None
353 __STATIC_INLINE void LL_UCPD_Disable(UCPD_TypeDef *UCPDx)
355 CLEAR_BIT(UCPDx->CFG1, UCPD_CFG1_UCPDEN);
359 * @brief Check if UCPD peripheral is enabled
360 * @rmtoll CFG1 UCPDEN LL_UCPD_IsEnabled
361 * @param UCPDx UCPD Instance
362 * @retval State of bit (1 or 0).
364 __STATIC_INLINE uint32_t LL_UCPD_IsEnabled(UCPD_TypeDef const * const UCPDx)
366 return ((READ_BIT(UCPDx->CFG1, UCPD_CFG1_UCPDEN) == (UCPD_CFG1_UCPDEN)) ? 1UL : 0UL);
370 * @brief Set the receiver ordered set detection enable
371 * @rmtoll CFG1 RXORDSETEN LL_UCPD_SetRxOrderSet
372 * @param UCPDx UCPD Instance
373 * @param OrderSet This parameter can be combination of the following values:
374 * @arg @ref LL_UCPD_ORDERSET_SOP
375 * @arg @ref LL_UCPD_ORDERSET_SOP1
376 * @arg @ref LL_UCPD_ORDERSET_SOP2
377 * @arg @ref LL_UCPD_ORDERSET_HARDRST
378 * @arg @ref LL_UCPD_ORDERSET_CABLERST
379 * @arg @ref LL_UCPD_ORDERSET_SOP1_DEBUG
380 * @arg @ref LL_UCPD_ORDERSET_SOP2_DEBUG
381 * @arg @ref LL_UCPD_ORDERSET_SOP_EXT1
382 * @arg @ref LL_UCPD_ORDERSET_SOP_EXT2
383 * @retval None
385 __STATIC_INLINE void LL_UCPD_SetRxOrderSet(UCPD_TypeDef *UCPDx, uint32_t OrderSet)
387 MODIFY_REG(UCPDx->CFG1, UCPD_CFG1_RXORDSETEN, OrderSet);
391 * @brief Set the prescaler for ucpd clock
392 * @rmtoll CFG1 UCPDCLK LL_UCPD_SetPSCClk
393 * @param UCPDx UCPD Instance
394 * @param Psc This parameter can be one of the following values:
395 * @arg @ref LL_UCPD_PSC_DIV1
396 * @arg @ref LL_UCPD_PSC_DIV2
397 * @arg @ref LL_UCPD_PSC_DIV4
398 * @arg @ref LL_UCPD_PSC_DIV8
399 * @arg @ref LL_UCPD_PSC_DIV16
400 * @retval None
402 __STATIC_INLINE void LL_UCPD_SetPSCClk(UCPD_TypeDef *UCPDx, uint32_t Psc)
404 MODIFY_REG(UCPDx->CFG1, UCPD_CFG1_PSC_UCPDCLK, Psc);
408 * @brief Set the number of cycles (minus 1) of the half bit clock
409 * @rmtoll CFG1 TRANSWIN LL_UCPD_SetTransWin
410 * @param UCPDx UCPD Instance
411 * @param TransWin a value between Min_Data=0x1 and Max_Data=0x1F
412 * @retval None
414 __STATIC_INLINE void LL_UCPD_SetTransWin(UCPD_TypeDef *UCPDx, uint32_t TransWin)
416 MODIFY_REG(UCPDx->CFG1, UCPD_CFG1_TRANSWIN, TransWin << UCPD_CFG1_TRANSWIN_Pos);
420 * @brief Set the clock divider value to generate an interframe gap
421 * @rmtoll CFG1 IFRGAP LL_UCPD_SetIfrGap
422 * @param UCPDx UCPD Instance
423 * @param IfrGap a value between Min_Data=0x1 and Max_Data=0x1F
424 * @retval None
426 __STATIC_INLINE void LL_UCPD_SetIfrGap(UCPD_TypeDef *UCPDx, uint32_t IfrGap)
428 MODIFY_REG(UCPDx->CFG1, UCPD_CFG1_IFRGAP, IfrGap << UCPD_CFG1_IFRGAP_Pos);
432 * @brief Set the clock divider value to generate an interframe gap
433 * @rmtoll CFG1 HBITCLKDIV LL_UCPD_SetHbitClockDiv
434 * @param UCPDx UCPD Instance
435 * @param HbitClock a value between Min_Data=0x0 and Max_Data=0x3F
436 * @retval None
438 __STATIC_INLINE void LL_UCPD_SetHbitClockDiv(UCPD_TypeDef *UCPDx, uint32_t HbitClock)
440 MODIFY_REG(UCPDx->CFG1, UCPD_CFG1_HBITCLKDIV, HbitClock << UCPD_CFG1_HBITCLKDIV_Pos);
444 * @}
447 /** @defgroup UCPD_LL_EF_CFG2 CFG2 register
448 * @{
452 * @brief Enable the wakeup mode
453 * @rmtoll CFG2 WUPEN LL_UCPD_WakeUpEnable
454 * @param UCPDx UCPD Instance
455 * @retval None
457 __STATIC_INLINE void LL_UCPD_WakeUpEnable(UCPD_TypeDef *UCPDx)
459 SET_BIT(UCPDx->CFG2, UCPD_CFG2_WUPEN);
463 * @brief Disable the wakeup mode
464 * @rmtoll CFG2 WUPEN LL_UCPD_WakeUpDisable
465 * @param UCPDx UCPD Instance
466 * @retval None
468 __STATIC_INLINE void LL_UCPD_WakeUpDisable(UCPD_TypeDef *UCPDx)
470 CLEAR_BIT(UCPDx->CFG2, UCPD_CFG2_WUPEN);
474 * @brief Force clock enable
475 * @rmtoll CFG2 FORCECLK LL_UCPD_ForceClockEnable
476 * @param UCPDx UCPD Instance
477 * @retval None
479 __STATIC_INLINE void LL_UCPD_ForceClockEnable(UCPD_TypeDef *UCPDx)
481 SET_BIT(UCPDx->CFG2, UCPD_CFG2_FORCECLK);
485 * @brief Force clock disable
486 * @rmtoll CFG2 FORCECLK LL_UCPD_ForceClockDisable
487 * @param UCPDx UCPD Instance
488 * @retval None
490 __STATIC_INLINE void LL_UCPD_ForceClockDisable(UCPD_TypeDef *UCPDx)
492 CLEAR_BIT(UCPDx->CFG2, UCPD_CFG2_FORCECLK);
496 * @brief RxFilter enable
497 * @rmtoll CFG2 RXFILTDIS LL_UCPD_RxFilterEnable
498 * @param UCPDx UCPD Instance
499 * @retval None
501 __STATIC_INLINE void LL_UCPD_RxFilterEnable(UCPD_TypeDef *UCPDx)
503 CLEAR_BIT(UCPDx->CFG2, UCPD_CFG2_RXFILTDIS);
507 * @brief RxFilter disable
508 * @rmtoll CFG2 RXFILTDIS LL_UCPD_RxFilterDisable
509 * @param UCPDx UCPD Instance
510 * @retval None
512 __STATIC_INLINE void LL_UCPD_RxFilterDisable(UCPD_TypeDef *UCPDx)
514 SET_BIT(UCPDx->CFG2, UCPD_CFG2_RXFILTDIS);
518 * @}
522 * @}
525 /** @defgroup UCPD_LL_EF_CR CR register
526 * @{
529 * @brief Type C detector for CC2 enable
530 * @rmtoll CR CC2TCDIS LL_UCPD_TypeCDetectionCC2Enable
531 * @param UCPDx UCPD Instance
532 * @retval None
534 __STATIC_INLINE void LL_UCPD_TypeCDetectionCC2Enable(UCPD_TypeDef *UCPDx)
536 CLEAR_BIT(UCPDx->CR, UCPD_CR_CC2TCDIS);
540 * @brief Type C detector for CC2 disable
541 * @rmtoll CR CC2TCDIS LL_UCPD_TypeCDetectionCC2Disable
542 * @param UCPDx UCPD Instance
543 * @retval None
545 __STATIC_INLINE void LL_UCPD_TypeCDetectionCC2Disable(UCPD_TypeDef *UCPDx)
547 SET_BIT(UCPDx->CR, UCPD_CR_CC2TCDIS);
551 * @brief Type C detector for CC1 enable
552 * @rmtoll CR CC1TCDIS LL_UCPD_TypeCDetectionCC1Enable
553 * @param UCPDx UCPD Instance
554 * @retval None
556 __STATIC_INLINE void LL_UCPD_TypeCDetectionCC1Enable(UCPD_TypeDef *UCPDx)
558 CLEAR_BIT(UCPDx->CR, UCPD_CR_CC1TCDIS);
562 * @brief Type C detector for CC1 disable
563 * @rmtoll CR CC1TCDIS LL_UCPD_TypeCDetectionCC1Disable
564 * @param UCPDx UCPD Instance
565 * @retval None
567 __STATIC_INLINE void LL_UCPD_TypeCDetectionCC1Disable(UCPD_TypeDef *UCPDx)
569 SET_BIT(UCPDx->CR, UCPD_CR_CC1TCDIS);
573 * @brief Source Vconn discharge enable
574 * @rmtoll CR RDCH LL_UCPD_VconnDischargeEnable
575 * @param UCPDx UCPD Instance
576 * @retval None
578 __STATIC_INLINE void LL_UCPD_VconnDischargeEnable(UCPD_TypeDef *UCPDx)
580 SET_BIT(UCPDx->CR, UCPD_CR_RDCH);
584 * @brief Source Vconn discharge disable
585 * @rmtoll CR RDCH LL_UCPD_VconnDischargeDisable
586 * @param UCPDx UCPD Instance
587 * @retval None
589 __STATIC_INLINE void LL_UCPD_VconnDischargeDisable(UCPD_TypeDef *UCPDx)
591 CLEAR_BIT(UCPDx->CR, UCPD_CR_RDCH);
595 * @brief Signal Fast Role Swap request
596 * @rmtoll CR FRSTX LL_UCPD_VconnDischargeDisable
597 * @param UCPDx UCPD Instance
598 * @retval None
600 __STATIC_INLINE void LL_UCPD_SignalFRSTX(UCPD_TypeDef *UCPDx)
602 SET_BIT(UCPDx->CR, UCPD_CR_FRSTX);
606 * @brief Fast Role swap RX detection enable
607 * @rmtoll CR FRSRXEN LL_UCPD_FRSDetectionEnable
608 * @param UCPDx UCPD Instance
609 * @retval None
611 __STATIC_INLINE void LL_UCPD_FRSDetectionEnable(UCPD_TypeDef *UCPDx)
613 SET_BIT(UCPDx->CR, UCPD_CR_FRSRXEN);
617 * @brief Fast Role swap RX detection disable
618 * @rmtoll CR FRSRXEN LL_UCPD_FRSDetectionDisable
619 * @param UCPDx UCPD Instance
620 * @retval None
622 __STATIC_INLINE void LL_UCPD_FRSDetectionDisable(UCPD_TypeDef *UCPDx)
624 CLEAR_BIT(UCPDx->CR, UCPD_CR_FRSRXEN);
628 * @brief Set cc enable
629 * @rmtoll CR CC1VCONNEN LL_UCPD_SetccEnable
630 * @param UCPDx UCPD Instance
631 * @param CCEnable This parameter can be one of the following values:
632 * @arg @ref LL_UCPD_CCENABLE_NONE
633 * @arg @ref LL_UCPD_CCENABLE_CC1
634 * @arg @ref LL_UCPD_CCENABLE_CC2
635 * @arg @ref LL_UCPD_CCENABLE_CC1CC2
636 * @retval None
638 __STATIC_INLINE void LL_UCPD_SetccEnable(UCPD_TypeDef *UCPDx, uint32_t CCEnable)
640 MODIFY_REG(UCPDx->CR, UCPD_CR_CCENABLE, CCEnable);
644 * @brief Set UCPD SNK role
645 * @rmtoll CR ANAMODE LL_UCPD_SetSNKRole
646 * @param UCPDx UCPD Instance
647 * @retval None
649 __STATIC_INLINE void LL_UCPD_SetSNKRole(UCPD_TypeDef *UCPDx)
651 SET_BIT(UCPDx->CR, UCPD_CR_ANAMODE);
655 * @brief Set UCPD SRC role
656 * @rmtoll CR ANAMODE LL_UCPD_SetSRCRole
657 * @param UCPDx UCPD Instance
658 * @retval None
660 __STATIC_INLINE void LL_UCPD_SetSRCRole(UCPD_TypeDef *UCPDx)
662 CLEAR_BIT(UCPDx->CR, UCPD_CR_ANAMODE);
666 * @brief Get UCPD Role
667 * @rmtoll CR ANAMODE LL_UCPD_GetRole
668 * @param UCPDx UCPD Instance
669 * @retval Returned value can be one of the following values:
670 * @arg @ref LL_UCPD_ROLE_SNK
671 * @arg @ref LL_UCPD_ROLE_SRC
673 __STATIC_INLINE uint32_t LL_UCPD_GetRole(UCPD_TypeDef const * const UCPDx)
675 return (uint32_t)(READ_BIT(UCPDx->CR, UCPD_CR_ANAMODE));
679 * @brief Set Rp resistor
680 * @rmtoll CR ANASUBMODE LL_UCPD_SetRpResistor
681 * @param UCPDx UCPD Instance
682 * @param Resistor This parameter can be one of the following values:
683 * @arg @ref LL_UCPD_RESISTOR_DEFAULT
684 * @arg @ref LL_UCPD_RESISTOR_1_5A
685 * @arg @ref LL_UCPD_RESISTOR_3_0A
686 * @arg @ref LL_UCPD_RESISTOR_NONE
687 * @retval None
689 __STATIC_INLINE void LL_UCPD_SetRpResistor(UCPD_TypeDef *UCPDx, uint32_t Resistor)
691 MODIFY_REG(UCPDx->CR, UCPD_CR_ANASUBMODE, Resistor);
695 * @brief Set CC pin
696 * @rmtoll CR PHYCCSEL LL_UCPD_SetCCPin
697 * @param UCPDx UCPD Instance
698 * @param CCPin This parameter can be one of the following values:
699 * @arg @ref LL_UCPD_CCPIN_CC1
700 * @arg @ref LL_UCPD_CCPIN_CC2
701 * @retval None
703 __STATIC_INLINE void LL_UCPD_SetCCPin(UCPD_TypeDef *UCPDx, uint32_t CCPin)
705 MODIFY_REG(UCPDx->CR, UCPD_CR_PHYCCSEL, CCPin);
709 * @brief Rx enable
710 * @rmtoll CR PHYRXEN LL_UCPD_RxEnable
711 * @param UCPDx UCPD Instance
712 * @retval None
714 __STATIC_INLINE void LL_UCPD_RxEnable(UCPD_TypeDef *UCPDx)
716 SET_BIT(UCPDx->CR, UCPD_CR_PHYRXEN);
720 * @brief Rx disable
721 * @rmtoll CR PHYRXEN LL_UCPD_RxDisable
722 * @param UCPDx UCPD Instance
723 * @retval None
725 __STATIC_INLINE void LL_UCPD_RxDisable(UCPD_TypeDef *UCPDx)
727 CLEAR_BIT(UCPDx->CR, UCPD_CR_PHYRXEN);
731 * @brief Set Rx mode
732 * @rmtoll CR RXMODE LL_UCPD_SetRxMode
733 * @param UCPDx UCPD Instance
734 * @param RxMode This parameter can be one of the following values:
735 * @arg @ref LL_UCPD_RXMODE_NORMAL
736 * @arg @ref LL_UCPD_RXMODE_BIST_TEST_DATA
737 * @retval None
739 __STATIC_INLINE void LL_UCPD_SetRxMode(UCPD_TypeDef *UCPDx, uint32_t RxMode)
741 MODIFY_REG(UCPDx->CR, UCPD_CR_RXMODE, RxMode);
745 * @brief Send Hard Reset
746 * @rmtoll CR TXHRST LL_UCPD_SendHardReset
747 * @param UCPDx UCPD Instance
748 * @retval None
750 __STATIC_INLINE void LL_UCPD_SendHardReset(UCPD_TypeDef *UCPDx)
752 SET_BIT(UCPDx->CR, UCPD_CR_TXHRST);
756 * @brief Send message
757 * @rmtoll CR TXSEND LL_UCPD_SendMessage
758 * @param UCPDx UCPD Instance
759 * @retval None
761 __STATIC_INLINE void LL_UCPD_SendMessage(UCPD_TypeDef *UCPDx)
763 SET_BIT(UCPDx->CR, UCPD_CR_TXSEND);
767 * @brief Set Tx mode
768 * @rmtoll CR TXMODE LL_UCPD_SetTxMode
769 * @param UCPDx UCPD Instance
770 * @param TxMode This parameter can be one of the following values:
771 * @arg @ref LL_UCPD_TXMODE_NORMAL
772 * @arg @ref LL_UCPD_TXMODE_CABLE_RESET
773 * @arg @ref LL_UCPD_TXMODE_BIST_CARRIER2
774 * @retval None
776 __STATIC_INLINE void LL_UCPD_SetTxMode(UCPD_TypeDef *UCPDx, uint32_t TxMode)
778 MODIFY_REG(UCPDx->CR, UCPD_CR_TXMODE, TxMode);
782 * @}
785 /** @defgroup UCPD_LL_EF_IT_Management Interrupt Management
786 * @{
790 * @brief Enable FRS interrupt
791 * @rmtoll IMR FRSEVTIE LL_UCPD_EnableIT_FRS
792 * @param UCPDx UCPD Instance
793 * @retval None
795 __STATIC_INLINE void LL_UCPD_EnableIT_FRS(UCPD_TypeDef *UCPDx)
797 SET_BIT(UCPDx->IMR, UCPD_IMR_FRSEVTIE);
801 * @brief Enable type c event on CC2
802 * @rmtoll IMR TYPECEVT2IE LL_UCPD_EnableIT_TypeCEventCC2
803 * @param UCPDx UCPD Instance
804 * @retval None
806 __STATIC_INLINE void LL_UCPD_EnableIT_TypeCEventCC2(UCPD_TypeDef *UCPDx)
808 SET_BIT(UCPDx->IMR, UCPD_IMR_TYPECEVT2IE);
812 * @brief Enable type c event on CC1
813 * @rmtoll IMR TYPECEVT1IE LL_UCPD_EnableIT_TypeCEventCC1
814 * @param UCPDx UCPD Instance
815 * @retval None
817 __STATIC_INLINE void LL_UCPD_EnableIT_TypeCEventCC1(UCPD_TypeDef *UCPDx)
819 SET_BIT(UCPDx->IMR, UCPD_IMR_TYPECEVT1IE);
823 * @brief Enable Rx message end interrupt
824 * @rmtoll IMR RXMSGENDIE LL_UCPD_EnableIT_RxMsgEnd
825 * @param UCPDx UCPD Instance
826 * @retval None
828 __STATIC_INLINE void LL_UCPD_EnableIT_RxMsgEnd(UCPD_TypeDef *UCPDx)
830 SET_BIT(UCPDx->IMR, UCPD_IMR_RXMSGENDIE);
834 * @brief Enable Rx overrun interrupt
835 * @rmtoll IMR RXOVRIE LL_UCPD_EnableIT_RxOvr
836 * @param UCPDx UCPD Instance
837 * @retval None
839 __STATIC_INLINE void LL_UCPD_EnableIT_RxOvr(UCPD_TypeDef *UCPDx)
841 SET_BIT(UCPDx->IMR, UCPD_IMR_RXOVRIE);
845 * @brief Enable Rx hard resrt interrupt
846 * @rmtoll IMR RXHRSTDETIE LL_UCPD_EnableIT_RxHRST
847 * @param UCPDx UCPD Instance
848 * @retval None
850 __STATIC_INLINE void LL_UCPD_EnableIT_RxHRST(UCPD_TypeDef *UCPDx)
852 SET_BIT(UCPDx->IMR, UCPD_IMR_RXHRSTDETIE);
856 * @brief Enable Rx orderset interrupt
857 * @rmtoll IMR RXORDDETIE LL_UCPD_EnableIT_RxOrderSet
858 * @param UCPDx UCPD Instance
859 * @retval None
861 __STATIC_INLINE void LL_UCPD_EnableIT_RxOrderSet(UCPD_TypeDef *UCPDx)
863 SET_BIT(UCPDx->IMR, UCPD_IMR_RXORDDETIE);
867 * @brief Enable Rx non empty interrupt
868 * @rmtoll IMR RXNEIE LL_UCPD_EnableIT_RxNE
869 * @param UCPDx UCPD Instance
870 * @retval None
872 __STATIC_INLINE void LL_UCPD_EnableIT_RxNE(UCPD_TypeDef *UCPDx)
874 SET_BIT(UCPDx->IMR, UCPD_IMR_RXNEIE);
878 * @brief Enable TX underrun interrupt
879 * @rmtoll IMR TXUNDIE LL_UCPD_EnableIT_TxUND
880 * @param UCPDx UCPD Instance
881 * @retval None
883 __STATIC_INLINE void LL_UCPD_EnableIT_TxUND(UCPD_TypeDef *UCPDx)
885 SET_BIT(UCPDx->IMR, UCPD_IMR_TXUNDIE);
889 * @brief Enable hard reset sent interrupt
890 * @rmtoll IMR HRSTSENTIE LL_UCPD_EnableIT_TxHRSTSENT
891 * @param UCPDx UCPD Instance
892 * @retval None
894 __STATIC_INLINE void LL_UCPD_EnableIT_TxHRSTSENT(UCPD_TypeDef *UCPDx)
896 SET_BIT(UCPDx->IMR, UCPD_IMR_HRSTSENTIE);
900 * @brief Enable hard reset discard interrupt
901 * @rmtoll IMR HRSTDISCIE LL_UCPD_EnableIT_TxHRSTDISC
902 * @param UCPDx UCPD Instance
903 * @retval None
905 __STATIC_INLINE void LL_UCPD_EnableIT_TxHRSTDISC(UCPD_TypeDef *UCPDx)
907 SET_BIT(UCPDx->IMR, UCPD_IMR_HRSTDISCIE);
911 * @brief Enable Tx message abort interrupt
912 * @rmtoll IMR TXMSGABTIE LL_UCPD_EnableIT_TxMSGABT
913 * @param UCPDx UCPD Instance
914 * @retval None
916 __STATIC_INLINE void LL_UCPD_EnableIT_TxMSGABT(UCPD_TypeDef *UCPDx)
918 SET_BIT(UCPDx->IMR, UCPD_IMR_TXMSGABTIE);
922 * @brief Enable Tx message sent interrupt
923 * @rmtoll IMR TXMSGSENTIE LL_UCPD_EnableIT_TxMSGSENT
924 * @param UCPDx UCPD Instance
925 * @retval None
927 __STATIC_INLINE void LL_UCPD_EnableIT_TxMSGSENT(UCPD_TypeDef *UCPDx)
929 SET_BIT(UCPDx->IMR, UCPD_IMR_TXMSGSENTIE);
933 * @brief Enable Tx message discarded interrupt
934 * @rmtoll IMR TXMSGDISCIE LL_UCPD_EnableIT_TxMSGDISC
935 * @param UCPDx UCPD Instance
936 * @retval None
938 __STATIC_INLINE void LL_UCPD_EnableIT_TxMSGDISC(UCPD_TypeDef *UCPDx)
940 SET_BIT(UCPDx->IMR, UCPD_IMR_TXMSGDISCIE);
944 * @brief Enable Tx data receive interrupt
945 * @rmtoll IMR TXISIE LL_UCPD_EnableIT_TxIS
946 * @param UCPDx UCPD Instance
947 * @retval None
949 __STATIC_INLINE void LL_UCPD_EnableIT_TxIS(UCPD_TypeDef *UCPDx)
951 SET_BIT(UCPDx->IMR, UCPD_IMR_TXISIE);
955 * @brief Disable FRS interrupt
956 * @rmtoll IMR FRSEVTIE LL_UCPD_DisableIT_FRS
957 * @param UCPDx UCPD Instance
958 * @retval None
960 __STATIC_INLINE void LL_UCPD_DisableIT_FRS(UCPD_TypeDef *UCPDx)
962 CLEAR_BIT(UCPDx->IMR, UCPD_IMR_FRSEVTIE);
966 * @brief Disable type c event on CC2
967 * @rmtoll IMR TYPECEVT2IE LL_UCPD_DisableIT_TypeCEventCC2
968 * @param UCPDx UCPD Instance
969 * @retval None
971 __STATIC_INLINE void LL_UCPD_DisableIT_TypeCEventCC2(UCPD_TypeDef *UCPDx)
973 CLEAR_BIT(UCPDx->IMR, UCPD_IMR_TYPECEVT2IE);
977 * @brief Disable type c event on CC1
978 * @rmtoll IMR TYPECEVT1IE LL_UCPD_DisableIT_TypeCEventCC1
979 * @param UCPDx UCPD Instance
980 * @retval None
982 __STATIC_INLINE void LL_UCPD_DisableIT_TypeCEventCC1(UCPD_TypeDef *UCPDx)
984 CLEAR_BIT(UCPDx->IMR, UCPD_IMR_TYPECEVT1IE);
988 * @brief Disable Rx message end interrupt
989 * @rmtoll IMR RXMSGENDIE LL_UCPD_DisableIT_RxMsgEnd
990 * @param UCPDx UCPD Instance
991 * @retval None
993 __STATIC_INLINE void LL_UCPD_DisableIT_RxMsgEnd(UCPD_TypeDef *UCPDx)
995 CLEAR_BIT(UCPDx->IMR, UCPD_IMR_RXMSGENDIE);
999 * @brief Disable Rx overrun interrupt
1000 * @rmtoll IMR RXOVRIE LL_UCPD_DisableIT_RxOvr
1001 * @param UCPDx UCPD Instance
1002 * @retval None
1004 __STATIC_INLINE void LL_UCPD_DisableIT_RxOvr(UCPD_TypeDef *UCPDx)
1006 CLEAR_BIT(UCPDx->IMR, UCPD_IMR_RXOVRIE);
1010 * @brief Disable Rx hard resrt interrupt
1011 * @rmtoll IMR RXHRSTDETIE LL_UCPD_DisableIT_RxHRST
1012 * @param UCPDx UCPD Instance
1013 * @retval None
1015 __STATIC_INLINE void LL_UCPD_DisableIT_RxHRST(UCPD_TypeDef *UCPDx)
1017 CLEAR_BIT(UCPDx->IMR, UCPD_IMR_RXHRSTDETIE);
1021 * @brief Disable Rx orderset interrupt
1022 * @rmtoll IMR RXORDDETIE LL_UCPD_DisableIT_RxOrderSet
1023 * @param UCPDx UCPD Instance
1024 * @retval None
1026 __STATIC_INLINE void LL_UCPD_DisableIT_RxOrderSet(UCPD_TypeDef *UCPDx)
1028 CLEAR_BIT(UCPDx->IMR, UCPD_IMR_RXORDDETIE);
1032 * @brief Disable Rx non empty interrupt
1033 * @rmtoll IMR RXNEIE LL_UCPD_DisableIT_RxNE
1034 * @param UCPDx UCPD Instance
1035 * @retval None
1037 __STATIC_INLINE void LL_UCPD_DisableIT_RxNE(UCPD_TypeDef *UCPDx)
1039 CLEAR_BIT(UCPDx->IMR, UCPD_IMR_RXNEIE);
1043 * @brief Disable TX underrun interrupt
1044 * @rmtoll IMR TXUNDIE LL_UCPD_DisableIT_TxUND
1045 * @param UCPDx UCPD Instance
1046 * @retval None
1048 __STATIC_INLINE void LL_UCPD_DisableIT_TxUND(UCPD_TypeDef *UCPDx)
1050 CLEAR_BIT(UCPDx->IMR, UCPD_IMR_TXUNDIE);
1054 * @brief Disable hard reset sent interrupt
1055 * @rmtoll IMR HRSTSENTIE LL_UCPD_DisableIT_TxHRSTSENT
1056 * @param UCPDx UCPD Instance
1057 * @retval None
1059 __STATIC_INLINE void LL_UCPD_DisableIT_TxHRSTSENT(UCPD_TypeDef *UCPDx)
1061 CLEAR_BIT(UCPDx->IMR, UCPD_IMR_HRSTSENTIE);
1065 * @brief Disable hard reset discard interrupt
1066 * @rmtoll IMR HRSTDISCIE LL_UCPD_DisableIT_TxHRSTDISC
1067 * @param UCPDx UCPD Instance
1068 * @retval None
1070 __STATIC_INLINE void LL_UCPD_DisableIT_TxHRSTDISC(UCPD_TypeDef *UCPDx)
1072 CLEAR_BIT(UCPDx->IMR, UCPD_IMR_HRSTDISCIE);
1076 * @brief Disable Tx message abort interrupt
1077 * @rmtoll IMR TXMSGABTIE LL_UCPD_DisableIT_TxMSGABT
1078 * @param UCPDx UCPD Instance
1079 * @retval None
1081 __STATIC_INLINE void LL_UCPD_DisableIT_TxMSGABT(UCPD_TypeDef *UCPDx)
1083 CLEAR_BIT(UCPDx->IMR, UCPD_IMR_TXMSGABTIE);
1087 * @brief Disable Tx message sent interrupt
1088 * @rmtoll IMR TXMSGSENTIE LL_UCPD_DisableIT_TxMSGSENT
1089 * @param UCPDx UCPD Instance
1090 * @retval None
1092 __STATIC_INLINE void LL_UCPD_DisableIT_TxMSGSENT(UCPD_TypeDef *UCPDx)
1094 CLEAR_BIT(UCPDx->IMR, UCPD_IMR_TXMSGSENTIE);
1098 * @brief Disable Tx message discarded interrupt
1099 * @rmtoll IMR TXMSGDISCIE LL_UCPD_DisableIT_TxMSGDISC
1100 * @param UCPDx UCPD Instance
1101 * @retval None
1103 __STATIC_INLINE void LL_UCPD_DisableIT_TxMSGDISC(UCPD_TypeDef *UCPDx)
1105 CLEAR_BIT(UCPDx->IMR, UCPD_IMR_TXMSGDISCIE);
1109 * @brief Disable Tx data receive interrupt
1110 * @rmtoll IMR TXISIE LL_UCPD_DisableIT_TxIS
1111 * @param UCPDx UCPD Instance
1112 * @retval None
1114 __STATIC_INLINE void LL_UCPD_DisableIT_TxIS(UCPD_TypeDef *UCPDx)
1116 CLEAR_BIT(UCPDx->IMR, UCPD_IMR_TXISIE);
1120 * @brief Check if FRS interrupt enabled
1121 * @rmtoll IMR FRSEVTIE LL_UCPD_DisableIT_FRS
1122 * @param UCPDx UCPD Instance
1123 * @retval State of bit (1 or 0).
1125 __STATIC_INLINE uint32_t LL_UCPD_IsEnableIT_FRS(UCPD_TypeDef const * const UCPDx)
1127 return ((READ_BIT(UCPDx->IMR, UCPD_IMR_FRSEVTIE) == UCPD_IMR_FRSEVTIE) ? 1UL : 0UL);
1131 * @brief Check if type c event on CC2 enabled
1132 * @rmtoll IMR TYPECEVT2IE LL_UCPD_DisableIT_TypeCEventCC2
1133 * @param UCPDx UCPD Instance
1134 * @retval State of bit (1 or 0).
1136 __STATIC_INLINE uint32_t LL_UCPD_IsEnableIT_TypeCEventCC2(UCPD_TypeDef const * const UCPDx)
1138 return ((READ_BIT(UCPDx->IMR, UCPD_IMR_TYPECEVT2IE) == UCPD_IMR_TYPECEVT2IE) ? 1UL : 0UL);
1142 * @brief Check if type c event on CC1 enabled
1143 * @rmtoll IMR2 TYPECEVT1IE LL_UCPD_IsEnableIT_TypeCEventCC1
1144 * @param UCPDx UCPD Instance
1145 * @retval State of bit (1 or 0).
1147 __STATIC_INLINE uint32_t LL_UCPD_IsEnableIT_TypeCEventCC1(UCPD_TypeDef const * const UCPDx)
1149 return ((READ_BIT(UCPDx->IMR, UCPD_IMR_TYPECEVT1IE) == UCPD_IMR_TYPECEVT1IE) ? 1UL : 0UL);
1153 * @brief Check if Rx message end interrupt enabled
1154 * @rmtoll IMR RXMSGENDIE LL_UCPD_IsEnableIT_RxMsgEnd
1155 * @param UCPDx UCPD Instance
1156 * @retval State of bit (1 or 0).
1158 __STATIC_INLINE uint32_t LL_UCPD_IsEnableIT_RxMsgEnd(UCPD_TypeDef const * const UCPDx)
1160 return ((READ_BIT(UCPDx->IMR, UCPD_IMR_RXMSGENDIE) == UCPD_IMR_RXMSGENDIE) ? 1UL : 0UL);
1164 * @brief Check if Rx overrun interrupt enabled
1165 * @rmtoll IMR RXOVRIE LL_UCPD_IsEnableIT_RxOvr
1166 * @param UCPDx UCPD Instance
1167 * @retval State of bit (1 or 0).
1169 __STATIC_INLINE uint32_t LL_UCPD_IsEnableIT_RxOvr(UCPD_TypeDef const * const UCPDx)
1171 return ((READ_BIT(UCPDx->IMR, UCPD_IMR_RXOVRIE) == UCPD_IMR_RXOVRIE) ? 1UL : 0UL);
1175 * @brief Check if Rx hard resrt interrupt enabled
1176 * @rmtoll IMR RXHRSTDETIE LL_UCPD_IsEnableIT_RxHRST
1177 * @param UCPDx UCPD Instance
1178 * @retval State of bit (1 or 0).
1180 __STATIC_INLINE uint32_t LL_UCPD_IsEnableIT_RxHRST(UCPD_TypeDef const * const UCPDx)
1182 return ((READ_BIT(UCPDx->IMR, UCPD_IMR_RXHRSTDETIE) == UCPD_IMR_RXHRSTDETIE) ? 1UL : 0UL);
1186 * @brief Check if Rx orderset interrupt enabled
1187 * @rmtoll IMR RXORDDETIE LL_UCPD_IsEnableIT_RxOrderSet
1188 * @param UCPDx UCPD Instance
1189 * @retval State of bit (1 or 0).
1191 __STATIC_INLINE uint32_t LL_UCPD_IsEnableIT_RxOrderSet(UCPD_TypeDef const * const UCPDx)
1193 return ((READ_BIT(UCPDx->IMR, UCPD_IMR_RXORDDETIE) == UCPD_IMR_RXORDDETIE) ? 1UL : 0UL);
1197 * @brief Check if Rx non empty interrupt enabled
1198 * @rmtoll IMR RXNEIE LL_UCPD_IsEnableIT_RxNE
1199 * @param UCPDx UCPD Instance
1200 * @retval State of bit (1 or 0).
1202 __STATIC_INLINE uint32_t LL_UCPD_IsEnableIT_RxNE(UCPD_TypeDef const * const UCPDx)
1204 return ((READ_BIT(UCPDx->IMR, UCPD_IMR_RXNEIE) == UCPD_IMR_RXNEIE) ? 1UL : 0UL);
1208 * @brief Check if TX underrun interrupt enabled
1209 * @rmtoll IMR TXUNDIE LL_UCPD_IsEnableIT_TxUND
1210 * @param UCPDx UCPD Instance
1211 * @retval State of bit (1 or 0).
1213 __STATIC_INLINE uint32_t LL_UCPD_IsEnableIT_TxUND(UCPD_TypeDef const * const UCPDx)
1215 return ((READ_BIT(UCPDx->IMR, UCPD_IMR_TXUNDIE) == UCPD_IMR_TXUNDIE) ? 1UL : 0UL);
1219 * @brief Check if hard reset sent interrupt enabled
1220 * @rmtoll IMR HRSTSENTIE LL_UCPD_IsEnableIT_TxHRSTSENT
1221 * @param UCPDx UCPD Instance
1222 * @retval State of bit (1 or 0).
1224 __STATIC_INLINE uint32_t LL_UCPD_IsEnableIT_TxHRSTSENT(UCPD_TypeDef const * const UCPDx)
1226 return ((READ_BIT(UCPDx->IMR, UCPD_IMR_HRSTSENTIE) == UCPD_IMR_HRSTSENTIE) ? 1UL : 0UL);
1230 * @brief Check if hard reset discard interrupt enabled
1231 * @rmtoll IMR HRSTDISCIE LL_UCPD_IsEnableIT_TxHRSTDISC
1232 * @param UCPDx UCPD Instance
1233 * @retval State of bit (1 or 0).
1235 __STATIC_INLINE uint32_t LL_UCPD_IsEnableIT_TxHRSTDISC(UCPD_TypeDef const * const UCPDx)
1237 return ((READ_BIT(UCPDx->IMR, UCPD_IMR_HRSTDISCIE) == UCPD_IMR_HRSTDISCIE) ? 1UL : 0UL);
1241 * @brief Check if Tx message abort interrupt enabled
1242 * @rmtoll IMR TXMSGABTIE LL_UCPD_IsEnableIT_TxMSGABT
1243 * @param UCPDx UCPD Instance
1244 * @retval State of bit (1 or 0).
1246 __STATIC_INLINE uint32_t LL_UCPD_IsEnableIT_TxMSGABT(UCPD_TypeDef const * const UCPDx)
1248 return ((READ_BIT(UCPDx->IMR, UCPD_IMR_TXMSGABTIE) == UCPD_IMR_TXMSGABTIE) ? 1UL : 0UL);
1252 * @brief Check if Tx message sent interrupt enabled
1253 * @rmtoll IMR TXMSGSENTIE LL_UCPD_IsEnableIT_TxMSGSENT
1254 * @param UCPDx UCPD Instance
1255 * @retval State of bit (1 or 0).
1257 __STATIC_INLINE uint32_t LL_UCPD_IsEnableIT_TxMSGSENT(UCPD_TypeDef const * const UCPDx)
1259 return ((READ_BIT(UCPDx->IMR, UCPD_IMR_TXMSGSENTIE) == UCPD_IMR_TXMSGSENTIE) ? 1UL : 0UL);
1263 * @brief Check if Tx message discarded interrupt enabled
1264 * @rmtoll IMR TXMSGDISCIE LL_UCPD_IsEnableIT_TxMSGDISC
1265 * @param UCPDx UCPD Instance
1266 * @retval State of bit (1 or 0).
1268 __STATIC_INLINE uint32_t LL_UCPD_IsEnableIT_TxMSGDISC(UCPD_TypeDef const * const UCPDx)
1270 return ((READ_BIT(UCPDx->IMR, UCPD_IMR_TXMSGDISCIE) == UCPD_IMR_TXMSGDISCIE) ? 1UL : 0UL);
1274 * @brief Check if Tx data receive interrupt enabled
1275 * @rmtoll IMR TXISIE LL_UCPD_IsEnableIT_TxIS
1276 * @param UCPDx UCPD Instance
1277 * @retval State of bit (1 or 0).
1279 __STATIC_INLINE uint32_t LL_UCPD_IsEnableIT_TxIS(UCPD_TypeDef const * const UCPDx)
1281 return ((READ_BIT(UCPDx->IMR, UCPD_IMR_TXISIE) == UCPD_IMR_TXISIE) ? 1UL : 0UL);
1285 * @}
1288 /** @defgroup UCPD_LL_EF_IT_Clear Interrupt Clear
1289 * @{
1292 * @brief Clear FRS interrupt
1293 * @rmtoll ICR FRSEVTIE LL_UCPD_ClearFlag_FRS
1294 * @param UCPDx UCPD Instance
1295 * @retval None
1297 __STATIC_INLINE void LL_UCPD_ClearFlag_FRS(UCPD_TypeDef *UCPDx)
1299 SET_BIT(UCPDx->ICR, UCPD_ICR_FRSEVTCF);
1303 * @brief Clear type c event on CC2
1304 * @rmtoll IIMR TYPECEVT2IE LL_UCPD_ClearFlag_TypeCEventCC2
1305 * @param UCPDx UCPD Instance
1306 * @retval None
1308 __STATIC_INLINE void LL_UCPD_ClearFlag_TypeCEventCC2(UCPD_TypeDef *UCPDx)
1310 SET_BIT(UCPDx->ICR, UCPD_ICR_TYPECEVT2CF);
1314 * @brief Clear type c event on CC1
1315 * @rmtoll IIMR TYPECEVT1IE LL_UCPD_ClearFlag_TypeCEventCC1
1316 * @param UCPDx UCPD Instance
1317 * @retval None
1319 __STATIC_INLINE void LL_UCPD_ClearFlag_TypeCEventCC1(UCPD_TypeDef *UCPDx)
1321 SET_BIT(UCPDx->ICR, UCPD_ICR_TYPECEVT1CF);
1325 * @brief Clear Rx message end interrupt
1326 * @rmtoll ICR RXMSGENDIE LL_UCPD_ClearFlag_RxMsgEnd
1327 * @param UCPDx UCPD Instance
1328 * @retval None
1330 __STATIC_INLINE void LL_UCPD_ClearFlag_RxMsgEnd(UCPD_TypeDef *UCPDx)
1332 SET_BIT(UCPDx->ICR, UCPD_ICR_RXMSGENDCF);
1336 * @brief Clear Rx overrun interrupt
1337 * @rmtoll ICR RXOVRIE LL_UCPD_ClearFlag_RxOvr
1338 * @param UCPDx UCPD Instance
1339 * @retval None
1341 __STATIC_INLINE void LL_UCPD_ClearFlag_RxOvr(UCPD_TypeDef *UCPDx)
1343 SET_BIT(UCPDx->ICR, UCPD_ICR_RXOVRCF);
1347 * @brief Clear Rx hard resrt interrupt
1348 * @rmtoll ICR RXHRSTDETIE LL_UCPD_ClearFlag_RxHRST
1349 * @param UCPDx UCPD Instance
1350 * @retval None
1352 __STATIC_INLINE void LL_UCPD_ClearFlag_RxHRST(UCPD_TypeDef *UCPDx)
1354 SET_BIT(UCPDx->ICR, UCPD_ICR_RXHRSTDETCF);
1358 * @brief Clear Rx orderset interrupt
1359 * @rmtoll ICR RXORDDETIE LL_UCPD_ClearFlag_RxOrderSet
1360 * @param UCPDx UCPD Instance
1361 * @retval None
1363 __STATIC_INLINE void LL_UCPD_ClearFlag_RxOrderSet(UCPD_TypeDef *UCPDx)
1365 SET_BIT(UCPDx->ICR, UCPD_ICR_RXORDDETCF);
1369 * @brief Clear TX underrun interrupt
1370 * @rmtoll ICR TXUNDIE LL_UCPD_ClearFlag_TxUND
1371 * @param UCPDx UCPD Instance
1372 * @retval None
1374 __STATIC_INLINE void LL_UCPD_ClearFlag_TxUND(UCPD_TypeDef *UCPDx)
1376 SET_BIT(UCPDx->ICR, UCPD_ICR_TXUNDCF);
1380 * @brief Clear hard reset sent interrupt
1381 * @rmtoll ICR HRSTSENTIE LL_UCPD_ClearFlag_TxHRSTSENT
1382 * @param UCPDx UCPD Instance
1383 * @retval None
1385 __STATIC_INLINE void LL_UCPD_ClearFlag_TxHRSTSENT(UCPD_TypeDef *UCPDx)
1387 SET_BIT(UCPDx->ICR, UCPD_ICR_HRSTSENTCF);
1391 * @brief Clear hard reset discard interrupt
1392 * @rmtoll ICR HRSTDISCIE LL_UCPD_ClearFlag_TxHRSTDISC
1393 * @param UCPDx UCPD Instance
1394 * @retval None
1396 __STATIC_INLINE void LL_UCPD_ClearFlag_TxHRSTDISC(UCPD_TypeDef *UCPDx)
1398 SET_BIT(UCPDx->ICR, UCPD_ICR_HRSTDISCCF);
1402 * @brief Clear Tx message abort interrupt
1403 * @rmtoll ICR TXMSGABTIE LL_UCPD_ClearFlag_TxMSGABT
1404 * @param UCPDx UCPD Instance
1405 * @retval None
1407 __STATIC_INLINE void LL_UCPD_ClearFlag_TxMSGABT(UCPD_TypeDef *UCPDx)
1409 SET_BIT(UCPDx->ICR, UCPD_ICR_TXMSGABTCF);
1413 * @brief Clear Tx message sent interrupt
1414 * @rmtoll ICR TXMSGSENTIE LL_UCPD_ClearFlag_TxMSGSENT
1415 * @param UCPDx UCPD Instance
1416 * @retval None
1418 __STATIC_INLINE void LL_UCPD_ClearFlag_TxMSGSENT(UCPD_TypeDef *UCPDx)
1420 SET_BIT(UCPDx->ICR, UCPD_ICR_TXMSGSENTCF);
1424 * @brief Clear Tx message discarded interrupt
1425 * @rmtoll ICR TXMSGDISCIE LL_UCPD_ClearFlag_TxMSGDISC
1426 * @param UCPDx UCPD Instance
1427 * @retval None
1429 __STATIC_INLINE void LL_UCPD_ClearFlag_TxMSGDISC(UCPD_TypeDef *UCPDx)
1431 SET_BIT(UCPDx->ICR, UCPD_ICR_TXMSGDISCCF);
1435 * @}
1438 /** @defgroup UCPD_LL_EF_FLAG_Management FLAG Management
1439 * @{
1443 * @brief Check if FRS interrupt
1444 * @rmtoll SR FRSEVT LL_UCPD_IsActiveFlag_FRS
1445 * @param UCPDx UCPD Instance
1446 * @retval None
1448 __STATIC_INLINE uint32_t LL_UCPD_IsActiveFlag_FRS(UCPD_TypeDef const * const UCPDx)
1450 return ((READ_BIT(UCPDx->SR, UCPD_SR_FRSEVT) == UCPD_SR_FRSEVT) ? 1UL : 0UL);
1454 * @brief Check if type c event on CC2
1455 * @rmtoll SR TYPECEVT2 LL_UCPD_IsActiveFlag_TypeCEventCC2
1456 * @param UCPDx UCPD Instance
1457 * @retval None
1459 __STATIC_INLINE uint32_t LL_UCPD_IsActiveFlag_TypeCEventCC2(UCPD_TypeDef const * const UCPDx)
1461 return ((READ_BIT(UCPDx->SR, UCPD_SR_TYPECEVT2) == UCPD_SR_TYPECEVT2) ? 1UL : 0UL);
1465 * @brief Check if type c event on CC1
1466 * @rmtoll SR TYPECEVT1 LL_UCPD_IsActiveFlag_TypeCEventCC1
1467 * @param UCPDx UCPD Instance
1468 * @retval None
1470 __STATIC_INLINE uint32_t LL_UCPD_IsActiveFlag_TypeCEventCC1(UCPD_TypeDef const * const UCPDx)
1472 return ((READ_BIT(UCPDx->SR, UCPD_SR_TYPECEVT1) == UCPD_SR_TYPECEVT1) ? 1UL : 0UL);
1476 * @brief Check if Rx message end interrupt
1477 * @rmtoll SR RXMSGEND LL_UCPD_IsActiveFlag_RxMsgEnd
1478 * @param UCPDx UCPD Instance
1479 * @retval None
1481 __STATIC_INLINE uint32_t LL_UCPD_IsActiveFlag_RxMsgEnd(UCPD_TypeDef const * const UCPDx)
1483 return ((READ_BIT(UCPDx->SR, UCPD_SR_RXMSGEND) == UCPD_SR_RXMSGEND) ? 1UL : 0UL);
1487 * @brief Check if Rx overrun interrupt
1488 * @rmtoll SR RXOVR LL_UCPD_IsActiveFlag_RxOvr
1489 * @param UCPDx UCPD Instance
1490 * @retval None
1492 __STATIC_INLINE uint32_t LL_UCPD_IsActiveFlag_RxOvr(UCPD_TypeDef const * const UCPDx)
1494 return ((READ_BIT(UCPDx->SR, UCPD_SR_RXOVR) == UCPD_SR_RXOVR) ? 1UL : 0UL);
1498 * @brief Check if Rx hard resrt interrupt
1499 * @rmtoll SR RXHRSTDET LL_UCPD_IsActiveFlag_RxHRST
1500 * @param UCPDx UCPD Instance
1501 * @retval None
1503 __STATIC_INLINE uint32_t LL_UCPD_IsActiveFlag_RxHRST(UCPD_TypeDef const * const UCPDx)
1505 return ((READ_BIT(UCPDx->SR, UCPD_SR_RXHRSTDET) == UCPD_SR_RXHRSTDET) ? 1UL : 0UL);
1509 * @brief Check if Rx orderset interrupt
1510 * @rmtoll SR RXORDDET LL_UCPD_IsActiveFlag_RxOrderSet
1511 * @param UCPDx UCPD Instance
1512 * @retval State of bit (1 or 0).
1514 __STATIC_INLINE uint32_t LL_UCPD_IsActiveFlag_RxOrderSet(UCPD_TypeDef const * const UCPDx)
1516 return ((READ_BIT(UCPDx->SR, UCPD_SR_RXORDDET) == UCPD_SR_RXORDDET) ? 1UL : 0UL);
1520 * @brief Check if Rx non empty interrupt
1521 * @rmtoll SR RXNE LL_UCPD_IsActiveFlag_RxNE
1522 * @param UCPDx UCPD Instance
1523 * @retval State of bit (1 or 0).
1525 __STATIC_INLINE uint32_t LL_UCPD_IsActiveFlag_RxNE(UCPD_TypeDef const * const UCPDx)
1527 return ((READ_BIT(UCPDx->SR, UCPD_SR_RXNE) == UCPD_SR_RXNE) ? 1UL : 0UL);
1531 * @brief Check if TX underrun interrupt
1532 * @rmtoll SR TXUND LL_UCPD_IsActiveFlag_TxUND
1533 * @param UCPDx UCPD Instance
1534 * @retval State of bit (1 or 0).
1536 __STATIC_INLINE uint32_t LL_UCPD_IsActiveFlag_TxUND(UCPD_TypeDef const * const UCPDx)
1538 return ((READ_BIT(UCPDx->SR, UCPD_SR_TXUND) == UCPD_SR_TXUND) ? 1UL : 0UL);
1542 * @brief Check if hard reset sent interrupt
1543 * @rmtoll SR HRSTSENT LL_UCPD_IsActiveFlag_TxHRSTSENT
1544 * @param UCPDx UCPD Instance
1545 * @retval State of bit (1 or 0).
1547 __STATIC_INLINE uint32_t LL_UCPD_IsActiveFlag_TxHRSTSENT(UCPD_TypeDef const * const UCPDx)
1549 return ((READ_BIT(UCPDx->SR, UCPD_SR_HRSTSENT) == UCPD_SR_HRSTSENT) ? 1UL : 0UL);
1553 * @brief Check if hard reset discard interrupt
1554 * @rmtoll SR HRSTDISC LL_UCPD_IsActiveFlag_TxHRSTDISC
1555 * @param UCPDx UCPD Instance
1556 * @retval State of bit (1 or 0).
1558 __STATIC_INLINE uint32_t LL_UCPD_IsActiveFlag_TxHRSTDISC(UCPD_TypeDef const * const UCPDx)
1560 return ((READ_BIT(UCPDx->SR, UCPD_SR_HRSTDISC) == UCPD_SR_HRSTDISC) ? 1UL : 0UL);
1564 * @brief Check if Tx message abort interrupt
1565 * @rmtoll SR TXMSGABT LL_UCPD_IsActiveFlag_TxMSGABT
1566 * @param UCPDx UCPD Instance
1567 * @retval State of bit (1 or 0).
1569 __STATIC_INLINE uint32_t LL_UCPD_IsActiveFlag_TxMSGABT(UCPD_TypeDef const * const UCPDx)
1571 return ((READ_BIT(UCPDx->SR, UCPD_SR_TXMSGABT) == UCPD_SR_TXMSGABT) ? 1UL : 0UL);
1575 * @brief Check if Tx message sent interrupt
1576 * @rmtoll SR TXMSGSENT LL_UCPD_IsActiveFlag_TxMSGSENT
1577 * @param UCPDx UCPD Instance
1578 * @retval State of bit (1 or 0).
1580 __STATIC_INLINE uint32_t LL_UCPD_IsActiveFlag_TxMSGSENT(UCPD_TypeDef const * const UCPDx)
1582 return ((READ_BIT(UCPDx->SR, UCPD_SR_TXMSGSENT) == UCPD_SR_TXMSGSENT) ? 1UL : 0UL);
1586 * @brief Check if Tx message discarded interrupt
1587 * @rmtoll SR TXMSGDISC LL_UCPD_IsActiveFlag_TxMSGDISC
1588 * @param UCPDx UCPD Instance
1589 * @retval State of bit (1 or 0).
1591 __STATIC_INLINE uint32_t LL_UCPD_IsActiveFlag_TxMSGDISC(UCPD_TypeDef const * const UCPDx)
1593 return ((READ_BIT(UCPDx->SR, UCPD_SR_TXMSGDISC) == UCPD_SR_TXMSGDISC) ? 1UL : 0UL);
1597 * @brief Check if Tx data receive interrupt
1598 * @rmtoll SR TXIS LL_UCPD_IsActiveFlag_TxIS
1599 * @param UCPDx UCPD Instance
1600 * @retval State of bit (1 or 0).
1602 __STATIC_INLINE uint32_t LL_UCPD_IsActiveFlag_TxIS(UCPD_TypeDef const * const UCPDx)
1604 return ((READ_BIT(UCPDx->SR, UCPD_SR_TXIS) == UCPD_SR_TXIS) ? 1UL : 0UL);
1608 * @brief return the vstate value for CC2
1609 * @rmtoll SR TXIS LL_UCPD_GetTypeCVstateCC2
1610 * @param UCPDx UCPD Instance
1611 * @retval val
1613 __STATIC_INLINE uint32_t LL_UCPD_GetTypeCVstateCC2(UCPD_TypeDef const * const UCPDx)
1615 return UCPDx->SR & UCPD_SR_TYPEC_VSTATE_CC2;
1619 * @brief return the vstate value for CC1
1620 * @rmtoll SR TXIS LL_UCPD_GetTypeCVstateCC1
1621 * @param UCPDx UCPD Instance
1622 * @retval val
1624 __STATIC_INLINE uint32_t LL_UCPD_GetTypeCVstateCC1(UCPD_TypeDef const * const UCPDx)
1626 return UCPDx->SR & UCPD_SR_TYPEC_VSTATE_CC1;
1630 * @}
1634 /** @defgroup UCPD_LL_EF_DMA_Management DMA Management
1635 * @{
1639 * @brief Rx DMA Enable
1640 * @rmtoll CFG1 RXDMAEN LL_UCPD_RxDMAEnable
1641 * @param UCPDx UCPD Instance
1642 * @retval None
1644 __STATIC_INLINE void LL_UCPD_RxDMAEnable(UCPD_TypeDef *UCPDx)
1646 SET_BIT(UCPDx->CFG1, UCPD_CFG1_RXDMAEN);
1650 * @brief Rx DMA Disable
1651 * @rmtoll CFG1 RXDMAEN LL_UCPD_RxDMADisable
1652 * @param UCPDx UCPD Instance
1653 * @retval None
1655 __STATIC_INLINE void LL_UCPD_RxDMADisable(UCPD_TypeDef *UCPDx)
1657 CLEAR_BIT(UCPDx->CFG1, UCPD_CFG1_RXDMAEN);
1661 * @brief Tx DMA Enable
1662 * @rmtoll CFG1 TXDMAEN LL_UCPD_TxDMAEnable
1663 * @param UCPDx UCPD Instance
1664 * @retval None
1666 __STATIC_INLINE void LL_UCPD_TxDMAEnable(UCPD_TypeDef *UCPDx)
1668 SET_BIT(UCPDx->CFG1, UCPD_CFG1_TXDMAEN);
1672 * @brief Tx DMA Disable
1673 * @rmtoll CFG1 TXDMAEN LL_UCPD_TxDMADisable
1674 * @param UCPDx UCPD Instance
1675 * @retval None
1677 __STATIC_INLINE void LL_UCPD_TxDMADisable(UCPD_TypeDef *UCPDx)
1679 CLEAR_BIT(UCPDx->CFG1, UCPD_CFG1_TXDMAEN);
1683 * @brief Check if DMA Tx is enabled
1684 * @rmtoll CR2 TXDMAEN LL_UCPD_IsEnabledTxDMA
1685 * @param UCPDx UCPD Instance
1686 * @retval State of bit (1 or 0).
1688 __STATIC_INLINE uint32_t LL_UCPD_IsEnabledTxDMA(UCPD_TypeDef const * const UCPDx)
1690 return ((READ_BIT(UCPDx->CFG1, UCPD_CFG1_TXDMAEN) == (UCPD_CFG1_TXDMAEN)) ? 1UL : 0UL);
1694 * @brief Check if DMA Rx is enabled
1695 * @rmtoll CR2 RXDMAEN LL_UCPD_IsEnabledRxDMA
1696 * @param UCPDx UCPD Instance
1697 * @retval State of bit (1 or 0).
1699 __STATIC_INLINE uint32_t LL_UCPD_IsEnabledRxDMA(UCPD_TypeDef const * const UCPDx)
1701 return ((READ_BIT(UCPDx->CFG1, UCPD_CFG1_RXDMAEN) == (UCPD_CFG1_RXDMAEN)) ? 1UL : 0UL);
1705 * @}
1708 /** @defgroup UCPD_LL_EF_DATA_Management DATA Management
1709 * @{
1713 * @brief write the orderset for Tx message
1714 * @rmtoll TX_ORDSET TXORDSET LL_UCPD_WriteTxOrderSet
1715 * @param UCPDx UCPD Instance
1716 * @param TxOrderSet one of the following value
1717 * @arg @ref LL_UCPD_ORDERED_SET_SOP
1718 * @arg @ref LL_UCPD_ORDERED_SET_SOP1
1719 * @arg @ref LL_UCPD_ORDERED_SET_SOP2
1720 * @arg @ref LL_UCPD_ORDERED_SET_HARD_RESET
1721 * @arg @ref LL_UCPD_ORDERED_SET_CABLE_RESET
1722 * @arg @ref LL_UCPD_ORDERED_SET_SOP1_DEBUG
1723 * @arg @ref LL_UCPD_ORDERED_SET_SOP2_DEBUG
1724 * @retval None
1726 __STATIC_INLINE void LL_UCPD_WriteTxOrderSet(UCPD_TypeDef *UCPDx, uint32_t TxOrderSet)
1728 WRITE_REG(UCPDx->TX_ORDSET, TxOrderSet);
1732 * @brief write the Tx paysize
1733 * @rmtoll TX_PAYSZ TXPAYSZ LL_UCPD_WriteTxPaySize
1734 * @param UCPDx UCPD Instance
1735 * @param TxPaySize
1736 * @retval None.
1738 __STATIC_INLINE void LL_UCPD_WriteTxPaySize(UCPD_TypeDef *UCPDx, uint32_t TxPaySize)
1740 WRITE_REG(UCPDx->TX_PAYSZ, TxPaySize);
1744 * @brief Write data
1745 * @rmtoll TXDR DR LL_UCPD_WriteData
1746 * @param UCPDx UCPD Instance
1747 * @param Data Value between Min_Data=0x00 and Max_Data=0xFF
1748 * @retval None.
1750 __STATIC_INLINE void LL_UCPD_WriteData(UCPD_TypeDef *UCPDx, uint8_t Data)
1752 WRITE_REG(UCPDx->TXDR, Data);
1756 * @brief read RX the orderset
1757 * @rmtoll RX_ORDSET RXORDSET LL_UCPD_ReadRxOrderSet
1758 * @param UCPDx UCPD Instance
1759 * @retval RxOrderSet one of the following value
1760 * @arg @ref LL_UCPD_RXORDSET_SOP
1761 * @arg @ref LL_UCPD_RXORDSET_SOP1
1762 * @arg @ref LL_UCPD_RXORDSET_SOP2
1763 * @arg @ref LL_UCPD_RXORDSET_SOP1_DEBUG
1764 * @arg @ref LL_UCPD_RXORDSET_SOP2_DEBUG
1765 * @arg @ref LL_UCPD_RXORDSET_CABLE_RESET
1766 * @arg @ref LL_UCPD_RXORDSET_SOPEXT1
1767 * @arg @ref LL_UCPD_RXORDSET_SOPEXT2
1769 __STATIC_INLINE uint32_t LL_UCPD_ReadRxOrderSet(UCPD_TypeDef const * const UCPDx)
1771 return READ_BIT(UCPDx->RX_ORDSET, UCPD_RX_ORDSET_RXORDSET);
1775 * @brief Read the Rx paysize
1776 * @rmtoll TX_PAYSZ TXPAYSZ LL_UCPD_ReadRxPaySize
1777 * @param UCPDx UCPD Instance
1778 * @retval RXPaysize.
1780 __STATIC_INLINE uint32_t LL_UCPD_ReadRxPaySize(UCPD_TypeDef const * const UCPDx)
1782 return READ_BIT(UCPDx->TX_PAYSZ, UCPD_RX_PAYSZ_RXPAYSZ);
1786 * @brief Read data
1787 * @rmtoll TXDR RXDATA LL_UCPD_ReadData
1788 * @param UCPDx UCPD Instance
1789 * @retval RxData Value between Min_Data=0x00 and Max_Data=0xFF
1791 __STATIC_INLINE uint32_t LL_UCPD_ReadData(UCPD_TypeDef const * const UCPDx)
1793 return READ_REG(UCPDx->RXDR);
1797 * @brief Set Rx OrderSet Ext1
1798 * @rmtoll RX_ORDEXT1 RXSOPX1 LL_UCPD_SetRxOrdExt1
1799 * @param UCPDx UCPD Instance
1800 * @param SOPExt Value between Min_Data=0x00000 and Max_Data=0xFFFFF
1801 * @retval None
1803 __STATIC_INLINE void LL_UCPD_SetRxOrdExt1(UCPD_TypeDef *UCPDx, uint32_t SOPExt)
1805 WRITE_REG(UCPDx->RX_ORDEXT1, SOPExt);
1809 * @brief Set Rx OrderSet Ext2
1810 * @rmtoll RX_ORDEXT2 RXSOPX2 LL_UCPD_SetRxOrdExt2
1811 * @param UCPDx UCPD Instance
1812 * @param SOPExt Value between Min_Data=0x00000 and Max_Data=0xFFFFF
1813 * @retval None
1815 __STATIC_INLINE void LL_UCPD_SetRxOrdExt2(UCPD_TypeDef *UCPDx, uint32_t SOPExt)
1817 WRITE_REG(UCPDx->RX_ORDEXT2, SOPExt);
1821 * @}
1824 #if defined(USE_FULL_LL_DRIVER)
1825 /** @defgroup UCPD_LL_EF_Init Initialization and de-initialization functions
1826 * @{
1829 ErrorStatus LL_UCPD_DeInit(UCPD_TypeDef *UCPDx);
1830 ErrorStatus LL_UCPD_Init(UCPD_TypeDef *UCPDx, LL_UCPD_InitTypeDef *UCPD_InitStruct);
1831 void LL_UCPD_StructInit(LL_UCPD_InitTypeDef *UCPD_InitStruct);
1834 * @}
1836 #endif /* USE_FULL_LL_DRIVER */
1839 * @}
1842 #endif /* defined (UCPD1) */
1845 * @}
1849 * @}
1852 #ifdef __cplusplus
1854 #endif
1856 #endif /* STM32G4xx_LL_UCPD_H */
1858 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/