fpga config: use include_bytes

This commit is contained in:
occheung 2020-09-16 17:46:58 +08:00
parent df510d18d1
commit 1be44e256d
1 changed files with 12 additions and 9 deletions

View File

@ -108,16 +108,19 @@ fn main() -> ! {
// Drive SPI_SS_B low
fpga_ss.set_low().unwrap();
let config_data = include_bytes!("../build/top.bin");
fpga_cfg_spi.transfer(&config_data).unwrap();
// Send the whole image without interruption
let base_address = 0x08100000;
let size = 135100;
for index in 0..size {
unsafe {
let data :u8 = ptr::read_volatile((base_address + index) as *const u8);
block!(fpga_cfg_spi.send(data)).unwrap();
block!(fpga_cfg_spi.read()).unwrap();
}
}
// let base_address = 0x08100000;
// let size = 135100;
// for index in 0..size {
// unsafe {
// let data :u8 = ptr::read_volatile((base_address + index) as *const u8);
// block!(fpga_cfg_spi.send(data)).unwrap();
// block!(fpga_cfg_spi.read()).unwrap();
// }
// }
// Drive SPI_SS_B high
fpga_ss.set_high().unwrap();