Rak4631 remove spi1 (#6042)
Some checks failed
CI / setup (check) (push) Waiting to run
CI / setup (esp32) (push) Waiting to run
CI / setup (esp32c3) (push) Waiting to run
CI / setup (esp32c6) (push) Waiting to run
CI / setup (esp32s3) (push) Waiting to run
CI / setup (nrf52840) (push) Waiting to run
CI / setup (rp2040) (push) Waiting to run
CI / setup (stm32) (push) Waiting to run
CI / check (push) Blocked by required conditions
CI / build-esp32 (push) Blocked by required conditions
CI / build-esp32-s3 (push) Blocked by required conditions
CI / build-esp32-c3 (push) Blocked by required conditions
CI / build-esp32-c6 (push) Blocked by required conditions
CI / build-nrf52 (push) Blocked by required conditions
CI / build-rpi2040 (push) Blocked by required conditions
CI / build-stm32 (push) Blocked by required conditions
CI / build-debian-src (push) Waiting to run
CI / package-pio-deps-native (push) Waiting to run
CI / test-native (push) Waiting to run
CI / docker-debian-amd64 (push) Waiting to run
CI / docker-alpine-amd64 (push) Waiting to run
CI / docker-debian-arm64 (push) Waiting to run
CI / docker-debian-armv7 (push) Waiting to run
CI / after-checks (push) Blocked by required conditions
CI / gather-artifacts (esp32) (push) Blocked by required conditions
CI / gather-artifacts (esp32c3) (push) Blocked by required conditions
CI / gather-artifacts (esp32c6) (push) Blocked by required conditions
CI / gather-artifacts (esp32s3) (push) Blocked by required conditions
CI / gather-artifacts (nrf52840) (push) Blocked by required conditions
CI / gather-artifacts (rp2040) (push) Blocked by required conditions
CI / gather-artifacts (stm32) (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
CI / release-firmware (esp32) (push) Blocked by required conditions
CI / release-firmware (esp32c3) (push) Blocked by required conditions
CI / release-firmware (esp32c6) (push) Blocked by required conditions
CI / release-firmware (esp32s3) (push) Blocked by required conditions
CI / release-firmware (nrf52840) (push) Blocked by required conditions
CI / release-firmware (rp2040) (push) Blocked by required conditions
CI / release-firmware (stm32) (push) Blocked by required conditions
Flawfinder Scan / Flawfinder (push) Waiting to run
Semgrep Full Scan / semgrep-full (push) Has been cancelled

* Removed non-existant SPI1 interface on rak4631

* trunk fmt
This commit is contained in:
Woutvstk 2025-02-14 19:53:22 +01:00 committed by GitHub
parent 01935ea35e
commit 9b46cb4ef0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 19 deletions

View File

@ -6,28 +6,28 @@
void d_writeCommand(uint8_t c) void d_writeCommand(uint8_t c)
{ {
SPI1.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE0)); SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE0));
if (PIN_EINK_DC >= 0) if (PIN_EINK_DC >= 0)
digitalWrite(PIN_EINK_DC, LOW); digitalWrite(PIN_EINK_DC, LOW);
if (PIN_EINK_CS >= 0) if (PIN_EINK_CS >= 0)
digitalWrite(PIN_EINK_CS, LOW); digitalWrite(PIN_EINK_CS, LOW);
SPI1.transfer(c); SPI.transfer(c);
if (PIN_EINK_CS >= 0) if (PIN_EINK_CS >= 0)
digitalWrite(PIN_EINK_CS, HIGH); digitalWrite(PIN_EINK_CS, HIGH);
if (PIN_EINK_DC >= 0) if (PIN_EINK_DC >= 0)
digitalWrite(PIN_EINK_DC, HIGH); digitalWrite(PIN_EINK_DC, HIGH);
SPI1.endTransaction(); SPI.endTransaction();
} }
void d_writeData(uint8_t d) void d_writeData(uint8_t d)
{ {
SPI1.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE0)); SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE0));
if (PIN_EINK_CS >= 0) if (PIN_EINK_CS >= 0)
digitalWrite(PIN_EINK_CS, LOW); digitalWrite(PIN_EINK_CS, LOW);
SPI1.transfer(d); SPI.transfer(d);
if (PIN_EINK_CS >= 0) if (PIN_EINK_CS >= 0)
digitalWrite(PIN_EINK_CS, HIGH); digitalWrite(PIN_EINK_CS, HIGH);
SPI1.endTransaction(); SPI.endTransaction();
} }
unsigned long d_waitWhileBusy(uint16_t busy_time) unsigned long d_waitWhileBusy(uint16_t busy_time)
@ -53,7 +53,7 @@ unsigned long d_waitWhileBusy(uint16_t busy_time)
void scanEInkDevice(void) void scanEInkDevice(void)
{ {
SPI1.begin(); SPI.begin();
d_writeCommand(0x22); d_writeCommand(0x22);
d_writeData(0x83); d_writeData(0x83);
d_writeCommand(0x20); d_writeCommand(0x20);
@ -62,6 +62,6 @@ void scanEInkDevice(void)
LOG_DEBUG("EInk display found"); LOG_DEBUG("EInk display found");
else else
LOG_DEBUG("EInk display not found"); LOG_DEBUG("EInk display not found");
SPI1.end(); SPI.end();
} }
#endif #endif

View File

@ -107,15 +107,11 @@ static const uint8_t AREF = PIN_AREF;
/* /*
* SPI Interfaces * SPI Interfaces
*/ */
#define SPI_INTERFACES_COUNT 2 #define SPI_INTERFACES_COUNT 1
#define PIN_SPI_MISO (45) #define PIN_SPI_MISO (29)
#define PIN_SPI_MOSI (44) #define PIN_SPI_MOSI (30)
#define PIN_SPI_SCK (43) #define PIN_SPI_SCK (3)
#define PIN_SPI1_MISO (29) // (0 + 29)
#define PIN_SPI1_MOSI (30) // (0 + 30)
#define PIN_SPI1_SCK (3) // (0 + 3)
static const uint8_t SS = 42; static const uint8_t SS = 42;
static const uint8_t MOSI = PIN_SPI_MOSI; static const uint8_t MOSI = PIN_SPI_MOSI;
@ -130,8 +126,8 @@ static const uint8_t SCK = PIN_SPI_SCK;
#define PIN_EINK_BUSY (0 + 4) #define PIN_EINK_BUSY (0 + 4)
#define PIN_EINK_DC (0 + 17) #define PIN_EINK_DC (0 + 17)
#define PIN_EINK_RES (-1) #define PIN_EINK_RES (-1)
#define PIN_EINK_SCLK (0 + 3) #define PIN_EINK_SCLK PIN_SPI_SCK
#define PIN_EINK_MOSI (0 + 30) // also called SDI #define PIN_EINK_MOSI PIN_SPI_MOSI // also called SDI
// #define USE_EINK // #define USE_EINK
@ -259,7 +255,7 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
#define PIN_ETHERNET_RESET 21 #define PIN_ETHERNET_RESET 21
#define PIN_ETHERNET_SS PIN_EINK_CS #define PIN_ETHERNET_SS PIN_EINK_CS
#define ETH_SPI_PORT SPI1 #define ETH_SPI_PORT SPI
#define AQ_SET_PIN 10 #define AQ_SET_PIN 10
#ifdef __cplusplus #ifdef __cplusplus