summaryrefslogtreecommitdiff
path: root/docs/reference
diff options
context:
space:
mode:
authorhathach <[email protected]>2024-10-10 16:22:12 +0700
committerhathach <[email protected]>2024-10-10 16:28:36 +0700
commit57aac432b52df6d284c98daf591e661d1c55aa05 (patch)
tree1e980f0c18f558e3041dbef3021afa346297a85d /docs/reference
parentffdf81f53a84111a2536defa86e4a637c3c46854 (diff)
add new tusb_int_handler(rhport, in_isr) as common irq handler
update tusb_init() to take rhport and role, defined as macro with optional argument for backward compatible
Diffstat (limited to 'docs/reference')
-rw-r--r--docs/reference/getting_started.rst13
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
}