summaryrefslogtreecommitdiff
path: root/src/tusb_hal.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-12-05 13:20:25 +0700
committerhathach <[email protected]>2018-12-05 13:20:25 +0700
commita73017fdc23f7bedf38e754cba3a4ffbcf8d4c27 (patch)
tree04c68202c20a45318ea61d27fede4bfd12e0beac /src/tusb_hal.h
parent6048a3bff48dc588849f83f4088367d20b6bc651 (diff)
hal clean up
- replace tusb_hal_int_enable/disable to dcd_int_enable/disable, hcd_int_enable/disable - remove tusb_hal_init(), this will be part of dcd_init/hcd_init, anything beyond dcd/hcd should be inited by bsp
Diffstat (limited to 'src/tusb_hal.h')
-rw-r--r--src/tusb_hal.h37
1 files changed, 9 insertions, 28 deletions
diff --git a/src/tusb_hal.h b/src/tusb_hal.h
index 85a2a8709..301e8c2f2 100644
--- a/src/tusb_hal.h
+++ b/src/tusb_hal.h
@@ -51,55 +51,37 @@ extern "C" {
//--------------------------------------------------------------------+
// HAL API
//--------------------------------------------------------------------+
-/** \ingroup group_mcu
- * \defgroup group_hal Hardware Abtract Layer (HAL)
- * Hardware Abstraction Layer (HAL) is an abstraction layer, between the physical hardware and the tinyusb stack.
- * Its function is to hide differences in hardware from most of MCUs, so that most of the stack code does not need to be changed to
- * run on systems with a different MCU.
- * HAL are sets of routines that emulate some platform-specific details, giving programs direct access to the hardware resources.
- * @{ */
-
-/** \brief Initialize USB controller hardware
- * \returns true if succeeded
- * \note This function is invoked by \ref tusb_init as part of the initialization.
- */
-bool tusb_hal_init(void);
-
-/** \brief Enable USB Interrupt on a specific USB Controller
- * \param[in] rhport is a zero-based index to identify USB controller's ID
- */
-void tusb_hal_int_enable(uint8_t rhport);
-
-/** \brief Disable USB Interrupt on a specific USB Controller
- * \param[in] rhport is a zero-based index to identify USB controller's ID
- */
-void tusb_hal_int_disable(uint8_t rhport);
// Only required to implement if using No RTOS (osal_none)
uint32_t tusb_hal_millis(void);
+// TODO remove
+extern void dcd_int_enable (uint8_t rhport);
+extern void dcd_int_disable(uint8_t rhport);
// Enable all ports' interrupt
+// TODO remove
static inline void tusb_hal_int_enable_all(void)
{
#ifdef CFG_TUSB_RHPORT0_MODE
- tusb_hal_int_enable(0);
+ dcd_int_enable(0);
#endif
#ifdef CFG_TUSB_RHPORT0_MODE
- tusb_hal_int_enable(1);
+ dcd_int_enable(1);
#endif
}
// Disable all ports' interrupt
+// TODO remove
static inline void tusb_hal_int_disable_all(void)
{
#ifdef CFG_TUSB_RHPORT0_MODE
- tusb_hal_int_disable(0);
+ dcd_int_disable(0);
#endif
#ifdef CFG_TUSB_RHPORT0_MODE
- tusb_hal_int_disable(1);
+ dcd_int_disable(1);
#endif
}
@@ -111,4 +93,3 @@ static inline void tusb_hal_int_disable_all(void)
#endif /* _TUSB_HAL_H_ */
-/** @} */