da1469x_dk_xxx: Add VBUS handling

Two BSPs with DA146xx MCUs are now adopted to
VBUS handling changed introduced to dcd_da146xx driver.

da14695_dk_usb as bus-powered devices informs driver that
VBUS is present at startup.

da1469x-dk-pro has VBUS change interrupt handler that
informs driver about VBUS changes.
This commit is contained in:
Jerzy Kasenberg
2021-09-17 11:48:38 +02:00
parent 6d8677a78a
commit a71ac71d7f
2 changed files with 33 additions and 2 deletions
+8 -1
View File
@@ -53,6 +53,9 @@ void UnhandledIRQ(void)
while(1);
}
// DA146xx driver function that must be called whenever VBUS changes.
extern void tusb_vbus_changed(bool present);
void board_init(void)
{
// LED
@@ -70,7 +73,10 @@ void board_init(void)
// 1ms tick timer
SysTick_Config(SystemCoreClock / 1000);
NVIC_SetPriority(USB_IRQn, 2);
#if TUSB_OPT_DEVICE_ENABLED
// This board is USB powered there is no need to monitor
// VBUS line. Notify driver that VBUS is present.
tusb_vbus_changed(true);
/* Setup USB IRQ */
NVIC_SetPriority(USB_IRQn, 2);
@@ -81,6 +87,7 @@ void board_init(void)
mcu_gpio_set_pin_function(14, MCU_GPIO_MODE_INPUT, MCU_GPIO_FUNC_USB);
mcu_gpio_set_pin_function(15, MCU_GPIO_MODE_INPUT, MCU_GPIO_FUNC_USB);
#endif
}
//--------------------------------------------------------------------+