Pete, in case you want to try again, I ultimately found I needed to change another line. The lines I changed were the two delayMicroseconds calls like so:
SPI.setDataMode(1);
SPI.begin(_SS);
}
void end(void) {
pinMode(_SS, INPUT);
SPI.end();
}
size_t write(uint8_t value) {
PIN_MAP[_SS].gpio_peripheral->BRR = PIN_MAP[_SS].gpio_pin; //Low
delayMicroseconds(10); //10 fixes it **********************
//SPI.setDataMode(3);
SPI.transfer(value);
// SPI.setDataMode(0);
delayMicroseconds(100); //100 fixes it **************************
PIN_MAP[_SS].gpio_peripheral->BSRR = PIN_MAP[_SS].gpio_pin; //High
return 1;
}
#endif