[][src]Crate register

Unified interface for type-safe MMIO and CPU register access.

Based on tock-register-interface.

Minimum Supported Rust Version (MSRV)

This crate is guaranteed to compile on stable Rust 1.39 and up. It might compile with older versions but that may change in any new patch release.

Modules

cpu

CPU traits.

mmio

MMIO traits.

Macros

register_bitfields

Define register types and fields.

register_bitmasks

Helper macro for defining register fields.

register_fields
register_structs
test_fields

Structs

Field

Specific section of a register.

FieldValue

Values for the specific register fields.

InMemoryRegister

In memory volatile register.

LocalRegisterCopy

This behaves very similarly to a read-only register, but instead of doing a volatile read to MMIO to get the value for each function call, a copy of the register contents are stored locally in memory. This allows a peripheral to do a single read on a register, and then check which bits are set without having to do a full MMIO read each time. It also allows the value of the register to be "cached" in case the peripheral driver needs to clear the register in hardware yet still be able to check the bits.

Traits

IntLike

IntLike properties needed to read/write/modify a register.

RegisterLongName

Descriptive name for each register.

TryFromValue

Conversion of raw register value into enumerated values member. Implemented inside register_bitfields! macro for each bit field.