Hello.
nrf5340, in SDK v2.8.0
I'm going to use 3 cs pins for spi communication.
Is there an example to refer to??
And did the setting below go well?
CONFIG_SPI=y
CONFIG_SPI_NRFX=y
--------------------------------------------------------------------------------
&spi1 {
compatible = "nordic,nrf-spim";
status = "okay";
pinctrl-0 = <&spi1_default>;
pinctrl-1 = <&spi1_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&gpio0 8 GPIO_ACTIVE_LOW>, /* CS1 핀 */
<&gpio0 9 GPIO_ACTIVE_LOW>, /* CS2 핀 */
<&gpio0 10 GPIO_ACTIVE_LOW>; /* CS3 핀 */
slave1: spi-dev1@0 {
compatible = "spi-device";
reg = <0>; /* 슬레이브 1의 ID */
spi-max-frequency = <8000000>;
};
slave2: spi-dev2@1 {
compatible = "spi-device";
reg = <1>; /* 슬레이브 2의 ID */
spi-max-frequency = <8000000>;
};
slave3: spi-dev3@2 {
compatible = "spi-device";
reg = <2>; /* 슬레이브 3의 ID */
spi-max-frequency = <8000000>;
};
};
--------------------------------------------------------------------------------
spi1_default: spi1_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 20)>, /* SPI SCK 핀 */
<NRF_PSEL(SPIM_MOSI, 0, 21)>, /* SPI MOSI 핀 */
<NRF_PSEL(SPIM_MISO, 0, 22)>; /* SPI MISO 핀 */
};
};
spi1_sleep: spi1_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 20)>, /* SPI SCK 핀 */
<NRF_PSEL(SPIM_MOSI, 0, 21)>, /* SPI MOSI 핀 */
<NRF_PSEL(SPIM_MISO, 0, 22)>; /* SPI MISO 핀 */
low-power-enable;
};
};