diff options
| author | James Munns <[email protected]> | 2025-12-18 14:53:33 +0100 |
|---|---|---|
| committer | James Munns <[email protected]> | 2025-12-18 15:02:24 +0100 |
| commit | b0cf9b4626e7fa99d1da82a5eb745e9ed14508de (patch) | |
| tree | 8c8cdbf14561ac133d0fd377b9ebd57105495105 /embassy-mcxa/src/clocks/config.rs | |
| parent | c94c09c72d16fd5cc9cb7c925386e7a2d6de1dcd (diff) | |
First basic test works
Diffstat (limited to 'embassy-mcxa/src/clocks/config.rs')
| -rw-r--r-- | embassy-mcxa/src/clocks/config.rs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/embassy-mcxa/src/clocks/config.rs b/embassy-mcxa/src/clocks/config.rs index 0f362ad0a..3f1729d00 100644 --- a/embassy-mcxa/src/clocks/config.rs +++ b/embassy-mcxa/src/clocks/config.rs | |||
| @@ -157,6 +157,8 @@ pub struct SpllConfig { | |||
| 157 | pub source: SpllSource, | 157 | pub source: SpllSource, |
| 158 | pub mode: SpllMode, | 158 | pub mode: SpllMode, |
| 159 | pub power: PoweredClock, | 159 | pub power: PoweredClock, |
| 160 | /// Is the "pll1_clk_div" clock enabled? | ||
| 161 | pub pll1_clk_div: Option<Div8>, | ||
| 160 | } | 162 | } |
| 161 | 163 | ||
| 162 | pub enum SpllSource { | 164 | pub enum SpllSource { |
| @@ -168,7 +170,6 @@ pub enum SpllSource { | |||
| 168 | Firc, | 170 | Firc, |
| 169 | /// S Internal Oscillator (12M) | 171 | /// S Internal Oscillator (12M) |
| 170 | Sirc, | 172 | Sirc, |
| 171 | |||
| 172 | // TODO: the reference manual hints that ROSC is possible, | 173 | // TODO: the reference manual hints that ROSC is possible, |
| 173 | // however the minimum input frequency is 32K, but ROSC is 16K. | 174 | // however the minimum input frequency is 32K, but ROSC is 16K. |
| 174 | // Some diagrams show this option, and some diagrams omit it. | 175 | // Some diagrams show this option, and some diagrams omit it. |
| @@ -182,9 +183,7 @@ pub enum SpllSource { | |||
| 182 | /// P: 1..=31 | 183 | /// P: 1..=31 |
| 183 | pub enum SpllMode { | 184 | pub enum SpllMode { |
| 184 | /// Fout = M x Fin | 185 | /// Fout = M x Fin |
| 185 | Mode1a { | 186 | Mode1a { m_mult: u16 }, |
| 186 | m_mult: u16, | ||
| 187 | }, | ||
| 188 | /// if !bypass_p2_div: Fout = (M / (2 x P)) x Fin | 187 | /// if !bypass_p2_div: Fout = (M / (2 x P)) x Fin |
| 189 | /// if bypass_p2_div: Fout = (M / P ) x Fin | 188 | /// if bypass_p2_div: Fout = (M / P ) x Fin |
| 190 | Mode1b { | 189 | Mode1b { |
| @@ -193,10 +192,7 @@ pub enum SpllMode { | |||
| 193 | bypass_p2_div: bool, | 192 | bypass_p2_div: bool, |
| 194 | }, | 193 | }, |
| 195 | /// Fout = (M / N) x Fin | 194 | /// Fout = (M / N) x Fin |
| 196 | Mode1c { | 195 | Mode1c { m_mult: u16, n_div: u8 }, |
| 197 | m_mult: u16, | ||
| 198 | n_div: u8, | ||
| 199 | }, | ||
| 200 | /// if !bypass_p2_div: Fout = (M / (N x 2 x P)) x Fin | 196 | /// if !bypass_p2_div: Fout = (M / (N x 2 x P)) x Fin |
| 201 | /// if bypass_p2_div: Fout = (M / ( N x P )) x Fin | 197 | /// if bypass_p2_div: Fout = (M / ( N x P )) x Fin |
| 202 | Mode1d { | 198 | Mode1d { |
| @@ -204,10 +200,9 @@ pub enum SpllMode { | |||
| 204 | n_div: u8, | 200 | n_div: u8, |
| 205 | p_div: u8, | 201 | p_div: u8, |
| 206 | bypass_p2_div: bool, | 202 | bypass_p2_div: bool, |
| 207 | } | 203 | }, |
| 208 | } | 204 | } |
| 209 | 205 | ||
| 210 | |||
| 211 | // FIRC/FRO180M | 206 | // FIRC/FRO180M |
| 212 | 207 | ||
| 213 | /// ```text | 208 | /// ```text |
