mirror of
https://github.com/PSenfft/mb85rc.git
synced 2025-08-22 12:54:16 +00:00
fixed some issues
This commit is contained in:
parent
d440043120
commit
8e7389085f
@ -1,4 +1,7 @@
|
|||||||
|
#![no_std]
|
||||||
|
|
||||||
use embedded_hal::i2c::{I2c, SevenBitAddress};
|
use embedded_hal::i2c::{I2c, SevenBitAddress};
|
||||||
|
use core::result::Result;
|
||||||
|
|
||||||
const DEVICE_ADDRESS: u8 = 0b10100000;
|
const DEVICE_ADDRESS: u8 = 0b10100000;
|
||||||
const DEVICE_ADDRESS_CODE: u8 = 0b00000000;
|
const DEVICE_ADDRESS_CODE: u8 = 0b00000000;
|
||||||
@ -52,7 +55,7 @@ impl<T: I2c> MB85RC<T> {
|
|||||||
/// * `memory_address` - The memory address to read from.
|
/// * `memory_address` - The memory address to read from.
|
||||||
/// # Returns
|
/// # Returns
|
||||||
/// * `Result<u8, Infallible>` - The byte read from the specified
|
/// * `Result<u8, Infallible>` - The byte read from the specified
|
||||||
pub fn random_read(&mut self, memory_address: &mut [u8; 2]) -> Result<u8, T::Error> {
|
pub fn random_read(&mut self, memory_address: &[u8; 2]) -> Result<u8, T::Error> {
|
||||||
let mut buffer: [u8; 1] = [0];
|
let mut buffer: [u8; 1] = [0];
|
||||||
self.i2c
|
self.i2c
|
||||||
.write_read(self.address, memory_address, &mut buffer)?;
|
.write_read(self.address, memory_address, &mut buffer)?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user