I am having an issue with a G30 module.
If I want to talk to two devices I set up SPI like this
SPI.Configuration config_Right = new SPI.Configuration(GHI.Pins.G30.Gpio.PC7, false, 0, 0, false, false, 500, GHI.Pins.G30.SpiBus.Spi2); SPI.Configuration config_mcu = new SPI.Configuration(GHI.Pins.G30.Gpio.PB0, false, 3, 0, false, true, 500, GHI.Pins.G30.SpiBus.Spi2); SPI_Bus = new SPI(config_mcu);
Now before initiating an SPI transaction I make sure to execute
SPI_Bus.Config = <the appropriate config>
I have seen this work in the past. The only difference being that I changed the clock_edge parameter of config_mcu to true.
Now the confusing part is that If I conduct a transaction using config_right, then my next transaction with config_mcu will not contain the correct data on MOSI. I have confirmed that MOSI behavior is incorrect even with no devices attached.
However if I continue to have transactions with config_mcu they will be correct until the next time I launch a transaction with the other device, then the first one with config_mcu will be wrong again.
Does anyone know what might be the source of my issue?