Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Examples,PeriphDrivers): Update TMR Clock Source names to be consistent with the User Guides #956

Merged
merged 7 commits into from
Mar 20, 2024

Conversation

sihyung-maxim
Copy link
Contributor

@sihyung-maxim sihyung-maxim commented Mar 18, 2024

Description

The microcontrollers with the TMR_RevB IP Core allow users to select different clock sources for each timer instance. In the MSDK, this is represented using the mxc_tmr_clock_t enum. However, the options in the mxc_tmr_clock_t enum were named after frequencies of the clock sources, not their individually-referred names.

typedef enum {
    MXC_TMR_APB_CLK = 0,
    MXC_TMR_EXT_CLK,
    MXC_TMR_32M_CLK,
    MXC_TMR_8M_CLK,
    MXC_TMR_32K_CLK,
    MXC_TMR_8K_CLK
} mxc_tmr_clock_t;

This can cause confusion as the named frequencies doesn't always match the actual frequency of the clock source. For example, the MXC_TMR_32M_CLK represents the ERFO clock which could range from 16-32MHz. We have parts in the MSDK setting the ERFO to 16MHz, 25MHz, and 32MHz. The MXC_TMR_8K_CLK represents the INRO clock, and this oscillator's frequency is highly variable. Some parts also have the INRO set to 80KHz.

This PR updates the TMR enum names (while leaving the old names in) to make it more readable and consistent with the user guides for the affected parts. Also, I scrubbed through the TMR RevB drivers to ensure the clock source selections are correct and only had what the part actually supports.

Checklist Before Requesting Review

  • PR Title follows correct guidelines.
  • Description of changes and all other relevant information.
  • (Optional) Link any related GitHub issues using a keyword
  • (Optional) Provide info on any relevant functional testing/validation. For API changes or significant features, this is not optional.

@github-actions github-actions bot added MAX32655 Related to the MAX32655 (ME17) MAX32670 Related to the MAX32670 (ME15) MAX32672 Related to the MAX32672 (ME21) MAX32675 Related to the MAX32675 (ME16) MAX32680 Related to the MAX32680 (ME20) MAX32690 Related to the MAX32690 (ME18) MAX78000 Related to the MAX78000 (AI85) MAX78002 Related to the MAX78002 (AI87) MAX32662 Related to the MAX32662 (ME12) labels Mar 18, 2024
Copy link
Contributor

@Jake-Carter Jake-Carter left a comment

Choose a reason for hiding this comment

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

Good change, just need to clang/lint

@sihyung-maxim
Copy link
Contributor Author

/clang-format-run

@sihyung-maxim sihyung-maxim merged commit 7ee1fd3 into main Mar 20, 2024
8 checks passed
@sihyung-maxim sihyung-maxim deleted the fix/tmr branch March 20, 2024 20:03
EricB-ADI pushed a commit that referenced this pull request Aug 21, 2024
… be consistent with the User Guides (#956)"

This reverts commit 7ee1fd3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MAX32655 Related to the MAX32655 (ME17) MAX32662 Related to the MAX32662 (ME12) MAX32670 Related to the MAX32670 (ME15) MAX32672 Related to the MAX32672 (ME21) MAX32675 Related to the MAX32675 (ME16) MAX32680 Related to the MAX32680 (ME20) MAX32690 Related to the MAX32690 (ME18) MAX78000 Related to the MAX78000 (AI85) MAX78002 Related to the MAX78002 (AI87)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants