Skip to content

Commit

Permalink
Align TWAI register field for ESP32-C6/H2
Browse files Browse the repository at this point in the history
  • Loading branch information
jessebraham committed Oct 31, 2024
1 parent 48fd400 commit ea160bf
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
13 changes: 5 additions & 8 deletions esp32c6/src/twai0/err_code_cap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pub type R = crate::R<ERR_CODE_CAP_SPEC>;
#[doc = "Field `ERR_CAPTURE_CODE_SEGMENT` reader - This register contains information about the location of errors on the bus."]
pub type ERR_CAPTURE_CODE_SEGMENT_R = crate::FieldReader;
#[doc = "Field `ERR_CAPTURE_CODE_DIRECTION` reader - 1: RX, error occurred during reception. 0: TX, error occurred during transmission."]
pub type ERR_CAPTURE_CODE_DIRECTION_R = crate::BitReader;
#[doc = "Field `ECC_DIRECTION` reader - 1: RX, error occurred during reception. 0: TX, error occurred during transmission."]
pub type ECC_DIRECTION_R = crate::BitReader;
#[doc = "Field `ERR_CAPTURE_CODE_TYPE` reader - 00: bit error. 01: form error. 10:stuff error. 11:other type of error."]
pub type ERR_CAPTURE_CODE_TYPE_R = crate::FieldReader;
impl R {
Expand All @@ -14,8 +14,8 @@ impl R {
}
#[doc = "Bit 5 - 1: RX, error occurred during reception. 0: TX, error occurred during transmission."]
#[inline(always)]
pub fn err_capture_code_direction(&self) -> ERR_CAPTURE_CODE_DIRECTION_R {
ERR_CAPTURE_CODE_DIRECTION_R::new(((self.bits >> 5) & 1) != 0)
pub fn ecc_direction(&self) -> ECC_DIRECTION_R {
ECC_DIRECTION_R::new(((self.bits >> 5) & 1) != 0)
}
#[doc = "Bits 6:7 - 00: bit error. 01: form error. 10:stuff error. 11:other type of error."]
#[inline(always)]
Expand All @@ -28,10 +28,7 @@ impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ERR_CODE_CAP")
.field("err_capture_code_segment", &self.err_capture_code_segment())
.field(
"err_capture_code_direction",
&self.err_capture_code_direction(),
)
.field("ecc_direction", &self.ecc_direction())
.field("err_capture_code_type", &self.err_capture_code_type())
.finish()
}
Expand Down
5 changes: 5 additions & 0 deletions esp32c6/svd/patches/esp32c6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -490,3 +490,8 @@ TWAI*:
_modify:
SELF_RX_REQUEST:
name: SELF_RX_REQ

ERR_CODE_CAP:
_modify:
ERR_CAPTURE_CODE_DIRECTION:
name: ECC_DIRECTION
13 changes: 5 additions & 8 deletions esp32h2/src/twai0/err_code_cap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pub type R = crate::R<ERR_CODE_CAP_SPEC>;
#[doc = "Field `ERR_CAPTURE_CODE_SEGMENT` reader - This register contains information about the location of errors on the bus."]
pub type ERR_CAPTURE_CODE_SEGMENT_R = crate::FieldReader;
#[doc = "Field `ERR_CAPTURE_CODE_DIRECTION` reader - 1: RX, error occurred during reception. 0: TX, error occurred during transmission."]
pub type ERR_CAPTURE_CODE_DIRECTION_R = crate::BitReader;
#[doc = "Field `ECC_DIRECTION` reader - 1: RX, error occurred during reception. 0: TX, error occurred during transmission."]
pub type ECC_DIRECTION_R = crate::BitReader;
#[doc = "Field `ERR_CAPTURE_CODE_TYPE` reader - 00: bit error. 01: form error. 10:stuff error. 11:other type of error."]
pub type ERR_CAPTURE_CODE_TYPE_R = crate::FieldReader;
impl R {
Expand All @@ -14,8 +14,8 @@ impl R {
}
#[doc = "Bit 5 - 1: RX, error occurred during reception. 0: TX, error occurred during transmission."]
#[inline(always)]
pub fn err_capture_code_direction(&self) -> ERR_CAPTURE_CODE_DIRECTION_R {
ERR_CAPTURE_CODE_DIRECTION_R::new(((self.bits >> 5) & 1) != 0)
pub fn ecc_direction(&self) -> ECC_DIRECTION_R {
ECC_DIRECTION_R::new(((self.bits >> 5) & 1) != 0)
}
#[doc = "Bits 6:7 - 00: bit error. 01: form error. 10:stuff error. 11:other type of error."]
#[inline(always)]
Expand All @@ -28,10 +28,7 @@ impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ERR_CODE_CAP")
.field("err_capture_code_segment", &self.err_capture_code_segment())
.field(
"err_capture_code_direction",
&self.err_capture_code_direction(),
)
.field("ecc_direction", &self.ecc_direction())
.field("err_capture_code_type", &self.err_capture_code_type())
.finish()
}
Expand Down
5 changes: 5 additions & 0 deletions esp32h2/svd/patches/esp32h2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -506,3 +506,8 @@ TWAI*:
_modify:
SELF_RX_REQUEST:
name: SELF_RX_REQ

ERR_CODE_CAP:
_modify:
ERR_CAPTURE_CODE_DIRECTION:
name: ECC_DIRECTION

0 comments on commit ea160bf

Please sign in to comment.