From 876726cebd79600333bba1f5c47c2ada08a319b2 Mon Sep 17 00:00:00 2001 From: akari Date: Sat, 15 Jul 2023 22:21:43 -0600 Subject: [PATCH 1/4] Add patch for FLT_PRSC --- devices/common_patches/enc.yaml | 9 +++++++++ devices/imxrt1061.yaml | 1 + devices/imxrt1062.yaml | 1 + devices/imxrt1064.yaml | 1 + 4 files changed, 12 insertions(+) create mode 100644 devices/common_patches/enc.yaml diff --git a/devices/common_patches/enc.yaml b/devices/common_patches/enc.yaml new file mode 100644 index 000000000000..fb5f9e69da1d --- /dev/null +++ b/devices/common_patches/enc.yaml @@ -0,0 +1,9 @@ +# Add FILT_PRSC to ENCx FILT registers +ENC*: + FILT: + _add: + FILT_PRSC: + description: "Clock prescaler value" + bitOffset: 13 + bitWidth: 3 + access: read-write diff --git a/devices/imxrt1061.yaml b/devices/imxrt1061.yaml index 672cd9af80bc..b615bfbfef65 100644 --- a/devices/imxrt1061.yaml +++ b/devices/imxrt1061.yaml @@ -8,3 +8,4 @@ _include: - "common_patches/xbara.yaml" - "common_patches/instance_renames.yaml" - "common_patches/flexio_106x.yaml" + - "common_patches/enc.yaml" diff --git a/devices/imxrt1062.yaml b/devices/imxrt1062.yaml index 323cd57a1752..ae2544c33911 100644 --- a/devices/imxrt1062.yaml +++ b/devices/imxrt1062.yaml @@ -8,3 +8,4 @@ _include: - "common_patches/xbara.yaml" - "common_patches/instance_renames.yaml" - "common_patches/flexio_106x.yaml" + - "common_patches/enc.yaml" diff --git a/devices/imxrt1064.yaml b/devices/imxrt1064.yaml index b81f3810a2b0..02ff90790a25 100644 --- a/devices/imxrt1064.yaml +++ b/devices/imxrt1064.yaml @@ -8,3 +8,4 @@ _include: - "common_patches/xbara.yaml" - "common_patches/instance_renames.yaml" - "common_patches/flexio_106x.yaml" + - "common_patches/enc.yaml" \ No newline at end of file From 6a6e05b7a8e13a0527c81100ce493caa3c4dfbb0 Mon Sep 17 00:00:00 2001 From: akari Date: Sat, 15 Jul 2023 22:36:12 -0600 Subject: [PATCH 2/4] add SERCLKDIV fixing? issue #36 --- devices/common_patches/enc.yaml | 2 +- devices/common_patches/flexspi.yaml | 18 ++++++++++++++++++ devices/imxrt1061.yaml | 1 + devices/imxrt1062.yaml | 1 + devices/imxrt1064.yaml | 3 ++- 5 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 devices/common_patches/flexspi.yaml diff --git a/devices/common_patches/enc.yaml b/devices/common_patches/enc.yaml index fb5f9e69da1d..0ec5c7a02ca3 100644 --- a/devices/common_patches/enc.yaml +++ b/devices/common_patches/enc.yaml @@ -3,7 +3,7 @@ ENC*: FILT: _add: FILT_PRSC: - description: "Clock prescaler value" + description: Clock prescaler value bitOffset: 13 bitWidth: 3 access: read-write diff --git a/devices/common_patches/flexspi.yaml b/devices/common_patches/flexspi.yaml new file mode 100644 index 000000000000..abc575096d34 --- /dev/null +++ b/devices/common_patches/flexspi.yaml @@ -0,0 +1,18 @@ +# Add SERCLKDIV to FLEXSPIx MCR0 registers +FLEXSPI*: + MCR0: + _add: + SERCLKDIV: + description: serial root clock divisor + bitOffset: 8 + bitWidth: 10 + access: read-write + SERCLKDIV: + SERCLKDIV_0: [0b000, "Divided by 1"] + SERCLKDIV_1: [0b001, "Divided by 2"] + SERCLKDIV_2: [0b010, "Divided by 3"] + SERCLKDIV_3: [0b011, "Divided by 4"] + SERCLKDIV_4: [0b100, "Divided by 5"] + SERCLKDIV_5: [0b101, "Divided by 6"] + SERCLKDIV_6: [0b110, "Divided by 7"] + SERCLKDIV_7: [0b111, "Divided by 8"] \ No newline at end of file diff --git a/devices/imxrt1061.yaml b/devices/imxrt1061.yaml index b615bfbfef65..af3fe86a841c 100644 --- a/devices/imxrt1061.yaml +++ b/devices/imxrt1061.yaml @@ -9,3 +9,4 @@ _include: - "common_patches/instance_renames.yaml" - "common_patches/flexio_106x.yaml" - "common_patches/enc.yaml" + - "common_patches/flexspi.yaml" diff --git a/devices/imxrt1062.yaml b/devices/imxrt1062.yaml index ae2544c33911..6e5e2999740c 100644 --- a/devices/imxrt1062.yaml +++ b/devices/imxrt1062.yaml @@ -9,3 +9,4 @@ _include: - "common_patches/instance_renames.yaml" - "common_patches/flexio_106x.yaml" - "common_patches/enc.yaml" + - "common_patches/flexspi.yaml" \ No newline at end of file diff --git a/devices/imxrt1064.yaml b/devices/imxrt1064.yaml index 02ff90790a25..25c786e68e61 100644 --- a/devices/imxrt1064.yaml +++ b/devices/imxrt1064.yaml @@ -8,4 +8,5 @@ _include: - "common_patches/xbara.yaml" - "common_patches/instance_renames.yaml" - "common_patches/flexio_106x.yaml" - - "common_patches/enc.yaml" \ No newline at end of file + - "common_patches/enc.yaml" + - "common_patches/flexspi.yaml" \ No newline at end of file From f0d9ebdac21f240fa797ddaa294145b1fb977795 Mon Sep 17 00:00:00 2001 From: Akari <84194114+Akari202@users.noreply.github.com> Date: Sun, 16 Jul 2023 10:07:12 -0600 Subject: [PATCH 3/4] Update devices/common_patches/flexspi.yaml Co-authored-by: Ian McIntyre --- devices/common_patches/flexspi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices/common_patches/flexspi.yaml b/devices/common_patches/flexspi.yaml index abc575096d34..c68578c06750 100644 --- a/devices/common_patches/flexspi.yaml +++ b/devices/common_patches/flexspi.yaml @@ -5,7 +5,7 @@ FLEXSPI*: SERCLKDIV: description: serial root clock divisor bitOffset: 8 - bitWidth: 10 + bitWidth: 3 access: read-write SERCLKDIV: SERCLKDIV_0: [0b000, "Divided by 1"] From 93e3a8d75ed77d5908aaf711f7727c3243d0e3c0 Mon Sep 17 00:00:00 2001 From: akari Date: Thu, 20 Jul 2023 09:34:47 -0600 Subject: [PATCH 4/4] Update patches to correct chips add generated code --- devices/common_patches/flexspi.yaml | 16 +- devices/imxrt1015.yaml | 2 + devices/imxrt1021.yaml | 2 + devices/imxrt1051.yaml | 4 +- devices/imxrt1052.yaml | 4 +- devices/imxrt1062.yaml | 2 +- devices/imxrt1064.yaml | 2 +- src/blocks/imxrt1015/enc1.rs | 8 + src/blocks/imxrt1015/flexspi.rs | 29 +- src/blocks/imxrt1021/enc.rs | 8 + src/blocks/imxrt1021/flexspi.rs | 1417 +++++++++++++++++++++++++++ src/blocks/imxrt1051/enc.rs | 723 ++++++++++++++ src/blocks/imxrt1061/flexspi.rs | 29 +- src/blocks/imxrt1176_cm4/enc.rs | 2 +- 14 files changed, 2231 insertions(+), 17 deletions(-) create mode 100644 src/blocks/imxrt1021/flexspi.rs create mode 100644 src/blocks/imxrt1051/enc.rs diff --git a/devices/common_patches/flexspi.yaml b/devices/common_patches/flexspi.yaml index c68578c06750..d627f3b9e6df 100644 --- a/devices/common_patches/flexspi.yaml +++ b/devices/common_patches/flexspi.yaml @@ -1,13 +1,13 @@ -# Add SERCLKDIV to FLEXSPIx MCR0 registers -FLEXSPI*: - MCR0: - _add: - SERCLKDIV: +# Add SERCLKDIV to FLEXSPIx MCR0 registers +FLEXSPI*: + MCR0: + _add: + SERCLKDIV: description: serial root clock divisor bitOffset: 8 bitWidth: 3 - access: read-write - SERCLKDIV: + access: read-write + SERCLKDIV: SERCLKDIV_0: [0b000, "Divided by 1"] SERCLKDIV_1: [0b001, "Divided by 2"] SERCLKDIV_2: [0b010, "Divided by 3"] @@ -15,4 +15,4 @@ FLEXSPI*: SERCLKDIV_4: [0b100, "Divided by 5"] SERCLKDIV_5: [0b101, "Divided by 6"] SERCLKDIV_6: [0b110, "Divided by 7"] - SERCLKDIV_7: [0b111, "Divided by 8"] \ No newline at end of file + SERCLKDIV_7: [0b111, "Divided by 8"] diff --git a/devices/imxrt1015.yaml b/devices/imxrt1015.yaml index e925e45ce8e0..a5064020efc3 100644 --- a/devices/imxrt1015.yaml +++ b/devices/imxrt1015.yaml @@ -8,6 +8,8 @@ _include: - "common_patches/lpuart_ridmae.yaml" - "common_patches/pit.yaml" - "common_patches/xbara.yaml" + - "common_patches/enc.yaml" + - "common_patches/flexspi.yaml" # See rationale in imxrt1011.yaml _modify: diff --git a/devices/imxrt1021.yaml b/devices/imxrt1021.yaml index a887514e6396..642417df5148 100644 --- a/devices/imxrt1021.yaml +++ b/devices/imxrt1021.yaml @@ -8,6 +8,8 @@ _include: - "common_patches/lpuart_ridmae.yaml" - "common_patches/pit.yaml" - "common_patches/xbara.yaml" + - "common_patches/enc.yaml" + - "common_patches/flexspi.yaml" # See rationale in imxrt1011.yaml _modify: diff --git a/devices/imxrt1051.yaml b/devices/imxrt1051.yaml index afbd877029d4..544ff3d21fc4 100644 --- a/devices/imxrt1051.yaml +++ b/devices/imxrt1051.yaml @@ -1,8 +1,10 @@ _svd: "../svd/imxrt1051.svd" -_include: +_include: - "common.yaml" - "common_patches/pwm1/submodule_cluster.yaml" - "common_patches/usb1.yaml" - "common_patches/dma0/tcd_cluster.yaml" - "common_patches/xbara.yaml" + - "common_patches/flexspi.yaml" + - "common_patches/enc.yaml" diff --git a/devices/imxrt1052.yaml b/devices/imxrt1052.yaml index 201e64f8e8bc..6c17c0077d54 100644 --- a/devices/imxrt1052.yaml +++ b/devices/imxrt1052.yaml @@ -1,8 +1,10 @@ _svd: "../svd/imxrt1052.svd" -_include: +_include: - "common.yaml" - "common_patches/pwm1/submodule_cluster.yaml" - "common_patches/usb1.yaml" - "common_patches/dma0/tcd_cluster.yaml" - "common_patches/xbara.yaml" + - "common_patches/flexspi.yaml" + - "common_patches/enc.yaml" diff --git a/devices/imxrt1062.yaml b/devices/imxrt1062.yaml index 6e5e2999740c..3fc1ddb7fc2a 100644 --- a/devices/imxrt1062.yaml +++ b/devices/imxrt1062.yaml @@ -9,4 +9,4 @@ _include: - "common_patches/instance_renames.yaml" - "common_patches/flexio_106x.yaml" - "common_patches/enc.yaml" - - "common_patches/flexspi.yaml" \ No newline at end of file + - "common_patches/flexspi.yaml" diff --git a/devices/imxrt1064.yaml b/devices/imxrt1064.yaml index 25c786e68e61..b770c6eb436a 100644 --- a/devices/imxrt1064.yaml +++ b/devices/imxrt1064.yaml @@ -9,4 +9,4 @@ _include: - "common_patches/instance_renames.yaml" - "common_patches/flexio_106x.yaml" - "common_patches/enc.yaml" - - "common_patches/flexspi.yaml" \ No newline at end of file + - "common_patches/flexspi.yaml" diff --git a/src/blocks/imxrt1015/enc1.rs b/src/blocks/imxrt1015/enc1.rs index 1070ba103a7d..4a1d029ee555 100644 --- a/src/blocks/imxrt1015/enc1.rs +++ b/src/blocks/imxrt1015/enc1.rs @@ -271,6 +271,14 @@ pub mod FILT { pub mod W {} pub mod RW {} } + #[doc = "Clock prescaler value"] + pub mod FILT_PRSC { + pub const offset: u16 = 13; + pub const mask: u16 = 0x07 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } } #[doc = "Watchdog Timeout Register"] pub mod WTR { diff --git a/src/blocks/imxrt1015/flexspi.rs b/src/blocks/imxrt1015/flexspi.rs index 4758688a1d26..b58e5639eab3 100644 --- a/src/blocks/imxrt1015/flexspi.rs +++ b/src/blocks/imxrt1015/flexspi.rs @@ -136,6 +136,31 @@ pub mod MCR0 { pub const ATDFEN_1: u32 = 0x01; } } + #[doc = "The serial root clock could be divided inside FlexSPI . Refer Clocks chapter for more details on clocking."] + pub mod SERCLKDIV { + pub const offset: u32 = 8; + pub const mask: u32 = 0x07 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Divided by 1"] + pub const SERCLKDIV_0: u32 = 0; + #[doc = "Divided by 2"] + pub const SERCLKDIV_1: u32 = 0x01; + #[doc = "Divided by 3"] + pub const SERCLKDIV_2: u32 = 0x02; + #[doc = "Divided by 4"] + pub const SERCLKDIV_3: u32 = 0x03; + #[doc = "Divided by 5"] + pub const SERCLKDIV_4: u32 = 0x04; + #[doc = "Divided by 6"] + pub const SERCLKDIV_5: u32 = 0x05; + #[doc = "Divided by 7"] + pub const SERCLKDIV_6: u32 = 0x06; + #[doc = "Divided by 8"] + pub const SERCLKDIV_7: u32 = 0x07; + } + } #[doc = "Half Speed Serial Flash access Enable."] pub mod HSEN { pub const offset: u32 = 11; @@ -162,7 +187,7 @@ pub mod MCR0 { pub const DOZEEN_1: u32 = 0x01; } } - #[doc = "This bit is to support Flash Octal mode access by combining Port A and B Data pins (SIOA\\[3:0\\] and SIOB\\[3:0\\])."] + #[doc = "This bit is to support Flash Octal mode access by combining Port A and B Data pins (A_DATA\\[3:0\\] and B_DATA\\[3:0\\])."] pub mod COMBINATIONEN { pub const offset: u32 = 13; pub const mask: u32 = 0x01 << offset; @@ -175,7 +200,7 @@ pub mod MCR0 { pub const COMBINATIONEN_1: u32 = 0x01; } } - #[doc = "This bit is used to force SCK output free-running. For FPGA applications, external device may use SCK clock as reference clock to its internal PLL. If SCK free-running is enabled, data sampling with loopback clock from SCK pad is not supported (MCR0\\[RXCLKSRC\\]=2)."] + #[doc = "This bit is used to force SCLK output free-running. For FPGA applications, external device may use SCLK as reference clock to its internal PLL. If SCLK free-running is enabled, data sampling with loopback clock from SCLK pad is not supported (MCR0\\[RXCLKSRC\\]=2)."] pub mod SCKFREERUNEN { pub const offset: u32 = 14; pub const mask: u32 = 0x01 << offset; diff --git a/src/blocks/imxrt1021/enc.rs b/src/blocks/imxrt1021/enc.rs index 1070ba103a7d..4a1d029ee555 100644 --- a/src/blocks/imxrt1021/enc.rs +++ b/src/blocks/imxrt1021/enc.rs @@ -271,6 +271,14 @@ pub mod FILT { pub mod W {} pub mod RW {} } + #[doc = "Clock prescaler value"] + pub mod FILT_PRSC { + pub const offset: u16 = 13; + pub const mask: u16 = 0x07 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } } #[doc = "Watchdog Timeout Register"] pub mod WTR { diff --git a/src/blocks/imxrt1021/flexspi.rs b/src/blocks/imxrt1021/flexspi.rs new file mode 100644 index 000000000000..b58e5639eab3 --- /dev/null +++ b/src/blocks/imxrt1021/flexspi.rs @@ -0,0 +1,1417 @@ +#[doc = "FlexSPI"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "Module Control Register 0"] + pub MCR0: crate::RWRegister, + #[doc = "Module Control Register 1"] + pub MCR1: crate::RWRegister, + #[doc = "Module Control Register 2"] + pub MCR2: crate::RWRegister, + #[doc = "AHB Bus Control Register"] + pub AHBCR: crate::RWRegister, + #[doc = "Interrupt Enable Register"] + pub INTEN: crate::RWRegister, + #[doc = "Interrupt Register"] + pub INTR: crate::RWRegister, + #[doc = "LUT Key Register"] + pub LUTKEY: crate::RWRegister, + #[doc = "LUT Control Register"] + pub LUTCR: crate::RWRegister, + #[doc = "AHB RX Buffer 0 Control Register 0"] + pub AHBRXBUF0CR0: crate::RWRegister, + #[doc = "AHB RX Buffer 1 Control Register 0"] + pub AHBRXBUF1CR0: crate::RWRegister, + #[doc = "AHB RX Buffer 2 Control Register 0"] + pub AHBRXBUF2CR0: crate::RWRegister, + #[doc = "AHB RX Buffer 3 Control Register 0"] + pub AHBRXBUF3CR0: crate::RWRegister, + _reserved0: [u8; 0x30], + #[doc = "Flash A1 Control Register 0"] + pub FLSHA1CR0: crate::RWRegister, + #[doc = "Flash A2 Control Register 0"] + pub FLSHA2CR0: crate::RWRegister, + #[doc = "Flash B1 Control Register 0"] + pub FLSHB1CR0: crate::RWRegister, + #[doc = "Flash B2 Control Register 0"] + pub FLSHB2CR0: crate::RWRegister, + #[doc = "Flash A1 Control Register 1"] + pub FLSHCR1: [crate::RWRegister; 4usize], + #[doc = "Flash A1 Control Register 2"] + pub FLSHCR2: [crate::RWRegister; 4usize], + _reserved1: [u8; 0x04], + #[doc = "Flash Control Register 4"] + pub FLSHCR4: crate::RWRegister, + _reserved2: [u8; 0x08], + #[doc = "IP Control Register 0"] + pub IPCR0: crate::RWRegister, + #[doc = "IP Control Register 1"] + pub IPCR1: crate::RWRegister, + _reserved3: [u8; 0x08], + #[doc = "IP Command Register"] + pub IPCMD: crate::RWRegister, + _reserved4: [u8; 0x04], + #[doc = "IP RX FIFO Control Register"] + pub IPRXFCR: crate::RWRegister, + #[doc = "IP TX FIFO Control Register"] + pub IPTXFCR: crate::RWRegister, + #[doc = "DLL Control Register 0"] + pub DLLCR: [crate::RWRegister; 2usize], + _reserved5: [u8; 0x18], + #[doc = "Status Register 0"] + pub STS0: crate::RORegister, + #[doc = "Status Register 1"] + pub STS1: crate::RORegister, + #[doc = "Status Register 2"] + pub STS2: crate::RORegister, + #[doc = "AHB Suspend Status Register"] + pub AHBSPNDSTS: crate::RORegister, + #[doc = "IP RX FIFO Status Register"] + pub IPRXFSTS: crate::RORegister, + #[doc = "IP TX FIFO Status Register"] + pub IPTXFSTS: crate::RORegister, + _reserved6: [u8; 0x08], + #[doc = "IP RX FIFO Data Register 0"] + pub RFDR: [crate::RORegister; 32usize], + #[doc = "IP TX FIFO Data Register 0"] + pub TFDR: [crate::WORegister; 32usize], + #[doc = "LUT 0"] + pub LUT: [crate::RWRegister; 64usize], +} +#[doc = "Module Control Register 0"] +pub mod MCR0 { + #[doc = "Software Reset"] + pub mod SWRESET { + pub const offset: u32 = 0; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Module Disable"] + pub mod MDIS { + pub const offset: u32 = 1; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Sample Clock source selection for Flash Reading"] + pub mod RXCLKSRC { + pub const offset: u32 = 4; + pub const mask: u32 = 0x03 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Dummy Read strobe generated by FlexSPI Controller and loopback internally."] + pub const RXCLKSRC_0: u32 = 0; + #[doc = "Dummy Read strobe generated by FlexSPI Controller and loopback from DQS pad."] + pub const RXCLKSRC_1: u32 = 0x01; + #[doc = "Flash provided Read strobe and input from DQS pad"] + pub const RXCLKSRC_3: u32 = 0x03; + } + } + #[doc = "Enable AHB bus Read Access to IP RX FIFO."] + pub mod ARDFEN { + pub const offset: u32 = 6; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "IP RX FIFO should be read by IP Bus. AHB Bus read access to IP RX FIFO memory space will get bus error response."] + pub const ARDFEN_0: u32 = 0; + #[doc = "IP RX FIFO should be read by AHB Bus. IP Bus read access to IP RX FIFO memory space will always return data zero but no bus error response."] + pub const ARDFEN_1: u32 = 0x01; + } + } + #[doc = "Enable AHB bus Write Access to IP TX FIFO."] + pub mod ATDFEN { + pub const offset: u32 = 7; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "IP TX FIFO should be written by IP Bus. AHB Bus write access to IP TX FIFO memory space will get bus error response."] + pub const ATDFEN_0: u32 = 0; + #[doc = "IP TX FIFO should be written by AHB Bus. IP Bus write access to IP TX FIFO memory space will be ignored but no bus error response."] + pub const ATDFEN_1: u32 = 0x01; + } + } + #[doc = "The serial root clock could be divided inside FlexSPI . Refer Clocks chapter for more details on clocking."] + pub mod SERCLKDIV { + pub const offset: u32 = 8; + pub const mask: u32 = 0x07 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Divided by 1"] + pub const SERCLKDIV_0: u32 = 0; + #[doc = "Divided by 2"] + pub const SERCLKDIV_1: u32 = 0x01; + #[doc = "Divided by 3"] + pub const SERCLKDIV_2: u32 = 0x02; + #[doc = "Divided by 4"] + pub const SERCLKDIV_3: u32 = 0x03; + #[doc = "Divided by 5"] + pub const SERCLKDIV_4: u32 = 0x04; + #[doc = "Divided by 6"] + pub const SERCLKDIV_5: u32 = 0x05; + #[doc = "Divided by 7"] + pub const SERCLKDIV_6: u32 = 0x06; + #[doc = "Divided by 8"] + pub const SERCLKDIV_7: u32 = 0x07; + } + } + #[doc = "Half Speed Serial Flash access Enable."] + pub mod HSEN { + pub const offset: u32 = 11; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Disable divide by 2 of serial flash clock for half speed commands."] + pub const HSEN_0: u32 = 0; + #[doc = "Enable divide by 2 of serial flash clock for half speed commands."] + pub const HSEN_1: u32 = 0x01; + } + } + #[doc = "Doze mode enable bit"] + pub mod DOZEEN { + pub const offset: u32 = 12; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Doze mode support disabled. AHB clock and serial clock will not be gated off when there is doze mode request from system."] + pub const DOZEEN_0: u32 = 0; + #[doc = "Doze mode support enabled. AHB clock and serial clock will be gated off when there is doze mode request from system."] + pub const DOZEEN_1: u32 = 0x01; + } + } + #[doc = "This bit is to support Flash Octal mode access by combining Port A and B Data pins (A_DATA\\[3:0\\] and B_DATA\\[3:0\\])."] + pub mod COMBINATIONEN { + pub const offset: u32 = 13; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Disable."] + pub const COMBINATIONEN_0: u32 = 0; + #[doc = "Enable."] + pub const COMBINATIONEN_1: u32 = 0x01; + } + } + #[doc = "This bit is used to force SCLK output free-running. For FPGA applications, external device may use SCLK as reference clock to its internal PLL. If SCLK free-running is enabled, data sampling with loopback clock from SCLK pad is not supported (MCR0\\[RXCLKSRC\\]=2)."] + pub mod SCKFREERUNEN { + pub const offset: u32 = 14; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Disable."] + pub const SCKFREERUNEN_0: u32 = 0; + #[doc = "Enable."] + pub const SCKFREERUNEN_1: u32 = 0x01; + } + } + #[doc = "Time out wait cycle for IP command grant."] + pub mod IPGRANTWAIT { + pub const offset: u32 = 16; + pub const mask: u32 = 0xff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Timeout wait cycle for AHB command grant."] + pub mod AHBGRANTWAIT { + pub const offset: u32 = 24; + pub const mask: u32 = 0xff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Module Control Register 1"] +pub mod MCR1 { + #[doc = "AHB Read/Write access to Serial Flash Memory space will timeout if not data received from Flash or data not transmitted after AHBBUSWAIT * 1024 ahb clock cycles, AHB Bus will get an error response"] + pub mod AHBBUSWAIT { + pub const offset: u32 = 0; + pub const mask: u32 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Command Sequence Execution will timeout and abort after SEQWAIT * 1024 Serial Root Clock cycles"] + pub mod SEQWAIT { + pub const offset: u32 = 16; + pub const mask: u32 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Module Control Register 2"] +pub mod MCR2 { + #[doc = "This bit determines whether AHB RX Buffer and AHB TX Buffer will be cleaned automatically when FlexSPI returns STOP mode ACK. Software should set this bit if AHB RX Buffer or AHB TX Buffer will be powered off in STOP mode. Otherwise AHB read access after exiting STOP mode may hit AHB RX Buffer or AHB TX Buffer but their data entries are invalid."] + pub mod CLRAHBBUFOPT { + pub const offset: u32 = 11; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "AHB RX/TX Buffer will not be cleaned automatically when FlexSPI return Stop mode ACK."] + pub const CLRAHBBUFOPT_0: u32 = 0; + #[doc = "AHB RX/TX Buffer will be cleaned automatically when FlexSPI return Stop mode ACK."] + pub const CLRAHBBUFOPT_1: u32 = 0x01; + } + } + #[doc = "The sampling clock phase selection will be reset to phase 0 when this bit is written with 0x1. This bit will be auto-cleared immediately."] + pub mod CLRLEARNPHASE { + pub const offset: u32 = 14; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "All external devices are same devices (both in types and size) for A1/A2/B1/B2."] + pub mod SAMEDEVICEEN { + pub const offset: u32 = 15; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "In Individual mode, FLSHA1CRx/FLSHA2CRx/FLSHB1CRx/FLSHB2CRx register setting will be applied to Flash A1/A2/B1/B2 separately. In Parallel mode, FLSHA1CRx register setting will be applied to Flash A1 and B1, FLSHA2CRx register setting will be applied to Flash A2 and B2. FLSHB1CRx/FLSHB2CRx register settings will be ignored."] + pub const SAMEDEVICEEN_0: u32 = 0; + #[doc = "FLSHA1CR0/FLSHA1CR1/FLSHA1CR2 register settings will be applied to Flash A1/A2/B1/B2. FLSHA2CRx/FLSHB1CRx/FLSHB2CRx will be ignored."] + pub const SAMEDEVICEEN_1: u32 = 0x01; + } + } + #[doc = "B_SCLK pad can be used as A_SCLK differential clock output (inverted clock to A_SCLK). In this case, port B flash access is not available. After changing the value of this field, MCR0\\[SWRESET\\] should be set."] + pub mod SCKBDIFFOPT { + pub const offset: u32 = 19; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "B_SCLK pad is used as port B SCLK clock output. Port B flash access is available."] + pub const SCKBDIFFOPT_0: u32 = 0; + #[doc = "B_SCLK pad is used as port A SCLK inverted clock output (Differential clock to A_SCLK). Port B flash access is not available."] + pub const SCKBDIFFOPT_1: u32 = 0x01; + } + } + #[doc = "Wait cycle (in AHB clock cycle) for idle state before suspended command sequence resumed."] + pub mod RESUMEWAIT { + pub const offset: u32 = 24; + pub const mask: u32 = 0xff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "AHB Bus Control Register"] +pub mod AHBCR { + #[doc = "Parallel mode enabled for AHB triggered Command (both read and write) ."] + pub mod APAREN { + pub const offset: u32 = 0; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Flash will be accessed in Individual mode."] + pub const APAREN_0: u32 = 0; + #[doc = "Flash will be accessed in Parallel mode."] + pub const APAREN_1: u32 = 0x01; + } + } + #[doc = "Enable AHB bus cachable read access support."] + pub mod CACHABLEEN { + pub const offset: u32 = 3; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Disabled. When there is AHB bus cachable read access, FlexSPI will not check whether it hit AHB TX Buffer."] + pub const CACHABLEEN_0: u32 = 0; + #[doc = "Enabled. When there is AHB bus cachable read access, FlexSPI will check whether it hit AHB TX Buffer first."] + pub const CACHABLEEN_1: u32 = 0x01; + } + } + #[doc = "Enable AHB bus bufferable write access support. This field affects the last beat of AHB write access, refer for more details about AHB bufferable write."] + pub mod BUFFERABLEEN { + pub const offset: u32 = 4; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Disabled. For all AHB write access (no matter bufferable or non-bufferable ), FlexSPI will return AHB Bus ready after all data is transmitted to External device and AHB command finished."] + pub const BUFFERABLEEN_0: u32 = 0; + #[doc = "Enabled. For AHB bufferable write access, FlexSPI will return AHB Bus ready when the AHB command is granted by arbitrator and will not wait for AHB command finished."] + pub const BUFFERABLEEN_1: u32 = 0x01; + } + } + #[doc = "AHB Read Prefetch Enable."] + pub mod PREFETCHEN { + pub const offset: u32 = 5; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "AHB Read Address option bit. This option bit is intend to remove AHB burst start address alignment limitation."] + pub mod READADDROPT { + pub const offset: u32 = 6; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "There is AHB read burst start address alignment limitation when flash is accessed in parallel mode or flash is wordaddressable."] + pub const READADDROPT_0: u32 = 0; + #[doc = "There is no AHB read burst start address alignment limitation. FlexSPI will fetch more data than AHB burst required to meet the alignment requirement."] + pub const READADDROPT_1: u32 = 0x01; + } + } +} +#[doc = "Interrupt Enable Register"] +pub mod INTEN { + #[doc = "IP triggered Command Sequences Execution finished interrupt enable."] + pub mod IPCMDDONEEN { + pub const offset: u32 = 0; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "IP triggered Command Sequences Grant Timeout interrupt enable."] + pub mod IPCMDGEEN { + pub const offset: u32 = 1; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "AHB triggered Command Sequences Grant Timeout interrupt enable."] + pub mod AHBCMDGEEN { + pub const offset: u32 = 2; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "IP triggered Command Sequences Error Detected interrupt enable."] + pub mod IPCMDERREN { + pub const offset: u32 = 3; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "AHB triggered Command Sequences Error Detected interrupt enable."] + pub mod AHBCMDERREN { + pub const offset: u32 = 4; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "IP RX FIFO WaterMark available interrupt enable."] + pub mod IPRXWAEN { + pub const offset: u32 = 5; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "IP TX FIFO WaterMark empty interrupt enable."] + pub mod IPTXWEEN { + pub const offset: u32 = 6; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "SCK is stopped during command sequence because Async RX FIFO full interrupt enable."] + pub mod SCKSTOPBYRDEN { + pub const offset: u32 = 8; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "SCK is stopped during command sequence because Async TX FIFO empty interrupt enable."] + pub mod SCKSTOPBYWREN { + pub const offset: u32 = 9; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "AHB Bus timeout interrupt.Refer Interrupts chapter for more details."] + pub mod AHBBUSTIMEOUTEN { + pub const offset: u32 = 10; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Sequence execution timeout interrupt enable.Refer Interrupts chapter for more details."] + pub mod SEQTIMEOUTEN { + pub const offset: u32 = 11; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Interrupt Register"] +pub mod INTR { + #[doc = "IP triggered Command Sequences Execution finished interrupt. This interrupt is also generated when there is IPCMDGE or IPCMDERR interrupt generated."] + pub mod IPCMDDONE { + pub const offset: u32 = 0; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "IP triggered Command Sequences Grant Timeout interrupt."] + pub mod IPCMDGE { + pub const offset: u32 = 1; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "AHB triggered Command Sequences Grant Timeout interrupt."] + pub mod AHBCMDGE { + pub const offset: u32 = 2; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "IP triggered Command Sequences Error Detected interrupt. When an error detected for IP command, this command will be ignored and not executed at all."] + pub mod IPCMDERR { + pub const offset: u32 = 3; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "AHB triggered Command Sequences Error Detected interrupt. When an error detected for AHB command, this command will be ignored and not executed at all."] + pub mod AHBCMDERR { + pub const offset: u32 = 4; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "IP RX FIFO watermark available interrupt."] + pub mod IPRXWA { + pub const offset: u32 = 5; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "IP TX FIFO watermark empty interrupt."] + pub mod IPTXWE { + pub const offset: u32 = 6; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "SCK is stopped during command sequence because Async RX FIFO full interrupt."] + pub mod SCKSTOPBYRD { + pub const offset: u32 = 8; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "SCK is stopped during command sequence because Async TX FIFO empty interrupt."] + pub mod SCKSTOPBYWR { + pub const offset: u32 = 9; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "AHB Bus timeout interrupt.Refer Interrupts chapter for more details."] + pub mod AHBBUSTIMEOUT { + pub const offset: u32 = 10; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Sequence execution timeout interrupt."] + pub mod SEQTIMEOUT { + pub const offset: u32 = 11; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "LUT Key Register"] +pub mod LUTKEY { + #[doc = "The Key to lock or unlock LUT."] + pub mod KEY { + pub const offset: u32 = 0; + pub const mask: u32 = 0xffff_ffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "LUT Control Register"] +pub mod LUTCR { + #[doc = "Lock LUT"] + pub mod LOCK { + pub const offset: u32 = 0; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Unlock LUT"] + pub mod UNLOCK { + pub const offset: u32 = 1; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "AHB RX Buffer 0 Control Register 0"] +pub mod AHBRXBUF0CR0 { + #[doc = "AHB RX Buffer Size in 64 bits."] + pub mod BUFSZ { + pub const offset: u32 = 0; + pub const mask: u32 = 0xff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "This AHB RX Buffer is assigned according to AHB Master with ID (MSTR_ID)."] + pub mod MSTRID { + pub const offset: u32 = 16; + pub const mask: u32 = 0x0f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "This priority for AHB Master Read which this AHB RX Buffer is assigned. 7 is the highest priority, 0 the lowest."] + pub mod PRIORITY { + pub const offset: u32 = 24; + pub const mask: u32 = 0x03 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "AHB Read Prefetch Enable for current AHB RX Buffer corresponding Master."] + pub mod PREFETCHEN { + pub const offset: u32 = 31; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "AHB RX Buffer 1 Control Register 0"] +pub mod AHBRXBUF1CR0 { + #[doc = "AHB RX Buffer Size in 64 bits."] + pub mod BUFSZ { + pub const offset: u32 = 0; + pub const mask: u32 = 0xff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "This AHB RX Buffer is assigned according to AHB Master with ID (MSTR_ID)."] + pub mod MSTRID { + pub const offset: u32 = 16; + pub const mask: u32 = 0x0f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "This priority for AHB Master Read which this AHB RX Buffer is assigned. 7 is the highest priority, 0 the lowest."] + pub mod PRIORITY { + pub const offset: u32 = 24; + pub const mask: u32 = 0x03 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "AHB Read Prefetch Enable for current AHB RX Buffer corresponding Master."] + pub mod PREFETCHEN { + pub const offset: u32 = 31; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "AHB RX Buffer 2 Control Register 0"] +pub mod AHBRXBUF2CR0 { + #[doc = "AHB RX Buffer Size in 64 bits."] + pub mod BUFSZ { + pub const offset: u32 = 0; + pub const mask: u32 = 0xff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "This AHB RX Buffer is assigned according to AHB Master with ID (MSTR_ID)."] + pub mod MSTRID { + pub const offset: u32 = 16; + pub const mask: u32 = 0x0f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "This priority for AHB Master Read which this AHB RX Buffer is assigned. 7 is the highest priority, 0 the lowest."] + pub mod PRIORITY { + pub const offset: u32 = 24; + pub const mask: u32 = 0x03 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "AHB Read Prefetch Enable for current AHB RX Buffer corresponding Master."] + pub mod PREFETCHEN { + pub const offset: u32 = 31; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "AHB RX Buffer 3 Control Register 0"] +pub mod AHBRXBUF3CR0 { + #[doc = "AHB RX Buffer Size in 64 bits."] + pub mod BUFSZ { + pub const offset: u32 = 0; + pub const mask: u32 = 0xff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "This AHB RX Buffer is assigned according to AHB Master with ID (MSTR_ID)."] + pub mod MSTRID { + pub const offset: u32 = 16; + pub const mask: u32 = 0x0f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "This priority for AHB Master Read which this AHB RX Buffer is assigned. 7 is the highest priority, 0 the lowest."] + pub mod PRIORITY { + pub const offset: u32 = 24; + pub const mask: u32 = 0x03 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "AHB Read Prefetch Enable for current AHB RX Buffer corresponding Master."] + pub mod PREFETCHEN { + pub const offset: u32 = 31; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Flash A1 Control Register 0"] +pub mod FLSHA1CR0 { + #[doc = "Flash Size in KByte."] + pub mod FLSHSZ { + pub const offset: u32 = 0; + pub const mask: u32 = 0x007f_ffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Flash A2 Control Register 0"] +pub mod FLSHA2CR0 { + #[doc = "Flash Size in KByte."] + pub mod FLSHSZ { + pub const offset: u32 = 0; + pub const mask: u32 = 0x007f_ffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Flash B1 Control Register 0"] +pub mod FLSHB1CR0 { + #[doc = "Flash Size in KByte."] + pub mod FLSHSZ { + pub const offset: u32 = 0; + pub const mask: u32 = 0x007f_ffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Flash B2 Control Register 0"] +pub mod FLSHB2CR0 { + #[doc = "Flash Size in KByte."] + pub mod FLSHSZ { + pub const offset: u32 = 0; + pub const mask: u32 = 0x007f_ffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Flash A1 Control Register 1"] +pub mod FLSHCR1 { + #[doc = "Serial Flash CS setup time."] + pub mod TCSS { + pub const offset: u32 = 0; + pub const mask: u32 = 0x1f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Serial Flash CS Hold time."] + pub mod TCSH { + pub const offset: u32 = 5; + pub const mask: u32 = 0x1f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Word Addressable."] + pub mod WA { + pub const offset: u32 = 10; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Column Address Size."] + pub mod CAS { + pub const offset: u32 = 11; + pub const mask: u32 = 0x0f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "CS interval unit"] + pub mod CSINTERVALUNIT { + pub const offset: u32 = 15; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "The CS interval unit is 1 serial clock cycle"] + pub const CSINTERVALUNIT_0: u32 = 0; + #[doc = "The CS interval unit is 256 serial clock cycle"] + pub const CSINTERVALUNIT_1: u32 = 0x01; + } + } + #[doc = "This field is used to set the minimum interval between flash device Chip selection deassertion and flash device Chip selection assertion. If external flash has a limitation on the interval between command sequences, this field should be set accordingly. If there is no limitation, set this field with value 0x0."] + pub mod CSINTERVAL { + pub const offset: u32 = 16; + pub const mask: u32 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Flash A1 Control Register 2"] +pub mod FLSHCR2 { + #[doc = "Sequence Index for AHB Read triggered Command in LUT."] + pub mod ARDSEQID { + pub const offset: u32 = 0; + pub const mask: u32 = 0x0f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Sequence Number for AHB Read triggered Command in LUT."] + pub mod ARDSEQNUM { + pub const offset: u32 = 5; + pub const mask: u32 = 0x07 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Sequence Index for AHB Write triggered Command."] + pub mod AWRSEQID { + pub const offset: u32 = 8; + pub const mask: u32 = 0x0f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Sequence Number for AHB Write triggered Command."] + pub mod AWRSEQNUM { + pub const offset: u32 = 13; + pub const mask: u32 = 0x07 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "For certain devices (such as FPGA), it need some time to write data into internal memory after the command sequences finished on FlexSPI interface"] + pub mod AWRWAIT { + pub const offset: u32 = 16; + pub const mask: u32 = 0x0fff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "AWRWAIT unit"] + pub mod AWRWAITUNIT { + pub const offset: u32 = 28; + pub const mask: u32 = 0x07 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "The AWRWAIT unit is 2 ahb clock cycle"] + pub const AWRWAITUNIT_0: u32 = 0; + #[doc = "The AWRWAIT unit is 8 ahb clock cycle"] + pub const AWRWAITUNIT_1: u32 = 0x01; + #[doc = "The AWRWAIT unit is 32 ahb clock cycle"] + pub const AWRWAITUNIT_2: u32 = 0x02; + #[doc = "The AWRWAIT unit is 128 ahb clock cycle"] + pub const AWRWAITUNIT_3: u32 = 0x03; + #[doc = "The AWRWAIT unit is 512 ahb clock cycle"] + pub const AWRWAITUNIT_4: u32 = 0x04; + #[doc = "The AWRWAIT unit is 2048 ahb clock cycle"] + pub const AWRWAITUNIT_5: u32 = 0x05; + #[doc = "The AWRWAIT unit is 8192 ahb clock cycle"] + pub const AWRWAITUNIT_6: u32 = 0x06; + #[doc = "The AWRWAIT unit is 32768 ahb clock cycle"] + pub const AWRWAITUNIT_7: u32 = 0x07; + } + } + #[doc = "Clear the instruction pointer which is internally saved pointer by JMP_ON_CS. Refer Programmable Sequence Engine for details."] + pub mod CLRINSTRPTR { + pub const offset: u32 = 31; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Flash Control Register 4"] +pub mod FLSHCR4 { + #[doc = "Write mask option bit 1. This option bit could be used to remove AHB write burst start address alignment limitation."] + pub mod WMOPT1 { + pub const offset: u32 = 0; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "DQS pin will be used as Write Mask when writing to external device. There is no limitation on AHB write burst start address alignment when flash is accessed in individual mode."] + pub const WMOPT1_0: u32 = 0; + #[doc = "DQS pin will not be used as Write Mask when writing to external device. There is limitation on AHB write burst start address alignment when flash is accessed in individual mode."] + pub const WMOPT1_1: u32 = 0x01; + } + } + #[doc = "Write mask enable bit for flash device on port A. When write mask function is needed for memory device on port A, this bit must be set."] + pub mod WMENA { + pub const offset: u32 = 2; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Write mask is disabled, DQS(RWDS) pin will be un-driven when writing to external device."] + pub const WMENA_0: u32 = 0; + #[doc = "Write mask is enabled, DQS(RWDS) pin will be driven by FlexSPI as write mask output when writing to external device."] + pub const WMENA_1: u32 = 0x01; + } + } + #[doc = "Write mask enable bit for flash device on port B. When write mask function is needed for memory device on port B, this bit must be set."] + pub mod WMENB { + pub const offset: u32 = 3; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Write mask is disabled, DQS(RWDS) pin will be un-driven when writing to external device."] + pub const WMENB_0: u32 = 0; + #[doc = "Write mask is enabled, DQS(RWDS) pin will be driven by FlexSPI as write mask output when writing to external device."] + pub const WMENB_1: u32 = 0x01; + } + } +} +#[doc = "IP Control Register 0"] +pub mod IPCR0 { + #[doc = "Serial Flash Address for IP command."] + pub mod SFAR { + pub const offset: u32 = 0; + pub const mask: u32 = 0xffff_ffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "IP Control Register 1"] +pub mod IPCR1 { + #[doc = "Flash Read/Program Data Size (in Bytes) for IP command."] + pub mod IDATSZ { + pub const offset: u32 = 0; + pub const mask: u32 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Sequence Index in LUT for IP command."] + pub mod ISEQID { + pub const offset: u32 = 16; + pub const mask: u32 = 0x0f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Sequence Number for IP command: ISEQNUM+1."] + pub mod ISEQNUM { + pub const offset: u32 = 24; + pub const mask: u32 = 0x07 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Parallel mode Enabled for IP command."] + pub mod IPAREN { + pub const offset: u32 = 31; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Flash will be accessed in Individual mode."] + pub const IPAREN_0: u32 = 0; + #[doc = "Flash will be accessed in Parallel mode."] + pub const IPAREN_1: u32 = 0x01; + } + } +} +#[doc = "IP Command Register"] +pub mod IPCMD { + #[doc = "Setting this bit will trigger an IP Command."] + pub mod TRG { + pub const offset: u32 = 0; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "IP RX FIFO Control Register"] +pub mod IPRXFCR { + #[doc = "Clear all valid data entries in IP RX FIFO."] + pub mod CLRIPRXF { + pub const offset: u32 = 0; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "IP RX FIFO reading by DMA enabled."] + pub mod RXDMAEN { + pub const offset: u32 = 1; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "IP RX FIFO would be read by processor."] + pub const RXDMAEN_0: u32 = 0; + #[doc = "IP RX FIFO would be read by DMA."] + pub const RXDMAEN_1: u32 = 0x01; + } + } + #[doc = "Watermark level is (RXWMRK+1)*64 Bits."] + pub mod RXWMRK { + pub const offset: u32 = 2; + pub const mask: u32 = 0x0f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "IP TX FIFO Control Register"] +pub mod IPTXFCR { + #[doc = "Clear all valid data entries in IP TX FIFO."] + pub mod CLRIPTXF { + pub const offset: u32 = 0; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "IP TX FIFO filling by DMA enabled."] + pub mod TXDMAEN { + pub const offset: u32 = 1; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "IP TX FIFO would be filled by processor."] + pub const TXDMAEN_0: u32 = 0; + #[doc = "IP TX FIFO would be filled by DMA."] + pub const TXDMAEN_1: u32 = 0x01; + } + } + #[doc = "Watermark level is (TXWMRK+1)*64 Bits."] + pub mod TXWMRK { + pub const offset: u32 = 2; + pub const mask: u32 = 0x0f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "DLL Control Register 0"] +pub mod DLLCR { + #[doc = "DLL calibration enable."] + pub mod DLLEN { + pub const offset: u32 = 0; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Software could force a reset on DLL by setting this field to 0x1. This will cause the DLL to lose lock and re-calibrate to detect an ref_clock half period phase shift. The reset action is edge triggered, so software need to clear this bit after set this bit (no delay limitation)."] + pub mod DLLRESET { + pub const offset: u32 = 1; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "The delay target for slave delay line is: ((SLVDLYTARGET+1) * 1/32 * clock cycle of reference clock (serial root clock). If serial root clock is >= 100 MHz, DLLEN set to 0x1, OVRDEN set to =0x0, then SLVDLYTARGET setting of 0xF is recommended."] + pub mod SLVDLYTARGET { + pub const offset: u32 = 3; + pub const mask: u32 = 0x0f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Slave clock delay line delay cell number selection override enable."] + pub mod OVRDEN { + pub const offset: u32 = 8; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Slave clock delay line delay cell number selection override value."] + pub mod OVRDVAL { + pub const offset: u32 = 9; + pub const mask: u32 = 0x3f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Status Register 0"] +pub mod STS0 { + #[doc = "This status bit indicates the state machine in SEQ_CTL is idle and there is command sequence executing on FlexSPI interface."] + pub mod SEQIDLE { + pub const offset: u32 = 0; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "This status bit indicates the state machine in ARB_CTL is busy and there is command sequence granted by arbitrator and not finished yet on FlexSPI interface. When ARB_CTL state (ARBIDLE=0x1) is idle, there will be no transaction on FlexSPI interface also (SEQIDLE=0x1). So this bit should be polled to wait for FlexSPI controller become idle instead of SEQIDLE."] + pub mod ARBIDLE { + pub const offset: u32 = 1; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "This status field indicates the trigger source of current command sequence granted by arbitrator. This field value is meaningless when ARB_CTL is not busy (STS0\\[ARBIDLE\\]=0x1)."] + pub mod ARBCMDSRC { + pub const offset: u32 = 2; + pub const mask: u32 = 0x03 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Triggered by AHB read command (triggered by AHB read)."] + pub const ARBCMDSRC_0: u32 = 0; + #[doc = "Triggered by AHB write command (triggered by AHB Write)."] + pub const ARBCMDSRC_1: u32 = 0x01; + #[doc = "Triggered by IP command (triggered by setting register bit IPCMD.TRG)."] + pub const ARBCMDSRC_2: u32 = 0x02; + #[doc = "Triggered by suspended command (resumed)."] + pub const ARBCMDSRC_3: u32 = 0x03; + } + } +} +#[doc = "Status Register 1"] +pub mod STS1 { + #[doc = "Indicates the sequence index when an AHB command error is detected. This field will be cleared when INTR\\[AHBCMDERR\\] is write-1-clear(w1c)."] + pub mod AHBCMDERRID { + pub const offset: u32 = 0; + pub const mask: u32 = 0x0f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Indicates the Error Code when AHB command Error detected. This field will be cleared when INTR\\[AHBCMDERR\\] is write-1-clear(w1c)."] + pub mod AHBCMDERRCODE { + pub const offset: u32 = 8; + pub const mask: u32 = 0x0f << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "No error."] + pub const AHBCMDERRCODE_0: u32 = 0; + #[doc = "AHB Write command with JMP_ON_CS instruction used in the sequence."] + pub const AHBCMDERRCODE_2: u32 = 0x02; + #[doc = "There is unknown instruction opcode in the sequence."] + pub const AHBCMDERRCODE_3: u32 = 0x03; + #[doc = "Instruction DUMMY_SDR/DUMMY_RWDS_SDR used in DDR sequence."] + pub const AHBCMDERRCODE_4: u32 = 0x04; + #[doc = "Instruction DUMMY_DDR/DUMMY_RWDS_DDR used in SDR sequence."] + pub const AHBCMDERRCODE_5: u32 = 0x05; + #[doc = "Sequence execution timeout."] + pub const AHBCMDERRCODE_14: u32 = 0x0e; + } + } + #[doc = "Indicates the sequence Index when IP command error detected. This field will be cleared when INTR\\[IPCMDERR\\] is write-1-clear(w1c)."] + pub mod IPCMDERRID { + pub const offset: u32 = 16; + pub const mask: u32 = 0x0f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Indicates the Error Code when IP command Error detected. This field will be cleared when INTR\\[IPCMDERR\\] is write-1-clear(w1c)."] + pub mod IPCMDERRCODE { + pub const offset: u32 = 24; + pub const mask: u32 = 0x0f << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "No error."] + pub const IPCMDERRCODE_0: u32 = 0; + #[doc = "IP command with JMP_ON_CS instruction used in the sequence."] + pub const IPCMDERRCODE_2: u32 = 0x02; + #[doc = "There is unknown instruction opcode in the sequence."] + pub const IPCMDERRCODE_3: u32 = 0x03; + #[doc = "Instruction DUMMY_SDR/DUMMY_RWDS_SDR used in DDR sequence."] + pub const IPCMDERRCODE_4: u32 = 0x04; + #[doc = "Instruction DUMMY_DDR/DUMMY_RWDS_DDR used in SDR sequence."] + pub const IPCMDERRCODE_5: u32 = 0x05; + #[doc = "Flash access start address exceed the whole flash address range (A1/A2/B1/B2)."] + pub const IPCMDERRCODE_6: u32 = 0x06; + #[doc = "Sequence execution timeout."] + pub const IPCMDERRCODE_14: u32 = 0x0e; + #[doc = "Flash boundary crossed."] + pub const IPCMDERRCODE_15: u32 = 0x0f; + } + } +} +#[doc = "Status Register 2"] +pub mod STS2 { + #[doc = "Flash A sample clock slave delay line locked."] + pub mod ASLVLOCK { + pub const offset: u32 = 0; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Flash A sample clock reference delay line locked."] + pub mod AREFLOCK { + pub const offset: u32 = 1; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Flash A sample clock slave delay line delay cell number selection ."] + pub mod ASLVSEL { + pub const offset: u32 = 2; + pub const mask: u32 = 0x3f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Flash A sample clock reference delay line delay cell number selection."] + pub mod AREFSEL { + pub const offset: u32 = 8; + pub const mask: u32 = 0x3f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Flash B sample clock slave delay line locked."] + pub mod BSLVLOCK { + pub const offset: u32 = 16; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Flash B sample clock reference delay line locked."] + pub mod BREFLOCK { + pub const offset: u32 = 17; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Flash B sample clock slave delay line delay cell number selection."] + pub mod BSLVSEL { + pub const offset: u32 = 18; + pub const mask: u32 = 0x3f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Flash B sample clock reference delay line delay cell number selection."] + pub mod BREFSEL { + pub const offset: u32 = 24; + pub const mask: u32 = 0x3f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "AHB Suspend Status Register"] +pub mod AHBSPNDSTS { + #[doc = "Indicates if an AHB read prefetch command sequence has been suspended."] + pub mod ACTIVE { + pub const offset: u32 = 0; + pub const mask: u32 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "AHB RX BUF ID for suspended command sequence."] + pub mod BUFID { + pub const offset: u32 = 1; + pub const mask: u32 = 0x07 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Left Data size for suspended command sequence (in byte)."] + pub mod DATLFT { + pub const offset: u32 = 16; + pub const mask: u32 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "IP RX FIFO Status Register"] +pub mod IPRXFSTS { + #[doc = "Fill level of IP RX FIFO."] + pub mod FILL { + pub const offset: u32 = 0; + pub const mask: u32 = 0xff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Total Read Data Counter: RDCNTR * 64 Bits."] + pub mod RDCNTR { + pub const offset: u32 = 16; + pub const mask: u32 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "IP TX FIFO Status Register"] +pub mod IPTXFSTS { + #[doc = "Fill level of IP TX FIFO."] + pub mod FILL { + pub const offset: u32 = 0; + pub const mask: u32 = 0xff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Total Write Data Counter: WRCNTR * 64 Bits."] + pub mod WRCNTR { + pub const offset: u32 = 16; + pub const mask: u32 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "IP RX FIFO Data Register 0"] +pub mod RFDR { + #[doc = "RX Data"] + pub mod RXDATA { + pub const offset: u32 = 0; + pub const mask: u32 = 0xffff_ffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "IP TX FIFO Data Register 0"] +pub mod TFDR { + #[doc = "TX Data"] + pub mod TXDATA { + pub const offset: u32 = 0; + pub const mask: u32 = 0xffff_ffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "LUT 0"] +pub mod LUT { + #[doc = "OPERAND0"] + pub mod OPERAND0 { + pub const offset: u32 = 0; + pub const mask: u32 = 0xff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "NUM_PADS0"] + pub mod NUM_PADS0 { + pub const offset: u32 = 8; + pub const mask: u32 = 0x03 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "OPCODE"] + pub mod OPCODE0 { + pub const offset: u32 = 10; + pub const mask: u32 = 0x3f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "OPERAND1"] + pub mod OPERAND1 { + pub const offset: u32 = 16; + pub const mask: u32 = 0xff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "NUM_PADS1"] + pub mod NUM_PADS1 { + pub const offset: u32 = 24; + pub const mask: u32 = 0x03 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "OPCODE1"] + pub mod OPCODE1 { + pub const offset: u32 = 26; + pub const mask: u32 = 0x3f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} diff --git a/src/blocks/imxrt1051/enc.rs b/src/blocks/imxrt1051/enc.rs new file mode 100644 index 000000000000..1070ba103a7d --- /dev/null +++ b/src/blocks/imxrt1051/enc.rs @@ -0,0 +1,723 @@ +#[doc = "Quadrature Decoder"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "Control Register"] + pub CTRL: crate::RWRegister, + #[doc = "Input Filter Register"] + pub FILT: crate::RWRegister, + #[doc = "Watchdog Timeout Register"] + pub WTR: crate::RWRegister, + #[doc = "Position Difference Counter Register"] + pub POSD: crate::RWRegister, + #[doc = "Position Difference Hold Register"] + pub POSDH: crate::RORegister, + #[doc = "Revolution Counter Register"] + pub REV: crate::RWRegister, + #[doc = "Revolution Hold Register"] + pub REVH: crate::RORegister, + #[doc = "Upper Position Counter Register"] + pub UPOS: crate::RWRegister, + #[doc = "Lower Position Counter Register"] + pub LPOS: crate::RWRegister, + #[doc = "Upper Position Hold Register"] + pub UPOSH: crate::RORegister, + #[doc = "Lower Position Hold Register"] + pub LPOSH: crate::RORegister, + #[doc = "Upper Initialization Register"] + pub UINIT: crate::RWRegister, + #[doc = "Lower Initialization Register"] + pub LINIT: crate::RWRegister, + #[doc = "Input Monitor Register"] + pub IMR: crate::RORegister, + #[doc = "Test Register"] + pub TST: crate::RWRegister, + #[doc = "Control 2 Register"] + pub CTRL2: crate::RWRegister, + #[doc = "Upper Modulus Register"] + pub UMOD: crate::RWRegister, + #[doc = "Lower Modulus Register"] + pub LMOD: crate::RWRegister, + #[doc = "Upper Position Compare Register"] + pub UCOMP: crate::RWRegister, + #[doc = "Lower Position Compare Register"] + pub LCOMP: crate::RWRegister, +} +#[doc = "Control Register"] +pub mod CTRL { + #[doc = "Compare Interrupt Enable"] + pub mod CMPIE { + pub const offset: u16 = 0; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Compare interrupt is disabled"] + pub const CMPIE_0: u16 = 0; + #[doc = "Compare interrupt is enabled"] + pub const CMPIE_1: u16 = 0x01; + } + } + #[doc = "Compare Interrupt Request"] + pub mod CMPIRQ { + pub const offset: u16 = 1; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "No match has occurred"] + pub const CMPIRQ_0: u16 = 0; + #[doc = "COMP match has occurred"] + pub const CMPIRQ_1: u16 = 0x01; + } + } + #[doc = "Watchdog Enable"] + pub mod WDE { + pub const offset: u16 = 2; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Watchdog timer is disabled"] + pub const WDE_0: u16 = 0; + #[doc = "Watchdog timer is enabled"] + pub const WDE_1: u16 = 0x01; + } + } + #[doc = "Watchdog Timeout Interrupt Enable"] + pub mod DIE { + pub const offset: u16 = 3; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Watchdog timer interrupt is disabled"] + pub const DIE_0: u16 = 0; + #[doc = "Watchdog timer interrupt is enabled"] + pub const DIE_1: u16 = 0x01; + } + } + #[doc = "Watchdog Timeout Interrupt Request"] + pub mod DIRQ { + pub const offset: u16 = 4; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "No interrupt has occurred"] + pub const DIRQ_0: u16 = 0; + #[doc = "Watchdog timeout interrupt has occurred"] + pub const DIRQ_1: u16 = 0x01; + } + } + #[doc = "Use Negative Edge of INDEX Pulse"] + pub mod XNE { + pub const offset: u16 = 5; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Use positive transition edge of INDEX pulse"] + pub const XNE_0: u16 = 0; + #[doc = "Use negative transition edge of INDEX pulse"] + pub const XNE_1: u16 = 0x01; + } + } + #[doc = "INDEX Triggered Initialization of Position Counters UPOS and LPOS"] + pub mod XIP { + pub const offset: u16 = 6; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "No action"] + pub const XIP_0: u16 = 0; + #[doc = "INDEX pulse initializes the position counter"] + pub const XIP_1: u16 = 0x01; + } + } + #[doc = "INDEX Pulse Interrupt Enable"] + pub mod XIE { + pub const offset: u16 = 7; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "INDEX pulse interrupt is disabled"] + pub const XIE_0: u16 = 0; + #[doc = "INDEX pulse interrupt is enabled"] + pub const XIE_1: u16 = 0x01; + } + } + #[doc = "INDEX Pulse Interrupt Request"] + pub mod XIRQ { + pub const offset: u16 = 8; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "No interrupt has occurred"] + pub const XIRQ_0: u16 = 0; + #[doc = "INDEX pulse interrupt has occurred"] + pub const XIRQ_1: u16 = 0x01; + } + } + #[doc = "Enable Signal Phase Count Mode"] + pub mod PH1 { + pub const offset: u16 = 9; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Use standard quadrature decoder where PHASEA and PHASEB represent a two phase quadrature signal."] + pub const PH1_0: u16 = 0; + #[doc = "Bypass the quadrature decoder. A positive transition of the PHASEA input generates a count signal. The PHASEB input and the REV bit control the counter direction. If CTRL\\[REV\\] = 0, PHASEB = 0, then count up If CTRL\\[REV\\] = 0, PHASEB = 1, then count down If CTRL\\[REV\\] = 1, PHASEB = 0, then count down If CTRL\\[REV\\] = 1, PHASEB = 1, then count up"] + pub const PH1_1: u16 = 0x01; + } + } + #[doc = "Enable Reverse Direction Counting"] + pub mod REV { + pub const offset: u16 = 10; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Count normally"] + pub const REV_0: u16 = 0; + #[doc = "Count in the reverse direction"] + pub const REV_1: u16 = 0x01; + } + } + #[doc = "Software Triggered Initialization of Position Counters UPOS and LPOS"] + pub mod SWIP { + pub const offset: u16 = 11; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "No action"] + pub const SWIP_0: u16 = 0; + #[doc = "Initialize position counter"] + pub const SWIP_1: u16 = 0x01; + } + } + #[doc = "Use Negative Edge of HOME Input"] + pub mod HNE { + pub const offset: u16 = 12; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Use positive going edge-to-trigger initialization of position counters UPOS and LPOS"] + pub const HNE_0: u16 = 0; + #[doc = "Use negative going edge-to-trigger initialization of position counters UPOS and LPOS"] + pub const HNE_1: u16 = 0x01; + } + } + #[doc = "Enable HOME to Initialize Position Counters UPOS and LPOS"] + pub mod HIP { + pub const offset: u16 = 13; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "No action"] + pub const HIP_0: u16 = 0; + #[doc = "HOME signal initializes the position counter"] + pub const HIP_1: u16 = 0x01; + } + } + #[doc = "HOME Interrupt Enable"] + pub mod HIE { + pub const offset: u16 = 14; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Disable HOME interrupts"] + pub const HIE_0: u16 = 0; + #[doc = "Enable HOME interrupts"] + pub const HIE_1: u16 = 0x01; + } + } + #[doc = "HOME Signal Transition Interrupt Request"] + pub mod HIRQ { + pub const offset: u16 = 15; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "No interrupt"] + pub const HIRQ_0: u16 = 0; + #[doc = "HOME signal transition interrupt request"] + pub const HIRQ_1: u16 = 0x01; + } + } +} +#[doc = "Input Filter Register"] +pub mod FILT { + #[doc = "Input Filter Sample Period"] + pub mod FILT_PER { + pub const offset: u16 = 0; + pub const mask: u16 = 0xff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Input Filter Sample Count"] + pub mod FILT_CNT { + pub const offset: u16 = 8; + pub const mask: u16 = 0x07 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Watchdog Timeout Register"] +pub mod WTR { + #[doc = "WDOG\\[15:0\\] is a binary representation of the number of clock cycles plus one that the watchdog timer counts before timing out and optionally generating an interrupt"] + pub mod WDOG { + pub const offset: u16 = 0; + pub const mask: u16 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Position Difference Counter Register"] +pub mod POSD { + #[doc = "This read/write register contains the position change in value occurring between each read of the position register"] + pub mod POSD { + pub const offset: u16 = 0; + pub const mask: u16 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Position Difference Hold Register"] +pub mod POSDH { + #[doc = "This read-only register contains a snapshot of the value of the POSD register"] + pub mod POSDH { + pub const offset: u16 = 0; + pub const mask: u16 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Revolution Counter Register"] +pub mod REV { + #[doc = "This read/write register contains the current value of the revolution counter."] + pub mod REV { + pub const offset: u16 = 0; + pub const mask: u16 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Revolution Hold Register"] +pub mod REVH { + #[doc = "This read-only register contains a snapshot of the value of the REV register."] + pub mod REVH { + pub const offset: u16 = 0; + pub const mask: u16 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Upper Position Counter Register"] +pub mod UPOS { + #[doc = "This read/write register contains the upper (most significant) half of the position counter"] + pub mod POS { + pub const offset: u16 = 0; + pub const mask: u16 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Lower Position Counter Register"] +pub mod LPOS { + #[doc = "This read/write register contains the lower (least significant) half of the position counter"] + pub mod POS { + pub const offset: u16 = 0; + pub const mask: u16 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Upper Position Hold Register"] +pub mod UPOSH { + #[doc = "This read-only register contains a snapshot of the UPOS register."] + pub mod POSH { + pub const offset: u16 = 0; + pub const mask: u16 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Lower Position Hold Register"] +pub mod LPOSH { + #[doc = "This read-only register contains a snapshot of the LPOS register."] + pub mod POSH { + pub const offset: u16 = 0; + pub const mask: u16 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Upper Initialization Register"] +pub mod UINIT { + #[doc = "This read/write register contains the value to be used to initialize the upper half of the position counter (UPOS)"] + pub mod INIT { + pub const offset: u16 = 0; + pub const mask: u16 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Lower Initialization Register"] +pub mod LINIT { + #[doc = "This read/write register contains the value to be used to initialize the lower half of the position counter (LPOS)"] + pub mod INIT { + pub const offset: u16 = 0; + pub const mask: u16 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Input Monitor Register"] +pub mod IMR { + #[doc = "This is the raw HOME input."] + pub mod HOME { + pub const offset: u16 = 0; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "This is the raw INDEX input."] + pub mod INDEX { + pub const offset: u16 = 1; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "This is the raw PHASEB input."] + pub mod PHB { + pub const offset: u16 = 2; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "This is the raw PHASEA input."] + pub mod PHA { + pub const offset: u16 = 3; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "This is the filtered version of HOME input."] + pub mod FHOM { + pub const offset: u16 = 4; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "This is the filtered version of INDEX input."] + pub mod FIND { + pub const offset: u16 = 5; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "This is the filtered version of PHASEB input."] + pub mod FPHB { + pub const offset: u16 = 6; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "This is the filtered version of PHASEA input."] + pub mod FPHA { + pub const offset: u16 = 7; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Test Register"] +pub mod TST { + #[doc = "These bits hold the number of quadrature advances to generate."] + pub mod TEST_COUNT { + pub const offset: u16 = 0; + pub const mask: u16 = 0xff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "These bits hold the period of quadrature phase in IPBus clock cycles."] + pub mod TEST_PERIOD { + pub const offset: u16 = 8; + pub const mask: u16 = 0x1f << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } + #[doc = "Quadrature Decoder Negative Signal"] + pub mod QDN { + pub const offset: u16 = 13; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Leaves quadrature decoder signal in a positive direction"] + pub const QDN_0: u16 = 0; + #[doc = "Generates a negative quadrature decoder signal"] + pub const QDN_1: u16 = 0x01; + } + } + #[doc = "Test Counter Enable"] + pub mod TCE { + pub const offset: u16 = 14; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Test count is not enabled"] + pub const TCE_0: u16 = 0; + #[doc = "Test count is enabled"] + pub const TCE_1: u16 = 0x01; + } + } + #[doc = "Test Mode Enable"] + pub mod TEN { + pub const offset: u16 = 15; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Test module is not enabled"] + pub const TEN_0: u16 = 0; + #[doc = "Test module is enabled"] + pub const TEN_1: u16 = 0x01; + } + } +} +#[doc = "Control 2 Register"] +pub mod CTRL2 { + #[doc = "Update Hold Registers"] + pub mod UPDHLD { + pub const offset: u16 = 0; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Disable updates of hold registers on rising edge of TRIGGER"] + pub const UPDHLD_0: u16 = 0; + #[doc = "Enable updates of hold registers on rising edge of TRIGGER"] + pub const UPDHLD_1: u16 = 0x01; + } + } + #[doc = "Update Position Registers"] + pub mod UPDPOS { + pub const offset: u16 = 1; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "No action for POSD, REV, UPOS and LPOS on rising edge of TRIGGER"] + pub const UPDPOS_0: u16 = 0; + #[doc = "Clear POSD, REV, UPOS and LPOS on rising edge of TRIGGER"] + pub const UPDPOS_1: u16 = 0x01; + } + } + #[doc = "Enable Modulo Counting"] + pub mod MOD { + pub const offset: u16 = 2; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Disable modulo counting"] + pub const MOD_0: u16 = 0; + #[doc = "Enable modulo counting"] + pub const MOD_1: u16 = 0x01; + } + } + #[doc = "Count Direction Flag"] + pub mod DIR { + pub const offset: u16 = 3; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Last count was in the down direction"] + pub const DIR_0: u16 = 0; + #[doc = "Last count was in the up direction"] + pub const DIR_1: u16 = 0x01; + } + } + #[doc = "Roll-under Interrupt Enable"] + pub mod RUIE { + pub const offset: u16 = 4; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Roll-under interrupt is disabled"] + pub const RUIE_0: u16 = 0; + #[doc = "Roll-under interrupt is enabled"] + pub const RUIE_1: u16 = 0x01; + } + } + #[doc = "Roll-under Interrupt Request"] + pub mod RUIRQ { + pub const offset: u16 = 5; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "No roll-under has occurred"] + pub const RUIRQ_0: u16 = 0; + #[doc = "Roll-under has occurred"] + pub const RUIRQ_1: u16 = 0x01; + } + } + #[doc = "Roll-over Interrupt Enable"] + pub mod ROIE { + pub const offset: u16 = 6; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Roll-over interrupt is disabled"] + pub const ROIE_0: u16 = 0; + #[doc = "Roll-over interrupt is enabled"] + pub const ROIE_1: u16 = 0x01; + } + } + #[doc = "Roll-over Interrupt Request"] + pub mod ROIRQ { + pub const offset: u16 = 7; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "No roll-over has occurred"] + pub const ROIRQ_0: u16 = 0; + #[doc = "Roll-over has occurred"] + pub const ROIRQ_1: u16 = 0x01; + } + } + #[doc = "Revolution Counter Modulus Enable"] + pub mod REVMOD { + pub const offset: u16 = 8; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Use INDEX pulse to increment/decrement revolution counter (REV)."] + pub const REVMOD_0: u16 = 0; + #[doc = "Use modulus counting roll-over/under to increment/decrement revolution counter (REV)."] + pub const REVMOD_1: u16 = 0x01; + } + } + #[doc = "Output Control"] + pub mod OUTCTL { + pub const offset: u16 = 9; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "POSMATCH pulses when a match occurs between the position counters (POS) and the compare value (COMP)."] + pub const OUTCTL_0: u16 = 0; + #[doc = "POSMATCH pulses when the UPOS, LPOS, REV, or POSD registers are read."] + pub const OUTCTL_1: u16 = 0x01; + } + } + #[doc = "Simultaneous PHASEA and PHASEB Change Interrupt Enable"] + pub mod SABIE { + pub const offset: u16 = 10; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Simultaneous PHASEA and PHASEB change interrupt disabled."] + pub const SABIE_0: u16 = 0; + #[doc = "Simultaneous PHASEA and PHASEB change interrupt enabled."] + pub const SABIE_1: u16 = 0x01; + } + } + #[doc = "Simultaneous PHASEA and PHASEB Change Interrupt Request"] + pub mod SABIRQ { + pub const offset: u16 = 11; + pub const mask: u16 = 0x01 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "No simultaneous change of PHASEA and PHASEB has occurred."] + pub const SABIRQ_0: u16 = 0; + #[doc = "A simultaneous change of PHASEA and PHASEB has occurred."] + pub const SABIRQ_1: u16 = 0x01; + } + } +} +#[doc = "Upper Modulus Register"] +pub mod UMOD { + #[doc = "This read/write register contains the upper (most significant) half of the modulus register"] + pub mod MOD { + pub const offset: u16 = 0; + pub const mask: u16 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Lower Modulus Register"] +pub mod LMOD { + #[doc = "This read/write register contains the lower (least significant) half of the modulus register"] + pub mod MOD { + pub const offset: u16 = 0; + pub const mask: u16 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Upper Position Compare Register"] +pub mod UCOMP { + #[doc = "This read/write register contains the upper (most significant) half of the position compare register"] + pub mod COMP { + pub const offset: u16 = 0; + pub const mask: u16 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} +#[doc = "Lower Position Compare Register"] +pub mod LCOMP { + #[doc = "This read/write register contains the lower (least significant) half of the position compare register"] + pub mod COMP { + pub const offset: u16 = 0; + pub const mask: u16 = 0xffff << offset; + pub mod R {} + pub mod W {} + pub mod RW {} + } +} diff --git a/src/blocks/imxrt1061/flexspi.rs b/src/blocks/imxrt1061/flexspi.rs index 4758688a1d26..b58e5639eab3 100644 --- a/src/blocks/imxrt1061/flexspi.rs +++ b/src/blocks/imxrt1061/flexspi.rs @@ -136,6 +136,31 @@ pub mod MCR0 { pub const ATDFEN_1: u32 = 0x01; } } + #[doc = "The serial root clock could be divided inside FlexSPI . Refer Clocks chapter for more details on clocking."] + pub mod SERCLKDIV { + pub const offset: u32 = 8; + pub const mask: u32 = 0x07 << offset; + pub mod R {} + pub mod W {} + pub mod RW { + #[doc = "Divided by 1"] + pub const SERCLKDIV_0: u32 = 0; + #[doc = "Divided by 2"] + pub const SERCLKDIV_1: u32 = 0x01; + #[doc = "Divided by 3"] + pub const SERCLKDIV_2: u32 = 0x02; + #[doc = "Divided by 4"] + pub const SERCLKDIV_3: u32 = 0x03; + #[doc = "Divided by 5"] + pub const SERCLKDIV_4: u32 = 0x04; + #[doc = "Divided by 6"] + pub const SERCLKDIV_5: u32 = 0x05; + #[doc = "Divided by 7"] + pub const SERCLKDIV_6: u32 = 0x06; + #[doc = "Divided by 8"] + pub const SERCLKDIV_7: u32 = 0x07; + } + } #[doc = "Half Speed Serial Flash access Enable."] pub mod HSEN { pub const offset: u32 = 11; @@ -162,7 +187,7 @@ pub mod MCR0 { pub const DOZEEN_1: u32 = 0x01; } } - #[doc = "This bit is to support Flash Octal mode access by combining Port A and B Data pins (SIOA\\[3:0\\] and SIOB\\[3:0\\])."] + #[doc = "This bit is to support Flash Octal mode access by combining Port A and B Data pins (A_DATA\\[3:0\\] and B_DATA\\[3:0\\])."] pub mod COMBINATIONEN { pub const offset: u32 = 13; pub const mask: u32 = 0x01 << offset; @@ -175,7 +200,7 @@ pub mod MCR0 { pub const COMBINATIONEN_1: u32 = 0x01; } } - #[doc = "This bit is used to force SCK output free-running. For FPGA applications, external device may use SCK clock as reference clock to its internal PLL. If SCK free-running is enabled, data sampling with loopback clock from SCK pad is not supported (MCR0\\[RXCLKSRC\\]=2)."] + #[doc = "This bit is used to force SCLK output free-running. For FPGA applications, external device may use SCLK as reference clock to its internal PLL. If SCLK free-running is enabled, data sampling with loopback clock from SCLK pad is not supported (MCR0\\[RXCLKSRC\\]=2)."] pub mod SCKFREERUNEN { pub const offset: u32 = 14; pub const mask: u32 = 0x01 << offset; diff --git a/src/blocks/imxrt1176_cm4/enc.rs b/src/blocks/imxrt1176_cm4/enc.rs index 36236068afaa..fa7f093cd36d 100644 --- a/src/blocks/imxrt1176_cm4/enc.rs +++ b/src/blocks/imxrt1176_cm4/enc.rs @@ -283,7 +283,7 @@ pub mod FILT { pub mod W {} pub mod RW {} } - #[doc = "prescaler divide IPbus clock to FILT clk"] + #[doc = "Clock prescaler value"] pub mod FILT_PRSC { pub const offset: u16 = 13; pub const mask: u16 = 0x07 << offset;