|
| 1 | +#ifndef Pins_Arduino_h |
| 2 | +#define Pins_Arduino_h |
| 3 | + |
| 4 | +#include <stdint.h> |
| 5 | + |
| 6 | +#define EXTERNAL_NUM_INTERRUPTS 16 |
| 7 | +#define NUM_DIGITAL_PINS 9 |
| 8 | +#define NUM_ANALOG_INPUTS 7 |
| 9 | + |
| 10 | +#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) |
| 11 | +#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) |
| 12 | +#define digitalPinHasPWM(p) (p < 34) |
| 13 | + |
| 14 | +// Renaming few signals |
| 15 | +#define SPI_CLK SCK // IO14 |
| 16 | +#define SPI_MISO MISO // IO12 |
| 17 | +#define SPI_MOSI MOSI // IO13 |
| 18 | +#define SPI_CS0 SS // IO15, Default SPI CS: Extension Header, Pin_3 |
| 19 | +#define SD_SPI_CS1 SPI_CS1 // SPI Chip Select: MicroSD Card |
| 20 | +#define LED_WIFI_LINK LED1_BUILDIN // LED6 on the LogSens V1.1 Board |
| 21 | +#define LED_WIFI_ACT LED2_BUILDIN // LED7 on the LogSens V1.1 Board\ |
| 22 | + |
| 23 | +/* LED_BUILTIN is kept for compatibility reason; mapped to LED2 on the LogSens V1.1 Board */ |
| 24 | +static const uint8_t LED_BUILTIN = 33; |
| 25 | +#define BUILTIN_LED LED_BUILTIN // backward compatibility |
| 26 | + |
| 27 | +/* UART0: Serial Port for Programming and Debugging on the LogSens V1.1 Board */ |
| 28 | +static const uint8_t TX = 1; |
| 29 | +static const uint8_t RX = 3; |
| 30 | + |
| 31 | +#ifdef BOARD_VARIANT_RS485 |
| 32 | +/* UART2: Serial Port conencted to RS485 transceiver on the LogSens V1.1 Board */ |
| 33 | +static const uint8_t UART2_TX = 17; |
| 34 | +static const uint8_t UART2_RX = 16; |
| 35 | +static const uint8_t UART2_RTS = 4; |
| 36 | +#endif /* BOARD_VARIANT_RS485 */ |
| 37 | + |
| 38 | +#ifdef BOARD_VARIANT_CAN |
| 39 | +/* CAN Bus conencted to CAN transceiver on the LogSens V1.1 Board */ |
| 40 | +static const uint8_t CAN_TX = 17; |
| 41 | +static const uint8_t CAN_RX = 16; |
| 42 | +static const uint8_t CAN_TXDE = 4; |
| 43 | +#endif /* BOARD_VARIANT_CAN */ |
| 44 | + |
| 45 | +/* I2C Bus: Shared between RTC chip, Expansion Header (X3), Sensor Header (X7) on the LogSens V1.1 Board */ |
| 46 | +static const uint8_t SDA = 21; |
| 47 | +static const uint8_t SCL = 22; |
| 48 | + |
| 49 | +/* SPI Bus: Shared between MicroSD Card (X6) and Expansion Header (X3) */ |
| 50 | +static const uint8_t SS = 15; // SPI Chip Select - 0; Connected to Extension Header, Pin_3 on the LogSens V1.1 Board |
| 51 | +static const uint8_t MOSI = 13; |
| 52 | +static const uint8_t MISO = 12; |
| 53 | +static const uint8_t SCK = 14; |
| 54 | + |
| 55 | +static const uint8_t SPI_SS1 = 23; // SPI Chip Select - 1; connected to MicroSD Card on the LogSens V1.1 Board |
| 56 | + |
| 57 | +/* Software Controlled: IO, LEDs and Switches */ |
| 58 | +static const uint8_t BUZZER_CTRL = 19; // Signal connected to MOSFET gate pin to control conenctor (X8) |
| 59 | +static const uint8_t SD_CARD_DETECT = 35; // MicroSD Card (X6): Card Detect Signal |
| 60 | + |
| 61 | +static const uint8_t SW2_BUILDIN = 0; // Tactile Switch-2 (SW2); ESP32 BOOT0 pin, Use it with care !! |
| 62 | +static const uint8_t SW3_BUILDIN = 36; // Tactile Switch-3 (SW3) |
| 63 | +static const uint8_t SW4_BUILDIN = 34; // Tactile Switch-4 (SW4) |
| 64 | + |
| 65 | +static const uint8_t LED1_BUILDIN = 32; // Connected to LogSens V1.1: LED6 |
| 66 | +static const uint8_t LED2_BUILDIN = 33; // Connected to LogSens V1.1: LED7 |
| 67 | + |
| 68 | + |
| 69 | +/* Analog Input Channels accessible on the LogSens V1.1 Board */ |
| 70 | +//static const uint8_t A0 = 36; |
| 71 | +//static const uint8_t A3 = 39; |
| 72 | +static const uint8_t A4 = 32; |
| 73 | +static const uint8_t A5 = 33; |
| 74 | +//static const uint8_t A6 = 34; |
| 75 | +//static const uint8_t A7 = 35; |
| 76 | +//static const uint8_t A10 = 4; |
| 77 | +//static const uint8_t A11 = 0; |
| 78 | +static const uint8_t A12 = 2; |
| 79 | +static const uint8_t A13 = 15; |
| 80 | +//static const uint8_t A14 = 13; |
| 81 | +//static const uint8_t A15 = 12; |
| 82 | +//static const uint8_t A16 = 14; |
| 83 | +static const uint8_t A17 = 27; |
| 84 | +static const uint8_t A18 = 25; |
| 85 | +static const uint8_t A19 = 26; |
| 86 | + |
| 87 | +//static const uint8_t T0 = 4; |
| 88 | +//static const uint8_t T1 = 0; |
| 89 | +static const uint8_t T2 = 2; |
| 90 | +static const uint8_t T3 = 15; |
| 91 | +//static const uint8_t T4 = 13; |
| 92 | +//static const uint8_t T5 = 12; |
| 93 | +//static const uint8_t T6 = 14; |
| 94 | +static const uint8_t T7 = 27; |
| 95 | +static const uint8_t T8 = 33; |
| 96 | +static const uint8_t T9 = 32; |
| 97 | + |
| 98 | +/* DAC Channels accessible on the LogSens V1.1 Board */ |
| 99 | +static const uint8_t DAC1 = 25; |
| 100 | +static const uint8_t DAC2 = 26; |
| 101 | + |
| 102 | +#endif /* Pins_Arduino_h */ |
0 commit comments