Following the example from the link below, I tried to specify the CS Pin in the .c source file
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/spi.h>
struct spi_cs_control *cs_ctrl_f7 =
&(struct spi_cs_control) {
.gpio_dev = DEVICE_DT_GET(DT_NODELABEL(gpio1)),
.delay = 2,
.gpio_pin = 6,
.gpio_dt_flags = GPIO_ACTIVE_LOW
};
/* SPI-Mode 0 (CPOL Low, CPHA Low) required for STM32F769 SPI bootloader, f_max= 8 MHz */
static const struct spi_config spi_cfg_f7 = {
.operation = SPI_WORD_SET(8) | SPI_TRANSFER_MSB,
.frequency = 4000000,
.slave = 0,
.cs = &cs_ctrl_f7
};
But this results in Errors like the following: error: 'struct spi_cs_control' has no member named 'gpio_pin'
Could you please provide an example of how to use multiple SPI CS-Pins specified in a C source file?