forked from M-Labs/artiq-zynq
Compare commits
2 Commits
bf50a44f76
...
8cb6cf6094
Author | SHA1 | Date |
---|---|---|
Jonathan Coates | 8cb6cf6094 | |
Egor Savkin | c6fcc4e351 |
|
@ -116,7 +116,7 @@ pub extern "C" fn dma_record_output(target: i32, word: i32) {
|
|||
}
|
||||
}
|
||||
|
||||
pub extern "C" fn dma_record_output_wide(target: i32, words: CSlice<i32>) {
|
||||
pub extern "C" fn dma_record_output_wide(target: i32, words: &CSlice<i32>) {
|
||||
assert!(words.len() <= 16); // enforce the hardware limit
|
||||
|
||||
unsafe {
|
||||
|
|
|
@ -20,6 +20,7 @@ pub enum RtioClock {
|
|||
Int_150,
|
||||
Ext0_Bypass,
|
||||
Ext0_Synth0_10to125,
|
||||
Ext0_Synth0_80to125,
|
||||
Ext0_Synth0_100to125,
|
||||
Ext0_Synth0_125to125,
|
||||
}
|
||||
|
@ -36,6 +37,7 @@ fn get_rtio_clock_cfg(cfg: &Config) -> RtioClock {
|
|||
"ext0_bypass_125" => RtioClock::Ext0_Bypass,
|
||||
"ext0_bypass_100" => RtioClock::Ext0_Bypass,
|
||||
"ext0_synth0_10to125" => RtioClock::Ext0_Synth0_10to125,
|
||||
"ext0_synth0_80to125" => RtioClock::Ext0_Synth0_80to125,
|
||||
"ext0_synth0_100to125" => RtioClock::Ext0_Synth0_100to125,
|
||||
"ext0_synth0_125to125" => RtioClock::Ext0_Synth0_125to125,
|
||||
_ => {
|
||||
|
@ -130,6 +132,23 @@ fn setup_si5324(i2c: &mut I2c, timer: &mut GlobalTimer, clk: RtioClock) {
|
|||
SI5324_EXT_INPUT,
|
||||
)
|
||||
}
|
||||
RtioClock::Ext0_Synth0_80to125 => {
|
||||
// 125 MHz output from 80 MHz CLKINx reference, 611 Hz BW
|
||||
info!("using 80MHz reference to make 125MHz RTIO clock with PLL");
|
||||
(
|
||||
si5324::FrequencySettings {
|
||||
n1_hs: 4,
|
||||
nc1_ls: 10,
|
||||
n2_hs: 10,
|
||||
n2_ls: 250,
|
||||
n31: 40,
|
||||
n32: 40,
|
||||
bwsel: 4,
|
||||
crystal_as_ckin2: false,
|
||||
},
|
||||
SI5324_EXT_INPUT,
|
||||
)
|
||||
}
|
||||
RtioClock::Ext0_Synth0_100to125 => {
|
||||
// 125MHz output, from 100MHz CLKINx reference, 586 Hz loop bandwidth
|
||||
info!("using 100MHz reference to make 125MHz RTIO clock with PLL");
|
||||
|
|
|
@ -107,7 +107,7 @@ pub extern "C" fn output(target: i32, data: i32) {
|
|||
}
|
||||
}
|
||||
|
||||
pub extern "C" fn output_wide(target: i32, data: CSlice<i32>) {
|
||||
pub extern "C" fn output_wide(target: i32, data: &CSlice<i32>) {
|
||||
unsafe {
|
||||
csr::rtio::target_write(target as u32);
|
||||
// writing target clears o_data
|
||||
|
|
Loading…
Reference in New Issue