git clone git@github.com:hathach/tinyusb.git tinyusb
cd tinyusb
git submodule update --init
examples is the folder where all the application & project files are located. There are demos for both device and hosts. For each, there are different projects for each of supported RTOS. Click to have more information on how to build and run device demos.
It is relatively simple to incorporate tinyusb to your (existing) project
git submodule this repo into your project in a subfolder. Let's say it is your_project/tinyusbIf you don't use any RTOSes at all, you need to continuously and/or periodically call tud_task()/tuh_task() function. Most of the callbacks and functionality are handled and invoke within the call of that task runner.
int main(void)
{
your_init_code();
tusb_init(); // initialize tinyusb stack
while(1) // the mainloop
{
your_application_code();
tud_task(); // tinyusb device task
tuh_task(); // tinyusb host task
}
}