Macro tock_registers::register_bitmasks
source ยท macro_rules! register_bitmasks { { // BITFIELD_NAME OFFSET(x) $(#[$outer:meta])* $valtype:ident, $reg_mod:ident, $reg_desc:ident, [ $( $(#[$inner:meta])* $field:ident OFFSET($offset:expr)),+ $(,)? ] } => { ... }; { // BITFIELD_NAME OFFSET // All fields are 1 bit $(#[$outer:meta])* $valtype:ident, $reg_mod:ident, $reg_desc:ident, [ $( $(#[$inner:meta])* $field:ident $offset:expr ),+ $(,)? ] } => { ... }; { // BITFIELD_NAME OFFSET(x) NUMBITS(y) $(#[$outer:meta])* $valtype:ident, $reg_mod:ident, $reg_desc:ident, [ $( $(#[$inner:meta])* $field:ident OFFSET($offset:expr) NUMBITS($numbits:expr) ),+ $(,)? ] } => { ... }; { // BITFIELD_NAME OFFSET(x) NUMBITS(y) [] $(#[$outer:meta])* $valtype:ident, $reg_mod:ident, $reg_desc:ident, [ $( $(#[$inner:meta])* $field:ident OFFSET($offset:expr) NUMBITS($numbits:expr) $values:tt ),+ $(,)? ] } => { ... }; { $valtype:ident, $reg_desc:ident, $(#[$outer:meta])* $field:ident, $offset:expr, $numbits:expr, [$( $(#[$inner:meta])* $valname:ident = $value:expr ),+ $(,)?] } => { ... }; { $valtype:ident, $reg_desc:ident, $(#[$outer:meta])* $field:ident, $offset:expr, $numbits:expr, [] } => { ... }; ( // final implementation of the macro @debug $valtype:ident, $reg_mod:ident, $reg_desc:ident, [$($field:ident),*] ) => { ... }; ( @fv_enum_type_seq $valtype:ident, $enum_val:path $(, $($rest:path),+)? ) => { ... }; ( @fv_enum_type_seq $valtype:ident $(,)? ) => { ... }; }
Expand description
Helper macro for defining register fields.