blob: 4cc73324a433888d41b2c0ed073e043c0f6c40fd [file] [log] [blame]
use crate::chip_config::CONFIG;
use kernel::common::StaticRef;
use lowrisc::i2c::{I2c, I2cRegisters};
pub static mut I2C: I2c = I2c::new(I2C_BASE, (1 / CONFIG.cpu_freq) * 1000 * 1000);
// This is a placeholder address as the I2C MMIO interface isn't avaliable yet
const I2C_BASE: StaticRef<I2cRegisters> =
unsafe { StaticRef::new(0x4008_0000 as *const I2cRegisters) };