#[doc = "Reader of register SETUP_1"]
pub type R = crate::R<u32, super::SETUP_1>;
#[doc = "Writer for register SETUP_1"]
pub type W = crate::W<u32, super::SETUP_1>;
#[doc = "Register SETUP_1 `reset()`'s with value 0"]
impl crate::ResetValue for super::SETUP_1 {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Reader of field `DOTW`"]
pub type DOTW_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `DOTW`"]
pub struct DOTW_W<'a> {
w: &'a mut W,
}
impl<'a> DOTW_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24);
self.w
}
}
#[doc = "Reader of field `HOUR`"]
pub type HOUR_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `HOUR`"]
pub struct HOUR_W<'a> {
w: &'a mut W,
}
impl<'a> HOUR_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x1f << 16)) | (((value as u32) & 0x1f) << 16);
self.w
}
}
#[doc = "Reader of field `MIN`"]
pub type MIN_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `MIN`"]
pub struct MIN_W<'a> {
w: &'a mut W,
}
impl<'a> MIN_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x3f << 8)) | (((value as u32) & 0x3f) << 8);
self.w
}
}
#[doc = "Reader of field `SEC`"]
pub type SEC_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `SEC`"]
pub struct SEC_W<'a> {
w: &'a mut W,
}
impl<'a> SEC_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !0x3f) | ((value as u32) & 0x3f);
self.w
}
}
impl R {
#[doc = "Bits 24:26 - Day of the week: 1-Monday...0-Sunday ISO 8601 mod 7"]
#[inline(always)]
pub fn dotw(&self) -> DOTW_R {
DOTW_R::new(((self.bits >> 24) & 0x07) as u8)
}
#[doc = "Bits 16:20 - Hours"]
#[inline(always)]
pub fn hour(&self) -> HOUR_R {
HOUR_R::new(((self.bits >> 16) & 0x1f) as u8)
}
#[doc = "Bits 8:13 - Minutes"]
#[inline(always)]
pub fn min(&self) -> MIN_R {
MIN_R::new(((self.bits >> 8) & 0x3f) as u8)
}
#[doc = "Bits 0:5 - Seconds"]
#[inline(always)]
pub fn sec(&self) -> SEC_R {
SEC_R::new((self.bits & 0x3f) as u8)
}
}
impl W {
#[doc = "Bits 24:26 - Day of the week: 1-Monday...0-Sunday ISO 8601 mod 7"]
#[inline(always)]
pub fn dotw(&mut self) -> DOTW_W {
DOTW_W { w: self }
}
#[doc = "Bits 16:20 - Hours"]
#[inline(always)]
pub fn hour(&mut self) -> HOUR_W {
HOUR_W { w: self }
}
#[doc = "Bits 8:13 - Minutes"]
#[inline(always)]
pub fn min(&mut self) -> MIN_W {
MIN_W { w: self }
}
#[doc = "Bits 0:5 - Seconds"]
#[inline(always)]
pub fn sec(&mut self) -> SEC_W {
SEC_W { w: self }
}
}