Module port

Source
Expand description

GPIO & Pin control.

This module contains a Pins struct which represents all pins of the board. The Pins struct is most easily constructed using the arduino_hal::pins!() macro:

let dp = arduino_hal::Peripherals::take().unwrap();
let pins = arduino_hal::pins!(dp);

Additionally, the mode submodule contains all valid types for the MODE generic parameter of a pin. The Pin type-alias represents a pin which can represent any of the pins dynamically (while usually each pin has its own type).

Check the documentation for avr_hal_generic::port::Pin for a detailed explanation of GPIO pins in avr-hal.

Modules§

mode
GPIO pin modes

Structs§

Pins
Pins of the Arduino Uno, Arduino Nano, SparkFun ProMini 3.3V (8Mhz), and SparkFun ProMini 5V (16MHz).

Traits§

PinMode
PinOps

Type Aliases§

A0
A0
A1
A1
A2
A2
A3
A3
A4
A4
A5
A5
D0
D0 / RX
D1
D1 / TX
D2
D2
D3
D3
D4
D4
D5
D5
D6
D6
D7
D7
D8
D8
D9
D9
D10
D10
D11
D11
D12
D12
D13
D13
Pin
Type-alias for a pin type which can represent any concrete pin.