165 lines
14 KiB
Rust
165 lines
14 KiB
Rust
#[repr(C)]
|
|
#[doc = "Register block"]
|
|
pub struct RegisterBlock {
|
|
ir: Ir,
|
|
tcr: Tcr,
|
|
tc: Tc,
|
|
pr: Pr,
|
|
pc: Pc,
|
|
mcr: Mcr,
|
|
mr: [Mr; 4],
|
|
ccr: Ccr,
|
|
cr: [Cr; 2],
|
|
_reserved9: [u8; 0x08],
|
|
emr: Emr,
|
|
_reserved10: [u8; 0x30],
|
|
ctcr: Ctcr,
|
|
pwmc: Pwmc,
|
|
}
|
|
impl RegisterBlock {
|
|
#[doc = "0x00 - Interrupt Register (IR). The IR can be written to clear interrupts. The IR can be read to identify which of five possible interrupt sources are pending."]
|
|
#[inline(always)]
|
|
pub const fn ir(&self) -> &Ir {
|
|
&self.ir
|
|
}
|
|
#[doc = "0x04 - Timer Control Register (TCR). The TCR is used to control the Timer Counter functions. The Timer Counter can be disabled or reset through the TCR."]
|
|
#[inline(always)]
|
|
pub const fn tcr(&self) -> &Tcr {
|
|
&self.tcr
|
|
}
|
|
#[doc = "0x08 - Timer Counter (TC). The 32-bit TC is incremented every PR+1 cycles of PCLK. The TC is controlled through the TCR."]
|
|
#[inline(always)]
|
|
pub const fn tc(&self) -> &Tc {
|
|
&self.tc
|
|
}
|
|
#[doc = "0x0c - Prescale Register (PR). When the Prescale Counter (below) is equal to this value, the next clock increments the TC and clears the PC."]
|
|
#[inline(always)]
|
|
pub const fn pr(&self) -> &Pr {
|
|
&self.pr
|
|
}
|
|
#[doc = "0x10 - Prescale Counter (PC). The 32-bit PC is a counter which is incremented to the value stored in PR. When the value in PR is reached, the TC is incremented and the PC is cleared. The PC is observable and controllable through the bus interface."]
|
|
#[inline(always)]
|
|
pub const fn pc(&self) -> &Pc {
|
|
&self.pc
|
|
}
|
|
#[doc = "0x14 - Match Control Register (MCR). The MCR is used to control if an interrupt is generated and if the TC is reset when a Match occurs."]
|
|
#[inline(always)]
|
|
pub const fn mcr(&self) -> &Mcr {
|
|
&self.mcr
|
|
}
|
|
#[doc = "0x18..0x28 - Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC."]
|
|
#[inline(always)]
|
|
pub const fn mr(&self, n: usize) -> &Mr {
|
|
&self.mr[n]
|
|
}
|
|
#[doc = "Iterator for array of:"]
|
|
#[doc = "0x18..0x28 - Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC."]
|
|
#[inline(always)]
|
|
pub fn mr_iter(&self) -> impl Iterator<Item = &Mr> {
|
|
self.mr.iter()
|
|
}
|
|
#[doc = "0x28 - Capture Control Register (CCR). The CCR controls which edges of the capture inputs are used to load the Capture Registers and whether or not an interrupt is generated when a capture takes place."]
|
|
#[inline(always)]
|
|
pub const fn ccr(&self) -> &Ccr {
|
|
&self.ccr
|
|
}
|
|
#[doc = "0x2c..0x34 - Capture Register (CR). CR is loaded with the value of TC when there is an event on the CT16Bn_CAPm input."]
|
|
#[inline(always)]
|
|
pub const fn cr(&self, n: usize) -> &Cr {
|
|
&self.cr[n]
|
|
}
|
|
#[doc = "Iterator for array of:"]
|
|
#[doc = "0x2c..0x34 - Capture Register (CR). CR is loaded with the value of TC when there is an event on the CT16Bn_CAPm input."]
|
|
#[inline(always)]
|
|
pub fn cr_iter(&self) -> impl Iterator<Item = &Cr> {
|
|
self.cr.iter()
|
|
}
|
|
#[doc = "0x3c - External Match Register (EMR). The EMR controls the match function and the external match pins CT32B0_MAT\\[3:0\\]."]
|
|
#[inline(always)]
|
|
pub const fn emr(&self) -> &Emr {
|
|
&self.emr
|
|
}
|
|
#[doc = "0x70 - Count Control Register (CTCR). The CTCR selects between Timer and Counter mode, and in Counter mode selects the signal and edge(s) for counting."]
|
|
#[inline(always)]
|
|
pub const fn ctcr(&self) -> &Ctcr {
|
|
&self.ctcr
|
|
}
|
|
#[doc = "0x74 - PWM Control Register (PWMCON). The PWMCON enables PWM mode for the external match pins CT32B0_MAT\\[3:0\\]."]
|
|
#[inline(always)]
|
|
pub const fn pwmc(&self) -> &Pwmc {
|
|
&self.pwmc
|
|
}
|
|
}
|
|
#[doc = "IR (rw) register accessor: Interrupt Register (IR). The IR can be written to clear interrupts. The IR can be read to identify which of five possible interrupt sources are pending.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ir::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ir::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ir`]
|
|
module"]
|
|
#[doc(alias = "IR")]
|
|
pub type Ir = crate::Reg<ir::IrSpec>;
|
|
#[doc = "Interrupt Register (IR). The IR can be written to clear interrupts. The IR can be read to identify which of five possible interrupt sources are pending."]
|
|
pub mod ir;
|
|
#[doc = "TCR (rw) register accessor: Timer Control Register (TCR). The TCR is used to control the Timer Counter functions. The Timer Counter can be disabled or reset through the TCR.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tcr`]
|
|
module"]
|
|
#[doc(alias = "TCR")]
|
|
pub type Tcr = crate::Reg<tcr::TcrSpec>;
|
|
#[doc = "Timer Control Register (TCR). The TCR is used to control the Timer Counter functions. The Timer Counter can be disabled or reset through the TCR."]
|
|
pub mod tcr;
|
|
#[doc = "TC (rw) register accessor: Timer Counter (TC). The 32-bit TC is incremented every PR+1 cycles of PCLK. The TC is controlled through the TCR.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tc`]
|
|
module"]
|
|
#[doc(alias = "TC")]
|
|
pub type Tc = crate::Reg<tc::TcSpec>;
|
|
#[doc = "Timer Counter (TC). The 32-bit TC is incremented every PR+1 cycles of PCLK. The TC is controlled through the TCR."]
|
|
pub mod tc;
|
|
#[doc = "PR (rw) register accessor: Prescale Register (PR). When the Prescale Counter (below) is equal to this value, the next clock increments the TC and clears the PC.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pr`]
|
|
module"]
|
|
#[doc(alias = "PR")]
|
|
pub type Pr = crate::Reg<pr::PrSpec>;
|
|
#[doc = "Prescale Register (PR). When the Prescale Counter (below) is equal to this value, the next clock increments the TC and clears the PC."]
|
|
pub mod pr;
|
|
#[doc = "PC (rw) register accessor: Prescale Counter (PC). The 32-bit PC is a counter which is incremented to the value stored in PR. When the value in PR is reached, the TC is incremented and the PC is cleared. The PC is observable and controllable through the bus interface.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pc`]
|
|
module"]
|
|
#[doc(alias = "PC")]
|
|
pub type Pc = crate::Reg<pc::PcSpec>;
|
|
#[doc = "Prescale Counter (PC). The 32-bit PC is a counter which is incremented to the value stored in PR. When the value in PR is reached, the TC is incremented and the PC is cleared. The PC is observable and controllable through the bus interface."]
|
|
pub mod pc;
|
|
#[doc = "MCR (rw) register accessor: Match Control Register (MCR). The MCR is used to control if an interrupt is generated and if the TC is reset when a Match occurs.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mcr`]
|
|
module"]
|
|
#[doc(alias = "MCR")]
|
|
pub type Mcr = crate::Reg<mcr::McrSpec>;
|
|
#[doc = "Match Control Register (MCR). The MCR is used to control if an interrupt is generated and if the TC is reset when a Match occurs."]
|
|
pub mod mcr;
|
|
#[doc = "MR (rw) register accessor: Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mr`]
|
|
module"]
|
|
#[doc(alias = "MR")]
|
|
pub type Mr = crate::Reg<mr::MrSpec>;
|
|
#[doc = "Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC."]
|
|
pub mod mr;
|
|
#[doc = "CCR (rw) register accessor: Capture Control Register (CCR). The CCR controls which edges of the capture inputs are used to load the Capture Registers and whether or not an interrupt is generated when a capture takes place.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ccr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ccr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ccr`]
|
|
module"]
|
|
#[doc(alias = "CCR")]
|
|
pub type Ccr = crate::Reg<ccr::CcrSpec>;
|
|
#[doc = "Capture Control Register (CCR). The CCR controls which edges of the capture inputs are used to load the Capture Registers and whether or not an interrupt is generated when a capture takes place."]
|
|
pub mod ccr;
|
|
#[doc = "CR (r) register accessor: Capture Register (CR). CR is loaded with the value of TC when there is an event on the CT16Bn_CAPm input.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cr`]
|
|
module"]
|
|
#[doc(alias = "CR")]
|
|
pub type Cr = crate::Reg<cr::CrSpec>;
|
|
#[doc = "Capture Register (CR). CR is loaded with the value of TC when there is an event on the CT16Bn_CAPm input."]
|
|
pub mod cr;
|
|
#[doc = "EMR (rw) register accessor: External Match Register (EMR). The EMR controls the match function and the external match pins CT32B0_MAT\\[3:0\\].\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`emr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`emr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@emr`]
|
|
module"]
|
|
#[doc(alias = "EMR")]
|
|
pub type Emr = crate::Reg<emr::EmrSpec>;
|
|
#[doc = "External Match Register (EMR). The EMR controls the match function and the external match pins CT32B0_MAT\\[3:0\\]."]
|
|
pub mod emr;
|
|
#[doc = "CTCR (rw) register accessor: Count Control Register (CTCR). The CTCR selects between Timer and Counter mode, and in Counter mode selects the signal and edge(s) for counting.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ctcr`]
|
|
module"]
|
|
#[doc(alias = "CTCR")]
|
|
pub type Ctcr = crate::Reg<ctcr::CtcrSpec>;
|
|
#[doc = "Count Control Register (CTCR). The CTCR selects between Timer and Counter mode, and in Counter mode selects the signal and edge(s) for counting."]
|
|
pub mod ctcr;
|
|
#[doc = "PWMC (rw) register accessor: PWM Control Register (PWMCON). The PWMCON enables PWM mode for the external match pins CT32B0_MAT\\[3:0\\].\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pwmc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pwmc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pwmc`]
|
|
module"]
|
|
#[doc(alias = "PWMC")]
|
|
pub type Pwmc = crate::Reg<pwmc::PwmcSpec>;
|
|
#[doc = "PWM Control Register (PWMCON). The PWMCON enables PWM mode for the external match pins CT32B0_MAT\\[3:0\\]."]
|
|
pub mod pwmc;
|