You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a specific epd which requires to read data from the MOSI line after sending a command but switching the CS pin between each byte. It's unclear to me if this is even achievable with the SPI Bus implementation. If so some guidance would be appreciated.
Some relevant parts from the documentation:
Here it also states that a CS pulse is necessary between each read.
I thought something like this would be working:
pubfnread_otp(&mutself,buffer:&mut[u8]) -> Result<(),E>{self.bus.lock(|bus| {letmut bus = bus.borrow_mut();self.cs.set_low().ok();// Command modeself.dc.set_low().ok();// Send read command
bus.write(&[0xA2])?;self.dc.set_high().ok();// Data mode// Read datafor byte in buffer.iter_mut(){self.cs.set_high().ok();self.cs.set_low().ok();// Send dummy byte and read the resultletmut read_buf = [0u8];
bus.transfer(&mut read_buf,&[0x00])?;*byte = read_buf[0];}self.cs.set_high().ok();Ok(())})}
but then i found out that the transfer also wants to read on the MISO line.
The text was updated successfully, but these errors were encountered:
While it may (or may not) be supported by the SPI hardware of your microcontroller, it's not something supported by the abstraction layer provided by embedded-hal.
I am working on a specific epd which requires to read data from the MOSI line after sending a command but switching the CS pin between each byte. It's unclear to me if this is even achievable with the SPI Bus implementation. If so some guidance would be appreciated.
Some relevant parts from the documentation:
Here it also states that a CS pulse is necessary between each read.
I thought something like this would be working:
but then i found out that the transfer also wants to read on the MISO line.
The text was updated successfully, but these errors were encountered: