use super::{marker, BitM, FieldSpec, RegisterSpec, Unsafe, Writable}; pub struct R { pub(crate) bits: REG::Ux, pub(super) _reg: marker::PhantomData, } pub struct W { #[doc = "Writable bits"] pub(crate) bits: REG::Ux, pub(super) _reg: marker::PhantomData, } pub struct FieldReader where FI: FieldSpec, { pub(crate) bits: FI::Ux, _reg: marker::PhantomData, } impl FieldReader { #[doc = " Creates a new instance of the reader."] #[allow(unused)] #[inline(always)] pub(crate) const fn new(bits: FI::Ux) -> Self { Self { bits, _reg: marker::PhantomData, } } } pub struct BitReader { pub(crate) bits: bool, _reg: marker::PhantomData, } impl BitReader { #[doc = " Creates a new instance of the reader."] #[allow(unused)] #[inline(always)] pub(crate) const fn new(bits: bool) -> Self { Self { bits, _reg: marker::PhantomData, } } } pub struct FieldWriter<'a, REG, const WI: u8, FI = u8, Safety = Unsafe> where REG: Writable + RegisterSpec, FI: FieldSpec, { pub(crate) w: &'a mut W, pub(crate) o: u8, _field: marker::PhantomData<(FI, Safety)>, } impl<'a, REG, const WI: u8, FI, Safety> FieldWriter<'a, REG, WI, FI, Safety> where REG: Writable + RegisterSpec, FI: FieldSpec, { #[doc = " Creates a new instance of the writer"] #[allow(unused)] #[inline(always)] pub(crate) fn new(w: &'a mut W, o: u8) -> Self { Self { w, o, _field: marker::PhantomData, } } } pub struct BitWriter<'a, REG, FI = bool, M = BitM> where REG: Writable + RegisterSpec, bool: From, { pub(crate) w: &'a mut W, pub(crate) o: u8, _field: marker::PhantomData<(FI, M)>, } impl<'a, REG, FI, M> BitWriter<'a, REG, FI, M> where REG: Writable + RegisterSpec, bool: From, { #[doc = " Creates a new instance of the writer"] #[allow(unused)] #[inline(always)] pub(crate) fn new(w: &'a mut W, o: u8) -> Self { Self { w, o, _field: marker::PhantomData, } } }