File tree Expand file tree Collapse file tree 5 files changed +21
-2
lines changed
STM32L5xx/L552Z(C-E)TxQ_L562ZETxQ Expand file tree Collapse file tree 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;
5151void HAL_PCD_MspInit (PCD_HandleTypeDef * hpcd )
5252{
5353 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+
5461#if defined(PWR_CR2_USV ) || defined(PWR_SVMCR_USV )
5562 /* Enable VDDUSB on Pwrctrl CR2 register*/
5663 HAL_PWREx_EnableVddUSB ();
Original file line number Diff line number Diff line change @@ -70,6 +70,9 @@ extern "C" {
7070#elif defined(STM32G0xx )
7171#define USB_IRQn USB_UCPD1_2_IRQn
7272#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
7376#elif defined(STM32L5xx )
7477#define USB_IRQn USB_FS_IRQn
7578#define USB_IRQHandler USB_FS_IRQHandler
Original file line number Diff line number Diff line change 3939#define PD12 19
4040#define PA4 PIN_A9
4141#define PB4 21
42- #define PB5 22
42+ #define PB5 22 // UCPD TCPP
4343#define PB3 23
4444// 24 is PA4 (20)
4545// 25 is PB4 (21)
233233 #define PIN_SERIAL_TX PG7
234234#endif
235235
236+ // Pin UCPD to configure TCPP in default Type-C legacy state (UCPD_DBn for TCPP01)
237+ #define PIN_UCPD_TCPP PB5
238+
236239// Extra HAL modules
237240#if !defined(HAL_DAC_MODULE_DISABLED )
238241 #define HAL_DAC_MODULE_ENABLED
Original file line number Diff line number Diff line change 301301 #define PIN_SERIAL_TX PA9
302302#endif
303303
304+ // Pin UCPD to configure TCPP in default Type-C legacy state (UCPD_PWR for TCPP03)
305+ #define PIN_UCPD_TCPP PB5
306+
304307// Extra HAL modules
305308#if !defined(HAL_DAC_MODULE_DISABLED )
306309 #define HAL_DAC_MODULE_ENABLED
Original file line number Diff line number Diff line change 3737#define PD12 PIN_A15
3838#define PA4 PIN_A16 // SB35 ON
3939#define PB4 21 // SB36 ON
40- #define PB5 22
40+ #define PB5 22 // UCPD TCPP
4141#define PB3 23
4242// 24 is PA4 (20) as default SB38 ON
4343// 25 is PB4 (21) as default SB43 ON
236236 #define PIN_SERIAL_TX PA9
237237#endif
238238
239+ // Pin UCPD to configure TCPP in default Type-C legacy state (UCPD_DBn for TCPP01)
240+ #define PIN_UCPD_TCPP PB5
241+
239242// Extra HAL modules
240243#if !defined(HAL_DAC_MODULE_DISABLED )
241244 #define HAL_DAC_MODULE_ENABLED
You can’t perform that action at this time.
0 commit comments