forked from M-Labs/artiq
1
0
Fork 0

hmc830: compile-time configurable reference frequency

This commit is contained in:
Sebastien Bourdeauducq 2018-06-19 13:47:32 +08:00
parent 6f3ed81626
commit d29b3dd588
2 changed files with 9 additions and 1 deletions

View File

@ -330,7 +330,13 @@ pub fn init() -> Result<(), &'static str> {
hmc830::select_spi_mode();
hmc830::detect()?;
hmc830::init();
hmc830::set_dividers(1, 24, 0, 2); // 100MHz ref, 1.2GHz out
// 1.2GHz out
#[cfg(hmc830_ref = "100")]
hmc830::set_dividers(1, 24, 0, 2);
#[cfg(hmc830_ref = "150")]
hmc830::set_dividers(2, 32, 0, 2);
hmc830::check_locked()?;
hmc7043::enable();

View File

@ -204,6 +204,8 @@ class Standalone(MiniSoC, AMPSoC):
self.submodules += serwb_core
self.add_wb_slave(self.mem_map["serwb"], 8192, serwb_core.etherbone.wishbone.bus)
self.config["HMC830_REF"] = "100"
# RTIO
rtio_channels = []
for i in range(4):