Legion2 / CorsairLightingProtocol

Control LEDs connected to an Arduino with iCUE, create an unofficial Corsair iCUE compatible Arduino LED controller.
Apache License 2.0
514 stars 64 forks source link

SAMD Architecture Support #214

Closed Spegs21 closed 2 years ago

Spegs21 commented 3 years ago

I see that there have been a lot of questions regarding support of other platform looking through the readme but one that hasn't come up is the SAMD architecture, specifically the SAMD21 chip.

I think this should meet the raw HID requirements that many of the other chips do not. One drawback I see is the lack of an EEPROM but this could be mitigated with a flash storage library or external EEPROM.

I've made some preliminary changes to the library but don't have anything that compiles yet.

Legion2 commented 3 years ago

Can you provide a list of arduino board names, which I can use to test SAMD. I only need the names to setup the compiler in arduino IDE.

Spegs21 commented 3 years ago

Sure,

Official Arduino Boards:

Adafruit Boards:

Add via: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json

Legion2 commented 3 years ago

OK the EEPROM api has to be abstracted from the code, so it can be replaced when needed.

Spegs21 commented 3 years ago

Is that the only issue you've found? I edit the HID files to allow ARDUIINO_ARCH_SAMD and the compiler complains about lack of USB_Send and TRANSFER_RELEASE depending on which board I select.

Legion2 commented 3 years ago

https://www.arduino.cc/en/Reference/HID here only 32u4 based board, a Due and a Zero are supported

Spegs21 commented 3 years ago

Have you enabled your #if blocks in RawHID.h/.cpp by changing: #if defined(ARDUINO_ARCH_AVR) to #if defined(ARDUINO_ARCH_AVR) || #if defined(ARDUINO_ARCH_SAMD)

I'm trying to compile for Arduino Zero (Native USB Port).

Legion2 commented 3 years ago

no I didn't started coding, can you share your changes and open a PR?

Spegs21 commented 3 years ago

I added the PR. I don't have much experience with the USB API and HID libraries so I don't know how much help I'll be with this.