Trait rp6::avr::device::register::Register

source ·
pub trait Register: Default + Sized {
    type T: RegisterValue;
    type RegisterBits = RegisterBits<Self>;

    const ADDRESS: *mut Self::T;
Show 14 methods // Provided methods fn write<V>(value: V)
where V: Into<Self::T> { ... } fn read() -> Self::T { ... } fn set(bits: RegisterBits<Self>) { ... } fn set_mask_raw(mask: Self::T) { ... } fn unset(bits: RegisterBits<Self>) { ... } fn unset_mask_raw(mask: Self::T) { ... } fn toggle(mask: RegisterBits<Self>) { ... } fn toggle_raw(mask: Self::T) { ... } fn is_set(bits: RegisterBits<Self>) -> bool { ... } fn is_mask_set_raw(mask: Self::T) -> bool { ... } fn is_clear(mask: RegisterBits<Self>) -> bool { ... } fn is_clear_raw(mask: Self::T) -> bool { ... } fn wait_until_set(bits: RegisterBits<Self>) { ... } fn wait_until_mask_set_raw(mask: Self::T) { ... }
}
Expand description

A register.

Required Associated Types§

source

type T: RegisterValue

The type that can represent the value of the register.

Provided Associated Types§

source

type RegisterBits = RegisterBits<Self>

The type representing a set of bits that may be manipulated within the register.

Required Associated Constants§

source

const ADDRESS: *mut Self::T

The address of the register.

Provided Methods§

source

fn write<V>(value: V)where
V: Into<Self::T>,

Writes a value to the register.

source

fn read() -> Self::T

Reads the value of the register.

source

fn set(bits: RegisterBits<Self>)

Sets a set of bits to 1 in the register.

source

fn set_mask_raw(mask: Self::T)

Sets a bitmask in a register.

This is equivalent to r |= mask.

source

fn unset(bits: RegisterBits<Self>)

Unsets a set of bits in the register.

All of the bits will be set to 0.

source

fn unset_mask_raw(mask: Self::T)

Clears a bitmask from a register.

This is equivalent to r &= !mask.

source

fn toggle(mask: RegisterBits<Self>)

Toggles a set of bits within the register.

All specified bits which were previously 0 will become 1, and all specified bits that were previous 1 will become 0.

source

fn toggle_raw(mask: Self::T)

Toggles a mask in the register.

This is equivalent to r ^= mask.

source

fn is_set(bits: RegisterBits<Self>) -> bool

Checks if a set of bits are enabled.

All specifed bits must be set for this function to return true.

source

fn is_mask_set_raw(mask: Self::T) -> bool

Checks if a mask is set in the register.

This is equivalent to (r & mask) == mask.

source

fn is_clear(mask: RegisterBits<Self>) -> bool

Checks if a set of bits are not set.

All specified bits must be 0 for this function to return true.

source

fn is_clear_raw(mask: Self::T) -> bool

Checks if a mask is clear in the register.

This is equivalent to (r & mask) == 0.

source

fn wait_until_set(bits: RegisterBits<Self>)

Waits until a set of bits are set in the register.

This function will block until all bits that are set in the mask are also set in the register.

source

fn wait_until_mask_set_raw(mask: Self::T)

Waits until a bit mask is set in the register.

This function will block until all bits that are set in the mask are also set in the register.

Implementors§

source§

impl Register for ACSR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x28 as *mut u8}

source§

impl Register for ADC

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x24 as *mut u8}

source§

impl Register for ADCH

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x25 as *mut u8}

source§

impl Register for ADCL

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x24 as *mut u8}

source§

impl Register for ADCSRA

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x26 as *mut u8}

source§

impl Register for ADMUX

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x27 as *mut u8}

source§

impl Register for ASSR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x42 as *mut u8}

source§

impl Register for DDRA

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x3a as *mut u8}

source§

impl Register for DDRB

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x37 as *mut u8}

source§

impl Register for DDRC

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x34 as *mut u8}

source§

impl Register for DDRD

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x31 as *mut u8}

source§

impl Register for EEAR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x3e as *mut u8}

