tinyusb  0.4
Click here to lend your support to tinyusb donation and make a donation at pledgie.com
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
tusb.c
Go to the documentation of this file.
1 /**************************************************************************/
37 /**************************************************************************/
38 
39 #define _TINY_USB_SOURCE_FILE_
40 
41 #include "tusb.h"
42 
44 {
45  ASSERT_STATUS( hal_init() ) ; // hardware init
46 
47 #if MODE_HOST_SUPPORTED
48  ASSERT_STATUS( usbh_init() ); // host stack init
49 #endif
50 
51 #if MODE_DEVICE_SUPPORTED
52  ASSERT_STATUS ( usbd_init() ); // device stack init
53 #endif
54 
55 #if (TUSB_CFG_CONTROLLER_0_MODE)
57 #endif
58 
59 #if (TUSB_CFG_CONTROLLER_1_MODE)
61 #endif
62 
63  return TUSB_ERROR_NONE;
64 }
65 
71 void tusb_isr(uint8_t coreid)
72 {
73 #if MODE_HOST_SUPPORTED
74  hcd_isr(coreid);
75 #endif
76 
77 #if MODE_DEVICE_SUPPORTED
78  dcd_isr(coreid);
79 #endif
80 
81 }
82 
83 #if TUSB_CFG_OS == TUSB_OS_NONE
84 void tusb_task_runner(void)
85 {
86  #if MODE_HOST_SUPPORTED
87  usbh_enumeration_task(NULL);
88  #endif
89 
90  #if MODE_DEVICE_SUPPORTED
91  usbd_task(NULL);
92  #endif
93 }
94 #endif
tusb_error_t tusb_init(void)
Initialize the usb stack.
Definition: tusb.c:43
static void hal_interrupt_enable(uint8_t coreid) ATTR_ALWAYS_INLINE
Enable USB Interrupt on a specific USB Controller.
void tusb_task_runner(void)
Run all tinyusb's internal tasks (e.g host task, device task).
Definition: tusb.c:84
tusb_error_t
Error Code returned.
Definition: tusb_errors.h:100
void tusb_isr(uint8_t coreid)
USB interrupt handler.
Definition: tusb.c:71
tusb_error_t hal_init(void)
Initialize USB controller hardware.
Definition: hal_lpc11uxx.c:44