[−]Struct arduino_leonardo::pins::Pins
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 dataINT1
: External Interrupt
d3: PD0<Input<Floating>>
D3
/ SCL
- PWM: atmega32u4_hal::timer::Timer0Pwm
SCL
: i2c/twi clockINT0
: External InterruptOC0B
: Output Compare ChannelB
for Timer/Counter0
d4: PD4<Input<Floating>>
D4
d5: PC6<Input<Floating>>
D5
- PWM: atmega32u4_hal::timer::Timer3Pwm
OC3A
: Output Compare ChannelA
for Timer/Counter3#OC4A
: Inverted Output Compare ChannelA
for Timer/Counter4 (Not implemented)
d6: PD7<Input<Floating>>
D6
- PWM: atmega32u4_hal::timer::Timer4Pwm
OC4D
: Output Compare ChannelD
for Timer/Counter4
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 ChannelA
for Timer/Counter1#OC4B
: Inverted Output Compare ChannelB
for Timer/Counter4 (Not implemented)
d10: PB6<Input<Floating>>
D10
- PWM: atmega32u4_hal::timer::Timer1Pwm
OC1B
: Output Compare ChannelB
for Timer/Counter1OC4B
: Output Compare ChannelB
for Timer/Counter4 (Not implemented)
d11: PB7<Input<Floating>>
D11
- PWM: atmega32u4_hal::timer::Timer0Pwm
OC0A
: Output Compare ChannelB
for Timer/Counter0OC1C
: Output Compare ChannelC
for Timer/Counter1
d12: PD6<Input<Floating>>
D12
#OC4D
: Inverted Output Compare ChannelD
for Timer/Counter4 (Not implemented)
d13: PC7<Input<Floating>>
D13
/ LED_BUILTIN
- Onboard LED
- PWM: atmega32u4_hal::timer::Timer4Pwm
OC4A
: Output Compare ChannelA
for Timer/Counter4
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
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,