rename hal_init() to hal_usb_init()

This commit is contained in:
hathach 2018-03-02 21:41:38 +07:00
parent bc9274591f
commit 381caaff1c
9 changed files with 8 additions and 6 deletions

View File

@ -53,7 +53,7 @@ void hal_usb_int_disable(uint8_t coreid)
NVIC_DisableIRQ(USB_IRQn); NVIC_DisableIRQ(USB_IRQn);
} }
bool hal_init(void) bool hal_usb_init(void)
{ {
// TODO remove magic number // TODO remove magic number
/* Enable AHB clock to the USB block and USB RAM. */ /* Enable AHB clock to the USB block and USB RAM. */

View File

@ -53,7 +53,7 @@ void hal_usb_int_disable(uint8_t coreid)
NVIC_DisableIRQ(USB_IRQ_IRQn); NVIC_DisableIRQ(USB_IRQ_IRQn);
} }
bool hal_init(void) bool hal_usb_init(void)
{ {
// TODO remove magic number // TODO remove magic number
LPC_SYSCON->SYSAHBCLKCTRL |= ((0x1<<14) | (0x1<<27)); /* Enable AHB clock to the USB block and USB RAM. */ LPC_SYSCON->SYSAHBCLKCTRL |= ((0x1<<14) | (0x1<<27)); /* Enable AHB clock to the USB block and USB RAM. */

View File

@ -56,7 +56,7 @@ void hal_usb_int_disable(uint8_t coreid)
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
// IMPLEMENTATION // IMPLEMENTATION
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
bool hal_init(void) bool hal_usb_init(void)
{ {
enum { enum {
USBCLK_DEVCIE = 0x12, // AHB + Device USBCLK_DEVCIE = 0x12, // AHB + Device

View File

@ -79,7 +79,7 @@ static void hal_controller_reset(uint8_t coreid)
// return timeout_expired(&timeout) ? TUSB_ERROR_OSAL_TIMEOUT : TUSB_ERROR_NONE; // return timeout_expired(&timeout) ? TUSB_ERROR_OSAL_TIMEOUT : TUSB_ERROR_NONE;
} }
bool hal_init(void) bool hal_usb_init(void)
{ {
LPC_CREG->CREG0 &= ~(1<<5); /* Turn on the phy */ LPC_CREG->CREG0 &= ~(1<<5); /* Turn on the phy */

View File

@ -73,6 +73,8 @@ typedef struct {
}usbd_device_info_t; }usbd_device_info_t;
extern usbd_device_info_t usbd_devices[CONTROLLER_DEVICE_NUMBER]; extern usbd_device_info_t usbd_devices[CONTROLLER_DEVICE_NUMBER];
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
// callback from DCD ISR // callback from DCD ISR
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+

View File

@ -42,7 +42,7 @@
tusb_error_t tusb_init(void) tusb_error_t tusb_init(void)
{ {
VERIFY( hal_init(), TUSB_ERROR_FAILED ) ; // hardware init VERIFY( hal_usb_init(), TUSB_ERROR_FAILED ) ; // hardware init
#if MODE_HOST_SUPPORTED #if MODE_HOST_SUPPORTED
ASSERT_STATUS( usbh_init() ); // host stack init ASSERT_STATUS( usbh_init() ); // host stack init

View File

@ -71,7 +71,7 @@ extern "C" {
* \returns true if succeedded * \returns true if succeedded
* \note This function is invoked by \ref tusb_init as part of the initialization. * \note This function is invoked by \ref tusb_init as part of the initialization.
*/ */
bool hal_init(void); bool hal_usb_init(void);
/** \brief Enable USB Interrupt on a specific USB Controller /** \brief Enable USB Interrupt on a specific USB Controller
* \param[in] coreid is a zero-based index to identify USB controller's ID * \param[in] coreid is a zero-based index to identify USB controller's ID