diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2021-11-20 13:47:17 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-11-20 13:52:16 -0500 |
commit | bb08dc7ae91488a6e9e1e88de28bd43be9fa5651 (patch) | |
tree | 0f8255ecf3f5d4bd4a9b66db302795071533ba64 /src/atsam/main.c | |
parent | 92ca1119868abbd859c8f7a3f88143cf53561eb3 (diff) | |
download | kutter-bb08dc7ae91488a6e9e1e88de28bd43be9fa5651.tar.gz kutter-bb08dc7ae91488a6e9e1e88de28bd43be9fa5651.tar.xz kutter-bb08dc7ae91488a6e9e1e88de28bd43be9fa5651.zip |
atsam: Add get_pclock_frequency() helper function
Add get_pclock_frequency() and use it to calculate peripheral clocks.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/atsam/main.c')
-rw-r--r-- | src/atsam/main.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/atsam/main.c b/src/atsam/main.c index 843b5034..83c561e6 100644 --- a/src/atsam/main.c +++ b/src/atsam/main.c @@ -56,6 +56,13 @@ enable_pclock(uint32_t id) PMC->PMC_PCER1 = 1 << (id - 32); } +// Return the frequency of the given peripheral clock +uint32_t +get_pclock_frequency(uint32_t id) +{ + return CONFIG_CLOCK_FREQ; +} + /**************************************************************** * Resets |