Skip to content

Conversation

@jnohlgard
Copy link
Member

@jnohlgard jnohlgard commented Apr 27, 2017

A collection of improvements for the multipurpose clock generator (MCG) driver, including:

  • Add state transition graph to MCG documentation
  • Simplify MCG state traversal algorithm
    The new implementation uses a precalculated map of which mode to switch
    to next if going from mode A to mode B. This simplifies the
    implementation for moving between modes which are not direct neighbors.
    See mcg.h documentation for a diagram of the state machine for the
    clocking modes. Also found in the CPU reference manual of all Kinetis
    CPUs, MCG chapter, MCG mode state diagram.
  • Add support for low-end MCG without PLL
  • Use {} for empty while loops

Tested on Mulle/K60, FRDM-K22F (in #6994), FRDM-KW41Z (in #6995)

Will be required for future support of Kinetis L series CPUs and KW41Z

@jnohlgard jnohlgard added Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Apr 27, 2017
@jnohlgard jnohlgard added this to the Release 2017.07 milestone Apr 27, 2017
Joakim Nohlgård added 4 commits May 30, 2017 08:50
The new implementation uses a precalculated map of which mode to switch
to next if going from mode A to mode B. This simplifies the
implementation for moving between modes which are not direct neighbors.
See mcg.h documentation for a diagram of the state machine for the
clocking modes. Also found in the CPU reference manual of all Kinetis
CPUs, MCG chapter, MCG mode state diagram.
Found in Kinetis L series, among others
Copy link
Contributor

@kYc0o kYc0o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK.

Tested on FRDM-K64F and pba-d-01-kw2x with success.

@kYc0o kYc0o merged commit 5f0b8e5 into RIOT-OS:master Jun 12, 2017
@jnohlgard jnohlgard deleted the pr/kinetis-mcg branch June 21, 2017 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants