mirror of
https://github.com/PSenfft/mb85rc.git
synced 2025-08-22 12:54:16 +00:00
implemented read and write and dummy -functions /not tested
This commit is contained in:
parent
07d2dbfd43
commit
5f3a792aa1
20
src/lib.rs
20
src/lib.rs
@ -12,6 +12,12 @@ struct MB85RC<T: I2c<SevenBitAddress>> {
|
||||
i2c: T,
|
||||
}
|
||||
|
||||
enum i2c_frequency {
|
||||
standard_mode = 100_000,
|
||||
fast_mode = 400_000,
|
||||
fast_mode_plus = 1_000_000,
|
||||
}
|
||||
|
||||
impl<T: I2c> MB85RC<T> {
|
||||
pub fn new(i2c: T) -> Self {
|
||||
MB85RC { i2c }
|
||||
@ -27,3 +33,17 @@ impl<T: I2c> Read for MB85RC<T> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
fn get_device_id() -> [u8; 3] {
|
||||
let mut id: [u8; 3] = [1, 2, 3];
|
||||
|
||||
id
|
||||
}
|
||||
|
||||
|
||||
fn byte_write(write_address: u8, data: u8) -> u8 {
|
||||
|
||||
let mut read_byte: u8 = 0x00;
|
||||
|
||||
read_byte
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user