System clock driver support for hardware abstraction layer.
This driver manage all clock providers.
// init sysclock
sysclock_setClock(120000000); // set clock to 120MHz
uint32_t timer_freq = sysclock_periphFreq();
int sysclock_setClock(uint32_t fosc);
Sets the system clock of the CPU, the system clock may be different of CPU
uint32_t sysclock_periphFreq(SYSCLOCK_CLOCK busClock);
Gets the actual frequency on a particular peripheral bus clock
int sysclock_setClockDiv(SYSCLOCK_CLOCK busClock, uint16_t div);
Change the divisor of the busClock given as argument
int32_t sysclock_sourceFreq(SYSCLOCK_SOURCE source);
Return the actual frequency of the clock source
int sysclock_setSourceFreq(SYSCLOCK_SOURCE source, uint32_t freq);
Change a frequency of a source if it can be modified
SYSCLOCK_SOURCE sysclock_source();
Return the actual clock source for system clock
int sysclock_switchSourceTo(SYSCLOCK_SOURCE source);
Switch the source clock of sysclock to another one and wait for the change effective
Header file : sysclock.h