nrf/twim: expose all functionality as inherent methods.

This commit is contained in:
Dario Nieuwenhuis
2022-01-13 20:47:28 +01:00
parent a287fef687
commit ecb4f8fb00
3 changed files with 157 additions and 267 deletions

View File

@ -26,7 +26,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
info!("Reading...");
let mut buf = [0u8; 16];
unwrap!(twi.write_then_read(ADDRESS, &mut [0x00], &mut buf));
unwrap!(twi.blocking_write_read(ADDRESS, &mut [0x00], &mut buf));
info!("Read: {=[u8]:x}", buf);
}

View File

@ -36,7 +36,7 @@ async fn main(_spawner: Spawner, mut p: Peripherals) {
info!("Reading...");
let mut buf = [0u8; 16];
unwrap!(twi.write_then_read(ADDRESS, &mut [0x00], &mut buf));
unwrap!(twi.blocking_write_read(ADDRESS, &mut [0x00], &mut buf));
info!("Read: {=[u8]:x}", buf);