Page 1 of 1

3 device limit on SPI

Posted: Fri May 26, 2017 12:55 pm
by markwj
The documentation talks about a 3 device limit on each SPI bus. I also see in spi_master.c:

Code: Select all

#define NO_CS 3     //Number of CS pins per SPI host

typedef struct {
    spi_device_t *device[NO_CS];
    intr_handle_t intr;
    spi_dev_t *hw;
    spi_transaction_t *cur_trans;
    int cur_cs;
    lldesc_t dmadesc_tx, dmadesc_rx;
    bool no_gpio_matrix;
} spi_host_t;
Is that NO_CS the only reason for this limit? Can I simply change to, say, 5 and recompile?

Re: 3 device limit on SPI

Posted: Fri May 26, 2017 3:52 pm
by WiFive
No you have to switch to sw cs instead of hw

https://esp32.com/viewtopic.php?f=18&t=1546

Re: 3 device limit on SPI

Posted: Sun May 28, 2017 2:26 pm
by markwj
That library looks great. Perfect for what I need. Thanks.