Skip to main content

Crate avr_port

Crate avr_port 

Source
Expand description

no_std GPIO port abstraction for AVR (ATmega328P).

Use Port B, C, and D via DDR/PORT/PIN registers:

  • PORTx: data register (read/write)
  • DDRx: data direction register (read/write)
  • PINx: input pins (read only)

§Example

use avr_port::{portb, Pin};

let mut port_b = portb::init();
port_b.set_pin_mode(Pin::P5, true);
port_b.set_pin_state(Pin::P5, true);
let _level = port_b.read_pin(Pin::P5);

Modules§

portb
portc
portd

Structs§

Port

Enums§

Pin