pub type R = crate::R<OCOLR_ARGB1555rs>;
pub type W = crate::W<OCOLR_ARGB1555rs>;
pub type BLUE_R = crate::FieldReader;
pub type BLUE_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
pub type GREEN_R = crate::FieldReader;
pub type GREEN_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
pub type RED_R = crate::FieldReader;
pub type RED_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
pub type A_R = crate::BitReader;
pub type A_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn blue(&self) -> BLUE_R {
BLUE_R::new((self.bits & 0x1f) as u8)
}
#[inline(always)]
pub fn green(&self) -> GREEN_R {
GREEN_R::new(((self.bits >> 5) & 0x1f) as u8)
}
#[inline(always)]
pub fn red(&self) -> RED_R {
RED_R::new(((self.bits >> 10) & 0x1f) as u8)
}
#[inline(always)]
pub fn a(&self) -> A_R {
A_R::new(((self.bits >> 15) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("OCOLR_ARGB1555")
.field("blue", &self.blue())
.field("green", &self.green())
.field("red", &self.red())
.field("a", &self.a())
.finish()
}
}
impl W {
#[inline(always)]
pub fn blue(&mut self) -> BLUE_W<OCOLR_ARGB1555rs> {
BLUE_W::new(self, 0)
}
#[inline(always)]
pub fn green(&mut self) -> GREEN_W<OCOLR_ARGB1555rs> {
GREEN_W::new(self, 5)
}
#[inline(always)]
pub fn red(&mut self) -> RED_W<OCOLR_ARGB1555rs> {
RED_W::new(self, 10)
}
#[inline(always)]
pub fn a(&mut self) -> A_W<OCOLR_ARGB1555rs> {
A_W::new(self, 15)
}
}
pub struct OCOLR_ARGB1555rs;
impl crate::RegisterSpec for OCOLR_ARGB1555rs {
type Ux = u32;
}
impl crate::Readable for OCOLR_ARGB1555rs {}
impl crate::Writable for OCOLR_ARGB1555rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for OCOLR_ARGB1555rs {}