ch32-rs / ch32v00x-hal

HAL for the CH32V003 family of microcontrollers
29 stars 11 forks source link

SPI feature request #15

Closed drbh closed 2 months ago

drbh commented 3 months ago

Hi @andelf this is an awesome project, thank you for all the work on ch320-rs.

I there a plan for SPI support in the near future?

I'd like to contribute but am still learning the basics of embedded development and will likely not be able to implement the protocol, however if I can assist with simple testing please let me know.

possibly helpful resource

**note my target peripheral is the nrf24l01

andelf commented 2 months ago

It should be an easy task. The preferred reference for CH32 is STM32's SPI peripheral. (Yes, these Chinese chip vendors made some effort to be compatible with STM32, you'll find almost the same register blocks).

Currently, I'm working on an all-on-one Embassy hal driver at https://github.com/ch32-rs/ch32-hal. ch32v00x-hal is the original HAL crate. ch32v00x-hal will be the crate for legacy HAL style embedded programming for now. I'll review and merge PRs here but I myself might not work on it.

An SPI demo is at https://github.com/ch32-rs/ch32-hal/blob/main/examples/ch32v003/src/bin/spi-lcd-st7735-cube.rs

drbh commented 2 months ago

Hi @andelf thanks for the information! I'm actually going to move over to the ch32-hal crate.

Thanks for adding the SPI demo, it is very helpful for understanding how to add other peripherals