mcg.h

Interface definition for the Kinetis MCG driver.

CLOCK_CORECLOCK

Core clock frequency, used by the ARM core and certain hardware modules in Kinetis CPUs.

1
(MCGOUTCLK)

The clock is derived from the MCG output clock divided by an integer divisor, which is controlled by the kinetis/include/periph_cpu.h::clock_config_t::clkdiv1 settings

CLOCK_BUSCLOCK

Bus clock frequency, used by several hardware modules in Kinetis CPUs.

1
(CLOCK_CORECLOCK / x)

The clock is derived from the MCG output clock divided by an integer divisor, which is controlled by the kinetis/include/periph_cpu.h::clock_config_t::clkdiv1 settings

int kinetis_mcg_set_mode(kinetis/include/periph_cpu.h::kinetis_mcg_mode_t mode)

Switch the MCG to the specified clocking mode.

Depending on the current clocking mode, this function may step through several other clocking modes in order to be able to reach the target mode.

Parameters

mode:Target mode

Return values

  • 0 on success
  • <0 on error
void kinetis_mcg_init(void)

Initialize the MCG.

The configuration is found in the clock_config struct defined in periph_conf.h