None
None
combo clock_polarity
combo clock_phase
combo baudrate
combo format
// setup the pins
palSetPadMode(GPIOA, 4, PAL_MODE_OUTPUT_PUSHPULL); // NSS
palSetPadMode(GPIOA, 5, PAL_MODE_OUTPUT_PUSHPULL); // SCK
palSetPadMode(GPIOA, 7, PAL_MODE_OUTPUT_PUSHPULL); // MOSI
// palSetPadMode(GPIOA, 4, PAL_MODE_ALTERNATE(5));// NSS
palSetPadMode(GPIOA, 5, PAL_MODE_ALTERNATE(5)); // SCK
palSetPadMode(GPIOA, 6, PAL_MODE_ALTERNATE(5)); // MISO
palSetPadMode(GPIOA, 7, PAL_MODE_ALTERNATE(5)); // MOSI
static const SPIConfig spicfg = {
NULL, GPIOA, 4,
0 attr_clock__polarity attr_clock__phase attr_baudrate attr_format};
spiStart(&SPID1, &spicfg);
spiStop(&SPID1);
palSetPadMode(GPIOA, 4, PAL_MODE_INPUT_ANALOG);
palSetPadMode(GPIOA, 5, PAL_MODE_INPUT_ANALOG);
palSetPadMode(GPIOA, 6, PAL_MODE_INPUT_ANALOG);
palSetPadMode(GPIOA, 7, PAL_MODE_INPUT_ANALOG);