setting SPI Slave mode
- Dominant language
- C++
- Stars
- 16.7k
- Forks
- 13.1k
- PR merge metrics
- No merged PRs in 30d
Description
- [ Y] This issue complies with the [issue POLICY doc](https://github.com/esp8266/Arduino/blob/master/POLICY.md).
- [ Y] I have read the documentation at [readthedocs](https://arduino-esp8266.readthedocs.io/en/latest) and the issue is not addressed there.
- [ Y] I have tested that the issue is present in current master branch (aka latest git).
- [Y ] I have searched the issue tracker for a similar issue.
- [ N/A] If there is a stack dump, I have decoded it.
- [ Y] I have filled out all fields below.
#### Platform
- Hardware: [ESP-12]
- Core Version: [28 August 2018]
- Development Env: [Arduino IDE]
- Operating System: [MacOS]
### Settings in IDE
- Module: [Generic ESP8266 Module
- Flash Mode: [dio]
- Flash Size: [512K]
- lwip Variant: [N/A]
- Reset Method: [ck]
- Flash Frequency: [40Mhz]
- CPU Frequency: [80Mhz]
- Upload Using: [OTA|SERIAL]
- Upload Speed: [115200] (serial upload only)
### Problem Description
I am using and nRF52832 as master using nrf5 SDK and 8266 as SPI slave.
The master works with other SPI slave devices.
It appears that the mode is wrong on the SPI slave as the data is changing on the leading edge of the clock and most of the time is getting corrupted. In other words data is flowing in both directions but is mostly incorrect.
I need to change the slave to mode 3. I verified this by changing the mode at the master. This is not the right solution as there are other slaves that need mode 0.
SPISlave.begin() has no facility for setting the mode but I guess one could set the mode bits after invoking that.
Is there any code example anywhere that would show me how to do this?
Better still, could a mode parameter be added to this call?
Note: https://github.com/esp8266/Arduino/issues/2416#issue-172312441 is related but **not** the same issue.
### Sketch
Test sketch is the one in the current version of this repo.
https://github.com/esp8266/Arduino/blob/74819a763bfb6e9890a57411dcea4aba221a778d/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
### Debug Messages
```
none
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.