Hi Abdelatif, 
Thanks for your kind answer.

How can you relate the method that you're offering me here with the System Type 
--> SPI Configuration in the Menuconfig? 
In this case, we disregard or overwrite the SPI Configuration --> SPIx CS Pin 
setting, do we?

-----Original Message-----
From: Abdelatif Guettouche <abdelatif.guettou...@gmail.com> 
Sent: Thursday, September 30, 2021 6:41 PM
To: dev@nuttx.apache.org
Subject: Re: How SPI Chip Select Number (CSn) works?

>  How, multiple slave devices can be used in this situation?

You can define as many CS pins as you need in your board logic.  Then in the 
corresponding spiXselect function, you enable the correct slave based on its ID.

On Thu, Sep 30, 2021 at 8:47 AM murat tologlu <mtolo...@hotmail.com> wrote:
>
> Hi,
>
> I am trying to implement a master-slave SPI configuration with multiple slave 
> devices on a single SPI bus.
>
> For this purpose I wanted to play with apps/system/spi/ SPI Tool to 
> experiment and understand how multiple slave devices can be configured on a 
> single bus in Nuttx, and a question occured:  In SPI configurations I have 
> seen in Nuttx so far, there is only a single CS pin number defined and this 
> corresponds to a single device. How, multiple slave devices can be used in 
> this situation?
>
> In SPI Tool the default value of uint32_t CSn is 0,  today I will make some 
> experiments and research to find-out my own answer but I'll also appreciate 
> having your comments about what happens if I chose CSn = 1,2,3.. , what is 
> the relation between this parameter and the actual hardware? I also wander 
> the effect of SPI devtype parameter.
>
> Thanks and best regards,
> Murat

Reply via email to