atsamd
atsamd copied to clipboard
Add Board support package for Adafruit Feather M4 CAN
Summary
Add Board support package for Adafruit Feather M4 CAN (NeoPixel support), add examples for Blinky and NeoPixel
Checklist
- [ ]
CHANGELOG.md
for the BSP or HAL updated - [ ] All new or modified code is well documented, especially public items
- [ ] No new warnings or clippy suggestions have been introduced (see CI or check locally)
If Adding a new Board
- [ ] Board CI added to
crates.json
- [ ] Board is properly following "Tier 2" conventions, unless otherwise decided to be "Tier 1"
I think this would be better as a #[cfg(feature = "can"]
like we did for the radio variants of feather m0 https://github.com/atsamd-rs/atsamd/blob/b82ab9ab0566deace39a6e8af6c963c33d6f8540/boards/feather_m0/src/lib.rs#L177 rather than an entirely separate BSP. Also I don't think we have CAN support in the HAL so I'm not sure how different it would be from the regular feather_m4. If the board is completely different and not compatible with the regular feather_m4, let me know, but I suspect it's just a minor variant.
I think this would be better as a
#[cfg(feature = "can"]
like we did for the radio variants of feather m0https://github.com/atsamd-rs/atsamd/blob/b82ab9ab0566deace39a6e8af6c963c33d6f8540/boards/feather_m0/src/lib.rs#L177
rather than an entirely separate BSP. Also I don't think we have CAN support in the HAL so I'm not sure how different it would be from the regular feather_m4. If the board is completely different and not compatible with the regular feather_m4, let me know, but I suspect it's just a minor variant.
I've been experimenting with the Adafruit Feather M4 CAN board and found that the NeoPixel example doesn't work. The problem turned out to be that the NeoPixel on the Adafruit Feather M4 CAN board is connected differently than on the Adafruit Feather M4 board, and the power supply to the NeoPixel is controlled by a microcontroller. The ultimate goal of all my experimentation is to run full CAN/CANFD work on this board using Rust.
Yeah I still think you could remap the neopixel and add the CAN pins under a feature flag.
I agree with @sajattack. I would strongly prefer not to create a new BSP if it can work as a feature flag. The duplicated code becomes much more of a liability, especially if it gets out of sync with the existing feather_m4