wfRx[SDA].I.started = 0;
wfRx[SDA].I.SDA = SDA;
wfRx[SDA].I.SCL = SCL;
- wfRx[SDA].I.delay = (500000 / baud) - 1;
+ wfRx[SDA].I.delay = 500000 / baud;
wfRx[SDA].I.SDAMode = gpioGetMode(SDA);
wfRx[SDA].I.SCLMode = gpioGetMode(SCL);
wfRx[CS].S.MOSI = MOSI;
wfRx[CS].S.CS = CS;
wfRx[CS].S.SCLK = SCLK;
- wfRx[CS].S.delay = 500000 / baud;
+ wfRx[CS].S.delay = (500000 / baud) - 1;
wfRx[CS].S.spiFlags = spiFlags;
wfRx[CS].S.MISOMode = gpioGetMode(MISO);
wfRx[CS].S.MOSIMode = gpioGetMode(MOSI);
#define PI_BB_I2C_MAX_BAUD 500000
#define PI_BB_SPI_MIN_BAUD 50
-#define PI_BB_SPI_MAX_BAUD 500000
+#define PI_BB_SPI_MAX_BAUD 250000
#define PI_BB_SER_MIN_BAUD 50
#define PI_BB_SER_MAX_BAUD 250000
MISO: 0-31
MOSI: 0-31
SCLK: 0-31
-baud: 50-500000
+baud: 50-250000
spiFlags: see below
. .
spiFlags consists of the least significant 22 bits.
p0 is 0 if CEx is active low (default) and 1 for active high.
+T is 1 if the least significant bit is transmitted on MOSI first, the
+default (0) shifts the most significant bit out first.
+
+R is 1 if the least significant bit is received on MISO first, the
+default (0) receives the most significant bit first.
+
The other bits in flags should be set to zero.
Returns 0 if OK, otherwise PI_BAD_USER_GPIO, PI_BAD_SPI_BAUD, or