mirror of
https://github.com/m-labs/artiq.git
synced 2025-01-23 17:08:12 +08:00
9 lines
215 B
Rust
9 lines
215 B
Rust
use csr;
|
|
|
|
pub fn set_speed(rate: u32) {
|
|
unsafe {
|
|
let tuning_word = (rate as u64) * (1 << 32) / (csr::CONFIG_CLOCK_FREQUENCY as u64);
|
|
csr::uart_phy::tuning_word_write(tuning_word as u32);
|
|
}
|
|
}
|