atsamd-rs / atsamd

Target atsamd microcontrollers using Rust
https://matrix.to/#/#atsamd-rs:matrix.org
Apache License 2.0
544 stars 198 forks source link

ATSAMD51 DAC support #39

Open tarcieri opened 5 years ago

tarcieri commented 5 years ago

This is a tracking issue for supporting the ATSAMD51's DAC. I'm primarily interested in supporting the AdaFruit NeoTrellis M4 (see https://github.com/rust-embedded/wg/issues/286). Wiring it into an ADC abstraction (#35) sounds cool, but for now I'd be happy just getting it working with the low-level API.

The main thing I have to go off of is AdaFruit's port of the Teensy audio engine to these platforms. Here are a few relevant commits:

Is DMA going to be an issue?

For what it's worth, I'd like to attempt to port this PureData synthesis engine to this platform:

https://github.com/mhroth/ZenGarden

I started a project to do that here:

https://github.com/neobirth/zengarden.rs

This project supports NEON acceleration, although I'm not sure if it's compatible with the subset of NEON (DSP instructions) supported by the ATSAMD51(G19A?). Otherwise it appears to be an easy-to-embed PureData engine that runs inside of an external event loop written in C++ that presents a C interface.

sajattack commented 5 years ago

The low-level API portion (what we call a PAC or peripheral access crate) is auto-generated and will be part of my SAMD51 PR. The docs are already available here.

tgross35 commented 5 months ago

Since there is now ADC support in the HAL https://docs.rs/atsamd-hal/latest/atsamd_hal/adc/index.html and the PAC https://docs.rs/atsamd51g/latest/atsamd51g/adc0/index.html, could this be closed?

ianrrees commented 5 months ago

I think so!

sajattack commented 5 months ago

ADC != DAC?

tgross35 commented 5 months ago

Misread, thanks

ianrrees commented 5 months ago

Whoops, thanks for the catch @sajattack!