You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/getting_started.rst
+20-3Lines changed: 20 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ It is relatively simple to incorporate tinyusb to your project
10
10
* Copy or ``git submodule`` this repo into your project in a subfolder. Let's say it is *your_project/tinyusb*
11
11
* Add all the .c in the ``tinyusb/src`` folder to your project
12
12
* Add *your_project/tinyusb/src* to your include path. Also make sure your current include path also contains the configuration file tusb_config.h.
13
-
* 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).
13
+
* 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).
14
14
* 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.
15
15
* Add tusb_init(rhport, role) call to your reset initialization code.
16
16
* Call ``tusb_int_handler(rhport, in_isr)`` in your USB IRQ Handler
@@ -20,8 +20,17 @@ It is relatively simple to incorporate tinyusb to your project
20
20
.. code-block::
21
21
22
22
int main(void) {
23
-
your_init_code();
24
-
tusb_init(0, TUSB_ROLE_DEVICE); // initialize device stack on roothub port 0
23
+
tusb_rhport_init_t dev_init = {
24
+
.role = TUSB_ROLE_DEVICE,
25
+
.speed = TUSB_SPEED_AUTO
26
+
};
27
+
tusb_init(0, &dev_init); // initialize device stack on roothub port 0
28
+
29
+
tusb_rhport_init_t host_init = {
30
+
.role = TUSB_ROLE_HOST,
31
+
.speed = TUSB_SPEED_AUTO
32
+
};
33
+
tusb_init(1, &host_init); // initialize host stack on roothub port 1
25
34
26
35
while(1) { // the mainloop
27
36
your_application_code();
@@ -30,6 +39,14 @@ It is relatively simple to incorporate tinyusb to your project
Copy file name to clipboardExpand all lines: library.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "TinyUSB",
3
-
"version": "0.17.0",
3
+
"version": "0.18.0",
4
4
"description": "TinyUSB is an open-source cross-platform USB Host/Device stack for embedded system, designed to be memory-safe with no dynamic allocation and thread-safe with all interrupt events are deferred then handled in the non-ISR task function.",
0 commit comments