move demo page to their folder
This commit is contained in:
@@ -1,63 +0,0 @@
|
||||
# Build Demos
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
**Table of Contents**
|
||||
|
||||
- [LPCXpresso](#lpcxpresso)
|
||||
- [Keil](#keil)
|
||||
- [IAR](#iar)
|
||||
- [Configure demo](#configure-demo)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
## LPCXpresso
|
||||
|
||||
LPCXpresso is an eclipse-based IDE, so you will need to create an workspace first then import project files (.cproject & .project) into it. The following step explain how to do just that.
|
||||
|
||||
1. Click *File->Import*, then expand the *General* folder and select **Existing Projects into Workspace** and click Next.
|
||||
|
||||

|
||||
|
||||
2. On the next dialog, Click *Browse* and choose the **repo/demos** folder inside the repo. You should see a list of all demo applications. \[**IMPORTANT**\] Make sure the option **Copy projects into workspace** is **CLEAR**, as demo application uses *link folders* and this option may cause problem with the copy import. Then choose any of the demo application and click *Finish*.
|
||||
|
||||

|
||||
|
||||
3. Select the configure corresponding to your development board.
|
||||
|
||||

|
||||
|
||||
4. Then select the correct MCU option from project properties then you are ready to go.
|
||||
|
||||

|
||||
|
||||
*TIPS* Working with eclipse-based IDE like lpcxpresso, you should change the indexer option in *Preferences->C/C++->Indexer* to "active build" to have a better code viewer. Those lines that are opt out by #if will be gray, I found this extremely helpful.
|
||||
|
||||

|
||||
|
||||
## Keil
|
||||
|
||||
It is relatively simple for Keil
|
||||
|
||||
1. Open the desired demo project e.g *demos/host/host\_freertos/host_freertos.uvproj*
|
||||
2. Select the configure corresponding to your development board and build it.
|
||||
|
||||

|
||||
|
||||
## IAR
|
||||
|
||||
IAR is just as easy as Keil
|
||||
|
||||
1. Open the desired demo project e.g *demos/host/host\_freertos/host_freertos.eww*
|
||||
2. Again select the configure corresponding to your development board and build it.
|
||||
|
||||

|
||||
|
||||
## Configure demo
|
||||
|
||||
Application demo is written to have the code excluded if its required option is not enabled in [tusb_config.h](). Some of combination may exceed the 32KB limit of IAR/Keil so you may want to re-configure to disable some class support, decrease TUSB_CFG_DEBUG or increase the compiler optimization level.
|
||||
|
||||
In addition, there are some configuration you can change such as
|
||||
|
||||
- CFG_UART_BAUDRATE in board.h
|
||||
- CFG_PRINTF_TARGET in the specific board header (e.g board_ea4357.h) to either Semihost, Uart, or SWO.
|
@@ -43,6 +43,6 @@ void led_blinking_task( void * p_task_para )
|
||||
~~~
|
||||
|
||||
|
||||
[//]: # (\subpage md_doxygen_started_build_demo)
|
||||
[//]: # (\subpage md_doxygen_started_device_demo)
|
||||
[//]: # (\subpage md_doxygen_started_host_demo)
|
||||
[//]: # (\subpage md_demos_readme)
|
||||
[//]: # (\subpage md_demos_device_readme)
|
||||
[//]: # (\subpage md_demos_host_readme)
|
@@ -1,81 +0,0 @@
|
||||
# Device Demos #
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
**Table of Contents**
|
||||
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Human Interface Device (HID)](#human-interface-device-hid)
|
||||
- [Keyboard](#keyboard)
|
||||
- [Mouse](#mouse)
|
||||
- [Mass Storage Class Device (MSC)](#mass-storage-class-device-msc)
|
||||
- [Communication Class Device (CDC)](#communication-class-device-cdc)
|
||||
- [Serial](#serial)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
device application code is store at *demos/device/src* containing
|
||||
|
||||
File | Description
|
||||
----- | -------------
|
||||
main.c | Initialization (board, stack) and a RTOS task scheduler call or just simple a indefinite loop for non OS to invoke class-specific tasks.
|
||||
tusb_config.h | tinyusb stack configuration.
|
||||
tusb_descriptors(c,h) | contains all the required usb descriptors for all combination of supported classes. And definition of stack-required variable *tusbd_descriptor_pointers*.
|
||||
app_os_prio.h | RTOS task priority definitions
|
||||
Class-specific | Application files for supported classes.
|
||||
|
||||
The demo will start with the greeting of enabled classes and chosen RTOS then start to blink an LED at 1 Hz.
|
||||
|
||||
## Prerequisites ##
|
||||
|
||||
In order to run application demo, you would need
|
||||
|
||||
- A [supported development board](../../boards/readme.md) with at least a button for mouse, keyboard demo.
|
||||
- A supported toolchain: LPCXpresso, Keil, IAR.
|
||||
- A decent terminal such as [Tera Term](http://en.sourceforge.jp/projects/ttssh2/) for CDC Serial.
|
||||
|
||||
## Human Interface Device (HID)
|
||||
|
||||
### Keyboard
|
||||
|
||||
After the board get enumerated successfully, you can try to press some buttons while opening notepad. It should get some characters out accordingly. In addition, when you press Capslock or Numlock key on your own pc's keyboard, the LED will blink faster twice. This demonstrates that keyboard application can receive Set Report via control pipe.
|
||||
|
||||
Notes: The very same buttons may also used by Mouse application. You can get the mouse moving and character, should you enable both.
|
||||
|
||||
### Mouse
|
||||
|
||||
After the board get enumerated successfully, you can try to press some buttons. The mouse's cursor should move accordingly.
|
||||
|
||||
Notes: The very same buttons may also used by Keyboard application. You can get the mouse moving and character, should you enable both.
|
||||
|
||||
## Mass Storage Class Device (MSC)
|
||||
|
||||
This class is very simple, as soon as the demo work, you could open the demo drive. Inside, you should find a *README.TXT* file which contains a few lines of descriptions. The demo drive's format is FAT12 and only has 8KB, which is the smallest possible to work with most host OS (Windows/Linux).
|
||||
|
||||
Notes: The entire disk contents ( 8KB ) is located on MCU's SRAM if possible (such as lpc43xx, lpc175x_6x). For MCU (lpc11u, lpc13u) that cannot afford that, the contents is instead on internal Flash which make the demo drive is read-only.
|
||||
|
||||
## Communication Class Device (CDC)
|
||||
|
||||
CDC has several subclass, currently tinyusb only supports the popular *Abstract Control Model (ACM)*
|
||||
|
||||
### Serial
|
||||
|
||||
The virtual COM is also as easy as MSC. Except that we need to "install" driver for the first plug if your host OS is Windows, Linux should be able to work right away.
|
||||
|
||||
**Install Driver for Windows**
|
||||
|
||||
Actually Windows already has the needed driver to operate with virtual serial of CDC-ACM, the *usbser*. However, since it also use Abstract Control Model for other purposes, it requires us to tell exactly which VendorID/ProductID comibination should be used as a virtual serial. The demo's src folder includes *WinCDCdriver.inf* to do just that.
|
||||
|
||||
Firstly open *Device Manager*, we should find our board under "Other devices", right click on it and choose "Update Driver Software..."
|
||||
|
||||

|
||||
|
||||
Then choose "Browse my computer for driver software" then navigate to the device demo's *src* and click next. Since I am nowhere near a known publisher to Microsoft, it will warn you with a scary dialog. With all your trust in me, click next and hope that nothing harmful will ever happen and we are done with the driver.
|
||||
|
||||

|
||||
|
||||
**Testing Demo**
|
||||
|
||||
Connect to the "tinyusb Serial Port" with your terminal application, and start to type. You should get echo back as the CDC serial application demo is written to transmit what it received.
|
||||
|
||||

|
@@ -1,93 +0,0 @@
|
||||
# Host Demos #
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
**Table of Contents**
|
||||
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Hub](#hub)
|
||||
- [Human Interface Device (HID)](#human-interface-device-hid)
|
||||
- [Keyboard](#keyboard)
|
||||
- [Mouse](#mouse)
|
||||
- [Mass Storage Class Device (MSC)](#mass-storage-class-device-msc)
|
||||
- [Communication Class Device (CDC)](#communication-class-device-cdc)
|
||||
- [Serial](#serial)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
host application code is store at *demos/host/src* containing
|
||||
|
||||
File | Description
|
||||
----- | -------------
|
||||
main.c | Initialization (board, stack) and a RTOS task scheduler call or just simple a indefinite loop for non OS to invoke class-specific tasks.
|
||||
tusb_config.h | tinyusb stack configuration.
|
||||
app_os_prio.h | RTOS task priority definitions
|
||||
Class-specific | Application files for supported classes.
|
||||
|
||||
Firstly connect your ansi-escaped supported terminal (see below) to the UART of the evaluation board since all the user interaction happens there. The default UART configure is
|
||||
- Baudrate = 115200
|
||||
- Data = 8 bits
|
||||
- Parity = none
|
||||
- Stop = 1 bit
|
||||
- Flow control = none
|
||||
|
||||
The demo will start with the greeting of enabled classes and chosen RTOS then start to blink an LED at 1 Hz. When any of supported devices is plugged or un-plugged either directly or via a hub, demo application will print out a short message. Notes: if usb device is composed of supported and unsupported classes such as a keyboard and a camera, the keyboard interface is still mounted as usual without any issues.
|
||||
|
||||
**NOTE** Host demo is quite power hunger, especially when you plug a hub with several devices on it. Make sure you have enough power before filing any bugs.
|
||||
|
||||
## Prerequisites ##
|
||||
|
||||
In order to run application demo, you would need
|
||||
|
||||
- A [supported development board](../../boards/readme.md).
|
||||
- A supported toolchain: LPCXpresso, Keil, IAR.
|
||||
- A [ANSI escape](http://en.wikipedia.org/wiki/ANSI_escape_code) supported terminal such as [Tera Term](http://en.sourceforge.jp/projects/ttssh2/) to demonstrate properly.
|
||||
|
||||
## Hub
|
||||
|
||||
Hub is internally handled by tinyusb stack, application code does not have to worry on how to get hub operated. However, application must be written to handle multiple devices simultaneously.
|
||||
|
||||
## Human Interface Device (HID)
|
||||
|
||||
### Keyboard
|
||||
|
||||
When a keyboard device is enumerated, any keys pressed on the device will be echoed to the UART terminal.
|
||||
|
||||

|
||||
|
||||
### Mouse
|
||||
|
||||
When a mouse device is enumerated, any movements or clicks on the device will be reflected on the terminal. Only make sure the terminal's windows is active on your host OS and it supports ANSI escape code.
|
||||
|
||||

|
||||
|
||||
## Mass Storage Class Device (MSC)
|
||||
|
||||
Mass storage demo application only supports device with FAT file system by the help of fatfs (source in *vendor/fatfs*). In addition, it also includes a minimal command line interface *msc_cli.c* to allow user to navigate and execute several basic file operations. When mass storage device is plugged, CLI will be activated, type "help" for the usage. Some are
|
||||
|
||||
Command | Description
|
||||
----- | -------------
|
||||
cls | clear screen
|
||||
ls | List information of the FILEs, only supported current directory.
|
||||
cd | change the current directory.
|
||||
cat | display contents of a file.
|
||||
cp | copy files to another location.
|
||||
mkdir | create a directory, if it does not already exist.
|
||||
mv | rename or move a directory or a file.
|
||||
rm | remove (delete) an empty directory or file
|
||||
|
||||
Furthermore, the demo's CLI also supports multiple mass storage devices. You could *cd* between disk drives, and copy a file from one to another.
|
||||
|
||||

|
||||
|
||||
## Communication Class Device (CDC)
|
||||
|
||||
CDC has several subclass, currently tinyusb only supports the popular *Abstract Control Model (ACM)*
|
||||
|
||||
### Serial
|
||||
|
||||
A virtual serial of CDC-ACM is supported, the host demo will echo back any thing it received from the device. So if you use the tinyusb device stack with CDC enabled to test with, you should modify it a bit to constantly send somethings (otherwise 2 demos will wait for each other).
|
||||
|
||||
Notes: FTDI is a vendor-specific class, which is not currently supported.
|
||||
|
||||

|
Reference in New Issue
Block a user