Trait rp6::avr::device::pin::Pin

source ·
pub trait Pin {
    type DDR: Register<T = u8>;
    type PORT: Register<T = u8>;
    type PIN: Register<T = u8>;

    const OFFSET: u8;
    const MASK: u8;

    // Provided methods
    fn set_direction(direction: DataDirection) { ... }
    fn set_input() { ... }
    fn set_output() { ... }
    fn set_high() { ... }
    fn set_low() { ... }
    fn toggle() { ... }
    fn is_high() -> bool { ... }
    fn is_low() -> bool { ... }
}
Expand description

An IO pin.

Required Associated Types§

source

type DDR: Register<T = u8>

The associated data direction register.

source

type PORT: Register<T = u8>

The associated port register.

source

type PIN: Register<T = u8>

Reads from the register will read input bits.

Required Associated Constants§

source

const OFFSET: u8

The numeric offset of the Pin in the register

source

const MASK: u8

The mask of the pin used for accessing registers.

Provided Methods§

source

fn set_direction(direction: DataDirection)

Sets the data direction of the pin.

source

fn set_input()

Sets the pin up as an input.

source

fn set_output()

Sets the pin up as an output.

source

fn set_high()

Set the pin to high.

The pin must be configured as an output.

source

fn set_low()

Set the pin to low.

The pin must be configured as an output.

source

fn toggle()

Toggles the pin.

The pin must be configured as an output.

source

fn is_high() -> bool

Check if the pin is currently high.

The pin must be configured as an input.

source

fn is_low() -> bool

Checks if the pin is currently low.

The pin must be configured as an input.

Implementors§

source§

impl Pin for a0

§

type DDR = DDRA

§

type PORT = PORTA

§

type PIN = PINA

source§

const OFFSET: u8 = 0u8

source§

const MASK: u8 = 1u8

source§

impl Pin for a1

§

type DDR = DDRA

§

type PORT = PORTA

§

type PIN = PINA

source§

const OFFSET: u8 = 1u8

source§

const MASK: u8 = 2u8

source§

impl Pin for a2

§

type DDR = DDRA

§

type PORT = PORTA

§

type PIN = PINA

source§

const OFFSET: u8 = 2u8

source§

const MASK: u8 = 4u8

source§

impl Pin for a3

§

type DDR = DDRA

§

type PORT = PORTA

§

type PIN = PINA

source§

const OFFSET: u8 = 3u8

source§

const MASK: u8 = 8u8

source§

impl Pin for a4

§

type DDR = DDRA

§

type PORT = PORTA

§

type PIN = PINA

source§

const OFFSET: u8 = 4u8

source§

const MASK: u8 = 16u8

source§

impl Pin for a5

§

type DDR = DDRA

§

type PORT = PORTA

§

type PIN = PINA

source§

const OFFSET: u8 = 5u8

source§

const MASK: u8 = 32u8

source§

impl Pin for a6

§

type DDR = DDRA

§

type PORT = PORTA

§

type PIN = PINA

source§

const OFFSET: u8 = 6u8

source§

const MASK: u8 = 64u8

source§

impl Pin for a7

§

type DDR = DDRA

§

type PORT = PORTA

§

type PIN = PINA

source§

const OFFSET: u8 = 7u8

source§

const MASK: u8 = 128u8

source§

impl Pin for b0

§

type DDR = DDRB

§

type PORT = PORTB

§

type PIN = PINB

source§

const OFFSET: u8 = 0u8

source§

const MASK: u8 = 1u8

source§

impl Pin for b1

§

type DDR = DDRB

§

type PORT = PORTB

§

type PIN = PINB

source§

const OFFSET: u8 = 1u8

source§

const MASK: u8 = 2u8

source§

impl Pin for b2

§

type DDR = DDRB

§

type PORT = PORTB

§

type PIN = PINB

source§

const OFFSET: u8 = 2u8

source§

const MASK: u8 = 4u8

source§

impl Pin for b3

§

type DDR = DDRB

§

type PORT = PORTB

§

type PIN = PINB

source§

const OFFSET: u8 = 3u8

source§

const MASK: u8 = 8u8

source§

impl Pin for b4

