Struct itsybitsy_m0::Pins

source ·
pub struct Pins {
Show 33 fields pub aref: Pin<PA03, Reset>, pub a0: Pin<PA02, Reset>, pub a1: Pin<PB08, Reset>, pub a2: Pin<PB09, Reset>, pub a3: Pin<PA04, Reset>, pub a4: Pin<PA05, Reset>, pub a5: Pin<PB02, Reset>, pub d0: Pin<PA11, Reset>, pub d1: Pin<PA10, Reset>, pub d2: Pin<PA14, Reset>, pub d3: Pin<PA09, Reset>, pub d4: Pin<PA08, Reset>, pub d5: Pin<PA15, Reset>, pub d7: Pin<PA21, Reset>, pub d9: Pin<PA07, Reset>, pub d10: Pin<PA18, Reset>, pub d11: Pin<PA16, Reset>, pub d12: Pin<PA19, Reset>, pub d13: Pin<PA17, Reset>, pub sda: Pin<PA22, Reset>, pub scl: Pin<PA23, Reset>, pub sclk: Pin<PB11, Reset>, pub mosi: Pin<PB10, Reset>, pub miso: Pin<PA12, Reset>, pub usb_dm: Pin<PA24, Reset>, pub usb_dp: Pin<PA25, Reset>, pub flash_sclk: Pin<PB23, Reset>, pub flash_mosi: Pin<PB22, Reset>, pub flash_miso: Pin<PB03, Reset>, pub flash_cs: Pin<PA27, Reset>, pub dotstar_sck: Pin<PA00, Reset>, pub dotstar_mosi: Pin<PA01, Reset>, pub dotstar_miso: Pin<PA13, Reset>, /* private fields */
}
Expand description

BSP replacement for the HAL Pins type

This type is intended to provide more meaningful names for the given pins.

Fields§

§aref: Pin<PA03, Reset>

AREF pin - has 1uF capacitor to ground

§a0: Pin<PA02, Reset>

Analog pin 0. Also hardware capacitive touch capability Can act as a true analog output as it has a DAC (which is not currently supported by this hal) as well as input. This field can also be accessed using the pin_alias! macro with the following alternate names:

a0,

§a1: Pin<PB08, Reset>

Analog Pin 1, PWM capable, hardware capacitive touch capability

§a2: Pin<PB09, Reset>

Analog Pin 2, PWM capable, hardware capacitive touch capability

§a3: Pin<PA04, Reset>

Analog Pin 3, hardware capacitive touch capability

§a4: Pin<PA05, Reset>

Analog Pin 4, hardware capacitive touch capability

§a5: Pin<PB02, Reset>

Analog Pin 5, hardware capacitive touch capability

§d0: Pin<PA11, Reset>

Pin 0, rx. Also analog input or I2S LRCLK This field can also be accessed using the pin_alias! macro with the following alternate names:

uart_rx,

§d1: Pin<PA10, Reset>

Pin 1, tx. Also analog input or I2S bitclock This field can also be accessed using the pin_alias! macro with the following alternate names:

uart_tx,

§d2: Pin<PA14, Reset>

Pin 2

§d3: Pin<PA09, Reset>

Pin 3, PWM capable. Also analog input or I2S master clock

§d4: Pin<PA08, Reset>

Pin 4, PWM capable. Also analog input or I2S data channel 1. Cannot be interrupt pin

§d5: Pin<PA15, Reset>

Pin 5, PWM capable. This is a special OUTPUT-only pin, that is level-shifted up to Vhi voltage This field can also be accessed using the pin_alias! macro with the following alternate names:

d5_pwm,

§d7: Pin<PA21, Reset>

Pin 7. Also I2S LRCLK

§d9: Pin<PA07, Reset>

Pin 9, PWM capable, hardware capacitive touch capability Also analog input or I2S data channel 0

§d10: Pin<PA18, Reset>

Pin 10, PWM capable

§d11: Pin<PA16, Reset>

Pin 11, PWM capable

§d12: Pin<PA19, Reset>

Pin 12. Also I2S data channel 0

§d13: Pin<PA17, Reset>

Pin 13, which is also attached to the red LED. PWM capable. This field can also be accessed using the pin_alias! macro with the following alternate names:

red_led,

§sda: Pin<PA22, Reset>

The I2C data line This field can also be accessed using the pin_alias! macro with the following alternate names:

sda,

§scl: Pin<PA23, Reset>

The I2C clock line This field can also be accessed using the pin_alias! macro with the following alternate names:

scl,

§sclk: Pin<PB11, Reset>

The SPI SCLK This field can also be accessed using the pin_alias! macro with the following alternate names:

sclk,

§mosi: Pin<PB10, Reset>

The SPI MOSI This field can also be accessed using the pin_alias! macro with the following alternate names:

mosi,

§miso: Pin<PA12, Reset>

The SPI MISO This field can also be accessed using the pin_alias! macro with the following alternate names:

miso,

§usb_dm: Pin<PA24, Reset>

The USB D- pad This field can also be accessed using the pin_alias! macro with the following alternate names:

usb_dm,

§usb_dp: Pin<PA25, Reset>

The USB D+ pad This field can also be accessed using the pin_alias! macro with the following alternate names:

usb_dp,

§flash_sclk: Pin<PB23, Reset>

SPI clock for the on-board SPI flash

§flash_mosi: Pin<PB22, Reset>

SPI MOSI for the on-board SPI flash

§flash_miso: Pin<PB03, Reset>

SPI MISO for the on-board SPI flash

§flash_cs: Pin<PA27, Reset>

SPI chip select for the on-board SPI flash

§dotstar_sck: Pin<PA00, Reset>

SPI SCK line for the Apa102 builtin Dotstar led This field can also be accessed using the pin_alias! macro with the following alternate names:

dot_star_clk,

§dotstar_mosi: Pin<PA01, Reset>

SPI MOSI line for the Apa102 builtin Dotstar led This field can also be accessed using the pin_alias! macro with the following alternate names:

dot_star_data,

§dotstar_miso: Pin<PA13, Reset>

Not connected, used as the SPI MISO line for the Apa102 builtin Dotstar led This field can also be accessed using the pin_alias! macro with the following alternate names:

dot_star_n_c,

Implementations§

source§

impl Pins

source

pub fn new(port: PORT) -> Self

Take ownership of the PAC [PORT] and split it into discrete [Pin]s.

This struct serves as a replacement for the HAL Pins struct. It is intended to provide more meaningful names for each [Pin] in a BSP. Any [Pin] not defined by the BSP is dropped.

PORT Pin Pins

source

pub unsafe fn port(&mut self) -> PORT

Take the PAC [PORT]

The [PORT] can only be taken once. Subsequent calls to this function will panic.

Safety

Direct access to the [PORT] could allow you to invalidate the compiler’s type-level tracking, so it is unsafe.

PORT

Auto Trait Implementations§

§

impl RefUnwindSafe for Pins

§

impl Send for Pins

§

impl !Sync for Pins

§

impl Unpin for Pins

§

impl UnwindSafe for Pins

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.