Struct peripherals::Reg [−][src]
pub struct Reg<R, P> { /* fields omitted */ }
Expand description
Base struct for all registers
This is the struct that allows to read and write registers. It is created as part of the
peripheral struct generated by the periph!
macro. The type parameters indicate the actual
register and the peripheral it belongs to.
Implementations
impl<R: Register, P: Peripheral> Reg<R, P>
[src]
impl<R: Register, P: Peripheral> Reg<R, P>
[src]impl<R: ReadRegister, P: Peripheral> Reg<R, P>
[src]
impl<R: ReadRegister, P: Peripheral> Reg<R, P>
[src]pub fn read(&self) -> Value<R::Value>
[src]
pub fn read(&self) -> Value<R::Value>
[src]Read the current value of this register
This returns a Value
, which can be used to read fields or modified and written back.
pub fn field<T>(&self, field: Field<R::Value, T, R::Int>) -> T where
R::Int: TryInto<T>,
<R::Int as TryInto<T>>::Error: Debug,
[src]
pub fn field<T>(&self, field: Field<R::Value, T, R::Int>) -> T where
R::Int: TryInto<T>,
<R::Int as TryInto<T>>::Error: Debug,
[src]Read the given field
Same as register.read().field(fields)
. See Value::field
for more details.
pub fn fields<F: Into<Fields<R::Value>> + MayToggle>(
&self,
fields: F
) -> FieldValues<R::Value, F::Toggle>
[src]
pub fn fields<F: Into<Fields<R::Value>> + MayToggle>(
&self,
fields: F
) -> FieldValues<R::Value, F::Toggle>
[src]Read the given fields
Same as register.read() & fields
. See Value
for more details.
pub fn test<B: Into<FieldValues<R::Value>>>(&self, bits: B) -> bool
[src]
pub fn test<B: Into<FieldValues<R::Value>>>(&self, bits: B) -> bool
[src]Test the value of the given fields
Same as register.read().test(bits)
. See Value::test
for more details.
impl<R: WriteRegister, P: Peripheral> Reg<R, P>
[src]
impl<R: WriteRegister, P: Peripheral> Reg<R, P>
[src]impl<R: ReadRegister + WriteRegister, P: Peripheral> Reg<R, P>
[src]
impl<R: ReadRegister + WriteRegister, P: Peripheral> Reg<R, P>
[src]Trait Implementations
Auto Trait Implementations
impl<R, P> Send for Reg<R, P> where
P: Send,
R: Send,
P: Send,
R: Send,
impl<R, P> Sync for Reg<R, P> where
P: Sync,
R: Sync,
P: Sync,
R: Sync,
impl<R, P> Unpin for Reg<R, P> where
P: Unpin,
R: Unpin,
P: Unpin,
R: Unpin,