Struct feather_m0::pins::Pins

source ·
pub struct Pins {
Show 23 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 d5: Pin<PA15, Reset>, pub d6: Pin<PA20, 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>, /* 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. 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

§a2: Pin<PB09, Reset>

Analog Pin 2

§a3: Pin<PA04, Reset>

Analog Pin 3

§a4: Pin<PA05, Reset>

Analog Pin 4

§a5: Pin<PB02, Reset>

Analog Pin 5

§d0: Pin<PA11, Reset>

Pin 0, rx 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 This field can also be accessed using the [pin_alias!] macro with the following alternate names:

uart_tx,

§d5: Pin<PA15, Reset>

Pin 5, PWM capable This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d5_pwm,

§d6: Pin<PA20, Reset>

Pin 6, PWM capable This field can also be accessed using the [pin_alias!] macro with the following alternate names:

ssd1306_dc,

§d9: Pin<PA07, Reset>

Pin 9, PWM capable. Also analog input (A7) This field can also be accessed using the [pin_alias!] macro with the following alternate names:

ssd1306_rst,

§d10: Pin<PA18, Reset>

Pin 10, PWM capable

§d11: Pin<PA16, Reset>

Pin 11, PWM capable

§d12: Pin<PA19, Reset>

Pin 12, PWM capable

§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,

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 Freeze for Pins

§

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 T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.