Clocks are an important part of an MCU and its peripherals. CM_ClockTree contains functions that configure the MCU's clock sources and clock settings for the peripherals used.
BitMasher uses two external crystal oscillators. The main oscillator is clocked at 40 MHz and drives the CPU and most of the MCU's peripherals. The secondary, low-frequency oscillator is clocked at 32.768 kHz and drives the MCU's low-energy peripherals, codec MCLK generation and the real-time clock module:
BitMasher also has the option to use the internal oscillator clocked at 19 MHz. This is intended for when BitMasher enters a low-power state.
While a function to enter the low-power clocking state exists, it is not yet fully functional.