diff options
| author | HiFiPhile <[email protected]> | 2024-10-30 19:36:05 +0100 |
|---|---|---|
| committer | HiFiPhile <[email protected]> | 2024-10-30 19:47:03 +0100 |
| commit | 85ff529a310b7e6ec2e4234e3e292fef6432882b (patch) | |
| tree | 41218fce4db7c23df1073dfdd42fb017c3cf0158 /docs/reference/getting_started.rst | |
| parent | 418b8b2f133d695362c735f271c966af10b5d251 (diff) | |
| parent | 8b1e40c3e2447de5b4a86bbcdcc0344946a4793d (diff) | |
Merge branch 'master' into dcd_notif
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'docs/reference/getting_started.rst')
| -rw-r--r-- | docs/reference/getting_started.rst | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/docs/reference/getting_started.rst b/docs/reference/getting_started.rst index 3db3fa206..ac4ab6392 100644 --- a/docs/reference/getting_started.rst +++ b/docs/reference/getting_started.rst @@ -12,22 +12,19 @@ It is relatively simple to incorporate tinyusb to your project * Add *your_project/tinyusb/src* to your include path. Also make sure your current include path also contains the configuration file tusb_config.h. * 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 CFG_TUSB_MCU, CFG_TUSB_OS since they are passed by IDE/compiler to maintain a unique configure for all boards). * If you use the device stack, make sure you have created/modified usb descriptors for your own need. Ultimately you need to implement all **tud descriptor** callbacks for the stack to work. -* Add tusb_init() call to your reset initialization code. -* Call ``tud_int_handler()`` (device) and/or ``tuh_int_handler()`` (host) in your USB IRQ Handler +* Add tusb_init(rhport, role) call to your reset initialization code. +* Call ``tusb_int_handler(rhport, in_isr)`` in your USB IRQ Handler * Implement all enabled classes's callbacks. * If you don't use any RTOSes at all, you need to continuously and/or periodically call tud_task()/tuh_task() function. All of the callbacks and functionality are handled and invoked within the call of that task runner. .. code-block:: - int main(void) - { + int main(void) { your_init_code(); - tusb_init(); // initialize tinyusb stack + tusb_init(0, TUSB_ROLE_DEVICE); // initialize device stack on roothub port 0 - while(1) // the mainloop - { + while(1) { // the mainloop your_application_code(); - tud_task(); // device task tuh_task(); // host task } |
