fn read_register<IF: I2C>(i2c: &IF, reg: reg) -> Result<u8, ()> {
    let mut reg_val = [0u8; 2];
    if i2c.recv_data(&[reg as u8], &mut reg_val).is_ok() {
        Ok(reg_val[0])
    } else {
        Err(())
    }
}
/** Read a register of the MSA300 via I2C */
Read a register of the MSA300 via I2C
Read a register of the MSA300 via I2C
fn read_register<IF: I2C>(i2c: &IF, reg: reg) -> Result<u8, ()> {
    let mut reg_val = [0u8; 2];
    if i2c.recv_data(&[reg as u8], &mut reg_val).is_ok() {
        Ok(reg_val[0])
    } else {
        Err(())
    }
}
fn read_register < IF : I2C > ( i2c : & IF , reg : reg ) -> Result < u8 , ( ) > { let mut reg_val = [ 0u8 ; 2 ] ; if i2c . recv_data ( & [ reg as u8 ] , & mut reg_val ) . is_ok ( ) { Ok ( reg_val [ 0 ] ) } else { Err ( ( ) ) } }
Read a register of the MSA300 via I2C
Read a register of the MSA300 via I2C
i2c
&IF
reg
reg
i2c
&IF
reg
reg