Table of Contents
tinyusb uses github as online repository https://github.com/hathach/tinyusb since it is the best place for open source project.
If you are using Linux, you already know how to what to do. But If Windows is your OS, I would suggest to install git and front-end gui such as tortoisegit to begin with.
After downloading/cloning, the code base is composed of
| Folder | Description |
|---|---|
| boards | Source files of supported boards |
| demos | Source & project files for demonstration application |
| mcu | Low level mcu core & peripheral drivers (e.g CMSIS ) |
| tests | Unit tests for the stack |
| tinyusb | All sources files for tinyusb stack itself. |
| vendor | Source files from 3rd party such as freeRTOS, fatfs etc ... |
demos 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 or host demo.
It is relatively simple to incorporate tinyusb to your (existing) project
If you dont use any RTOSes at all, you need to continuously and/or periodically call tusb_task_runner() 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();
tusb_task_runner(); // handle tinyusb event, task etc ...
}
}