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>
This commit is contained in:
Kevin O'Connor
2021-11-20 13:47:17 -05:00
parent 92ca111986
commit bb08dc7ae9
7 changed files with 22 additions and 12 deletions

View File

@@ -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