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

Add SPI_MODEx docs #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions SPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@
#define MSBFIRST 1
#endif

#define SPI_MODE0 0x00
#define SPI_MODE1 0x04
#define SPI_MODE2 0x08
#define SPI_MODE3 0x0C
// SPI Mode details: https://en.wikipedia.org/wiki/Serial_Peripheral_Interface#:~:text=the%20original%20specification.-,Mode%20numbers,-%5Bedit%5D
#define SPI_MODE0 0x00 // CPOL = 0, CPHA = 0
#define SPI_MODE1 0x04 // CPOL = 0, CPHA = 1
#define SPI_MODE2 0x08 // CPOL = 1, CPHA = 0
#define SPI_MODE3 0x0C // CPOL = 1, CPHA = 1

#define SPI_CLOCK_DIV4 0x00
#define SPI_CLOCK_DIV16 0x01
Expand Down