Skip to content

Commit

Permalink
Add constant for SPI mode 1,1
Browse files Browse the repository at this point in the history
  • Loading branch information
eldruin committed Feb 17, 2019
1 parent 6798858 commit fb272f3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,18 @@ pub enum Error<E> {
BufferingNotSupported,
}

/// SPI mode
pub const MODE: Mode = Mode {
/// SPI mode (CPOL = 0, CPHA = 0)
pub const MODE0: Mode = Mode {
phase: Phase::CaptureOnFirstTransition,
polarity: Polarity::IdleLow,
};

/// SPI mode (CPOL = 1, CPHA = 1)
pub const MODE1: Mode = Mode {
phase: Phase::CaptureOnSecondTransition,
polarity: Polarity::IdleHigh,
};

/// Channel selector
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Channel {
Expand Down

0 comments on commit fb272f3

Please sign in to comment.