espressif_tinyusb/docs/boards.md

80 lines
4.4 KiB
Markdown
Raw Normal View History

2019-04-02 17:04:55 +02:00
# Boards
2019-05-04 10:10:16 +02:00
The board support code is only used for self-contained examples and testing. It is not used when TinyUSB is part of a larger project. It is responsible for getting the MCU started and the USB peripheral clocked with minimal of on-board devices
- One LED for status
2019-04-02 17:04:55 +02:00
- One Button to get input from user
- One UART optionally, mostly for host examples
## Supported Boards
2018-12-12 17:08:08 +01:00
This code base already had supported for a handful of following boards
2019-04-02 17:04:55 +02:00
### Nordic nRF5x
- [Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062)
2019-09-01 06:54:56 +02:00
- [Adafruit Circuit Playground Bluefruit](https://www.adafruit.com/product/4333)
2019-05-13 06:33:50 +02:00
- [Nordic nRF52840 Development Kit (aka pca10056)](https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-DK)
2019-04-02 17:04:55 +02:00
### NXP LPC
2019-09-06 11:50:00 +02:00
- [LPCXpresso 11u37](https://www.nxp.com/design/microcontrollers-developer-resources/lpcxpresso-boards/lpcxpresso-board-for-lpc11u37h:OM13074)
- [LPCXpresso 11u68](https://www.nxp.com/support/developer-resources/evaluation-and-development-boards/lpcxpresso-boards/lpcxpresso-board-for-lpc11u68:OM13058)
2018-12-12 17:08:08 +01:00
- [LPCXpresso 1347](https://www.nxp.com/support/developer-resources/evaluation-and-development-boards/lpcxpresso-boards/lpcxpresso-board-for-lpc1347:OM13045)
2019-09-06 11:50:00 +02:00
- [ARM mbed LPC1768](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc1700-cortex-m3/arm-mbed-lpc1768-board:OM11043)
2018-12-12 17:08:08 +01:00
- [LPCXpresso 1769](https://www.nxp.com/support/developer-resources/evaluation-and-development-boards/lpcxpresso-boards/lpcxpresso-board-for-lpc1769:OM13000)
- [Keil MCB1800 Evaluation Board](http://www.keil.com/mcb1800)
- [Embedded Artists LPC4088 Quick Start board](https://www.embeddedartists.com/products/lpc4088-quickstart-board)
- [Embedded Artists LPC4357 Developer Kit](http://www.embeddedartists.com/products/kits/lpc4357_kit.php)
2019-09-01 06:54:56 +02:00
- [LPCXpresso 51U68](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpcxpresso51u68-for-the-lpc51u68-mcus:OM40005)
2019-09-05 11:24:59 +02:00
- [LPCXpresso 54114](https://www.nxp.com/design/microcontrollers-developer-resources/lpcxpresso-boards/lpcxpresso54114-board:OM13089)
- [LPCXpresso 55s69 EVK](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc5500-cortex-m33/lpcxpresso55s69-development-board:LPC55S69-EVK)
2014-03-26 09:32:44 +01:00
2019-04-02 17:04:55 +02:00
### MicroChip SAMD
2019-09-01 06:54:56 +02:00
- [Adafruit Circuit Playground Express](https://www.adafruit.com/product/3333)
- [Adafruit Feather M0 Express](https://www.adafruit.com/product/3403)
2018-12-12 17:08:08 +01:00
- [Adafruit Metro M0 Express](https://www.adafruit.com/product/3505)
2019-09-01 06:54:56 +02:00
- [Adafruit Feather M4 Express](https://www.adafruit.com/product/3857)
2018-12-12 17:08:08 +01:00
- [Adafruit Metro M4 Express](https://www.adafruit.com/product/3382)
2019-04-02 17:04:55 +02:00
### ST STM32
2019-07-22 14:23:31 +02:00
- [STM32F407g Discovery](https://www.st.com/en/evaluation-tools/stm32f4discovery.html)
- [STM32F411e Discovery](https://www.st.com/en/evaluation-tools/32f411ediscovery.html)
2019-09-05 11:24:59 +02:00
- [Nucleo H743zi](https://www.st.com/en/evaluation-tools/nucleo-h743zi.html)
2019-04-02 17:04:55 +02:00
## Add your own board
2014-03-26 09:32:44 +01:00
If you don't possess any of supported board above. Don't worry you can easily implemented your own one by following this guide as long as the mcu is supported.
2019-04-02 17:04:55 +02:00
- Create new makefile for your board at `hw/bsp/<board name>/board.mk` and linker file as well if needed.
- Create new source file for your board at `hw/bsp/<board name>/board_<board name>.c` and implement following APIs
### Board APIs
#### board_init()
Is responsible for starting the MCU, setting up the USB clock and USB pins. It is also responsible for initializing LED and button pins.
One useful clock debugging technique is to set up a PWM output at a known value such as 500hz based on the USB clock so that you can verify it is correct with a logic probe or oscilloscope.
Setup your USB in a crystal-less mode when available. That makes the code easier to port across boards.
#### board_led_write()
Set the pin corresponding to the led to output a value that lights the LED when `state` is true.
#### board_button_read()
Return current state of button, a `1` means active (pressed), a `0` means inactive.
#### board_millis()
The function returns the elapsed number of milliseconds since startup. On ARM this is commonly done with SysTick or Timer. This provide examples a way to measure time to blink LED or delay properly. It is only required when run examples without RTOS `CFG_TUSB_OS == OPT_OS_NONE`.
#### board_uart_read()
Get characters from UART peripheral.
#### board_uart_write()
Send characters to UART peripheral.