This class is designed for interfacing with ESP32 SPI module in slave mode. It means to be used and tested on Arduino platform. The main idea of testing with the main arduino .ino file is only to connect between SPI-Master signals and of the Slave. Further information could be found in the topics.
Cheer! iPAS
The code was adopted from https://gist.github.com/shaielc/e0937d68978b03b2544474b641328145. Thank you to @shaielc for the scaffolding. Then I found it works a bit currently. However, the adaptation is still required so a SPI-Slave module is functional (transfer data via DMA is disable).
To test the code, please wiring as the following figure:
The connections are described:
|
I also use the BusPirate for debugging. It is just an option, can be neglected. But, if you have one, SPI-sniffer article and the following BusPirate pinout maybe help:
- In case of Arduino IDE, please rename test.ino as your folder name.
- You would see that the master cannot get the correct reponsed data.
The received response is shifted left by one bit.
I am not sure why this is occured.
However, the SlaveSPI class works correctly.
- Update: the problem was fixed by the guide from spi timing #1427.
- NEW found possible solution for DMA buffer.