§

type DDR = DDRB

§

type PORT = PORTB

§

type PIN = PINB

source§

const OFFSET: u8 = 4u8

source§

const MASK: u8 = 16u8

source§

impl Pin for b5

§

type DDR = DDRB

§

type PORT = PORTB

§

type PIN = PINB

source§

const OFFSET: u8 = 5u8

source§

const MASK: u8 = 32u8

source§

impl Pin for b6

§

type DDR = DDRB

§

type PORT = PORTB

§

type PIN = PINB

source§

const OFFSET: u8 = 6u8

source§

const MASK: u8 = 64u8

source§

impl Pin for b7

§

type DDR = DDRB

§

type PORT = PORTB

§

type PIN = PINB

source§

const OFFSET: u8 = 7u8

source§

const MASK: u8 = 128u8

source§

impl Pin for c0

§

type DDR = DDRC

§

type PORT = PORTC

§

type PIN = PINC

source§

const OFFSET: u8 = 0u8

source§

const MASK: u8 = 1u8

source§

impl Pin for c1

§

type DDR = DDRC

§

type PORT = PORTC

§

type PIN = PINC

source§

const OFFSET: u8 = 1u8

source§

const MASK: u8 = 2u8

source§

impl Pin for c2

§

type DDR = DDRC

§

type PORT = PORTC

§

type PIN = PINC

source§

const OFFSET: u8 = 2u8

source§

const MASK: u8 = 4u8

source§

impl Pin for c3

§

type DDR = DDRC

§

type PORT = PORTC

§

type PIN = PINC

source§

const OFFSET: u8 = 3u8

source§

const MASK: u8 = 8u8

source§

impl Pin for c4

§

type DDR = DDRC

§

type PORT = PORTC

§

type PIN = PINC

source§

const OFFSET: u8 = 4u8

source§

const MASK: u8 = 16u8

source§

impl Pin for c5

§

type DDR = DDRC

§

type PORT = PORTC

§

type PIN = PINC

source§

const OFFSET: u8 = 5u8

source§

const MASK: u8 = 32u8

source§

impl Pin for c6

§

type DDR = DDRC

§

type PORT = PORTC

§

type PIN = PINC

source§

const OFFSET: u8 = 6u8

source§

const MASK: u8 = 64u8

source§

impl Pin for c7

§

type DDR = DDRC

§

type PORT = PORTC

§

type PIN = PINC

source§

const OFFSET: u8 = 7u8

source§

const MASK: u8 = 128u8

source§

impl Pin for d0

§

type DDR = DDRD

§

type PORT = PORTD

§

type PIN = PIND

source§

const OFFSET: u8 = 0u8

source§

const MASK: u8 = 1u8

source§

impl Pin for d1

§

type DDR = DDRD

§

type PORT = PORTD

§

type PIN = PIND

source§

const OFFSET: u8 = 1u8

source§

const MASK: u8 = 2u8

source§

impl Pin for d2

§

type DDR = DDRD

§

type PORT = PORTD

§

type PIN = PIND

source§

const OFFSET: u8 = 2u8

source§

const MASK: u8 = 4u8

source§

impl Pin for d3

§

type DDR = DDRD

§

type PORT = PORTD

§

type PIN = PIND

source§

const OFFSET: u8 = 3u8

source§

const MASK: u8 = 8u8

source§

impl Pin for d4

§

type DDR = DDRD

§

type PORT = PORTD

§

type PIN = PIND

source§

const OFFSET: u8 = 4u8

source§

const MASK: u8 = 16u8

source§

impl Pin for d5

§

type DDR = DDRD

§

type PORT = PORTD

§

type PIN = PIND

source§

const OFFSET: u8 = 5u8

source§

const MASK: u8 = 32u8

source§

impl Pin for d6

§

type DDR = DDRD

§

type PORT = PORTD

§

type PIN = PIND

source§

const OFFSET: u8 = 6u8

source§

const MASK: u8 = 64u8

source§

impl Pin for d7

§

type DDR = DDRD

§

type PORT = PORTD

§

type PIN = PIND

source§

const OFFSET: u8 = 7u8

source§

const MASK: u8 = 128u8