From 0666a6ba1dbd66cf8b93c113e362ccbcd99152a0 Mon Sep 17 00:00:00 2001 From: Arne Dußin Date: Sat, 6 Nov 2021 11:50:33 +0100 Subject: Initial commit --- src/tcc0.rs | 359 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 359 insertions(+) create mode 100644 src/tcc0.rs (limited to 'src/tcc0.rs') diff --git a/src/tcc0.rs b/src/tcc0.rs new file mode 100644 index 0000000..6ce813a --- /dev/null +++ b/src/tcc0.rs @@ -0,0 +1,359 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Control A"] + pub ctrla: crate::Reg, + #[doc = "0x04 - Control B Clear"] + pub ctrlbclr: crate::Reg, + #[doc = "0x05 - Control B Set"] + pub ctrlbset: crate::Reg, + _reserved3: [u8; 0x02], + #[doc = "0x08 - Synchronization Busy"] + pub syncbusy: crate::Reg, + #[doc = "0x0c - Recoverable Fault A Configuration"] + pub fctrla: crate::Reg, + #[doc = "0x10 - Recoverable Fault B Configuration"] + pub fctrlb: crate::Reg, + #[doc = "0x14 - Waveform Extension Configuration"] + pub wexctrl: crate::Reg, + #[doc = "0x18 - Driver Control"] + pub drvctrl: crate::Reg, + _reserved8: [u8; 0x02], + #[doc = "0x1e - Debug Control"] + pub dbgctrl: crate::Reg, + _reserved9: [u8; 0x01], + #[doc = "0x20 - Event Control"] + pub evctrl: crate::Reg, + #[doc = "0x24 - Interrupt Enable Clear"] + pub intenclr: crate::Reg, + #[doc = "0x28 - Interrupt Enable Set"] + pub intenset: crate::Reg, + #[doc = "0x2c - Interrupt Flag Status and Clear"] + pub intflag: crate::Reg, + #[doc = "0x30 - Status"] + pub status: crate::Reg, + _reserved_14_count: [u8; 0x04], + #[doc = "0x38 - Pattern"] + pub patt: crate::Reg, + _reserved16: [u8; 0x02], + #[doc = "0x3c - Waveform Control"] + pub wave: crate::Reg, + _reserved_17_per: [u8; 0x04], + _reserved_18_cc: [u8; 0x10], + _reserved19: [u8; 0x10], + #[doc = "0x64 - Pattern Buffer"] + pub pattbuf: crate::Reg, + _reserved20: [u8; 0x06], + _reserved_20_perbuf: [u8; 0x04], + _reserved_21_ccbuf: [u8; 0x10], +} +impl RegisterBlock { + #[doc = "0x34 - Count"] + #[inline(always)] + pub fn count_dith6_mode(&self) -> &crate::Reg { + unsafe { + &*(((self as *const Self) as *const u8).add(52usize) + as *const crate::Reg) + } + } + #[doc = "0x34 - Count"] + #[inline(always)] + pub fn count_dith5_mode(&self) -> &crate::Reg { + unsafe { + &*(((self as *const Self) as *const u8).add(52usize) + as *const crate::Reg) + } + } + #[doc = "0x34 - Count"] + #[inline(always)] + pub fn count_dith4_mode(&self) -> &crate::Reg { + unsafe { + &*(((self as *const Self) as *const u8).add(52usize) + as *const crate::Reg) + } + } + #[doc = "0x34 - Count"] + #[inline(always)] + pub fn count(&self) -> &crate::Reg { + unsafe { + &*(((self as *const Self) as *const u8).add(52usize) + as *const crate::Reg) + } + } + #[doc = "0x40 - Period"] + #[inline(always)] + pub fn per_dith6_mode(&self) -> &crate::Reg { + unsafe { + &*(((self as *const Self) as *const u8).add(64usize) + as *const crate::Reg) + } + } + #[doc = "0x40 - Period"] + #[inline(always)] + pub fn per_dith5_mode(&self) -> &crate::Reg { + unsafe { + &*(((self as *const Self) as *const u8).add(64usize) + as *const crate::Reg) + } + } + #[doc = "0x40 - Period"] + #[inline(always)] + pub fn per_dith4_mode(&self) -> &crate::Reg { + unsafe { + &*(((self as *const Self) as *const u8).add(64usize) + as *const crate::Reg) + } + } + #[doc = "0x40 - Period"] + #[inline(always)] + pub fn per(&self) -> &crate::Reg { + unsafe { + &*(((self as *const Self) as *const u8).add(64usize) + as *const crate::Reg) + } + } + #[doc = "0x44..0x54 - Compare and Capture"] + #[inline(always)] + pub fn cc_dith6_mode(&self) -> &[crate::Reg; 4] { + unsafe { + &*(((self as *const Self) as *const u8).add(68usize) + as *const [crate::Reg; 4]) + } + } + #[doc = "0x44..0x54 - Compare and Capture"] + #[inline(always)] + pub fn cc_dith5_mode(&self) -> &[crate::Reg; 4] { + unsafe { + &*(((self as *const Self) as *const u8).add(68usize) + as *const [crate::Reg; 4]) + } + } + #[doc = "0x44..0x54 - Compare and Capture"] + #[inline(always)] + pub fn cc_dith4_mode(&self) -> &[crate::Reg; 4] { + unsafe { + &*(((self as *const Self) as *const u8).add(68usize) + as *const [crate::Reg; 4]) + } + } + #[doc = "0x44..0x54 - Compare and Capture"] + #[inline(always)] + pub fn cc(&self) -> &[crate::Reg; 4] { + unsafe { + &*(((self as *const Self) as *const u8).add(68usize) + as *const [crate::Reg; 4]) + } + } + #[doc = "0x6c - Period Buffer"] + #[inline(always)] + pub fn perbuf_dith6_mode(&self) -> &crate::Reg { + unsafe { + &*(((self as *const Self) as *const u8).add(108usize) + as *const crate::Reg) + } + } + #[doc = "0x6c - Period Buffer"] + #[inline(always)] + pub fn perbuf_dith5_mode(&self) -> &crate::Reg { + unsafe { + &*(((self as *const Self) as *const u8).add(108usize) + as *const crate::Reg) + } + } + #[doc = "0x6c - Period Buffer"] + #[inline(always)] + pub fn perbuf_dith4_mode(&self) -> &crate::Reg { + unsafe { + &*(((self as *const Self) as *const u8).add(108usize) + as *const crate::Reg) + } + } + #[doc = "0x6c - Period Buffer"] + #[inline(always)] + pub fn perbuf(&self) -> &crate::Reg { + unsafe { + &*(((self as *const Self) as *const u8).add(108usize) + as *const crate::Reg) + } + } + #[doc = "0x70..0x80 - Compare and Capture Buffer"] + #[inline(always)] + pub fn ccbuf_dith6_mode(&self) -> &[crate::Reg; 4] { + unsafe { + &*(((self as *const Self) as *const u8).add(112usize) + as *const [crate::Reg; 4]) + } + } + #[doc = "0x70..0x80 - Compare and Capture Buffer"] + #[inline(always)] + pub fn ccbuf_dith5_mode(&self) -> &[crate::Reg; 4] { + unsafe { + &*(((self as *const Self) as *const u8).add(112usize) + as *const [crate::Reg; 4]) + } + } + #[doc = "0x70..0x80 - Compare and Capture Buffer"] + #[inline(always)] + pub fn ccbuf_dith4_mode(&self) -> &[crate::Reg; 4] { + unsafe { + &*(((self as *const Self) as *const u8).add(112usize) + as *const [crate::Reg; 4]) + } + } + #[doc = "0x70..0x80 - Compare and Capture Buffer"] + #[inline(always)] + pub fn ccbuf(&self) -> &[crate::Reg; 4] { + unsafe { + &*(((self as *const Self) as *const u8).add(112usize) + as *const [crate::Reg; 4]) + } + } +} +#[doc = "CTRLA register accessor: an alias for `Reg`"] +pub type CTRLA = crate::Reg; +#[doc = "Control A"] +pub mod ctrla; +#[doc = "CTRLBCLR register accessor: an alias for `Reg`"] +pub type CTRLBCLR = crate::Reg; +#[doc = "Control B Clear"] +pub mod ctrlbclr; +#[doc = "CTRLBSET register accessor: an alias for `Reg`"] +pub type CTRLBSET = crate::Reg; +#[doc = "Control B Set"] +pub mod ctrlbset; +#[doc = "SYNCBUSY register accessor: an alias for `Reg`"] +pub type SYNCBUSY = crate::Reg; +#[doc = "Synchronization Busy"] +pub mod syncbusy; +#[doc = "FCTRLA register accessor: an alias for `Reg`"] +pub type FCTRLA = crate::Reg; +#[doc = "Recoverable Fault A Configuration"] +pub mod fctrla; +#[doc = "FCTRLB register accessor: an alias for `Reg`"] +pub type FCTRLB = crate::Reg; +#[doc = "Recoverable Fault B Configuration"] +pub mod fctrlb; +#[doc = "WEXCTRL register accessor: an alias for `Reg`"] +pub type WEXCTRL = crate::Reg; +#[doc = "Waveform Extension Configuration"] +pub mod wexctrl; +#[doc = "DRVCTRL register accessor: an alias for `Reg`"] +pub type DRVCTRL = crate::Reg; +#[doc = "Driver Control"] +pub mod drvctrl; +#[doc = "DBGCTRL register accessor: an alias for `Reg`"] +pub type DBGCTRL = crate::Reg; +#[doc = "Debug Control"] +pub mod dbgctrl; +#[doc = "EVCTRL register accessor: an alias for `Reg`"] +pub type EVCTRL = crate::Reg; +#[doc = "Event Control"] +pub mod evctrl; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Interrupt Enable Clear"] +pub mod intenclr; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Interrupt Enable Set"] +pub mod intenset; +#[doc = "INTFLAG register accessor: an alias for `Reg`"] +pub type INTFLAG = crate::Reg; +#[doc = "Interrupt Flag Status and Clear"] +pub mod intflag; +#[doc = "STATUS register accessor: an alias for `Reg`"] +pub type STATUS = crate::Reg; +#[doc = "Status"] +pub mod status; +#[doc = "COUNT register accessor: an alias for `Reg`"] +pub type COUNT = crate::Reg; +#[doc = "Count"] +pub mod count; +#[doc = "COUNT_DITH4_MODE register accessor: an alias for `Reg`"] +pub type COUNT_DITH4_MODE = crate::Reg; +#[doc = "Count"] +pub mod count_dith4_mode; +#[doc = "COUNT_DITH5_MODE register accessor: an alias for `Reg`"] +pub type COUNT_DITH5_MODE = crate::Reg; +#[doc = "Count"] +pub mod count_dith5_mode; +#[doc = "COUNT_DITH6_MODE register accessor: an alias for `Reg`"] +pub type COUNT_DITH6_MODE = crate::Reg; +#[doc = "Count"] +pub mod count_dith6_mode; +#[doc = "PATT register accessor: an alias for `Reg`"] +pub type PATT = crate::Reg; +#[doc = "Pattern"] +pub mod patt; +#[doc = "WAVE register accessor: an alias for `Reg`"] +pub type WAVE = crate::Reg; +#[doc = "Waveform Control"] +pub mod wave; +#[doc = "PER register accessor: an alias for `Reg`"] +pub type PER = crate::Reg; +#[doc = "Period"] +pub mod per; +#[doc = "PER_DITH4_MODE register accessor: an alias for `Reg`"] +pub type PER_DITH4_MODE = crate::Reg; +#[doc = "Period"] +pub mod per_dith4_mode; +#[doc = "PER_DITH5_MODE register accessor: an alias for `Reg`"] +pub type PER_DITH5_MODE = crate::Reg; +#[doc = "Period"] +pub mod per_dith5_mode; +#[doc = "PER_DITH6_MODE register accessor: an alias for `Reg`"] +pub type PER_DITH6_MODE = crate::Reg; +#[doc = "Period"] +pub mod per_dith6_mode; +#[doc = "CC register accessor: an alias for `Reg`"] +pub type CC = crate::Reg; +#[doc = "Compare and Capture"] +pub mod cc; +#[doc = "CC_DITH4_MODE register accessor: an alias for `Reg`"] +pub type CC_DITH4_MODE = crate::Reg; +#[doc = "Compare and Capture"] +pub mod cc_dith4_mode; +#[doc = "CC_DITH5_MODE register accessor: an alias for `Reg`"] +pub type CC_DITH5_MODE = crate::Reg; +#[doc = "Compare and Capture"] +pub mod cc_dith5_mode; +#[doc = "CC_DITH6_MODE register accessor: an alias for `Reg`"] +pub type CC_DITH6_MODE = crate::Reg; +#[doc = "Compare and Capture"] +pub mod cc_dith6_mode; +#[doc = "PATTBUF register accessor: an alias for `Reg`"] +pub type PATTBUF = crate::Reg; +#[doc = "Pattern Buffer"] +pub mod pattbuf; +#[doc = "PERBUF register accessor: an alias for `Reg`"] +pub type PERBUF = crate::Reg; +#[doc = "Period Buffer"] +pub mod perbuf; +#[doc = "PERBUF_DITH4_MODE register accessor: an alias for `Reg`"] +pub type PERBUF_DITH4_MODE = crate::Reg; +#[doc = "Period Buffer"] +pub mod perbuf_dith4_mode; +#[doc = "PERBUF_DITH5_MODE register accessor: an alias for `Reg`"] +pub type PERBUF_DITH5_MODE = crate::Reg; +#[doc = "Period Buffer"] +pub mod perbuf_dith5_mode; +#[doc = "PERBUF_DITH6_MODE register accessor: an alias for `Reg`"] +pub type PERBUF_DITH6_MODE = crate::Reg; +#[doc = "Period Buffer"] +pub mod perbuf_dith6_mode; +#[doc = "CCBUF register accessor: an alias for `Reg`"] +pub type CCBUF = crate::Reg; +#[doc = "Compare and Capture Buffer"] +pub mod ccbuf; +#[doc = "CCBUF_DITH4_MODE register accessor: an alias for `Reg`"] +pub type CCBUF_DITH4_MODE = crate::Reg; +#[doc = "Compare and Capture Buffer"] +pub mod ccbuf_dith4_mode; +#[doc = "CCBUF_DITH5_MODE register accessor: an alias for `Reg`"] +pub type CCBUF_DITH5_MODE = crate::Reg; +#[doc = "Compare and Capture Buffer"] +pub mod ccbuf_dith5_mode; +#[doc = "CCBUF_DITH6_MODE register accessor: an alias for `Reg`"] +pub type CCBUF_DITH6_MODE = crate::Reg; +#[doc = "Compare and Capture Buffer"] +pub mod ccbuf_dith6_mode; -- cgit v1.2.3-70-g09d2