Skip to content

Commit 650f238

Browse files
committed
renesas-ra/main: Add support for USB LDO Regulator.
Signed-off-by: Andrew Leech <[email protected]>
1 parent 78ff170 commit 650f238

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

ports/renesas-ra/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,9 @@ int main(void) {
366366

367367
#if MICROPY_HW_ENABLE_USBDEV
368368
mp_usbd_init();
369+
#if USB_CFG_LDO_REGULATOR == USB_CFG_ENABLE
370+
mp_hal_usb_set_vdcen();
371+
#endif
369372
#endif
370373

371374
if (boot_res == BOARDCTRL_GOTO_SOFT_RESET_EXIT) {

ports/renesas-ra/mphalport.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ static inline void mp_hal_wake_main_task_from_isr(void) {
6464
// Defined for tinyusb support, nothing needs to be done here.
6565
}
6666

67+
#if USB_CFG_LDO_REGULATOR == USB_CFG_ENABLE
68+
#include "r_ioport.h"
69+
70+
static inline void mp_hal_usb_set_vdcen(void) {
71+
// Set VDCEN bit to enable USB LDO regulator
72+
R_USB_FS0->USBMC = (R_USB_FS0_USBMC_VDCEN_Msk);
73+
}
74+
#endif
75+
6776
// timing functions
6877

6978
#include "irq.h"

0 commit comments

Comments
 (0)