diff options
| author | hathach <[email protected]> | 2013-03-12 12:06:40 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-03-12 12:06:40 +0700 |
| commit | 453ea3986563c11c74ab3bf9d773a90458635ede (patch) | |
| tree | 458c107257cb73cfcdb5b77aa2ef7131e19dbdd8 /tinyusb/hal | |
| parent | 38ff7123b4f43aa85ce1848a0cb99bb73303cadd (diff) | |
add project file for keil
fix binary.h compiler specific
add hal_init code to reset & set usbmode --> able to get USB ISR
remove const qualifier from return function of
- get_operational_register
- get_period_frame_list
- get_async_head
- get_period_head
- get_control_qhd
add stub for
- hcd_port_connect_status
- hcd_port_speed
Diffstat (limited to 'tinyusb/hal')
| -rw-r--r-- | tinyusb/hal/hal_lpc43xx.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tinyusb/hal/hal_lpc43xx.c b/tinyusb/hal/hal_lpc43xx.c index 770ffd4ce..f86d5ec2a 100644 --- a/tinyusb/hal/hal_lpc43xx.c +++ b/tinyusb/hal/hal_lpc43xx.c @@ -42,6 +42,16 @@ #include "lpc43xx_cgu.h" +enum { + LPC43XX_USBMODE_DEVICE = 2, + LPC43XX_USBMODE_HOST = 3 +}; + +enum { + LPC43XX_USBMODE_VBUS_LOW = 0, + LPC43XX_USBMODE_VBUS_HIGH = 1 +}; + tusb_error_t hal_init() { /* Set up USB0 clock */ @@ -51,6 +61,12 @@ tusb_error_t hal_init() CGU_EnableEntity(CGU_CLKSRC_PLL0, ENABLE); /* Enable PLL after all setting is done */ LPC_CREG->CREG0 &= ~(1<<5); /* Turn on the phy */ + //------------- reset controller & set role -------------// + hcd_controller_reset(0); + LPC_USB0->USBMODE_H = LPC43XX_USBMODE_HOST | (LPC43XX_USBMODE_VBUS_HIGH << 5); + + hal_interrupt_enable(); + return TUSB_ERROR_NONE; } |
