arduino / arduino/ArduinoCore-API

Each core provides a different USBAPI

Open
#141 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
306
Forks
150
PR merge metrics
No merged PRs in 30d

Description

The Arduino Core API defines a very low level USB api in [api/USBAPI.h](https://github.com/arduino/ArduinoCore-API/blob/master/api/USBAPI.h). This API is implemented by the avr core in [cores/arduino/USBCore.cpp](https://github.com/arduino/ArduinoCore-avr/blob/master/cores/arduino/USBCore.cpp). But it is not implemented by samd core, which implements the same functionality but in its own [`USBDeviceClass` class](https://github.com/arduino/ArduinoCore-samd/blob/master/cores/arduino/USB/USBCore.cpp). The USB implementation in megaavr core (`USBCore.cpp`) is a copy of the avr usb implementation with some deviations. The mbed core implements its own version of the `PluggableUSBModule`.

As a result, each core implements its own USB API which is incompatible with the others, there exist many code duplicates and users of the USB API have to understand and adapt their code to each individual core implementation.

Are there any plans to improve this situation?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with api/USBAPI.h and compare the implementations in the avr, samd, megaavr, and mbed core paths named in the issue, including USBCore.cpp, USBDeviceClass, and PluggableUSBModule. The issue does not define a concrete change, so first establish the intended compatibility scope; done would require an agreed common USB API across the affected cores.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.