summaryrefslogtreecommitdiff
path: root/doxygen/getting_started.md
diff options
context:
space:
mode:
authorhathach <[email protected]>2014-04-16 12:01:49 +0700
committerhathach <[email protected]>2014-04-16 12:01:49 +0700
commit9aa3707f65158be001aaa065e4dee05b6389fcc2 (patch)
treed89f5eaf7299566928ea209fb6471050b95af806 /doxygen/getting_started.md
parent78b1c7dc1dba2f1e7a7e59ed3819da7898fee8f7 (diff)
doc updated
Diffstat (limited to 'doxygen/getting_started.md')
-rw-r--r--doxygen/getting_started.md28
1 files changed, 22 insertions, 6 deletions
diff --git a/doxygen/getting_started.md b/doxygen/getting_started.md
index 9da3327b2..6f7075ea8 100644
--- a/doxygen/getting_started.md
+++ b/doxygen/getting_started.md
@@ -26,23 +26,39 @@ 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 ...
-*repo/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.
+*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.
## Add tinyusb to your project
It is relatively simple to incorporate tinyusb to your (existing) project
-1. Copy core folder **repo/tinyusb** to your project. Let's say it is *your_project/tinyusb*
+1. Copy core folder **tinyusb** to your project. Let's say it is *your_project/tinyusb*
2. Add all the .c in the core folder to your project settings (uvproj, ewp, makefile)
3. Add *your_project/tinysb* to your include path. Also make sure your current include path also contains the configuration file tusb_config.h. Or you could simply put the tusb_config.h into the tinyusb folder as well.
-4. Make sure all required macros such as TUSB_CFG_MCU are all defined properly in tusb_config.h.
+4. Make sure all required macros are all defined properly in tusb_config.h (configure file in demo application is sufficient, but you need to add a few more such as TUSB_CFG_MCU, TUSB_CFG_OS, TUSB_CFG_OS_TASK_PRIO since they are passed by IDE/compiler to maintain a unique configure for all demo projects).
+5. If you use the device stack, make sure you have created/modified usb descriptors for your own need. Ultimately you need to fill out required pointers in tusbd_descriptor_pointers for that stack to work.
+6. Add tusb_init() call to your reset initialization code.
+7. Implement all enabled classes's callbacks.
+8. 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.
+~~~{.c}
+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 ...
+ }
+}
+~~~
\subpage md_boards_readme
-\subpage md_doxygen_started_build_demo
-
-\subpage md_doxygen_started_run_demo
+\subpage md_doxygen_started_demo
\subpage md_doxygen_tools \ No newline at end of file