Insert IDIVC into audio MCLK path, so it can be divided.

This commit is contained in:
Jared Boone 2016-01-29 15:17:05 -08:00
parent 275b644edd
commit a03a72474d
2 changed files with 13 additions and 1 deletions

View File

@ -516,7 +516,17 @@ void ClockManager::start_audio_pll() {
while( !cgu::pll0audio::is_locked() );
cgu::pll0audio::clock_enable();
set_clock(LPC_CGU->BASE_AUDIO_CLK, cgu::CLK_SEL::PLL0AUDIO);
set_base_audio_clock_divider(1);
set_clock(LPC_CGU->BASE_AUDIO_CLK, cgu::CLK_SEL::IDIVC);
}
void ClockManager::set_base_audio_clock_divider(const size_t divisor) {
LPC_CGU->IDIVC_CTRL =
(0 << 1)
| ((divisor - 1) << 2)
| (1 << 11)
| (toUType(cgu::CLK_SEL::PLL0AUDIO) << 24)
;
}
void ClockManager::stop_audio_pll() {

View File

@ -51,6 +51,8 @@ public:
void start_audio_pll();
void stop_audio_pll();
void set_base_audio_clock_divider(const size_t divisor);
void enable_codec_clocks();
void disable_codec_clocks();