Merge pull request #83 from belak/aggressive-write

Write data over SPI 1 byte at a time
main
Chris 2021-11-28 23:03:12 +01:00 committed by GitHub
commit b1830d16c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -60,8 +60,12 @@ where
// high for data // high for data
let _ = self.dc.set_high(); let _ = self.dc.set_high();
// Transfer data (u8-array) over spi for val in data.iter().copied() {
self.write(spi, data) // Transfer data one u8 at a time over spi
self.write(spi, &[val])?;
}
Ok(())
} }
/// Basic function for sending [Commands](Command) and the data belonging to it. /// Basic function for sending [Commands](Command) and the data belonging to it.