Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HW SPI: SPI_MODEx #52

Closed
1 of 5 tasks
olikraus opened this issue Aug 20, 2016 · 2 comments
Closed
1 of 5 tasks

HW SPI: SPI_MODEx #52

olikraus opened this issue Aug 20, 2016 · 2 comments
Labels
Milestone

Comments

@olikraus
Copy link
Owner

olikraus commented Aug 20, 2016

spi_mode in the info struct should correspond to the Arduino SPI modes SPI_MODE0, SPI_MODE1, etc.
However the numbers 0..3 do not correspond to SPI_MODE0..SPI_MODE3 because internally these macros do have several random values.
As a result, we can not simply pass 0..3 to SPISettings, instead a mapping has to happen first.

More tests are required. At least ST7920 must be tested.

Mode Clock Polarity (CPOL) Clock Phase (CPHA) Output Edge Data Takover
SPI_MODE0 0 0 Falling Rising
SPI_MODE1 0 1 Rising Falling
SPI_MODE2 1 0 Rising Falling
SPI_MODE3 1 1 Falling Rising

spi-bus-timing
Image Source: http://www.corelis.com/education/SPI_Tutorial.htm

  • Introduce SPI_MODEx mapping in the HW SPI procedures for Arduino
  • Check the table above (is this all correct? Does the HW respond correctly?)
  • Document the table in the code
  • Update the byte procedure (SW SPI)
  • Testing
@olikraus olikraus added the bug label Aug 20, 2016
@olikraus olikraus added this to the 2.4 milestone Aug 20, 2016
@olikraus
Copy link
Owner Author

Verified with ST7920 on Due, Uno and 101
Created a thread in Arduino Forum: http://forum.arduino.cc/index.php?topic=419660.0

@olikraus
Copy link
Owner Author

olikraus commented Aug 21, 2016

Verified with SH1106 on ESP8266, Due and 101.
Verified with UC1701 on Uno and 101.
Verified with SSD1306 onUno, Due and 101.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant