Skip to content

How do I make usage of the Hardware SPI for my ESP32? #1637

Closed

Description

@PelksUnderscore

This is my first time asking a question and im not even sure if im asking it correctly in the right place of this project.
In my Arduino IDE program whenever I start it up I get the message "No hardware SPI pins defined. All SPI access will default to bitbanged output" and after a bit of research I stumbled upon this post #1047 and did what it said and now my question is did I implement it correctly on my ESP32 when the code and message look like this?
Code:
#define FASTLED_ALL_PINS_HARDWARE_SPI
#define FASTLED_ESP32_SPI_BUS HSPI
#include <FastLED.h>

#define HSPI_MOSI_DATA 13
#define HSPI_SCLK_CLK 14
#define COLOR_ORDER BGR
#define LED_TYPE SK9822
#define Brightness 30
#define NUM_LEDS 41

FastLED.addLeds<LED_TYPE,HSPI_MOSI_DATA,HSPI_SCLK_CLK,BGR>(leds,NUM_LEDS);
FastLED.setBrightness(Brightness);

Message:
In file included from c:\Users\XXX\Documents\Arduino\libraries\FastLED\src/platforms/esp/32/fastled_esp32.h:6,
from c:\Users\XXX\Documents\Arduino\libraries\FastLED\src/platforms.h:42,
from c:\Users\XXX\Documents\Arduino\libraries\FastLED\src/FastLED.h:62,
from F:\POVI180IAPPIDUALIV6\POVI180IAPPIDUALIV6.ino:3:
c:\Users\XXX\Documents\Arduino\libraries\FastLED\src/platforms/esp/32/fastspi_esp32.h:2:17: note: #pragma message: ESP32 Hardware SPI support added
#pragma message "ESP32 Hardware SPI support added"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Activity

  1. robertlipe commented on Jul 17, 2024

    @robertlipe
    Contributor

    This message probably causes more confusion than good.

    Your question, as I understand it, was originally "how do I enable hardware SPI".
    You found that answer, did it.
    You're now getting a message that says Hardware SPI has been added.

    That seems like a good thing, no? You're in the code path that's using hardware SPI. If it's working, you're done!

    If that's the case, you can ignore (or remove) the #pragma message in question. It's just taking the (unusual) step of announcing success.

    If that takes case of that, please consider closing this ticket.

  2. zackees commented on Aug 31, 2024

    @zackees
    Member

    With these chips it's pretty much all hardware spi with their fancy async dma controllers.

    The hardware spi optimization is more of a relic of 10 years ago when the first arduino was launched and software spi was much slower than realtime hardware spi.

    Unless you are running the original arduino then don't worry about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions