Struct arduino_mkrzero::pins::Pins

source ·
pub struct Pins {
Show 33 fields pub pa02: Pin<PA02, Reset>, pub pa03: Pin<PA03, Reset>, pub pa04: Pin<PA04, Reset>, pub pa05: Pin<PA05, Reset>, pub pa06: Pin<PA06, Reset>, pub pa07: Pin<PA07, Reset>, pub pa08: Pin<PA08, Reset>, pub pa09: Pin<PA09, Reset>, pub pa10: Pin<PA10, Reset>, pub pa11: Pin<PA11, Reset>, pub pa12: Pin<PA12, Reset>, pub pa13: Pin<PA13, Reset>, pub pa14: Pin<PA14, Reset>, pub pa15: Pin<PA15, Reset>, pub pa16: Pin<PA16, Reset>, pub pa17: Pin<PA17, Reset>, pub pa18: Pin<PA18, Reset>, pub pa19: Pin<PA19, Reset>, pub pa20: Pin<PA20, Reset>, pub pa21: Pin<PA21, Reset>, pub pa22: Pin<PA22, Reset>, pub pa23: Pin<PA23, Reset>, pub pa24: Pin<PA24, Reset>, pub pa25: Pin<PA25, Reset>, pub pa27: Pin<PA27, Reset>, pub pb02: Pin<PB02, Reset>, pub pb03: Pin<PB03, Reset>, pub pb08: Pin<PB08, Reset>, pub pb09: Pin<PB09, Reset>, pub pb10: Pin<PB10, Reset>, pub pb11: Pin<PB11, Reset>, pub pb22: Pin<PB22, Reset>, pub pb23: Pin<PB23, 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§

§pa02: Pin<PA02, Reset>

PA02: Analog DAC output / ADC input 0, digital pin 15. This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d15, dac0, a0,

§pa03: Pin<PA03, Reset>

PA03: ADC/DAC reference voltage. This field can also be accessed using the [pin_alias!] macro with the following alternate names:

a_ref,

§pa04: Pin<PA04, Reset>

PA04: Analog input 3, digital pin 18. This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d18, a3,

§pa05: Pin<PA05, Reset>

PA05: Analog input 4, digital pin 19. This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d19, a4,

§pa06: Pin<PA06, Reset>

PA06: Analog input 5, digital pin 20. This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d20, a5,

§pa07: Pin<PA07, Reset>

PA07: Analog input 6, digital pin 21. This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d21, a6,

§pa08: Pin<PA08, Reset>

PA08: Sercom 2 SDA, digital pin 11. This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d11, i2c_sda,

§pa09: Pin<PA09, Reset>

PA09: Sercom 2 SCL, digital pin 12. This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d12, i2c_scl,

§pa10: Pin<PA10, Reset>

PA10: Digital pin 2. This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d2,

§pa11: Pin<PA11, Reset>

PA11: Digital pin 3. This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d3,

§pa12: Pin<PA12, Reset>

PA12: SD Card COPI. This field can also be accessed using the [pin_alias!] macro with the following alternate names:

sd_copi,

§pa13: Pin<PA13, Reset>

PA13: SD Card SCK. This field can also be accessed using the [pin_alias!] macro with the following alternate names:

sd_sck,

§pa14: Pin<PA14, Reset>

PA14: SD Card SS. Operated either by the peripheral or by an output GPIO pin. This field can also be accessed using the [pin_alias!] macro with the following alternate names:

sd_ss_gpio, sd_ss,

§pa15: Pin<PA15, Reset>

PA15: SD Card CIPO. This field can also be accessed using the [pin_alias!] macro with the following alternate names:

sd_cipo,

§pa16: Pin<PA16, Reset>

PA16: Sercom 1 SPI COPI, digital pin 8. This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d8, spi_copi,

§pa17: Pin<PA17, Reset>

PA17: Sercom 1 SPI SCK, digital pin 9 This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d9, spi_sck,

§pa18: Pin<PA18, Reset>

PA18: USB Input Detection This field can also be accessed using the [pin_alias!] macro with the following alternate names:

usb_id,

§pa19: Pin<PA19, Reset>

PA19: Main SPI CIPO, digital pin 10 This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d10, spi_cipo,

§pa20: Pin<PA20, Reset>

PA20: Digital pin 6 This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d6,

§pa21: Pin<PA21, Reset>

PA21: Digital pin 7 This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d7,

§pa22: Pin<PA22, Reset>

PA22: Digital pin 0 This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d0,

§pa23: Pin<PA23, Reset>

PA23: Digital pin 1 This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d1,

§pa24: Pin<PA24, Reset>

PA24: USB Negative This field can also be accessed using the [pin_alias!] macro with the following alternate names:

usb_n,

§pa25: Pin<PA25, Reset>

PA25: USB Positive This field can also be accessed using the [pin_alias!] macro with the following alternate names:

usb_p,

§pa27: Pin<PA27, Reset>

PA27: SD Card Detect

§pb02: Pin<PB02, Reset>

PB02: Analog input 1, digital pin 16 This field can also be accessed using the [pin_alias!] macro with the following alternate names:

a1, d16,

§pb03: Pin<PB03, Reset>

PB03: Analog input 2, digital pin 17 This field can also be accessed using the [pin_alias!] macro with the following alternate names:

a2, d17,

§pb08: Pin<PB08, Reset>

PB08: LED This field can also be accessed using the [pin_alias!] macro with the following alternate names:

led,

§pb09: Pin<PB09, Reset>

PB09: Battery voltage sensor This field can also be accessed using the [pin_alias!] macro with the following alternate names:

v_batt,

§pb10: Pin<PB10, Reset>

PB10: Digital pin 4 This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d4,

§pb11: Pin<PB11, Reset>

PB11: Digital pin 5 This field can also be accessed using the [pin_alias!] macro with the following alternate names:

d5,

§pb22: Pin<PB22, Reset>

PB22: UART Tx This field can also be accessed using the [pin_alias!] macro with the following alternate names:

uart_tx,

§pb23: Pin<PB23, Reset>

PB22: UART Rx This field can also be accessed using the [pin_alias!] macro with the following alternate names:

uart_rx,

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.