Implementation of PxMatrix with esp32-S3

Yohani
Posts: 6
Joined: Tue Jan 09, 2024 7:12 pm
Location: Valdivia, Chile

Implementation of PxMatrix with esp32-S3

Postby Yohani » Mon Jan 15, 2024 3:09 pm

Hello, I have a problem with the implementation of the PxMatrix library on the esp32-S3.

Specifically in the definition of the SPI pins.
In the library code snippet I start the definition of the SPI bus:

Code: Select all

    spi_t * spi = SPI.bus();
    // reg_value = 0x1234;  debug

    for(int i=0; i<47; i++)
      SPI_2BYTE(reg_value);

    spiSimpleTransaction(spi);

    spi->dev->mosi_dlen.usr_mosi_dbitlen = 16-reg_position-1;
    spi->dev->miso_dlen.usr_miso_dbitlen = 0;
    spi->dev->data_buf[0] = reg_value>>8;
    spi->dev->cmd.usr = 1;
    while(spi->dev->cmd.usr);

    GPIO_REG_SET(1 << _LATCH_PIN);

    spi->dev->mosi_dlen.usr_mosi_dbitlen = (reg_position-8)-1;
    spi->dev->data_buf[0] = reg_value>>(reg_position-8);
    spi->dev->cmd.usr = 1;
    while(spi->dev->cmd.usr);
    spiEndTransaction(spi);

    SPI_BYTE(reg_value&0xff);

    GPIO_REG_CLEAR(1 << _LATCH_PIN);
But when I try it it shows me the following error:

Code: Select all

'spi_dev_t' {aka 'volatile struct spi_dev_s'} has no member named 'mosi_dlen'; did you mean 'ms_dlen'
     spi->dev->mosi_dlen.usr_mosi_dbitlen = 16-reg_position-1;
               ^~~~~~~~~
               ms_dlen
From what I understand the code is trying to access the mosi_dlen, miso_dlen members of the spi_dev_t structure, but the ESP32 does not have those members.

This occurs only for this board, since I did the same for an esp-wroom-32 mini and this error does not appear.
The library I am using is: https://github.com/2dom/PxMatrix/tree/master


How can i solve this? What dou you recommend? change the plate or is it possible to solve this?

Who is online

Users browsing this forum: Google [Bot] and 226 guests