espressif_tinyusb/readme.md

87 lines
3.7 KiB
Markdown
Raw Normal View History

2013-05-07 08:36:34 +02:00
# tinyusb #
2012-11-26 07:24:01 +01:00
2013-05-07 08:36:34 +02:00
## What Is tinyusb ##
2013-05-08 05:42:04 +02:00
tinyusb is an open-source (BSD-licensed) USB Host/Device/OTG stack for embedded micro-controller. It is developed using [Test-Driven Development](tests/readme.md) approach to eliminate bugs as soon as possible.
2013-05-07 08:36:34 +02:00
2013-05-08 05:32:31 +02:00
More detail on TDD can be found at
- [James W. Grenning's book "Test Driven Development for Embedded C"](http://www.amazon.com/Driven-Development-Embedded-Pragmatic-Programmers/dp/193435662X)
- [throwtheswitch's Ceedling, CMock & Unity](http://throwtheswitch.org/)
2013-05-07 08:36:34 +02:00
## Features ##
### RTOS ###
2013-05-07 08:52:39 +02:00
tinyusb is designed to be OS-ware and run across OS vendors, thanks to its OS Abstraction Layer (OSAL). However, it can also run without an OS (OSAL will be expanded to be a state machine in this case). Currently the following OS can be run with tinyusb (out of the box).
2013-05-07 08:36:34 +02:00
- **None OS**
- **FreeRTOS**
### Host ###
- HID Mouse
- HID Keyboard
2013-05-08 05:32:31 +02:00
- Mass-Storage (MSC) coming soon...
2013-05-07 08:52:39 +02:00
- Hub coming soon...
2013-05-08 05:32:31 +02:00
- Multiple host controllers
2013-05-07 08:36:34 +02:00
### Device ###
coming soon ...
## Coding Standards ##
2013-05-08 05:32:31 +02:00
tinyusb make use of goodies features of C99, which saves a tons of code lines (also means save a tons of bugs). However, those features can be misused (plus C is a dangerous language by itself) and pave the way for bugs sneaking into. Therefore, to minimize bugs, the author try to comply with published Coding Standards like:
2013-05-07 08:36:34 +02:00
- [MISRA-C](http://www.misra-c.com/Activities/MISRAC/tabid/160/Default.aspx)
- [Power of 10](http://spinroot.com/p10/)
- ...
### MISRA-C 2004 Exceptions ###
MISRA-C is well respected & a bar for industrial coding standard. Where is possible, MISRA-C is followed but it is almost impossible to follow the standard without the following exceptions:
2013-05-07 08:52:39 +02:00
- **Rule 2.2: use only /*** It has long passed the day that C99 comment style // will cause any issues, especially compiler's C99 mode is required to build tinyusb. I think they will eventually drop this rule in upcoming MISRA-C 2012.
2013-05-07 08:36:34 +02:00
- **Rule 8.5: No definitions of objects or function in a header file** function definitions in header files are used to allow 'inlining'
2013-05-07 08:52:39 +02:00
- **Rule 14.7: A function shall have a single point of exit at the end of the function** Unfortunately, following this rule will have a lot of nesting if-else, I prefer to exit as soon as possible with assert style and flatten if-else.
2013-05-07 08:36:34 +02:00
- **Rule 18.4: Unions shall not be used** sorry MISRA, union is required to effectively mapped to MCU's registers
2013-05-08 05:32:31 +02:00
- expect to have more & more exceptions.
2013-05-07 08:36:34 +02:00
2013-05-07 08:52:39 +02:00
### Power of 10 Exceptions ###
2013-05-07 08:36:34 +02:00
- coming soon
## Is It Ready ##
2013-05-08 05:32:31 +02:00
Although tinyusb is still in early stage of developing, but most of the code can run out of the box with supported boards.
2013-05-07 08:36:34 +02:00
## Getting Started ##
coming soon ...
## Supported MCUs ##
- NXP LPC18xx/LPC43xx family
## Supported Toolchains ##
2013-05-07 08:52:39 +02:00
currently only lpcxpresso/redsuite is supported. However Keil & IAR are always on top of the list.
2013-05-07 08:36:34 +02:00
## Supported Boards ##
2013-05-08 05:32:31 +02:00
this code base can run out of the box with the following boards
2013-05-07 08:36:34 +02:00
### NXP LPC18xx/LPC43xx ###
- [Embedded Artists LPC4357 OEM & Base board](http://www.embeddedartists.com/products/kits/lpc4357_kit.php)
- [NGX Technologies LPC4330 Explorer](http://shop.ngxtechnologies.com/product_info.php?products_id=104)
## How Can I Help ##
2013-05-08 05:32:31 +02:00
If you find my little USB stack is useful, please take some time to file any issues that you encountered. It is not necessary to be a software bug, it can be a question, request, suggestion etc. We can consider each github's issue as a forum's topic. Alternatively, you can buy me a cup of coffee if you happen to be in Hochiminh city.
2013-05-07 08:36:34 +02:00
## License ##
2013-05-08 05:32:31 +02:00
BSD license for most of the code base, but each file is individually licensed especially those in /vendor folder. Please make sure you understand all the license term for files you use in your project.