esp-rs / esp32-hal

A hardware abstraction layer for the esp32 written in Rust.
Apache License 2.0
192 stars 28 forks source link

Added SPI peripheral driver #43

Closed arjanmels closed 3 years ago

arjanmels commented 3 years ago

SPI peripheral driver implements all basic SPI functionality at good speeds. It implements optimized versions of the embedded_hal::blocking::spi traits using the ESP32 16 x int32 hardware buffer for chunked transfers and iterator evaluation is done overlapped with the transmissions to achieve ~ 2.5us overhead between chunks.

It includes an examples using ESP32 WROVER DEVKIT LCD screen (using Ili9341 chip).

It does not yet include DMA, half-duplex or Quad SPI support. (I don't plan to implement this in the near future either, so I would recommend to merge this PR as-is.)

It needs a change in esp32: https://github.com/esp-rs/esp32/pull/37

Builds on PR #42 (although it is independent).

MabezDev commented 3 years ago

Very nice! Will try with a Ssd1351 Oled this weekend!

arjanmels commented 3 years ago

@MabezDev Did it work for you, or you got distracted by other work?

MabezDev commented 3 years ago

Hi @arjanmels , my deepest apologies for leaving this for so long.

I did get around to trying it out with the Ssd1351 today and it worked fantastically!!!

I've just released 0.7.0 for esp32 (again sorry for the delay!), I'll make the changes to this PR and merge this.

Thank you once again for your hard work!

arjanmels commented 3 years ago

@MabezDev No worries, been busy over summer with other stuff myself as well. Thanks for the invite for joining.