From b608141eed2df11787184e96374f5a6c23119d1f Mon Sep 17 00:00:00 2001 From: Kirill Mikhailov Date: Tue, 13 Aug 2024 14:51:43 +0200 Subject: [PATCH] Fix `I2C/COMD/OPCODE` values --- common_patches/i2c0.yaml | 9 ++--- common_patches/i2c_opcode.yaml | 8 +++++ esp32/svd/patches/esp32.yaml | 1 + esp32c2/src/i2c0/comd.rs | 58 ++++++++++++++++---------------- esp32c3/src/i2c0/comd.rs | 58 ++++++++++++++++---------------- esp32c6/src/i2c0/comd.rs | 58 ++++++++++++++++---------------- esp32h2/src/i2c0/comd.rs | 58 ++++++++++++++++---------------- esp32p4/src/i2c0/comd.rs | 58 ++++++++++++++++---------------- esp32s2/svd/patches/esp32s2.yaml | 1 + esp32s3/src/i2c0/comd.rs | 58 ++++++++++++++++---------------- 10 files changed, 189 insertions(+), 178 deletions(-) create mode 100644 common_patches/i2c_opcode.yaml diff --git a/common_patches/i2c0.yaml b/common_patches/i2c0.yaml index 783805d30..5bddd3111 100644 --- a/common_patches/i2c0.yaml +++ b/common_patches/i2c0.yaml @@ -28,8 +28,9 @@ COMD%s: access: read-write OPCODE: _name: Opcode - Rstart: [0, RSTART opcode] Write: [1, WRITE opcode] - Read: [2, READ opcode] - Stop: [3, STOP opcode] - End: [4, END opcode] \ No newline at end of file + Read: [3, READ opcode] + Stop: [2, STOP opcode] + End: [4, END opcode] + Rstart: [6, RSTART opcode] + \ No newline at end of file diff --git a/common_patches/i2c_opcode.yaml b/common_patches/i2c_opcode.yaml new file mode 100644 index 000000000..be36969d9 --- /dev/null +++ b/common_patches/i2c_opcode.yaml @@ -0,0 +1,8 @@ +COMD%s: + OPCODE: + _replace_enum: + Rstart: [0, RSTART opcode] + Write: [1, WRITE opcode] + Read: [2, READ opcode] + Stop: [3, STOP opcode] + End: [4, END opcode] \ No newline at end of file diff --git a/esp32/svd/patches/esp32.yaml b/esp32/svd/patches/esp32.yaml index 3e858847a..237dc05a7 100644 --- a/esp32/svd/patches/esp32.yaml +++ b/esp32/svd/patches/esp32.yaml @@ -6,6 +6,7 @@ I2C0: name: INT_ST _include: - ../../../common_patches/i2c0.yaml + - ../../../common_patches/i2c_opcode.yaml RTC_I2C: _modify: diff --git a/esp32c2/src/i2c0/comd.rs b/esp32c2/src/i2c0/comd.rs index bda2cbe5c..bb55c194e 100644 --- a/esp32c2/src/i2c0/comd.rs +++ b/esp32c2/src/i2c0/comd.rs @@ -23,16 +23,16 @@ pub type ACK_VALUE_W<'a, REG> = crate::BitWriter<'a, REG>; #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] pub enum OPCODE { - #[doc = "0: RSTART opcode"] - Rstart = 0, #[doc = "1: WRITE opcode"] Write = 1, - #[doc = "2: READ opcode"] - Read = 2, - #[doc = "3: STOP opcode"] - Stop = 3, + #[doc = "2: STOP opcode"] + Stop = 2, + #[doc = "3: READ opcode"] + Read = 3, #[doc = "4: END opcode"] End = 4, + #[doc = "6: RSTART opcode"] + Rstart = 6, } impl From for u8 { #[inline(always)] @@ -51,39 +51,39 @@ impl OPCODE_R { #[inline(always)] pub const fn variant(&self) -> Option { match self.bits { - 0 => Some(OPCODE::Rstart), 1 => Some(OPCODE::Write), - 2 => Some(OPCODE::Read), - 3 => Some(OPCODE::Stop), + 2 => Some(OPCODE::Stop), + 3 => Some(OPCODE::Read), 4 => Some(OPCODE::End), + 6 => Some(OPCODE::Rstart), _ => None, } } - #[doc = "RSTART opcode"] - #[inline(always)] - pub fn is_rstart(&self) -> bool { - *self == OPCODE::Rstart - } #[doc = "WRITE opcode"] #[inline(always)] pub fn is_write(&self) -> bool { *self == OPCODE::Write } - #[doc = "READ opcode"] - #[inline(always)] - pub fn is_read(&self) -> bool { - *self == OPCODE::Read - } #[doc = "STOP opcode"] #[inline(always)] pub fn is_stop(&self) -> bool { *self == OPCODE::Stop } + #[doc = "READ opcode"] + #[inline(always)] + pub fn is_read(&self) -> bool { + *self == OPCODE::Read + } #[doc = "END opcode"] #[inline(always)] pub fn is_end(&self) -> bool { *self == OPCODE::End } + #[doc = "RSTART opcode"] + #[inline(always)] + pub fn is_rstart(&self) -> bool { + *self == OPCODE::Rstart + } } #[doc = "Field `OPCODE` writer - Opcode part of command %s."] pub type OPCODE_W<'a, REG> = crate::FieldWriter<'a, REG, 3, OPCODE>; @@ -92,31 +92,31 @@ where REG: crate::Writable + crate::RegisterSpec, REG::Ux: From, { - #[doc = "RSTART opcode"] - #[inline(always)] - pub fn rstart(self) -> &'a mut crate::W { - self.variant(OPCODE::Rstart) - } #[doc = "WRITE opcode"] #[inline(always)] pub fn write(self) -> &'a mut crate::W { self.variant(OPCODE::Write) } - #[doc = "READ opcode"] - #[inline(always)] - pub fn read(self) -> &'a mut crate::W { - self.variant(OPCODE::Read) - } #[doc = "STOP opcode"] #[inline(always)] pub fn stop(self) -> &'a mut crate::W { self.variant(OPCODE::Stop) } + #[doc = "READ opcode"] + #[inline(always)] + pub fn read(self) -> &'a mut crate::W { + self.variant(OPCODE::Read) + } #[doc = "END opcode"] #[inline(always)] pub fn end(self) -> &'a mut crate::W { self.variant(OPCODE::End) } + #[doc = "RSTART opcode"] + #[inline(always)] + pub fn rstart(self) -> &'a mut crate::W { + self.variant(OPCODE::Rstart) + } } #[doc = "Field `COMMAND_DONE` reader - When command 0 is done in I2C Master mode, this bit changes to high level."] pub type COMMAND_DONE_R = crate::BitReader; diff --git a/esp32c3/src/i2c0/comd.rs b/esp32c3/src/i2c0/comd.rs index 0f2aff885..b32eb2c55 100644 --- a/esp32c3/src/i2c0/comd.rs +++ b/esp32c3/src/i2c0/comd.rs @@ -23,16 +23,16 @@ pub type ACK_VALUE_W<'a, REG> = crate::BitWriter<'a, REG>; #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] pub enum OPCODE { - #[doc = "0: RSTART opcode"] - Rstart = 0, #[doc = "1: WRITE opcode"] Write = 1, - #[doc = "2: READ opcode"] - Read = 2, - #[doc = "3: STOP opcode"] - Stop = 3, + #[doc = "2: STOP opcode"] + Stop = 2, + #[doc = "3: READ opcode"] + Read = 3, #[doc = "4: END opcode"] End = 4, + #[doc = "6: RSTART opcode"] + Rstart = 6, } impl From for u8 { #[inline(always)] @@ -51,39 +51,39 @@ impl OPCODE_R { #[inline(always)] pub const fn variant(&self) -> Option { match self.bits { - 0 => Some(OPCODE::Rstart), 1 => Some(OPCODE::Write), - 2 => Some(OPCODE::Read), - 3 => Some(OPCODE::Stop), + 2 => Some(OPCODE::Stop), + 3 => Some(OPCODE::Read), 4 => Some(OPCODE::End), + 6 => Some(OPCODE::Rstart), _ => None, } } - #[doc = "RSTART opcode"] - #[inline(always)] - pub fn is_rstart(&self) -> bool { - *self == OPCODE::Rstart - } #[doc = "WRITE opcode"] #[inline(always)] pub fn is_write(&self) -> bool { *self == OPCODE::Write } - #[doc = "READ opcode"] - #[inline(always)] - pub fn is_read(&self) -> bool { - *self == OPCODE::Read - } #[doc = "STOP opcode"] #[inline(always)] pub fn is_stop(&self) -> bool { *self == OPCODE::Stop } + #[doc = "READ opcode"] + #[inline(always)] + pub fn is_read(&self) -> bool { + *self == OPCODE::Read + } #[doc = "END opcode"] #[inline(always)] pub fn is_end(&self) -> bool { *self == OPCODE::End } + #[doc = "RSTART opcode"] + #[inline(always)] + pub fn is_rstart(&self) -> bool { + *self == OPCODE::Rstart + } } #[doc = "Field `OPCODE` writer - Opcode part of command %s."] pub type OPCODE_W<'a, REG> = crate::FieldWriter<'a, REG, 3, OPCODE>; @@ -92,31 +92,31 @@ where REG: crate::Writable + crate::RegisterSpec, REG::Ux: From, { - #[doc = "RSTART opcode"] - #[inline(always)] - pub fn rstart(self) -> &'a mut crate::W { - self.variant(OPCODE::Rstart) - } #[doc = "WRITE opcode"] #[inline(always)] pub fn write(self) -> &'a mut crate::W { self.variant(OPCODE::Write) } - #[doc = "READ opcode"] - #[inline(always)] - pub fn read(self) -> &'a mut crate::W { - self.variant(OPCODE::Read) - } #[doc = "STOP opcode"] #[inline(always)] pub fn stop(self) -> &'a mut crate::W { self.variant(OPCODE::Stop) } + #[doc = "READ opcode"] + #[inline(always)] + pub fn read(self) -> &'a mut crate::W { + self.variant(OPCODE::Read) + } #[doc = "END opcode"] #[inline(always)] pub fn end(self) -> &'a mut crate::W { self.variant(OPCODE::End) } + #[doc = "RSTART opcode"] + #[inline(always)] + pub fn rstart(self) -> &'a mut crate::W { + self.variant(OPCODE::Rstart) + } } #[doc = "Field `COMMAND_DONE` reader - reg_command_done"] pub type COMMAND_DONE_R = crate::BitReader; diff --git a/esp32c6/src/i2c0/comd.rs b/esp32c6/src/i2c0/comd.rs index bda2cbe5c..bb55c194e 100644 --- a/esp32c6/src/i2c0/comd.rs +++ b/esp32c6/src/i2c0/comd.rs @@ -23,16 +23,16 @@ pub type ACK_VALUE_W<'a, REG> = crate::BitWriter<'a, REG>; #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] pub enum OPCODE { - #[doc = "0: RSTART opcode"] - Rstart = 0, #[doc = "1: WRITE opcode"] Write = 1, - #[doc = "2: READ opcode"] - Read = 2, - #[doc = "3: STOP opcode"] - Stop = 3, + #[doc = "2: STOP opcode"] + Stop = 2, + #[doc = "3: READ opcode"] + Read = 3, #[doc = "4: END opcode"] End = 4, + #[doc = "6: RSTART opcode"] + Rstart = 6, } impl From for u8 { #[inline(always)] @@ -51,39 +51,39 @@ impl OPCODE_R { #[inline(always)] pub const fn variant(&self) -> Option { match self.bits { - 0 => Some(OPCODE::Rstart), 1 => Some(OPCODE::Write), - 2 => Some(OPCODE::Read), - 3 => Some(OPCODE::Stop), + 2 => Some(OPCODE::Stop), + 3 => Some(OPCODE::Read), 4 => Some(OPCODE::End), + 6 => Some(OPCODE::Rstart), _ => None, } } - #[doc = "RSTART opcode"] - #[inline(always)] - pub fn is_rstart(&self) -> bool { - *self == OPCODE::Rstart - } #[doc = "WRITE opcode"] #[inline(always)] pub fn is_write(&self) -> bool { *self == OPCODE::Write } - #[doc = "READ opcode"] - #[inline(always)] - pub fn is_read(&self) -> bool { - *self == OPCODE::Read - } #[doc = "STOP opcode"] #[inline(always)] pub fn is_stop(&self) -> bool { *self == OPCODE::Stop } + #[doc = "READ opcode"] + #[inline(always)] + pub fn is_read(&self) -> bool { + *self == OPCODE::Read + } #[doc = "END opcode"] #[inline(always)] pub fn is_end(&self) -> bool { *self == OPCODE::End } + #[doc = "RSTART opcode"] + #[inline(always)] + pub fn is_rstart(&self) -> bool { + *self == OPCODE::Rstart + } } #[doc = "Field `OPCODE` writer - Opcode part of command %s."] pub type OPCODE_W<'a, REG> = crate::FieldWriter<'a, REG, 3, OPCODE>; @@ -92,31 +92,31 @@ where REG: crate::Writable + crate::RegisterSpec, REG::Ux: From, { - #[doc = "RSTART opcode"] - #[inline(always)] - pub fn rstart(self) -> &'a mut crate::W { - self.variant(OPCODE::Rstart) - } #[doc = "WRITE opcode"] #[inline(always)] pub fn write(self) -> &'a mut crate::W { self.variant(OPCODE::Write) } - #[doc = "READ opcode"] - #[inline(always)] - pub fn read(self) -> &'a mut crate::W { - self.variant(OPCODE::Read) - } #[doc = "STOP opcode"] #[inline(always)] pub fn stop(self) -> &'a mut crate::W { self.variant(OPCODE::Stop) } + #[doc = "READ opcode"] + #[inline(always)] + pub fn read(self) -> &'a mut crate::W { + self.variant(OPCODE::Read) + } #[doc = "END opcode"] #[inline(always)] pub fn end(self) -> &'a mut crate::W { self.variant(OPCODE::End) } + #[doc = "RSTART opcode"] + #[inline(always)] + pub fn rstart(self) -> &'a mut crate::W { + self.variant(OPCODE::Rstart) + } } #[doc = "Field `COMMAND_DONE` reader - When command 0 is done in I2C Master mode, this bit changes to high level."] pub type COMMAND_DONE_R = crate::BitReader; diff --git a/esp32h2/src/i2c0/comd.rs b/esp32h2/src/i2c0/comd.rs index bda2cbe5c..bb55c194e 100644 --- a/esp32h2/src/i2c0/comd.rs +++ b/esp32h2/src/i2c0/comd.rs @@ -23,16 +23,16 @@ pub type ACK_VALUE_W<'a, REG> = crate::BitWriter<'a, REG>; #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] pub enum OPCODE { - #[doc = "0: RSTART opcode"] - Rstart = 0, #[doc = "1: WRITE opcode"] Write = 1, - #[doc = "2: READ opcode"] - Read = 2, - #[doc = "3: STOP opcode"] - Stop = 3, + #[doc = "2: STOP opcode"] + Stop = 2, + #[doc = "3: READ opcode"] + Read = 3, #[doc = "4: END opcode"] End = 4, + #[doc = "6: RSTART opcode"] + Rstart = 6, } impl From for u8 { #[inline(always)] @@ -51,39 +51,39 @@ impl OPCODE_R { #[inline(always)] pub const fn variant(&self) -> Option { match self.bits { - 0 => Some(OPCODE::Rstart), 1 => Some(OPCODE::Write), - 2 => Some(OPCODE::Read), - 3 => Some(OPCODE::Stop), + 2 => Some(OPCODE::Stop), + 3 => Some(OPCODE::Read), 4 => Some(OPCODE::End), + 6 => Some(OPCODE::Rstart), _ => None, } } - #[doc = "RSTART opcode"] - #[inline(always)] - pub fn is_rstart(&self) -> bool { - *self == OPCODE::Rstart - } #[doc = "WRITE opcode"] #[inline(always)] pub fn is_write(&self) -> bool { *self == OPCODE::Write } - #[doc = "READ opcode"] - #[inline(always)] - pub fn is_read(&self) -> bool { - *self == OPCODE::Read - } #[doc = "STOP opcode"] #[inline(always)] pub fn is_stop(&self) -> bool { *self == OPCODE::Stop } + #[doc = "READ opcode"] + #[inline(always)] + pub fn is_read(&self) -> bool { + *self == OPCODE::Read + } #[doc = "END opcode"] #[inline(always)] pub fn is_end(&self) -> bool { *self == OPCODE::End } + #[doc = "RSTART opcode"] + #[inline(always)] + pub fn is_rstart(&self) -> bool { + *self == OPCODE::Rstart + } } #[doc = "Field `OPCODE` writer - Opcode part of command %s."] pub type OPCODE_W<'a, REG> = crate::FieldWriter<'a, REG, 3, OPCODE>; @@ -92,31 +92,31 @@ where REG: crate::Writable + crate::RegisterSpec, REG::Ux: From, { - #[doc = "RSTART opcode"] - #[inline(always)] - pub fn rstart(self) -> &'a mut crate::W { - self.variant(OPCODE::Rstart) - } #[doc = "WRITE opcode"] #[inline(always)] pub fn write(self) -> &'a mut crate::W { self.variant(OPCODE::Write) } - #[doc = "READ opcode"] - #[inline(always)] - pub fn read(self) -> &'a mut crate::W { - self.variant(OPCODE::Read) - } #[doc = "STOP opcode"] #[inline(always)] pub fn stop(self) -> &'a mut crate::W { self.variant(OPCODE::Stop) } + #[doc = "READ opcode"] + #[inline(always)] + pub fn read(self) -> &'a mut crate::W { + self.variant(OPCODE::Read) + } #[doc = "END opcode"] #[inline(always)] pub fn end(self) -> &'a mut crate::W { self.variant(OPCODE::End) } + #[doc = "RSTART opcode"] + #[inline(always)] + pub fn rstart(self) -> &'a mut crate::W { + self.variant(OPCODE::Rstart) + } } #[doc = "Field `COMMAND_DONE` reader - When command 0 is done in I2C Master mode, this bit changes to high level."] pub type COMMAND_DONE_R = crate::BitReader; diff --git a/esp32p4/src/i2c0/comd.rs b/esp32p4/src/i2c0/comd.rs index 42d05c9d7..d07fe9611 100644 --- a/esp32p4/src/i2c0/comd.rs +++ b/esp32p4/src/i2c0/comd.rs @@ -23,16 +23,16 @@ pub type ACK_VALUE_W<'a, REG> = crate::BitWriter<'a, REG>; #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] pub enum OPCODE { - #[doc = "0: RSTART opcode"] - Rstart = 0, #[doc = "1: WRITE opcode"] Write = 1, - #[doc = "2: READ opcode"] - Read = 2, - #[doc = "3: STOP opcode"] - Stop = 3, + #[doc = "2: STOP opcode"] + Stop = 2, + #[doc = "3: READ opcode"] + Read = 3, #[doc = "4: END opcode"] End = 4, + #[doc = "6: RSTART opcode"] + Rstart = 6, } impl From for u8 { #[inline(always)] @@ -51,39 +51,39 @@ impl OPCODE_R { #[inline(always)] pub const fn variant(&self) -> Option { match self.bits { - 0 => Some(OPCODE::Rstart), 1 => Some(OPCODE::Write), - 2 => Some(OPCODE::Read), - 3 => Some(OPCODE::Stop), + 2 => Some(OPCODE::Stop), + 3 => Some(OPCODE::Read), 4 => Some(OPCODE::End), + 6 => Some(OPCODE::Rstart), _ => None, } } - #[doc = "RSTART opcode"] - #[inline(always)] - pub fn is_rstart(&self) -> bool { - *self == OPCODE::Rstart - } #[doc = "WRITE opcode"] #[inline(always)] pub fn is_write(&self) -> bool { *self == OPCODE::Write } - #[doc = "READ opcode"] - #[inline(always)] - pub fn is_read(&self) -> bool { - *self == OPCODE::Read - } #[doc = "STOP opcode"] #[inline(always)] pub fn is_stop(&self) -> bool { *self == OPCODE::Stop } + #[doc = "READ opcode"] + #[inline(always)] + pub fn is_read(&self) -> bool { + *self == OPCODE::Read + } #[doc = "END opcode"] #[inline(always)] pub fn is_end(&self) -> bool { *self == OPCODE::End } + #[doc = "RSTART opcode"] + #[inline(always)] + pub fn is_rstart(&self) -> bool { + *self == OPCODE::Rstart + } } #[doc = "Field `OPCODE` writer - Opcode part of command %s."] pub type OPCODE_W<'a, REG> = crate::FieldWriter<'a, REG, 3, OPCODE>; @@ -92,31 +92,31 @@ where REG: crate::Writable + crate::RegisterSpec, REG::Ux: From, { - #[doc = "RSTART opcode"] - #[inline(always)] - pub fn rstart(self) -> &'a mut crate::W { - self.variant(OPCODE::Rstart) - } #[doc = "WRITE opcode"] #[inline(always)] pub fn write(self) -> &'a mut crate::W { self.variant(OPCODE::Write) } - #[doc = "READ opcode"] - #[inline(always)] - pub fn read(self) -> &'a mut crate::W { - self.variant(OPCODE::Read) - } #[doc = "STOP opcode"] #[inline(always)] pub fn stop(self) -> &'a mut crate::W { self.variant(OPCODE::Stop) } + #[doc = "READ opcode"] + #[inline(always)] + pub fn read(self) -> &'a mut crate::W { + self.variant(OPCODE::Read) + } #[doc = "END opcode"] #[inline(always)] pub fn end(self) -> &'a mut crate::W { self.variant(OPCODE::End) } + #[doc = "RSTART opcode"] + #[inline(always)] + pub fn rstart(self) -> &'a mut crate::W { + self.variant(OPCODE::Rstart) + } } #[doc = "Field `COMMAND_DONE` reader - Represents whether command 0 is done in I2C Master mode. 0: Not done 1: Done"] pub type COMMAND_DONE_R = crate::BitReader; diff --git a/esp32s2/svd/patches/esp32s2.yaml b/esp32s2/svd/patches/esp32s2.yaml index 34d549888..07ccf711e 100644 --- a/esp32s2/svd/patches/esp32s2.yaml +++ b/esp32s2/svd/patches/esp32s2.yaml @@ -70,6 +70,7 @@ I2C0: name: INT_ST _include: - ../../../common_patches/i2c0.yaml + - ../../../common_patches/i2c_opcode.yaml RTC_CNTL: _modify: diff --git a/esp32s3/src/i2c0/comd.rs b/esp32s3/src/i2c0/comd.rs index bda2cbe5c..bb55c194e 100644 --- a/esp32s3/src/i2c0/comd.rs +++ b/esp32s3/src/i2c0/comd.rs @@ -23,16 +23,16 @@ pub type ACK_VALUE_W<'a, REG> = crate::BitWriter<'a, REG>; #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] pub enum OPCODE { - #[doc = "0: RSTART opcode"] - Rstart = 0, #[doc = "1: WRITE opcode"] Write = 1, - #[doc = "2: READ opcode"] - Read = 2, - #[doc = "3: STOP opcode"] - Stop = 3, + #[doc = "2: STOP opcode"] + Stop = 2, + #[doc = "3: READ opcode"] + Read = 3, #[doc = "4: END opcode"] End = 4, + #[doc = "6: RSTART opcode"] + Rstart = 6, } impl From for u8 { #[inline(always)] @@ -51,39 +51,39 @@ impl OPCODE_R { #[inline(always)] pub const fn variant(&self) -> Option { match self.bits { - 0 => Some(OPCODE::Rstart), 1 => Some(OPCODE::Write), - 2 => Some(OPCODE::Read), - 3 => Some(OPCODE::Stop), + 2 => Some(OPCODE::Stop), + 3 => Some(OPCODE::Read), 4 => Some(OPCODE::End), + 6 => Some(OPCODE::Rstart), _ => None, } } - #[doc = "RSTART opcode"] - #[inline(always)] - pub fn is_rstart(&self) -> bool { - *self == OPCODE::Rstart - } #[doc = "WRITE opcode"] #[inline(always)] pub fn is_write(&self) -> bool { *self == OPCODE::Write } - #[doc = "READ opcode"] - #[inline(always)] - pub fn is_read(&self) -> bool { - *self == OPCODE::Read - } #[doc = "STOP opcode"] #[inline(always)] pub fn is_stop(&self) -> bool { *self == OPCODE::Stop } + #[doc = "READ opcode"] + #[inline(always)] + pub fn is_read(&self) -> bool { + *self == OPCODE::Read + } #[doc = "END opcode"] #[inline(always)] pub fn is_end(&self) -> bool { *self == OPCODE::End } + #[doc = "RSTART opcode"] + #[inline(always)] + pub fn is_rstart(&self) -> bool { + *self == OPCODE::Rstart + } } #[doc = "Field `OPCODE` writer - Opcode part of command %s."] pub type OPCODE_W<'a, REG> = crate::FieldWriter<'a, REG, 3, OPCODE>; @@ -92,31 +92,31 @@ where REG: crate::Writable + crate::RegisterSpec, REG::Ux: From, { - #[doc = "RSTART opcode"] - #[inline(always)] - pub fn rstart(self) -> &'a mut crate::W { - self.variant(OPCODE::Rstart) - } #[doc = "WRITE opcode"] #[inline(always)] pub fn write(self) -> &'a mut crate::W { self.variant(OPCODE::Write) } - #[doc = "READ opcode"] - #[inline(always)] - pub fn read(self) -> &'a mut crate::W { - self.variant(OPCODE::Read) - } #[doc = "STOP opcode"] #[inline(always)] pub fn stop(self) -> &'a mut crate::W { self.variant(OPCODE::Stop) } + #[doc = "READ opcode"] + #[inline(always)] + pub fn read(self) -> &'a mut crate::W { + self.variant(OPCODE::Read) + } #[doc = "END opcode"] #[inline(always)] pub fn end(self) -> &'a mut crate::W { self.variant(OPCODE::End) } + #[doc = "RSTART opcode"] + #[inline(always)] + pub fn rstart(self) -> &'a mut crate::W { + self.variant(OPCODE::Rstart) + } } #[doc = "Field `COMMAND_DONE` reader - When command 0 is done in I2C Master mode, this bit changes to high level."] pub type COMMAND_DONE_R = crate::BitReader;