pub type R = crate::R<CCRrs>;
pub type W = crate::W<CCRrs>;
pub type INSTRUCTION_R = crate::FieldReader;
pub type INSTRUCTION_W<'a, REG> = crate::FieldWriter<'a, REG, 8, u8, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum IMODE {
NoInstruction = 0,
SingleLine = 1,
TwoLines = 2,
FourLines = 3,
}
impl From<IMODE> for u8 {
#[inline(always)]
fn from(variant: IMODE) -> Self {
variant as _
}
}
impl crate::FieldSpec for IMODE {
type Ux = u8;
}
impl crate::IsEnum for IMODE {}
pub type IMODE_R = crate::FieldReader<IMODE>;
impl IMODE_R {
#[inline(always)]
pub const fn variant(&self) -> IMODE {
match self.bits {
0 => IMODE::NoInstruction,
1 => IMODE::SingleLine,
2 => IMODE::TwoLines,
3 => IMODE::FourLines,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_no_instruction(&self) -> bool {
*self == IMODE::NoInstruction
}
#[inline(always)]
pub fn is_single_line(&self) -> bool {
*self == IMODE::SingleLine
}
#[inline(always)]
pub fn is_two_lines(&self) -> bool {
*self == IMODE::TwoLines
}
#[inline(always)]
pub fn is_four_lines(&self) -> bool {
*self == IMODE::FourLines
}
}
pub type IMODE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, IMODE, crate::Safe>;
impl<'a, REG> IMODE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn no_instruction(self) -> &'a mut crate::W<REG> {
self.variant(IMODE::NoInstruction)
}
#[inline(always)]
pub fn single_line(self) -> &'a mut crate::W<REG> {
self.variant(IMODE::SingleLine)
}
#[inline(always)]
pub fn two_lines(self) -> &'a mut crate::W<REG> {
self.variant(IMODE::TwoLines)
}
#[inline(always)]
pub fn four_lines(self) -> &'a mut crate::W<REG> {
self.variant(IMODE::FourLines)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ADMODE {
NoAddress = 0,
SingleLine = 1,
TwoLines = 2,
FourLines = 3,
}
impl From<ADMODE> for u8 {
#[inline(always)]
fn from(variant: ADMODE) -> Self {
variant as _
}
}
impl crate::FieldSpec for ADMODE {
type Ux = u8;
}
impl crate::IsEnum for ADMODE {}
pub type ADMODE_R = crate::FieldReader<ADMODE>;
impl ADMODE_R {
#[inline(always)]
pub const fn variant(&self) -> ADMODE {
match self.bits {
0 => ADMODE::NoAddress,
1 => ADMODE::SingleLine,
2 => ADMODE::TwoLines,
3 => ADMODE::FourLines,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_no_address(&self) -> bool {
*self == ADMODE::NoAddress
}
#[inline(always)]
pub fn is_single_line(&self) -> bool {
*self == ADMODE::SingleLine
}
#[inline(always)]
pub fn is_two_lines(&self) -> bool {
*self == ADMODE::TwoLines
}
#[inline(always)]
pub fn is_four_lines(&self) -> bool {
*self == ADMODE::FourLines
}
}
pub type ADMODE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ADMODE, crate::Safe>;
impl<'a, REG> ADMODE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn no_address(self) -> &'a mut crate::W<REG> {
self.variant(ADMODE::NoAddress)
}
#[inline(always)]
pub fn single_line(self) -> &'a mut crate::W<REG> {
self.variant(ADMODE::SingleLine)
}
#[inline(always)]
pub fn two_lines(self) -> &'a mut crate::W<REG> {
self.variant(ADMODE::TwoLines)
}
#[inline(always)]
pub fn four_lines(self) -> &'a mut crate::W<REG> {
self.variant(ADMODE::FourLines)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ADSIZE {
Bit8 = 0,
Bit16 = 1,
Bit24 = 2,
Bit32 = 3,
}
impl From<ADSIZE> for u8 {
#[inline(always)]
fn from(variant: ADSIZE) -> Self {
variant as _
}
}
impl crate::FieldSpec for ADSIZE {
type Ux = u8;
}
impl crate::IsEnum for ADSIZE {}
pub type ADSIZE_R = crate::FieldReader<ADSIZE>;
impl ADSIZE_R {
#[inline(always)]
pub const fn variant(&self) -> ADSIZE {
match self.bits {
0 => ADSIZE::Bit8,
1 => ADSIZE::Bit16,
2 => ADSIZE::Bit24,
3 => ADSIZE::Bit32,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_bit8(&self) -> bool {
*self == ADSIZE::Bit8
}
#[inline(always)]
pub fn is_bit16(&self) -> bool {
*self == ADSIZE::Bit16
}
#[inline(always)]
pub fn is_bit24(&self) -> bool {
*self == ADSIZE::Bit24
}
#[inline(always)]
pub fn is_bit32(&self) -> bool {
*self == ADSIZE::Bit32
}
}
pub type ADSIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ADSIZE, crate::Safe>;
impl<'a, REG> ADSIZE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn bit8(self) -> &'a mut crate::W<REG> {
self.variant(ADSIZE::Bit8)
}
#[inline(always)]
pub fn bit16(self) -> &'a mut crate::W<REG> {
self.variant(ADSIZE::Bit16)
}
#[inline(always)]
pub fn bit24(self) -> &'a mut crate::W<REG> {
self.variant(ADSIZE::Bit24)
}
#[inline(always)]
pub fn bit32(self) -> &'a mut crate::W<REG> {
self.variant(ADSIZE::Bit32)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ABMODE {
NoAlternateBytes = 0,
SingleLine = 1,
TwoLines = 2,
FourLines = 3,
}
impl From<ABMODE> for u8 {
#[inline(always)]
fn from(variant: ABMODE) -> Self {
variant as _
}
}
impl crate::FieldSpec for ABMODE {
type Ux = u8;
}
impl crate::IsEnum for ABMODE {}
pub type ABMODE_R = crate::FieldReader<ABMODE>;
impl ABMODE_R {
#[inline(always)]
pub const fn variant(&self) -> ABMODE {
match self.bits {
0 => ABMODE::NoAlternateBytes,
1 => ABMODE::SingleLine,
2 => ABMODE::TwoLines,
3 => ABMODE::FourLines,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_no_alternate_bytes(&self) -> bool {
*self == ABMODE::NoAlternateBytes
}
#[inline(always)]
pub fn is_single_line(&self) -> bool {
*self == ABMODE::SingleLine
}
#[inline(always)]
pub fn is_two_lines(&self) -> bool {
*self == ABMODE::TwoLines
}
#[inline(always)]
pub fn is_four_lines(&self) -> bool {
*self == ABMODE::FourLines
}
}
pub type ABMODE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ABMODE, crate::Safe>;
impl<'a, REG> ABMODE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn no_alternate_bytes(self) -> &'a mut crate::W<REG> {
self.variant(ABMODE::NoAlternateBytes)
}
#[inline(always)]
pub fn single_line(self) -> &'a mut crate::W<REG> {
self.variant(ABMODE::SingleLine)
}
#[inline(always)]
pub fn two_lines(self) -> &'a mut crate::W<REG> {
self.variant(ABMODE::TwoLines)
}
#[inline(always)]
pub fn four_lines(self) -> &'a mut crate::W<REG> {
self.variant(ABMODE::FourLines)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ABSIZE {
Bit8 = 0,
Bit16 = 1,
Bit24 = 2,
Bit32 = 3,
}
impl From<ABSIZE> for u8 {
#[inline(always)]
fn from(variant: ABSIZE) -> Self {
variant as _
}
}
impl crate::FieldSpec for ABSIZE {
type Ux = u8;
}
impl crate::IsEnum for ABSIZE {}
pub type ABSIZE_R = crate::FieldReader<ABSIZE>;
impl ABSIZE_R {
#[inline(always)]
pub const fn variant(&self) -> ABSIZE {
match self.bits {
0 => ABSIZE::Bit8,
1 => ABSIZE::Bit16,
2 => ABSIZE::Bit24,
3 => ABSIZE::Bit32,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_bit8(&self) -> bool {
*self == ABSIZE::Bit8
}
#[inline(always)]
pub fn is_bit16(&self) -> bool {
*self == ABSIZE::Bit16
}
#[inline(always)]
pub fn is_bit24(&self) -> bool {
*self == ABSIZE::Bit24
}
#[inline(always)]
pub fn is_bit32(&self) -> bool {
*self == ABSIZE::Bit32
}
}
pub type ABSIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ABSIZE, crate::Safe>;
impl<'a, REG> ABSIZE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn bit8(self) -> &'a mut crate::W<REG> {
self.variant(ABSIZE::Bit8)
}
#[inline(always)]
pub fn bit16(self) -> &'a mut crate::W<REG> {
self.variant(ABSIZE::Bit16)
}
#[inline(always)]
pub fn bit24(self) -> &'a mut crate::W<REG> {
self.variant(ABSIZE::Bit24)
}
#[inline(always)]
pub fn bit32(self) -> &'a mut crate::W<REG> {
self.variant(ABSIZE::Bit32)
}
}
pub type DCYC_R = crate::FieldReader;
pub type DCYC_W<'a, REG> = crate::FieldWriter<'a, REG, 5, u8, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DMODE {
NoData = 0,
SingleLine = 1,
TwoLines = 2,
FourLines = 3,
}
impl From<DMODE> for u8 {
#[inline(always)]
fn from(variant: DMODE) -> Self {
variant as _
}
}
impl crate::FieldSpec for DMODE {
type Ux = u8;
}
impl crate::IsEnum for DMODE {}
pub type DMODE_R = crate::FieldReader<DMODE>;
impl DMODE_R {
#[inline(always)]
pub const fn variant(&self) -> DMODE {
match self.bits {
0 => DMODE::NoData,
1 => DMODE::SingleLine,
2 => DMODE::TwoLines,
3 => DMODE::FourLines,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_no_data(&self) -> bool {
*self == DMODE::NoData
}
#[inline(always)]
pub fn is_single_line(&self) -> bool {
*self == DMODE::SingleLine
}
#[inline(always)]
pub fn is_two_lines(&self) -> bool {
*self == DMODE::TwoLines
}
#[inline(always)]
pub fn is_four_lines(&self) -> bool {
*self == DMODE::FourLines
}
}
pub type DMODE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, DMODE, crate::Safe>;
impl<'a, REG> DMODE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn no_data(self) -> &'a mut crate::W<REG> {
self.variant(DMODE::NoData)
}
#[inline(always)]
pub fn single_line(self) -> &'a mut crate::W<REG> {
self.variant(DMODE::SingleLine)
}
#[inline(always)]
pub fn two_lines(self) -> &'a mut crate::W<REG> {
self.variant(DMODE::TwoLines)
}
#[inline(always)]
pub fn four_lines(self) -> &'a mut crate::W<REG> {
self.variant(DMODE::FourLines)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum FMODE {
IndirectWrite = 0,
IndirectRead = 1,
AutomaticPolling = 2,
MemoryMapped = 3,
}
impl From<FMODE> for u8 {
#[inline(always)]
fn from(variant: FMODE) -> Self {
variant as _
}
}
impl crate::FieldSpec for FMODE {
type Ux = u8;
}
impl crate::IsEnum for FMODE {}
pub type FMODE_R = crate::FieldReader<FMODE>;
impl FMODE_R {
#[inline(always)]
pub const fn variant(&self) -> FMODE {
match self.bits {
0 => FMODE::IndirectWrite,
1 => FMODE::IndirectRead,
2 => FMODE::AutomaticPolling,
3 => FMODE::MemoryMapped,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_indirect_write(&self) -> bool {
*self == FMODE::IndirectWrite
}
#[inline(always)]
pub fn is_indirect_read(&self) -> bool {
*self == FMODE::IndirectRead
}
#[inline(always)]
pub fn is_automatic_polling(&self) -> bool {
*self == FMODE::AutomaticPolling
}
#[inline(always)]
pub fn is_memory_mapped(&self) -> bool {
*self == FMODE::MemoryMapped
}
}
pub type FMODE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, FMODE, crate::Safe>;
impl<'a, REG> FMODE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn indirect_write(self) -> &'a mut crate::W<REG> {
self.variant(FMODE::IndirectWrite)
}
#[inline(always)]
pub fn indirect_read(self) -> &'a mut crate::W<REG> {
self.variant(FMODE::IndirectRead)
}
#[inline(always)]
pub fn automatic_polling(self) -> &'a mut crate::W<REG> {
self.variant(FMODE::AutomaticPolling)
}
#[inline(always)]
pub fn memory_mapped(self) -> &'a mut crate::W<REG> {
self.variant(FMODE::MemoryMapped)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SIOO {
SendEveryTransaction = 0,
SendFirstCommand = 1,
}
impl From<SIOO> for bool {
#[inline(always)]
fn from(variant: SIOO) -> Self {
variant as u8 != 0
}
}
pub type SIOO_R = crate::BitReader<SIOO>;
impl SIOO_R {
#[inline(always)]
pub const fn variant(&self) -> SIOO {
match self.bits {
false => SIOO::SendEveryTransaction,
true => SIOO::SendFirstCommand,
}
}
#[inline(always)]
pub fn is_send_every_transaction(&self) -> bool {
*self == SIOO::SendEveryTransaction
}
#[inline(always)]
pub fn is_send_first_command(&self) -> bool {
*self == SIOO::SendFirstCommand
}
}
pub type SIOO_W<'a, REG> = crate::BitWriter<'a, REG, SIOO>;
impl<'a, REG> SIOO_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn send_every_transaction(self) -> &'a mut crate::W<REG> {
self.variant(SIOO::SendEveryTransaction)
}
#[inline(always)]
pub fn send_first_command(self) -> &'a mut crate::W<REG> {
self.variant(SIOO::SendFirstCommand)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DHHC {
NoDelay = 0,
Delayed = 1,
}
impl From<DHHC> for bool {
#[inline(always)]
fn from(variant: DHHC) -> Self {
variant as u8 != 0
}
}
pub type DHHC_R = crate::BitReader<DHHC>;
impl DHHC_R {
#[inline(always)]
pub const fn variant(&self) -> DHHC {
match self.bits {
false => DHHC::NoDelay,
true => DHHC::Delayed,
}
}
#[inline(always)]
pub fn is_no_delay(&self) -> bool {
*self == DHHC::NoDelay
}
#[inline(always)]
pub fn is_delayed(&self) -> bool {
*self == DHHC::Delayed
}
}
pub type DHHC_W<'a, REG> = crate::BitWriter<'a, REG, DHHC>;
impl<'a, REG> DHHC_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_delay(self) -> &'a mut crate::W<REG> {
self.variant(DHHC::NoDelay)
}
#[inline(always)]
pub fn delayed(self) -> &'a mut crate::W<REG> {
self.variant(DHHC::Delayed)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DDRM {
Disabled = 0,
Enabled = 1,
}
impl From<DDRM> for bool {
#[inline(always)]
fn from(variant: DDRM) -> Self {
variant as u8 != 0
}
}
pub type DDRM_R = crate::BitReader<DDRM>;
impl DDRM_R {
#[inline(always)]
pub const fn variant(&self) -> DDRM {
match self.bits {
false => DDRM::Disabled,
true => DDRM::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DDRM::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DDRM::Enabled
}
}
pub type DDRM_W<'a, REG> = crate::BitWriter<'a, REG, DDRM>;
impl<'a, REG> DDRM_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DDRM::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DDRM::Enabled)
}
}
impl R {
#[inline(always)]
pub fn instruction(&self) -> INSTRUCTION_R {
INSTRUCTION_R::new((self.bits & 0xff) as u8)
}
#[inline(always)]
pub fn imode(&self) -> IMODE_R {
IMODE_R::new(((self.bits >> 8) & 3) as u8)
}
#[inline(always)]
pub fn admode(&self) -> ADMODE_R {
ADMODE_R::new(((self.bits >> 10) & 3) as u8)
}
#[inline(always)]
pub fn adsize(&self) -> ADSIZE_R {
ADSIZE_R::new(((self.bits >> 12) & 3) as u8)
}
#[inline(always)]
pub fn abmode(&self) -> ABMODE_R {
ABMODE_R::new(((self.bits >> 14) & 3) as u8)
}
#[inline(always)]
pub fn absize(&self) -> ABSIZE_R {
ABSIZE_R::new(((self.bits >> 16) & 3) as u8)
}
#[inline(always)]
pub fn dcyc(&self) -> DCYC_R {
DCYC_R::new(((self.bits >> 18) & 0x1f) as u8)
}
#[inline(always)]
pub fn dmode(&self) -> DMODE_R {
DMODE_R::new(((self.bits >> 24) & 3) as u8)
}
#[inline(always)]
pub fn fmode(&self) -> FMODE_R {
FMODE_R::new(((self.bits >> 26) & 3) as u8)
}
#[inline(always)]
pub fn sioo(&self) -> SIOO_R {
SIOO_R::new(((self.bits >> 28) & 1) != 0)
}
#[inline(always)]
pub fn dhhc(&self) -> DHHC_R {
DHHC_R::new(((self.bits >> 30) & 1) != 0)
}
#[inline(always)]
pub fn ddrm(&self) -> DDRM_R {
DDRM_R::new(((self.bits >> 31) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CCR")
.field("instruction", &self.instruction())
.field("imode", &self.imode())
.field("admode", &self.admode())
.field("adsize", &self.adsize())
.field("abmode", &self.abmode())
.field("absize", &self.absize())
.field("dcyc", &self.dcyc())
.field("dmode", &self.dmode())
.field("fmode", &self.fmode())
.field("sioo", &self.sioo())
.field("dhhc", &self.dhhc())
.field("ddrm", &self.ddrm())
.finish()
}
}
impl W {
#[inline(always)]
pub fn instruction(&mut self) -> INSTRUCTION_W<CCRrs> {
INSTRUCTION_W::new(self, 0)
}
#[inline(always)]
pub fn imode(&mut self) -> IMODE_W<CCRrs> {
IMODE_W::new(self, 8)
}
#[inline(always)]
pub fn admode(&mut self) -> ADMODE_W<CCRrs> {
ADMODE_W::new(self, 10)
}
#[inline(always)]
pub fn adsize(&mut self) -> ADSIZE_W<CCRrs> {
ADSIZE_W::new(self, 12)
}
#[inline(always)]
pub fn abmode(&mut self) -> ABMODE_W<CCRrs> {
ABMODE_W::new(self, 14)
}
#[inline(always)]
pub fn absize(&mut self) -> ABSIZE_W<CCRrs> {
ABSIZE_W::new(self, 16)
}
#[inline(always)]
pub fn dcyc(&mut self) -> DCYC_W<CCRrs> {
DCYC_W::new(self, 18)
}
#[inline(always)]
pub fn dmode(&mut self) -> DMODE_W<CCRrs> {
DMODE_W::new(self, 24)
}
#[inline(always)]
pub fn fmode(&mut self) -> FMODE_W<CCRrs> {
FMODE_W::new(self, 26)
}
#[inline(always)]
pub fn sioo(&mut self) -> SIOO_W<CCRrs> {
SIOO_W::new(self, 28)
}
#[inline(always)]
pub fn dhhc(&mut self) -> DHHC_W<CCRrs> {
DHHC_W::new(self, 30)
}
#[inline(always)]
pub fn ddrm(&mut self) -> DDRM_W<CCRrs> {
DDRM_W::new(self, 31)
}
}
pub struct CCRrs;
impl crate::RegisterSpec for CCRrs {
type Ux = u32;
}
impl crate::Readable for CCRrs {}
impl crate::Writable for CCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CCRrs {}