aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpennae <[email protected]>2023-05-16 17:13:09 +0200
committerpennae <[email protected]>2023-05-17 19:29:26 +0200
commitd97a77147927b8ea6b245ec88a52de92db33813b (patch)
treea46bd863276a65896f2ad7a5f44f74907faad0fa
parent5bbed315131991745efacbaa5c384e11f704923b (diff)
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.
-rw-r--r--embassy-rp/src/clocks.rs15
1 files changed, 3 insertions, 12 deletions
diff --git a/embassy-rp/src/clocks.rs b/embassy-rp/src/clocks.rs
index 63f70cec4..dc8505987 100644
--- a/embassy-rp/src/clocks.rs
+++ b/embassy-rp/src/clocks.rs
@@ -34,7 +34,6 @@ impl ClockConfig {
34 }), 34 }),
35 xosc: Some(XoscConfig { 35 xosc: Some(XoscConfig {
36 hz: crystal_hz, 36 hz: crystal_hz,
37 clock_type: ExternalClock::Crystal,
38 sys_pll: Some(PllConfig { 37 sys_pll: Some(PllConfig {
39 refdiv: 1, 38 refdiv: 1,
40 fbdiv: 125, 39 fbdiv: 125,
@@ -119,7 +118,6 @@ pub struct RoscConfig {
119 118
120pub struct XoscConfig { 119pub struct XoscConfig {
121 pub hz: u32, 120 pub hz: u32,
122 pub clock_type: ExternalClock,
123 pub sys_pll: Option<PllConfig>, 121 pub sys_pll: Option<PllConfig>,
124 pub usb_pll: Option<PllConfig>, 122 pub usb_pll: Option<PllConfig>,
125} 123}
@@ -131,10 +129,6 @@ pub struct PllConfig {
131 pub post_div2: u8, 129 pub post_div2: u8,
132} 130}
133 131
134pub enum ExternalClock {
135 Crystal,
136 Clock,
137}
138pub struct RefClkConfig { 132pub struct RefClkConfig {
139 pub src: RefClkSrc, 133 pub src: RefClkSrc,
140 pub div: u8, 134 pub div: u8,
@@ -223,12 +217,9 @@ pub(crate) unsafe fn init(config: ClockConfig) {
223 }); 217 });
224 218
225 // start XOSC 219 // start XOSC
226 match config.clock_type { 220 // datasheet mentions support for clock inputs into XIN, but doesn't go into
227 ExternalClock::Crystal => start_xosc(config.hz), 221 // how this is achieved. pico-sdk doesn't support this at all.
228 // TODO The datasheet says the xosc needs to be put into a bypass mode to use an 222 start_xosc(config.hz);
229 // external clock, but is mum about how to do that.
230 ExternalClock::Clock => todo!(),
231 }
232 223
233 if let Some(sys_pll_config) = config.sys_pll { 224 if let Some(sys_pll_config) = config.sys_pll {
234 configure_pll(pac::PLL_SYS, config.hz, sys_pll_config); 225 configure_pll(pac::PLL_SYS, config.hz, sys_pll_config);