mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-24 18:02:40 +00:00
rename hal_init() to hal_usb_init()
This commit is contained in:
parent
bc9274591f
commit
381caaff1c
@ -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. */
|
||||||
|
@ -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. */
|
||||||
|
@ -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
|
||||||
|
@ -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 */
|
||||||
|
|
||||||
|
@ -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
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user