rp/clocks: remove unsupported xosc config input

the datasheet says that the xosc may be run by feeding a square wave
into the XIN pin of the chip, but requires that the oscillator be set to
pass through XIN in that case. it does not mention how, the xosc
peripheral does not seem to have any config bits that could be set to
this effect, and pico-sdk seems to have no (or at least no special)
handling for this configuration at all. it can thus be assumed to either
be not supported even by the reference sdk or to not need different
handling.
This commit is contained in:
pennae 2023-05-16 17:13:09 +02:00
parent 5bbed31513
commit d97a771479

View File

@ -34,7 +34,6 @@ impl ClockConfig {
}), }),
xosc: Some(XoscConfig { xosc: Some(XoscConfig {
hz: crystal_hz, hz: crystal_hz,
clock_type: ExternalClock::Crystal,
sys_pll: Some(PllConfig { sys_pll: Some(PllConfig {
refdiv: 1, refdiv: 1,
fbdiv: 125, fbdiv: 125,
@ -119,7 +118,6 @@ pub struct RoscConfig {
pub struct XoscConfig { pub struct XoscConfig {
pub hz: u32, pub hz: u32,
pub clock_type: ExternalClock,
pub sys_pll: Option<PllConfig>, pub sys_pll: Option<PllConfig>,
pub usb_pll: Option<PllConfig>, pub usb_pll: Option<PllConfig>,
} }
@ -131,10 +129,6 @@ pub struct PllConfig {
pub post_div2: u8, pub post_div2: u8,
} }
pub enum ExternalClock {
Crystal,
Clock,
}
pub struct RefClkConfig { pub struct RefClkConfig {
pub src: RefClkSrc, pub src: RefClkSrc,
pub div: u8, pub div: u8,
@ -223,12 +217,9 @@ pub(crate) unsafe fn init(config: ClockConfig) {
}); });
// start XOSC // start XOSC
match config.clock_type { // datasheet mentions support for clock inputs into XIN, but doesn't go into
ExternalClock::Crystal => start_xosc(config.hz), // how this is achieved. pico-sdk doesn't support this at all.
// TODO The datasheet says the xosc needs to be put into a bypass mode to use an start_xosc(config.hz);
// external clock, but is mum about how to do that.
ExternalClock::Clock => todo!(),
}
if let Some(sys_pll_config) = config.sys_pll { if let Some(sys_pll_config) = config.sys_pll {
configure_pll(pac::PLL_SYS, config.hz, sys_pll_config); configure_pll(pac::PLL_SYS, config.hz, sys_pll_config);