Skip to content

Implement a polling async SPI interface #129

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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions nrf52-hal-common/src/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,32 @@
use core::marker::PhantomData;

/// Input mode (type state)
#[derive(Debug)]
pub struct Input<MODE> {
_mode: PhantomData<MODE>,
}

/// Floating input (type state)
#[derive(Debug)]
pub struct Floating;
/// Pulled down input (type state)
#[derive(Debug)]
pub struct PullDown;
/// Pulled up input (type state)
#[derive(Debug)]
pub struct PullUp;

/// Output mode (type state)
#[derive(Debug)]
pub struct Output<MODE> {
_mode: PhantomData<MODE>,
}

/// Push pull output (type state)
#[derive(Debug)]
pub struct PushPull;
/// Open drain output (type state)
#[derive(Debug)]
pub struct OpenDrain;

// /// Alternate function
Expand All @@ -43,6 +50,7 @@ pub enum Level {
// across all of the possible pins
// ===============================================================
/// Generic $PX pin
#[derive(Debug)]
pub struct Pin<MODE> {
pub pin: u8,
#[cfg(feature = "52840")]
Expand Down
Loading