[]Struct arduino_leonardo::pins::Pins

pub struct Pins {
    pub d0: PD2<Input<Floating>>,
    pub d1: PD3<Input<Floating>>,
    pub d2: PD1<Input<Floating>>,
    pub d3: PD0<Input<Floating>>,
    pub d4: PD4<Input<Floating>>,
    pub d5: PC6<Input<Floating>>,
    pub d6: PD7<Input<Floating>>,
    pub d7: PE6<Input<Floating>>,
    pub d8: PB4<Input<Floating>>,
    pub d9: PB5<Input<Floating>>,
    pub d10: PB6<Input<Floating>>,
    pub d11: PB7<Input<Floating>>,
    pub d12: PD6<Input<Floating>>,
    pub d13: PC7<Input<Floating>>,
    pub led_rx: PB0<Input<Floating>>,
    pub led_tx: PD5<Input<Floating>>,
    pub ddr: DDR,
}

Convenience wrapper for easy access to Arduino Leonardo pins

Example

let dp = arduino_leonardo::Peripherals::take().unwrap();

let mut pins = arduino_leonardo::Pins::new(dp.PORTB, dp.PORTC, dp.PORTD, dp.PORTE);

// Notic that we can use `pins.ddr` for all pins.  It is generic over the
// different ports.
let mut led = pins.d13.into_output(pins.ddr);

Fields

d0: PD2<Input<Floating>>

D0 / RX

  • RX (UART)
  • INT2: External Interrupt
d1: PD3<Input<Floating>>

D1 / TX

  • TX (UART)
  • INT3: External Interrupt
d2: PD1<Input<Floating>>

D2 / SDA

  • SDA: i2c/twi data
  • INT1: External Interrupt
d3: PD0<Input<Floating>>

D3 / SCL

d4: PD4<Input<Floating>>

D4

d5: PC6<Input<Floating>>

D5

  • PWM: atmega32u4_hal::timer::Timer3Pwm
  • OC3A: Output Compare Channel A for Timer/Counter3
  • #OC4A: Inverted Output Compare Channel A for Timer/Counter4 (Not implemented)
d6: PD7<Input<Floating>>

D6

d7: PE6<Input<Floating>>

D7

  • INT6: External Interrupt
d8: PB4<Input<Floating>>

D8

d9: PB5<Input<Floating>>

D9

  • PWM: atmega32u4_hal::timer::Timer1Pwm
  • OC1A: Output Compare Channel A for Timer/Counter1
  • #OC4B: Inverted Output Compare Channel B for Timer/Counter4 (Not implemented)
d10: PB6<Input<Floating>>

D10

d11: PB7<Input<Floating>>

D11

d12: PD6<Input<Floating>>

D12

  • #OC4D: Inverted Output Compare Channel D for Timer/Counter4 (Not implemented)
d13: PC7<Input<Floating>>

D13 / LED_BUILTIN

led_rx: PB0<Input<Floating>>

RX

Led for indicating inbound data

led_tx: PD5<Input<Floating>>

TX

Led for indicating outbound data

ddr: DDR

Data Direction Register

This ddr is generic and can be used for all pins

Methods

impl Pins

pub fn new(portb: PORTB, portc: PORTC, portd: PORTD, porte: PORTE) -> Pins

Initialize pins

Auto Trait Implementations

impl Send for Pins

impl Sync for Pins

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]