starblue has quit [Ping timeout: 260 seconds]
starblue has joined #rust-embedded
emerent has quit [Ping timeout: 252 seconds]
emerent has joined #rust-embedded
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
fabic has joined #rust-embedded
dcz has joined #rust-embedded
fabic has quit [Ping timeout: 265 seconds]
dcz has quit [Ping timeout: 260 seconds]
gsalazar has joined #rust-embedded
dfgweb has joined #rust-embedded
Amadiro has quit [Remote host closed the connection]
dcz has joined #rust-embedded
fabic has joined #rust-embedded
rjframe has joined #rust-embedded
bendem has quit [Ping timeout: 250 seconds]
bendem has joined #rust-embedded
fabic has quit [Ping timeout: 265 seconds]
GenTooMan has quit [Ping timeout: 252 seconds]
GenTooMan has joined #rust-embedded
GenTooMan has quit [Ping timeout: 252 seconds]
GenTooMan has joined #rust-embedded
rjframe has quit [Ping timeout: 252 seconds]
fabic has joined #rust-embedded
gsalazar has quit [Ping timeout: 265 seconds]
starblue has quit [Ping timeout: 252 seconds]
starblue has joined #rust-embedded
<re_irc> <@dirbaio:matrix.org> yeah apparently I was using 0 and 2
<re_irc> <@dirbaio:matrix.org> 0 reads shifted garbeage, 2 reads 0xFF
<re_irc> <@adamgreig:matrix.org> it's not often documented as literally "mode 0" because it could be a bit ambiguous but the timing diagram usually tells the story
<re_irc> <@adamgreig:matrix.org> sigh
<re_irc> <@dirbaio:matrix.org> 2 does sample on falling edge, but it seems the device needs the initial dummy rising edge
<re_irc> <@adamgreig:matrix.org> no easy way to change cpha
<re_irc> <@dirbaio:matrix.org> it's right there documented https://docs.rs/ftd2xx-embedded-hal/0.9.1/ftd2xx_embedded_hal/struct.Spi.html#method.set_clock_polarity
<re_irc> <@dirbaio:matrix.org> I just suck at reading 🤣
<re_irc> <@dirbaio:matrix.org> The demo board does support i2c too, but needs changing like 7x 0201 0-ohm resistors
<re_irc> <@adamgreig:matrix.org> lol that's helpful
<re_irc> <@dirbaio:matrix.org> just ST being ST
<re_irc> <@almindor:matrix.org> introducing: https://crates.io/crates/mipidsi
fabic has quit [Ping timeout: 260 seconds]
Amadiro has joined #rust-embedded
<re_irc> <@firefrommoonlight:matrix.org> I can relate re mild frustration on Spi mode documentation across periphs. Also, some use mode terminology; others pol and phase. If you have multiple devices on a bus, hope there's a mode they all support
<re_irc> <@firefrommoonlight:matrix.org> MCU-side, I've set up the API so the mode is a struct of polarity and phase tuples, with optional constructors of `mode0()`, `mode1()` etc. If I'm confused by a datasheet's description of mode, I try modes and see which work
<re_irc> <@firefrommoonlight:matrix.org> I recall sometimes the terminology re phase and polarity is sometimes inconsistent, but can't recall what's confused me in the past
<re_irc> <@adamgreig:matrix.org> multiple devices on a bus don't need to use the same mode
<re_irc> <@adamgreig:matrix.org> they'll ignore anything while nto selected
<re_irc> <@adamgreig:matrix.org> (does mean you have to reconfigure the spi peripheral between devices though)
<re_irc> <@firefrommoonlight:matrix.org> Oh - reconfiguring the periph could be an option - good point
<re_irc> <@firefrommoonlight:matrix.org> I should probably add a method to do that
<re_irc> <@firefrommoonlight:matrix.org> I have a comment in one of my projects along the line of "Device A seems to work with modes A and B. Device B works with all modes except B. So, we use A
<re_irc> <@almindor:matrix.org> yeah that's how we implemented SPI sharing here: https://github.com/riscv-rust/e310x-hal/blob/master/src/spi.rs reconfigures each time you switch, seems to work good although I have only tested on mode0 both
<re_irc> <@almindor:matrix.org> each time a shared device on the bus needs to send or receive it calls configure on the bus e.g. https://github.com/riscv-rust/e310x-hal/blob/master/src/spi/shared_device.rs#L84
<re_irc> <@dirbaio:matrix.org> even different freqs! neat!
<re_irc> <@almindor:matrix.org> yeah it works fine with my usb host on 100khz and display at 54mhz
<re_irc> <@almindor:matrix.org> there are timing issues outside of SPI tho e.g. if the display resets (even soft reset) and you don't give it a delay it might register some stuff and go wonky even if CS is high
dcz has quit [Ping timeout: 252 seconds]
rjframe has joined #rust-embedded
rjframe has quit [Quit: Leaving]