cmumford / Adafruit_TinyUSB_ArduinoCore

TinyUSB Core for Arduino

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adafruit TinyUSB Core for Arduino

This repo is Arduino compatible variant from TinyUSB stack project to provide core USB functionality and CDC support for Arduino. Other class drivers such as Mass Storage, HID, MIDI etc ... are provided by Adafruit_TinyUSB_Arduino.

Porting

Currently Arduino TinyUSB is used by following cores

But it is also easy to port it to your own BSP as follows:

Add the codes

Include this repo as submodule to your BPS cores folder e.g

$ git submodule add https://github.com/adafruit/Adafruit_TinyUSB_ArduinoCore.git cores/arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore

Alternatively you could just copy the files over but will need to periodically sync to get the latest patches, features.

Write the platform dependent codes

You will need to create 2 files

  • tusb_config.h for configuration that best suites your port and
  • Adafruit_TinyUSB_port.cpp to implement platform-dependent functions
    • Adafruit_TinyUSB_Core_init() to initialize USB hardware (clock, pullups) and tinyusb stack
    • Adafruit_TinyUSB_Core_touch1200() callback that fired when IDE use touch 1200 feature to put board into DFU mode
    • Adafruit_USBD_Device getSerialDescriptor(), detach(), attach()

About

TinyUSB Core for Arduino

License:MIT License


Languages

Language:C++ 92.2%Language:C 5.6%Language:CMake 2.0%Language:Makefile 0.2%