* feat(i2c): Add support for the new I2C driver in IDF v5.4 * fix(build): Add the new driver to CMakeLists.txt * fix(i2c): Guard sleep retention Not all chips can restore I2C bus after light sleep * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
40 lines
1.1 KiB
C
40 lines
1.1 KiB
C
#ifndef Pins_Arduino_h
|
|
#define Pins_Arduino_h
|
|
|
|
#include <stdint.h>
|
|
#include "soc/soc_caps.h"
|
|
|
|
#define PIN_RGB_LED 8
|
|
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
|
|
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED;
|
|
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
|
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
|
|
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
|
|
#define RGB_BUILTIN LED_BUILTIN
|
|
#define RGB_BRIGHTNESS 64
|
|
|
|
static const uint8_t TX = 16;
|
|
static const uint8_t RX = 17;
|
|
|
|
static const uint8_t SDA = 23;
|
|
static const uint8_t SCL = 22;
|
|
|
|
static const uint8_t SS = 18;
|
|
static const uint8_t MOSI = 19;
|
|
static const uint8_t MISO = 20;
|
|
static const uint8_t SCK = 21;
|
|
|
|
static const uint8_t A0 = 0;
|
|
static const uint8_t A1 = 1;
|
|
static const uint8_t A2 = 2;
|
|
static const uint8_t A3 = 3;
|
|
static const uint8_t A4 = 4;
|
|
static const uint8_t A5 = 5;
|
|
static const uint8_t A6 = 6;
|
|
|
|
// LP I2C Pins are fixed on ESP32-C6
|
|
#define WIRE1_PIN_DEFINED
|
|
static const uint8_t SDA1 = 6;
|
|
static const uint8_t SCL1 = 7;
|
|
|
|
#endif /* Pins_Arduino_h */
|