source§

impl Register for EEARH

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x3f as *mut u8}

source§

impl Register for EEARL

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x3e as *mut u8}

source§

impl Register for EECR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x3c as *mut u8}

source§

impl Register for EEDR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x3d as *mut u8}

source§

impl Register for GICR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x5b as *mut u8}

source§

impl Register for GIFR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x5a as *mut u8}

source§

impl Register for HIGH

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x1 as *mut u8}

source§

impl Register for ICR1

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x46 as *mut u8}

source§

impl Register for ICR1H

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x47 as *mut u8}

source§

impl Register for ICR1L

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x46 as *mut u8}

source§

impl Register for LOCKBIT

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x0 as *mut u8}

source§

impl Register for LOW

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x0 as *mut u8}

source§

impl Register for MCUCR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x55 as *mut u8}

source§

impl Register for MCUCSR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x54 as *mut u8}

source§

impl Register for OCDR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x51 as *mut u8}

source§

impl Register for OCR0

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x5c as *mut u8}

source§

impl Register for OCR1A

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x4a as *mut u8}

source§

impl Register for OCR1AH

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x4b as *mut u8}

source§

impl Register for OCR1AL

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x4a as *mut u8}

source§

impl Register for OCR1B

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x48 as *mut u8}

source§

impl Register for OCR1BH

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x49 as *mut u8}

source§

impl Register for OCR1BL

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x48 as *mut u8}

source§

impl Register for OCR2

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x43 as *mut u8}

source§

impl Register for OSCCAL

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x51 as *mut u8}

source§

impl Register for PINA

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x39 as *mut u8}

source§

impl Register for PINB

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x36 as *mut u8}

source§

impl Register for PINC

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x33 as *mut u8}

source§

impl Register for PIND

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x30 as *mut u8}

source§

impl Register for PORTA

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x3b as *mut u8}

source§

impl Register for PORTB

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x38 as *mut u8}

source§

impl Register for PORTC

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x35 as *mut u8}

source§

impl Register for PORTD

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x32 as *mut u8}

source§

impl Register for SFIOR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x50 as *mut u8}

source§

impl Register for SP

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x5d as *mut u8}

source§

impl Register for SPCR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x2d as *mut u8}

source§

impl Register for SPDR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x2f as *mut u8}

source§

impl Register for SPH

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x5e as *mut u8}

source§

impl Register for SPL

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x5d as *mut u8}

source§

impl Register for SPMCR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x57 as *mut u8}

source§

impl Register for SPSR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x2e as *mut u8}

source§

impl Register for TCCR0

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x53 as *mut u8}

source§

impl Register for TCCR1A

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x4f as *mut u8}

source§

impl Register for TCCR1B

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x4e as *mut u8}

source§

impl Register for TCCR2

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x45 as *mut u8}

source§

impl Register for TCNT0

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x52 as *mut u8}

source§

impl Register for TCNT1

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x4c as *mut u8}

source§

impl Register for TCNT1H

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x4d as *mut u8}

source§

impl Register for TCNT1L

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x4c as *mut u8}

source§

impl Register for TCNT2

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x44 as *mut u8}

source§

impl Register for TIFR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x58 as *mut u8}

source§

impl Register for TIMSK

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x59 as *mut u8}

source§

impl Register for TWAR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x22 as *mut u8}

source§

impl Register for TWBR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x20 as *mut u8}

source§

impl Register for TWCR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x56 as *mut u8}

source§

impl Register for TWDR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x23 as *mut u8}

source§

impl Register for TWSR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x21 as *mut u8}

source§

impl Register for UBRRH

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x40 as *mut u8}

source§

impl Register for UBRRL

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x29 as *mut u8}

source§

impl Register for UCSRA

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x2b as *mut u8}

source§

impl Register for UCSRB

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x2a as *mut u8}

source§

impl Register for UCSRC

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x40 as *mut u8}

source§

impl Register for UDR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x2c as *mut u8}

source§

impl Register for WDTCR

§

type T = u8

source§

const ADDRESS: *mut u8 = {0x41 as *mut u8}