Module kernel::common::regs
[−]
[src]
Implementation of registers and bitfields.
Allows register maps to be specified like this:
use common::regs::{ReadOnly, ReadWrite, WriteOnly}; #[repr(C)] struct Registers { // Control register: read-write cr: ReadWrite<u32, Control::Register>, // Status register: read-only s: ReadOnly<u32, Status::Register>, }
and register fields and definitions to look like:
register_bitfields![u32, Status [ TXCOMPLETE OFFSET(0) NUMBITS(1) [], TXINTERRUPT OFFSET(1) NUMBITS(1) [], RXCOMPLETE OFFSET(2) NUMBITS(1) [], RXINTERRUPT OFFSET(3) NUMBITS(1) [], MODE OFFSET(4) NUMBITS(3) [ FullDuplex = 0, HalfDuplex = 1, Loopback = 2, Disabled = 3 ], ERRORCOUNT OFFSET(6) NUMBITS(3) [] ] ];
Reexports
use core::marker::PhantomData; |
use core::ops::Add; |
use core::ops::AddAssign; |
use core::ops::BitAnd; |
use core::ops::BitOr; |
use core::ops::Not; |
use core::ops::Shl; |
use core::ops::Shr; |
Modules
macros |
Macros for cleanly defining peripheral registers. |
Structs
Field |
Specific section of a register. |
FieldValue |
Values for the specific register fields. |
ReadOnly |
Read-only registers. |
ReadWrite |
Read/Write registers. |
WriteOnly |
Write-only registers. |
Traits
IntLike |
IntLike properties needed to read/write/modify a register. |
RegisterLongName |
Descriptive name for each register. |