rename hal_* to tusb_hal_*

This commit is contained in:
hathach
2018-03-11 13:01:57 +07:00
parent c39b24001d
commit 0384e40320
14 changed files with 37 additions and 38 deletions

View File

@@ -48,7 +48,7 @@ void SysTick_Handler (void)
system_ticks++;
}
uint32_t hal_tick_get(void)
uint32_t tusb_hal_tick_get(void)
{
return system_ticks;
}

View File

@@ -60,24 +60,24 @@ void SysTick_Handler (void)
}
bool hal_usb_init(void)
bool tusb_hal_init(void)
{
}
void hal_usb_int_enable(uint8_t port)
void tusb_hal_init_enable(uint8_t port)
{
(void) port;
NVIC_EnableIRQ(USBD_IRQn);
}
void hal_usb_int_disable(uint8_t port)
void tusb_hal_init_disable(uint8_t port)
{
(void) port;
NVIC_DisableIRQ(USBD_IRQn);
}
uint32_t hal_tick_get(void)
uint32_t tusb_hal_tick_get(void)
{
//#define tick2ms(tck) ( ( ((uint64_t)(tck)) * 1000) / configTICK_RATE_HZ )
//return tick2ms( app_timer_cnt_get() );
@@ -85,7 +85,7 @@ uint32_t hal_tick_get(void)
return system_ticks;
}
void hal_debugger_breakpoint(void)
void tusb_hal_dbg_breakpoint(void)
{
// M0 cannot check if debugger is attached or not
#if defined(__CORTEX_M) && (__CORTEX_M > 0)

View File

@@ -41,19 +41,19 @@
#if TUSB_CFG_MCU == MCU_LPC11UXX
void hal_usb_int_enable(uint8_t port)
void tusb_hal_init_enable(uint8_t port)
{
(void) port; // discard compiler's warning
NVIC_EnableIRQ(USB_IRQn);
}
void hal_usb_int_disable(uint8_t port)
void tusb_hal_init_disable(uint8_t port)
{
(void) port; // discard compiler's warning
NVIC_DisableIRQ(USB_IRQn);
}
bool hal_usb_init(void)
bool tusb_hal_init(void)
{
// TODO remove magic number
/* Enable AHB clock to the USB block and USB RAM. */

View File

@@ -41,19 +41,19 @@
#if TUSB_CFG_MCU == MCU_LPC13UXX
void hal_usb_int_enable(uint8_t port)
void tusb_hal_init_enable(uint8_t port)
{
(void) port; // discard compiler's warning
NVIC_EnableIRQ(USB_IRQ_IRQn);
}
void hal_usb_int_disable(uint8_t port)
void tusb_hal_init_disable(uint8_t port)
{
(void) port; // discard compiler's warning
NVIC_DisableIRQ(USB_IRQ_IRQn);
}
bool hal_usb_init(void)
bool tusb_hal_init(void)
{
// TODO remove magic number
LPC_SYSCON->SYSAHBCLKCTRL |= ((0x1<<14) | (0x1<<27)); /* Enable AHB clock to the USB block and USB RAM. */

View File

@@ -41,13 +41,13 @@
#if TUSB_CFG_MCU == MCU_LPC175X_6X
void hal_usb_int_enable(uint8_t port)
void tusb_hal_init_enable(uint8_t port)
{
(void) port; // discard compiler's warning
NVIC_EnableIRQ(USB_IRQn);
}
void hal_usb_int_disable(uint8_t port)
void tusb_hal_init_disable(uint8_t port)
{
(void) port; // discard compiler's warning
NVIC_DisableIRQ(USB_IRQn);
@@ -56,7 +56,7 @@ void hal_usb_int_disable(uint8_t port)
//--------------------------------------------------------------------+
// IMPLEMENTATION
//--------------------------------------------------------------------+
bool hal_usb_init(void)
bool tusb_hal_init(void)
{
enum {
USBCLK_DEVCIE = 0x12, // AHB + Device

View File

@@ -53,7 +53,7 @@ enum {
LPC43XX_USBMODE_VBUS_HIGH = 1
};
void hal_debugger_breakpoint(void)
void tusb_hal_dbg_breakpoint(void)
{
// M0 cannot check if debugger is attached or not
#if defined(__CORTEX_M) && (__CORTEX_M > 0)
@@ -65,12 +65,12 @@ void hal_debugger_breakpoint(void)
#endif
}
void hal_usb_int_enable(uint8_t port)
void tusb_hal_init_enable(uint8_t port)
{
NVIC_EnableIRQ(port ? USB1_IRQn : USB0_IRQn);
}
void hal_usb_int_disable(uint8_t port)
void tusb_hal_init_disable(uint8_t port)
{
NVIC_DisableIRQ(port ? USB1_IRQn : USB0_IRQn);
}
@@ -91,7 +91,7 @@ static void hal_controller_reset(uint8_t port)
// return timeout_expired(&timeout) ? TUSB_ERROR_OSAL_TIMEOUT : TUSB_ERROR_NONE;
}
bool hal_usb_init(void)
bool tusb_hal_init(void)
{
LPC_CREG->CREG0 &= ~(1<<5); /* Turn on the phy */