Each core provides a different USBAPI

Open
#141 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

Description

The Arduino Core API defines a very low level USB api in api/USBAPI.h. This API is implemented by the avr core in cores/arduino/USBCore.cpp. But it is not implemented by samd core, which implements the same functionality but in its own USBDeviceClass class. 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?

Dominant language
C++
Stars
306
Forks
150
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from arduino/ArduinoCore-API

All issues in arduino/ArduinoCore-API

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.