projects
/
gps-watch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
common: Add the spi module.
[gps-watch.git]
/
src
/
common
/
clock.rs
diff --git
a/src/common/clock.rs
b/src/common/clock.rs
index 659e572d3fe26d7baaa3547e5c7ac9b00a2e1719..1189fdd58a45ac49f9de05d39f5ae9c8fc11b4ec 100644
(file)
--- a/
src/common/clock.rs
+++ b/
src/common/clock.rs
@@
-75,6
+75,10
@@
const MCG_S_CLKST_MASK: u8 = 3 << MCG_S_CLKST_SHIFT;
const MCG_S_IREFST: u8 = 1 << 4;
const MCG_S_LOCK0: u8 = 1 << 6;
const MCG_S_IREFST: u8 = 1 << 4;
const MCG_S_LOCK0: u8 = 1 << 6;
+const OSC0_CR: u32 = 0x40065000;
+
+const OSC_CR_ERCLKEN: u8 = 1 << 7;
+
fn configure_clkdiv() {
let mut clkdiv1 = Reg32::new(SIM_CLKDIV1);
fn configure_clkdiv() {
let mut clkdiv1 = Reg32::new(SIM_CLKDIV1);
@@
-169,6
+173,10
@@
pub unsafe fn reset() {
switch_to_fbe();
}
switch_to_fbe();
}
+pub unsafe fn enable_osc0() {
+ Reg8::new(OSC0_CR).write(OSC_CR_ERCLKEN);
+}
+
pub unsafe fn configure_usb() {
let mut scgc4 = Reg32::new(SIM_SCGC4);
scgc4.modify(|v| v & !SIM_SCGC4_USBOTG);
pub unsafe fn configure_usb() {
let mut scgc4 = Reg32::new(SIM_SCGC4);
scgc4.modify(|v| v & !SIM_SCGC4_USBOTG);