avr-hal icon indicating copy to clipboard operation
avr-hal copied to clipboard

Add arduino nano

Open moritz31 opened this issue 6 years ago • 5 comments

What would be the way to go to add an arduino nano ?

moritz31 avatar Aug 23 '20 16:08 moritz31

The Arduino Nano is identical to the Arduino Uno in every way (well, at least in regards to the ATMega328) except physical form factor, so you can just pretend it's an Uno and use its crate. I don't know if @Rahix would prefer to create a dedicated Nano crate though, even if it just re-exports everything from the Uno.

lights0123 avatar Aug 23 '20 16:08 lights0123

This is for the Arduino Nano but not the Arduino Nano Every correct?

For future Googler's of Rust + Arduino Nano I think it's this one that works: https://store.arduino.cc/usa/arduino-nano

D1plo1d avatar Aug 26 '20 16:08 D1plo1d

@D1plo1d, yes the Arduino Nano Every has a completely different MCU (ATmega4809) so it is not compatible.

Rahix avatar Aug 26 '20 16:08 Rahix

The Arduino Nano is identical to the Arduino Uno in every way (well, at least in regards to the ATMega328) except physical form factor, so you can just pretend it's an Uno and use its crate. I don't know if @Rahix would prefer to create a dedicated Nano crate though, even if it just re-exports everything from the Uno.

I've thought about this for a bit and here's what I would suggest: For boards which are reasonably similar, we only have a single crate; arduino-uno in this case. For each 'compatible' board, this crate gets a cargo-feature to enable any slight changes as necessary. E.g. Arduino Nano exposes ADC6 and ADC7 which don't exist on Arduino Uno.

If this turns out to be too confusing, we can still add a "wrapper crate" which just exposes everything from arduino-uno and enables said feature by default.

Rahix avatar Aug 31 '20 09:08 Rahix

Arduino Nano is now "officially" supported in the arduino-uno crate via the arduino-nano feature flag. Here's the docs: https://rahix.github.io/avr-hal/arduino_uno/#compatible-boards

Rahix avatar Sep 12 '20 12:09 Rahix