drivers/include/periph: add FREQM peripheral driver#20020
drivers/include/periph: add FREQM peripheral driver#20020benpicco merged 14 commits intoRIOT-OS:masterfrom
Conversation
dylad
left a comment
There was a problem hiding this comment.
Give it a quick try and it works nice !
benpicco
left a comment
There was a problem hiding this comment.
This is looking good!
Some nits and a suggestion to simplify the API:
cpu/samd5x/include/periph_cpu.h
Outdated
| #ifndef SAM0_GCLK_MAIN | ||
| #define SAM0_GCLK_MAIN 0 /**< 120 MHz main clock */ | ||
| #endif |
There was a problem hiding this comment.
| #ifndef SAM0_GCLK_MAIN | |
| #define SAM0_GCLK_MAIN 0 /**< 120 MHz main clock */ | |
| #endif | |
| #define SAM0_GCLK_MAIN 0 /**< 120 MHz main clock */ |
Main Clock is fixed to GCLK0
There was a problem hiding this comment.
Is it possible that SAM0_GCLK_32KHZ is also fixed? When trying to overwrite it I didn't get any text on the terminal.
There was a problem hiding this comment.
It shoudln't be, unless it's hard-coded somewhere.
But maybe we should add some static_assert() to ensure no two GCLKs are configured to the same ID.
benpicco
left a comment
There was a problem hiding this comment.
Looks good!
Only some minor nitpicks.
b07dca4 to
bfb3b5f
Compare
benpicco
left a comment
There was a problem hiding this comment.
Looks good, thank you for your contribution!
|
Looks like something is missing with Kconfig. |
Contribution description
This PR adds a peripheral driver for frequency meter (FREQM). Tested with SAM E54 XPLAINED PRO EVALUATION KIT (ATSAME54P20A microcontroller).
I think I have access to some other boards to test the driver in the near future.
Testing procedure
As the FREQM needs a reference clock to measure the frequency of another clock this test uses two internal clocks. The slower internal clock is used as reference to measure the faster internal clock.
The test can be invoked with:
Expected result (via serial):