3 device limit on SPI

markwj
Posts: 90
Joined: Tue Mar 08, 2016 5:03 am

3 device limit on SPI

Postby markwj » Fri May 26, 2017 12:55 pm

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?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: 3 device limit on SPI

Postby WiFive » Fri May 26, 2017 3:52 pm

No you have to switch to sw cs instead of hw

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

markwj
Posts: 90
Joined: Tue Mar 08, 2016 5:03 am

Re: 3 device limit on SPI

Postby markwj » Sun May 28, 2017 2:26 pm

That library looks great. Perfect for what I need. Thanks.

Who is online

Users browsing this forum: No registered users and 171 guests