ole00 / ch554_sdcc_usb_blinky

CH55x USB demo and Host controller app
11 stars 2 forks source link

ch554_sdcc_usb_blinky

This is a demo Blinky project for CH55x MCU. It's based on ch554_sdcc sdk (https://github.com/Blinkinlabs/ch554_sdcc.git) , but improves the code clarity of the USB handling part.

Features:

The goal of this demo project was to improve the USB handling code, which - at the point of writing - was hard to maintain and not very practical for beginners to reuse in other projects. This code separates the common USB code into its own source file, which - in theory - does not need to be changed and should work straight away. The customistaion of the USB code is done via preprocessor variables which can be defined in the main.c program, or if they are undefined, a default placeholder is used.

The customisable options are:

PC Host controller program:

The program interacts with the CH55x USB Blinky program and controlls the following properties in order to demonstrate how to do custom data transfers between the Host (PC) and the USB device (MCU):

Building and running:

1) setup the ch554_sdcc sdk (https://github.com/Blinkinlabs/ch554_sdcc.git) and make sure you can compile and run the examples in the example directory 2) copy the 'projects' directory from this repo into the root of the ch554_sdcc sdk (examples and projects directories will be on the same level) 3) enter projects/usb_blink directory and run 'make' to build, then 'make flash' to upload the binary to your CH55x device 4) disconnect and connect CH55x device from your PC 5) enter projects/usb_blink_pc_host directory and run 'compile.sh' to produce usb_blink_pc executable 6) run './usb_blink_pc -h' for options how to interact with the blinky demo