[][src]Struct pygamer::clock::GenericClockController

pub struct GenericClockController { /* fields omitted */ }

GenericClockController encapsulates the GCLK hardware. It provides a type safe way to configure the system clocks. Initializing the GenericClockController instance configures the system to run at 120MHz by taking the DFLL48 and feeding it into the DPLL0 hardware which multiplies the signal by 2.5x.

Implementations

impl GenericClockController[src]

pub fn with_internal_32kosc(
    gclk: GCLK,
    mclk: &mut MCLK,
    osc32kctrl: &mut OSC32KCTRL,
    oscctrl: &mut OSCCTRL,
    nvmctrl: &mut NVMCTRL
) -> GenericClockController
[src]

Reset the clock controller, configure the system to run at 120Mhz and reset various clock dividers.

pub fn with_external_32kosc(
    gclk: GCLK,
    mclk: &mut MCLK,
    osc32kctrl: &mut OSC32KCTRL,
    oscctrl: &mut OSCCTRL,
    nvmctrl: &mut NVMCTRL
) -> GenericClockController
[src]

Reset the clock controller, configure the system to run at 120Mhz and reset various clock dividers.

pub fn gclk0(&mut self) -> GClock[src]

Returns a GClock for gclk0, the 120MHz oscillator.

pub fn gclk1(&mut self) -> GClock[src]

Returns a GClock for gclk1, the 32KHz oscillator.

pub fn get_gclk(&mut self, gclk: GEN_A) -> Option<GClock>[src]

Returns the GClock for the specified clock generator. If that clock generator has not yet been configured, returns None.

pub fn configure_gclk_divider_and_source(
    &mut self,
    gclk: GEN_A,
    divider: u16,
    src: SRC_A,
    improve_duty_cycle: bool
) -> Option<GClock>
[src]

Configures a clock generator with the specified divider and source. divider is a linear divider to be applied to the clock source. While the hardware also supports an exponential divider, this function doesn't expose that functionality at this time. improve_duty_cycle is a boolean that, when set to true, enables a 50/50 duty cycle for odd divider values. Returns a GClock for the configured clock generator. Returns None if the clock generator has already been configured.

impl GenericClockController[src]

pub fn tc0_tc1(&mut self, generator: &GClock) -> Option<Tc0Tc1Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn tcc0_tcc1(&mut self, generator: &GClock) -> Option<Tcc0Tcc1Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn tc2_tc3(&mut self, generator: &GClock) -> Option<Tc2Tc3Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn tcc2_tcc3(&mut self, generator: &GClock) -> Option<Tcc2Tcc3Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn tc4_tc5(&mut self, generator: &GClock) -> Option<Tc4Tc5Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn tcc4(&mut self, generator: &GClock) -> Option<Tcc4Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn tc6_tc7(&mut self, generator: &GClock) -> Option<Tc6Tc7Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn sercom0_core(&mut self, generator: &GClock) -> Option<Sercom0CoreClock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn sercom1_core(&mut self, generator: &GClock) -> Option<Sercom1CoreClock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn sercom2_core(&mut self, generator: &GClock) -> Option<Sercom2CoreClock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn sercom3_core(&mut self, generator: &GClock) -> Option<Sercom3CoreClock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn sercom4_core(&mut self, generator: &GClock) -> Option<Sercom4CoreClock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn sercom5_core(&mut self, generator: &GClock) -> Option<Sercom5CoreClock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn usb(&mut self, generator: &GClock) -> Option<UsbClock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn adc0(&mut self, generator: &GClock) -> Option<Adc0Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn adc1(&mut self, generator: &GClock) -> Option<Adc1Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn eic(&mut self, generator: &GClock) -> Option<EicClock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn freq_m_msr(&mut self, generator: &GClock) -> Option<FreqmMsrClock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn freq_m_ref(&mut self, generator: &GClock) -> Option<FreqmRefClock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn evsys0(&mut self, generator: &GClock) -> Option<Evsys0Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn evsys1(&mut self, generator: &GClock) -> Option<Evsys1Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn evsys2(&mut self, generator: &GClock) -> Option<Evsys2Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn evsys3(&mut self, generator: &GClock) -> Option<Evsys3Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn evsys4(&mut self, generator: &GClock) -> Option<Evsys4Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn evsys5(&mut self, generator: &GClock) -> Option<Evsys5Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn evsys6(&mut self, generator: &GClock) -> Option<Evsys6Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn evsys7(&mut self, generator: &GClock) -> Option<Evsys7Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn evsys8(&mut self, generator: &GClock) -> Option<Evsys8Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn evsys9(&mut self, generator: &GClock) -> Option<Evsys9Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn evsys10(&mut self, generator: &GClock) -> Option<Evsys10Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn evsys11(&mut self, generator: &GClock) -> Option<Evsys11Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn can0(&mut self, generator: &GClock) -> Option<Can0Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn can1(&mut self, generator: &GClock) -> Option<Can1Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn pdec(&mut self, generator: &GClock) -> Option<PdecClock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn ac(&mut self, generator: &GClock) -> Option<AcClock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn ccl(&mut self, generator: &GClock) -> Option<CclClock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn dac(&mut self, generator: &GClock) -> Option<DacClock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn i2s0(&mut self, generator: &GClock) -> Option<I2S0Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn i2s1(&mut self, generator: &GClock) -> Option<I2S1Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn sdhc0(&mut self, generator: &GClock) -> Option<Sdhc0Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn sdhc1(&mut self, generator: &GClock) -> Option<Sdhc1Clock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

pub fn cm4_trace(&mut self, generator: &GClock) -> Option<Cm4TraceClock>[src]

Configure the clock for peripheral(s) that match the name of this function to use the specific clock generator. The GClock parameter may be one of default clocks return from gclk0(), gclk1() or a clock configured by the host application using the configure_gclk_divider_and_source method. Returns a typed token that proves that the clock has been configured; the peripheral initialization code will typically require that this clock token be passed in to ensure that the clock has been initialized appropriately. Returns None is the specified generic clock has already been configured.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.