Struct arduino_nano33iot::Pins

source ·
pub struct Pins {
Show 36 fields pub rx: Pin<PB23, Reset>, pub tx: Pin<PB22, Reset>, pub d2: Pin<PB10, Reset>, pub d3: Pin<PB11, Reset>, pub d4: Pin<PA07, Reset>, pub d5: Pin<PA05, Reset>, pub d6: Pin<PA04, Reset>, pub d7: Pin<PA06, Reset>, pub d8: Pin<PA18, Reset>, pub d9: Pin<PA20, Reset>, pub d10: Pin<PA21, Reset>, pub miso: Pin<PA19, Reset>, pub mosi: Pin<PA16, Reset>, pub led_sck: Pin<PA17, Reset>, pub a0: Pin<PA02, Reset>, pub a1: Pin<PB02, Reset>, pub a2: Pin<PA11, Reset>, pub a3: Pin<PA10, Reset>, pub sda: Pin<PB08, Reset>, pub scl: Pin<PB09, Reset>, pub a6: Pin<PA09, Reset>, pub a7: Pin<PB03, Reset>, pub aref: Pin<PA03, Reset>, pub nina_mosi: Pin<PA12, Reset>, pub nina_miso: Pin<PA13, Reset>, pub nina_cs: Pin<PA14, Reset>, pub nina_sck: Pin<PA15, Reset>, pub nina_gpio0: Pin<PA27, Reset>, pub nina_resetn: Pin<PA08, Reset>, pub nina_ack: Pin<PA28, Reset>, pub serial_nina29: Pin<PA22, Reset>, pub serial_nina30: Pin<PA23, Reset>, pub usb_dm: Pin<PA24, Reset>, pub usb_dp: Pin<PA25, Reset>, pub p34: Pin<PA30, Reset>, pub p35: Pin<PA31, 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§

§rx: Pin<PB23, Reset>

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

rx,

§tx: Pin<PB22, Reset>

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

tx,

§d2: Pin<PB10, Reset>

Digital 2: PWM, TC

§d3: Pin<PB11, Reset>

Digital 3: PWM, TC

§d4: Pin<PA07, Reset>

Digital 4: TCC

§d5: Pin<PA05, Reset>

Digital 5: PWM, TCC, ADC

§d6: Pin<PA04, Reset>

Digital 6: PWM, TCC, ADC

§d7: Pin<PA06, Reset>

Digital 7: ADC

§d8: Pin<PA18, Reset>

Digital 8

§d9: Pin<PA20, Reset>

Digital 9: PWM, TCC

§d10: Pin<PA21, Reset>

Digital 10: PWM, TCC

§miso: Pin<PA19, Reset>

Digital 11/SCI MISO: PWM, TCC This field can also be accessed using the pin_alias! macro with the following alternate names:

miso,

§mosi: Pin<PA16, Reset>

Digital 12/SCI MOSI: PWM, TCC This field can also be accessed using the pin_alias! macro with the following alternate names:

mosi,

§led_sck: Pin<PA17, Reset>

Digital 13/LED/SPI SCK: ON-BOARD-LED This field can also be accessed using the pin_alias! macro with the following alternate names:

led, sck,

§a0: Pin<PA02, Reset>

Analog 0: DAC

§a1: Pin<PB02, Reset>

Analog 1

§a2: Pin<PA11, Reset>

Analog 2: PWM, TCC

§a3: Pin<PA10, Reset>

Analog 3: PWM, TCC

§sda: Pin<PB08, Reset>

Analog 4/SDA This field can also be accessed using the pin_alias! macro with the following alternate names:

sda,

§scl: Pin<PB09, Reset>

Analog 5/SCL: PWM< TCC This field can also be accessed using the pin_alias! macro with the following alternate names:

scl,

§a6: Pin<PA09, Reset>

Analog 6

§a7: Pin<PB03, Reset>

Analog 7

§aref: Pin<PA03, Reset>

AREF

§nina_mosi: Pin<PA12, Reset>

SPI (Lefacy ICSP) 1 / NINA MOSI This field can also be accessed using the pin_alias! macro with the following alternate names:

nina_mosi,

§nina_miso: Pin<PA13, Reset>

SPI (Lefacy ICSP) 2 / NINA MISO This field can also be accessed using the pin_alias! macro with the following alternate names:

nina_miso,

§nina_cs: Pin<PA14, Reset>

SPI (Lefacy ICSP) 3 / NINA CS This field can also be accessed using the pin_alias! macro with the following alternate names:

nina_cs,

§nina_sck: Pin<PA15, Reset>

SPI (Lefacy ICSP) 4 / NINA SCK This field can also be accessed using the pin_alias! macro with the following alternate names:

nina_sck,

§nina_gpio0: Pin<PA27, Reset>

NINA GPIO0

§nina_resetn: Pin<PA08, Reset>

NINA RESET_N This field can also be accessed using the pin_alias! macro with the following alternate names:

nina_reset_n,

§nina_ack: Pin<PA28, Reset>

NINA ACK This field can also be accessed using the pin_alias! macro with the following alternate names:

nina_ack,

§serial_nina29: Pin<PA22, Reset>

SerialNina 29: PWM, TC

§serial_nina30: Pin<PA23, Reset>

SerialNina 30: PWM, TC

§usb_dm: Pin<PA24, Reset>

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>

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

usb_dp,

§p34: Pin<PA30, Reset>

SWCLK

§p35: Pin<PA31, Reset>

SWDIO

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.