File tree 5 files changed +21
-2
lines changed
STM32L5xx/L552Z(C-E)TxQ_L562ZETxQ
5 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,13 @@ PCD_HandleTypeDef g_hpcd;
51
51
void HAL_PCD_MspInit (PCD_HandleTypeDef * hpcd )
52
52
{
53
53
const PinMap * map = NULL ;
54
+
55
+ #if defined(PIN_UCPD_TCPP )
56
+ /* Set TCPP default state: Type-C legacy */
57
+ pinMode (PIN_UCPD_TCPP , OUTPUT_OPEN_DRAIN );
58
+ digitalWriteFast (digitalPinToPinName (PIN_UCPD_TCPP ), LOW );
59
+ #endif
60
+
54
61
#if defined(PWR_CR2_USV ) || defined(PWR_SVMCR_USV )
55
62
/* Enable VDDUSB on Pwrctrl CR2 register*/
56
63
HAL_PWREx_EnableVddUSB ();
Original file line number Diff line number Diff line change @@ -70,6 +70,9 @@ extern "C" {
70
70
#elif defined(STM32G0xx )
71
71
#define USB_IRQn USB_UCPD1_2_IRQn
72
72
#define USB_IRQHandler USB_UCPD1_2_IRQHandler
73
+ #elif defined(STM32U5xx )
74
+ #define USB_IRQn OTG_FS_IRQn
75
+ #define USB_IRQHandler OTG_FS_IRQHandler
73
76
#elif defined(STM32L5xx )
74
77
#define USB_IRQn USB_FS_IRQn
75
78
#define USB_IRQHandler USB_FS_IRQHandler
Original file line number Diff line number Diff line change 39
39
#define PD12 19
40
40
#define PA4 PIN_A9
41
41
#define PB4 21
42
- #define PB5 22
42
+ #define PB5 22 // UCPD TCPP
43
43
#define PB3 23
44
44
// 24 is PA4 (20)
45
45
// 25 is PB4 (21)
233
233
#define PIN_SERIAL_TX PG7
234
234
#endif
235
235
236
+ // Pin UCPD to configure TCPP in default Type-C legacy state (UCPD_DBn for TCPP01)
237
+ #define PIN_UCPD_TCPP PB5
238
+
236
239
// Extra HAL modules
237
240
#if !defined(HAL_DAC_MODULE_DISABLED )
238
241
#define HAL_DAC_MODULE_ENABLED
Original file line number Diff line number Diff line change 301
301
#define PIN_SERIAL_TX PA9
302
302
#endif
303
303
304
+ // Pin UCPD to configure TCPP in default Type-C legacy state (UCPD_PWR for TCPP03)
305
+ #define PIN_UCPD_TCPP PB5
306
+
304
307
// Extra HAL modules
305
308
#if !defined(HAL_DAC_MODULE_DISABLED )
306
309
#define HAL_DAC_MODULE_ENABLED
Original file line number Diff line number Diff line change 37
37
#define PD12 PIN_A15
38
38
#define PA4 PIN_A16 // SB35 ON
39
39
#define PB4 21 // SB36 ON
40
- #define PB5 22
40
+ #define PB5 22 // UCPD TCPP
41
41
#define PB3 23
42
42
// 24 is PA4 (20) as default SB38 ON
43
43
// 25 is PB4 (21) as default SB43 ON
236
236
#define PIN_SERIAL_TX PA9
237
237
#endif
238
238
239
+ // Pin UCPD to configure TCPP in default Type-C legacy state (UCPD_DBn for TCPP01)
240
+ #define PIN_UCPD_TCPP PB5
241
+
239
242
// Extra HAL modules
240
243
#if !defined(HAL_DAC_MODULE_DISABLED )
241
244
#define HAL_DAC_MODULE_ENABLED
You can’t perform that action at this time.
0 commit comments