-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: add SPI aliases (use HSPI in S3)
- Loading branch information
Showing
6 changed files
with
39 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include "spi.h" | ||
|
||
SPIClass SPI1(SPI1_NUM); | ||
#ifdef SPI2_NUM | ||
SPIClass SPI2(SPI2_NUM); | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef LILKA_SPI_H | ||
#define LILKA_SPI_H | ||
|
||
#include <SPI.h> | ||
|
||
#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 | ||
# define SPI1_NUM HSPI | ||
# define SPI2_NUM FSPI | ||
extern SPIClass SPI1; | ||
extern SPIClass SPI2; | ||
#elif CONFIG_IDF_TARGET_ESP32C3 | ||
# define SPI1_NUM FSPI | ||
extern SPIClass SPI1; | ||
#endif | ||
|
||
// #if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 | ||
// #define VSPI FSPI | ||
// #endif | ||
// | ||
// SPIClass SPI1(VSPI); | ||
// SPIClass SPI2(HSPI); | ||
|
||
#endif // LILKA_SPI_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters