Added options for enabling CLKOUT.

- CLKOUT can be enabled in Radio settings and status bar.
- Fixed a typo(I believe) in ui_navigation.
This commit is contained in:
dqs105 2020-09-16 19:27:56 +08:00
parent 55783a60f5
commit b15b781039
8 changed files with 80 additions and 9 deletions

View file

@ -463,3 +463,17 @@ void ClockManager::stop_audio_pll() {
cgu::pll0audio::power_down();
while( cgu::pll0audio::is_locked() );
}
void ClockManager::enable_clock_output(bool enable) {
if(enable) {
clock_generator.enable_output(clock_generator_output_clkout);
clock_generator.set_ms_frequency(clock_generator_output_clkout, 10000000, si5351_vco_f, 0);
} else {
clock_generator.disable_output(clock_generator_output_clkout);
}
if(enable)
clock_generator.set_clock_control(clock_generator_output_clkout, si5351_clock_control_common[clock_generator_output_clkout].ms_src(get_reference_clock_generator_pll(reference.source)).clk_pdn(ClockControl::ClockPowerDown::Power_On));
else
clock_generator.set_clock_control(clock_generator_output_clkout, ClockControl::power_off());
}