macro_rules! clear_reg { ($periph:path, $instance:ident, $reg:ident $([$offset:expr])*, $($args:tt)+) => { ... }; }
Expand description
Creates a DCD command that clears specified bits / fields to 0 in the specified RAL register,
i.e. register &= !(arg1 | arg2 | ...)
.
Syntax:
ⓘ
write_reg!(ral::path::to::peripheral, INSTANCE, REGISTER, ...args)
Each arg
can be FIELD: value
, @FIELD
(= all bits of the field), or an arbitrary expression.
All args are bitwise-OR’d together to form the final value.
See crate-level docs for details on args
.
Returns a crate::Command::Write
with crate::WriteOp::Clear
.
Example
dcd::clear_reg!(ral::ccm, CCM, CBCMR, @PERIPH_CLK2_SEL)