Merge branch 'master' into keyboard
This commit is contained in:
commit
46da1142c8
|
@ -0,0 +1,56 @@
|
||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino":{
|
||||||
|
"ldscript": "esp32s3_out.ld",
|
||||||
|
"partitions": "default_8MB.csv",
|
||||||
|
"memory_type": "qio_opi"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DBOARD_HAS_PSRAM",
|
||||||
|
"-DARDUINO_ESP32S3_DEV",
|
||||||
|
"-DARDUINO_USB_MODE=1",
|
||||||
|
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||||
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
|
"-DARDUINO_EVENT_RUNNING_CORE=1"
|
||||||
|
],
|
||||||
|
"f_cpu": "240000000L",
|
||||||
|
"f_flash": "80000000L",
|
||||||
|
"flash_mode": "qio",
|
||||||
|
"hwids": [
|
||||||
|
[
|
||||||
|
"0x303A",
|
||||||
|
"0x1001"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "obp60s3_light"
|
||||||
|
},
|
||||||
|
"connectivity": [
|
||||||
|
"bluetooth",
|
||||||
|
"wifi"
|
||||||
|
],
|
||||||
|
"debug": {
|
||||||
|
"default_tool": "esp-builtin",
|
||||||
|
"onboard_tools": [
|
||||||
|
"esp-builtin"
|
||||||
|
],
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": [
|
||||||
|
"arduino",
|
||||||
|
"espidf"
|
||||||
|
],
|
||||||
|
"name": "OBP60 Light ESP32-S3-N8R8 (8 MB QD, 8 MB PSRAM)",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "8MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 8388608,
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 460800
|
||||||
|
},
|
||||||
|
"url": "https://open-boat-projects.org/en/diy-multifunktionsdisplay-obp-60/",
|
||||||
|
"vendor": "Open Boat Projects"
|
||||||
|
}
|
|
@ -4,7 +4,6 @@
|
||||||
#include "GwApi.h"
|
#include "GwApi.h"
|
||||||
#include "OBP60Hardware.h"
|
#include "OBP60Hardware.h"
|
||||||
|
|
||||||
|
|
||||||
class Color{
|
class Color{
|
||||||
public:
|
public:
|
||||||
uint8_t r;
|
uint8_t r;
|
||||||
|
@ -93,5 +92,4 @@ class LedTaskData{
|
||||||
//task function
|
//task function
|
||||||
void createSpiLedTask(LedTaskData *param);
|
void createSpiLedTask(LedTaskData *param);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -103,11 +103,6 @@ void hardwareInit(GwApi *api)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void startLedTask(GwApi *api){
|
|
||||||
ledTaskData=new LedTaskData(api);
|
|
||||||
createSpiLedTask(ledTaskData);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setPortPin(uint pin, bool value){
|
void setPortPin(uint pin, bool value){
|
||||||
pinMode(pin, OUTPUT);
|
pinMode(pin, OUTPUT);
|
||||||
digitalWrite(pin, value);
|
digitalWrite(pin, value);
|
||||||
|
@ -118,6 +113,11 @@ void togglePortPin(uint pin){
|
||||||
digitalWrite(pin, !digitalRead(pin));
|
digitalWrite(pin, !digitalRead(pin));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void startLedTask(GwApi *api){
|
||||||
|
ledTaskData=new LedTaskData(api);
|
||||||
|
createSpiLedTask(ledTaskData);
|
||||||
|
}
|
||||||
|
|
||||||
// Valid colors see hue
|
// Valid colors see hue
|
||||||
Color colorMapping(const String &colorString){
|
Color colorMapping(const String &colorString){
|
||||||
Color color = COLOR_RED;
|
Color color = COLOR_RED;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// General hardware definitions
|
// General hardware definitions
|
||||||
// CAN and RS485 bus pin definitions see obp60task.h
|
// CAN and RS485 bus pin definitions see obp60task.h
|
||||||
|
|
||||||
|
#ifdef HARDWARE_V21
|
||||||
// Direction pin for RS485 NMEA0183
|
// Direction pin for RS485 NMEA0183
|
||||||
#define OBP_DIRECTION_PIN 18
|
#define OBP_DIRECTION_PIN 18
|
||||||
// I2C
|
// I2C
|
||||||
|
@ -73,5 +74,88 @@
|
||||||
#define OBP_BACKLIGHT_LED 15 // GPIO port
|
#define OBP_BACKLIGHT_LED 15 // GPIO port
|
||||||
// Power Rail
|
// Power Rail
|
||||||
#define OBP_POWER_50 5 // 5.0V power rail
|
#define OBP_POWER_50 5 // 5.0V power rail
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Hardware configuration for OBP60 LIGHT
|
||||||
|
|
||||||
|
#ifdef HARDWARE_LIGHT
|
||||||
|
// Direction pin for RS485 NMEA0183
|
||||||
|
#define OBP_DIRECTION_PIN 8
|
||||||
|
// I2C
|
||||||
|
#define I2C_SPEED 10000UL // 10kHz clock speed on I2C bus
|
||||||
|
#define OBP_I2C_SDA 21
|
||||||
|
#define OBP_I2C_SCL 38
|
||||||
|
// DS1388 RTC
|
||||||
|
#define DS1388_I2C_ADDR 0x68 // Addr. 0x68
|
||||||
|
// BME280
|
||||||
|
#define BME280_I2C_ADDR 0x76 // Addr. 0x76 (0x77)
|
||||||
|
// BMP280
|
||||||
|
#define BMP280_I2C_ADDR 0x77 // Addr. 0x77 (0x76) Attention: Pull up resistor
|
||||||
|
// BMP085 / BMP180
|
||||||
|
#define BMP180_I2C_ADDR 0x77 // Addr. 0x77 (fix)
|
||||||
|
// SHT21 / HUT21
|
||||||
|
#define SHT21_I2C_ADDR 0x40 // Addr. 0x40 (fix)
|
||||||
|
// AS5600
|
||||||
|
#define AS5600_I2C_ADDR 0x36 // Addr. 0x36 (fix)
|
||||||
|
// INA219
|
||||||
|
#define SHUNT_VOLTAGE 0.075 // Shunt voltage in V by max. current (75mV)
|
||||||
|
#define INA219_I2C_ADDR1 0x40 // Addr. 0x41 (fix A0 = 5V, A1 = GND) for battery
|
||||||
|
#define INA219_I2C_ADDR2 0x41 // Addr. 0x44 (fix A0 = GND, A1 = 5V) for solar panels
|
||||||
|
#define INA219_I2C_ADDR3 0x45 // Addr. 0x45 (fix A0 = 5V, A1 = 5V) for generator
|
||||||
|
// INA226
|
||||||
|
#define INA226_I2C_ADDR1 0x41 // Addr. 0x41 (fix A0 = 5V, A1 = GND) for battery
|
||||||
|
#define INA226_I2C_ADDR2 0x44 // Addr. 0x44 (fix A0 = GND, A1 = 5V) for solar panels
|
||||||
|
#define INA226_I2C_ADDR3 0x45 // Addr. 0x45 (fix A0 = 5V, A1 = 5V) for generator
|
||||||
|
// Horter modules
|
||||||
|
#define PCF8574_I2C_ADDR1 0x20 // First digital out module
|
||||||
|
// FRAM (e.g. MB85RC256V)
|
||||||
|
#define FRAM_I2C_ADDR 0x50
|
||||||
|
// SPI (E-Ink display, Extern Bus)
|
||||||
|
#define OBP_SPI_CS 45
|
||||||
|
#define OBP_SPI_DC 46
|
||||||
|
#define OBP_SPI_RST 47
|
||||||
|
#define OBP_SPI_BUSY 48
|
||||||
|
#define OBP_SPI_CLK 12
|
||||||
|
#define OBP_SPI_DIN 11
|
||||||
|
#define SHOW_TIME 6000 // Show time in [ms] for logo and WiFi QR code
|
||||||
|
#define FULL_REFRESH_TIME 600 // Refresh cycle time in [s][600...3600] for full display update (very important healcy function)
|
||||||
|
// SPI SD-Card
|
||||||
|
#define SD_SPI_CS 10
|
||||||
|
#define SD_SPI_MOSI 40
|
||||||
|
#define SD_SPI_CLK 39
|
||||||
|
#define SD_SPI_MISO 13
|
||||||
|
|
||||||
|
// GPS (NEO-6M, NEO-M8N, ATGM336H)
|
||||||
|
#define OBP_GPS_RX 19
|
||||||
|
#define OBP_GPS_TX 20
|
||||||
|
// 1Wire (DS18B20)
|
||||||
|
#define OBP_1WIRE 17 // External 1Wire
|
||||||
|
// Buzzer
|
||||||
|
#define OBP_BUZZER 18
|
||||||
|
#define TONE1 1500 // 1500Hz
|
||||||
|
#define TONE2 2500 // 2500Hz
|
||||||
|
#define TONE3 3500 // 3500Hz
|
||||||
|
#define TONE4 4000 // 4000Hz
|
||||||
|
// Analog Input
|
||||||
|
#define OBP_ANALOG0 3 // Analog input for voltage power supply
|
||||||
|
#define MIN_VOLTAGE 10.0 // Min voltage for under voltage detection (then goto deep sleep)
|
||||||
|
#define POWER_FAIL_TIME 2 // in [ms] Accept min voltage until 2 x 1ms (for under voltage gaps by engine start)
|
||||||
|
// Buttons
|
||||||
|
#define UP 6 // Wheel up
|
||||||
|
#define DOWN 4 // Wheel down
|
||||||
|
#define CONF 5 // Wheel press
|
||||||
|
#define MENUE 2 // Button top
|
||||||
|
#define EXIT 1 // Button bottom
|
||||||
|
|
||||||
|
// Flash LED (1x WS2812B)
|
||||||
|
#define NUM_FLASH_LED 1 // Number of flash LED
|
||||||
|
#define OBP_FLASH_LED 10 // GPIO port
|
||||||
|
// Backlight LEDs (6x WS2812B)
|
||||||
|
#define NUM_BACKLIGHT_LED 6 // Number of Backlight LEDs
|
||||||
|
#define OBP_BACKLIGHT_LED 40 // GPIO port
|
||||||
|
// Power Rail
|
||||||
|
#define OBP_POWER_50 41 // Power LED
|
||||||
|
#define OBP_POWER_EPD 7 // ePaper power
|
||||||
|
#define OBP_POWER_SD 42 // SD card power
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ int keycode = 0; // Keycode of pressed key [0...8], 0 = nothing touched
|
||||||
int keycode2 = 0; // Keycode of very short pressed key [0...8], 0 = nothing touched
|
int keycode2 = 0; // Keycode of very short pressed key [0...8], 0 = nothing touched
|
||||||
int keycodeold = 0; // Old keycode
|
int keycodeold = 0; // Old keycode
|
||||||
int keycodeold2 = 0; // Old keycode for short pressed key
|
int keycodeold2 = 0; // Old keycode for short pressed key
|
||||||
|
int keystatus = 0; // Status of key [0...11]
|
||||||
bool keyoff = false; // Disable all keys
|
bool keyoff = false; // Disable all keys
|
||||||
int keydelay = 250; // Delay after key pressed in [ms]
|
int keydelay = 250; // Delay after key pressed in [ms]
|
||||||
bool keylock = false; // Key lock after pressed key is valid (repeat protection by conginous pressing)
|
bool keylock = false; // Key lock after pressed key is valid (repeat protection by conginous pressing)
|
||||||
|
@ -52,7 +53,9 @@ void initKeys(CommonData &commonData) {
|
||||||
commonData.keydata[5].h = 18;
|
commonData.keydata[5].h = 18;
|
||||||
}
|
}
|
||||||
|
|
||||||
int readKeypad(uint thSensitivity) {
|
#ifdef HARDWARE_V21
|
||||||
|
// Keypad functions for original OBP60 hardware
|
||||||
|
int readKeypad(uint thSensitivity) {
|
||||||
|
|
||||||
// Touch sensor values
|
// Touch sensor values
|
||||||
// 35000 - Not touched
|
// 35000 - Not touched
|
||||||
|
@ -61,7 +64,7 @@ int readKeypad(uint thSensitivity) {
|
||||||
// 170000 - Strong touched
|
// 170000 - Strong touched
|
||||||
uint32_t touchthreshold = (thSensitivity * -1200) + 170000; // thSensitivity 0...100%
|
uint32_t touchthreshold = (thSensitivity * -1200) + 170000; // thSensitivity 0...100%
|
||||||
|
|
||||||
int keystatus = 0; // Status of key [0...11], 0 = processed, 1...8 = key 1..8, 9 = right swipe , 10 = left swipe, 11 keys disabled
|
keystatus = 0; // Status of key [0...11], 0 = processed, 1...8 = key 1..8, 9 = right swipe , 10 = left swipe, 11 keys disabled
|
||||||
keycode = 0;
|
keycode = 0;
|
||||||
|
|
||||||
// Read key code
|
// Read key code
|
||||||
|
@ -207,6 +210,60 @@ int readKeypad(uint thSensitivity) {
|
||||||
keycodeold2 = keycode2;
|
keycodeold2 = keycode2;
|
||||||
|
|
||||||
return keystatus;
|
return keystatus;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HARDWARE_LIGHT
|
||||||
|
// Keypad functions for OBP60 clone (thSensitivity is inactiv)
|
||||||
|
int readKeypad(uint thSensitivity) {
|
||||||
|
pinMode(UP, INPUT);
|
||||||
|
pinMode(DOWN, INPUT);
|
||||||
|
pinMode(CONF, INPUT);
|
||||||
|
pinMode(MENUE, INPUT);
|
||||||
|
pinMode(EXIT, INPUT);
|
||||||
|
|
||||||
|
// Read key code
|
||||||
|
if(digitalRead(UP) == LOW){
|
||||||
|
keycode = 10; // Left swipe
|
||||||
|
}
|
||||||
|
else if(digitalRead(DOWN) == LOW){
|
||||||
|
keycode = 9; // Right swipe
|
||||||
|
}
|
||||||
|
else if(digitalRead(CONF) == LOW){
|
||||||
|
keycode = 3; // Key 3
|
||||||
|
}
|
||||||
|
else if(digitalRead(MENUE) == LOW){
|
||||||
|
keycode = 1; // Key 1
|
||||||
|
}
|
||||||
|
else if(digitalRead(EXIT) == LOW){
|
||||||
|
keycode = 2; // Key 2
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
keycode = 0; // No key activ
|
||||||
|
}
|
||||||
|
|
||||||
|
// Detect key
|
||||||
|
if (keycode > 0 ){
|
||||||
|
if(keycode != keycodeold){
|
||||||
|
starttime = millis(); // Start key pressed
|
||||||
|
keycodeold = keycode;
|
||||||
|
}
|
||||||
|
// If key pressed longer than 200ms
|
||||||
|
if(millis() > starttime + 200 && keycode == keycodeold) {
|
||||||
|
keystatus = keycode;
|
||||||
|
// Copy keycode
|
||||||
|
keycodeold = keycode;
|
||||||
|
delay(keydelay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
keycode = 0;
|
||||||
|
keycodeold = 0;
|
||||||
|
keystatus = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return keystatus;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -66,12 +66,14 @@ static unsigned char fish_bits[] = {
|
||||||
|
|
||||||
class PageFluid : public Page
|
class PageFluid : public Page
|
||||||
{
|
{
|
||||||
|
bool holdvalues = false;
|
||||||
int fluidtype;
|
int fluidtype;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageFluid(CommonData &common){
|
PageFluid(CommonData &common){
|
||||||
commonData = &common;
|
commonData = &common;
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageFluid");
|
common.logger->logDebug(GwLog::LOG,"Instantiate PageFluid");
|
||||||
|
holdvalues = common.config->getBool(common.config->holdvalues);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int handleKey(int key){
|
virtual int handleKey(int key){
|
||||||
|
@ -92,6 +94,9 @@ class PageFluid : public Page
|
||||||
GwConfigHandler *config = commonData->config;
|
GwConfigHandler *config = commonData->config;
|
||||||
GwLog *logger = commonData->logger;
|
GwLog *logger = commonData->logger;
|
||||||
|
|
||||||
|
// Old values for hold function
|
||||||
|
static double value1old;
|
||||||
|
|
||||||
// Get config data
|
// Get config data
|
||||||
String flashLED = config->getString(config->flashLED);
|
String flashLED = config->getString(config->flashLED);
|
||||||
String backlightMode = config->getString(config->backlight);
|
String backlightMode = config->getString(config->backlight);
|
||||||
|
@ -102,13 +107,14 @@ class PageFluid : public Page
|
||||||
setFlashLED(false);
|
setFlashLED(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logging boat values
|
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageFluid");
|
|
||||||
|
|
||||||
GwApi::BoatValue *bvalue1 = pageData.values[0];
|
GwApi::BoatValue *bvalue1 = pageData.values[0];
|
||||||
String name1 = bvalue1->getName();
|
String name1 = bvalue1->getName();
|
||||||
double value1 = bvalue1->value;
|
if (holdvalues and bvalue1->valid) {
|
||||||
bool valid1 = bvalue1->valid;
|
value1old = bvalue1->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Logging boat values
|
||||||
|
LOG_DEBUG(GwLog::LOG,"Drawing at PageFluid: value=%f", bvalue1->value);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -1012,6 +1012,9 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"page1type": "WindRoseFlex"
|
"page1type": "WindRoseFlex"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"page1type": "Fluid"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -1266,7 +1269,11 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"page2type": "WindRoseFlex"
|
"page2type": "WindRoseFlex"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"page2type": "Fluid"
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1517,6 +1524,9 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"page3type": "WindRoseFlex"
|
"page3type": "WindRoseFlex"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"page3type": "Fluid"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -1765,6 +1775,9 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"page4type": "WindRoseFlex"
|
"page4type": "WindRoseFlex"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"page4type": "Fluid"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -2010,6 +2023,9 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"page5type": "WindRoseFlex"
|
"page5type": "WindRoseFlex"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"page5type": "Fluid"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -2252,6 +2268,9 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"page6type": "WindRoseFlex"
|
"page6type": "WindRoseFlex"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"page6type": "Fluid"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -2491,6 +2510,9 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"page7type": "WindRoseFlex"
|
"page7type": "WindRoseFlex"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"page7type": "Fluid"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -2727,6 +2749,9 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"page8type": "WindRoseFlex"
|
"page8type": "WindRoseFlex"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"page8type": "Fluid"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -2960,6 +2985,9 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"page9type": "WindRoseFlex"
|
"page9type": "WindRoseFlex"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"page9type": "Fluid"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -3190,6 +3218,9 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"page10type": "WindRoseFlex"
|
"page10type": "WindRoseFlex"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"page10type": "Fluid"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
@ -49,10 +49,20 @@ void OBP60Init(GwApi *api){
|
||||||
String powermode = api->getConfig()->getConfigItem(api->getConfig()->powerMode,true)->asString();
|
String powermode = api->getConfig()->getConfigItem(api->getConfig()->powerMode,true)->asString();
|
||||||
api->getLogger()->logDebug(GwLog::DEBUG,"Power Mode is: %s", powermode.c_str());
|
api->getLogger()->logDebug(GwLog::DEBUG,"Power Mode is: %s", powermode.c_str());
|
||||||
if(powermode == "Max Power" || powermode == "Only 5.0V"){
|
if(powermode == "Max Power" || powermode == "Only 5.0V"){
|
||||||
|
#ifdef HARDWARE_V21
|
||||||
setPortPin(OBP_POWER_50, true); // Power on 5.0V rail
|
setPortPin(OBP_POWER_50, true); // Power on 5.0V rail
|
||||||
|
#endif
|
||||||
|
#ifdef HARDWARE_LIGHT
|
||||||
|
setPortPin(OBP_POWER_EPD, true);// Power on ePaper display
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
#ifdef HARDWARE_V21
|
||||||
setPortPin(OBP_POWER_50, false); // Power off 5.0V rail
|
setPortPin(OBP_POWER_50, false); // Power off 5.0V rail
|
||||||
|
#endif
|
||||||
|
#ifdef HARDWARE_LIGHT
|
||||||
|
setPortPin(OBP_POWER_EPD, false);// Power off ePaper display
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Settings for e-paper display
|
// Settings for e-paper display
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
//we only compile for some boards
|
//we only compile for some boards
|
||||||
#ifdef BOARD_OBP60S3
|
#ifdef BOARD_OBP60S3
|
||||||
#define USBSerial Serial
|
#define USBSerial Serial
|
||||||
|
#ifdef HARDWARE_V21
|
||||||
// CAN NMEA2000
|
// CAN NMEA2000
|
||||||
#define ESP32_CAN_TX_PIN 46
|
#define ESP32_CAN_TX_PIN 46
|
||||||
#define ESP32_CAN_RX_PIN 3
|
#define ESP32_CAN_RX_PIN 3
|
||||||
|
@ -12,6 +13,18 @@
|
||||||
#define GWSERIAL_TX 17
|
#define GWSERIAL_TX 17
|
||||||
#define GWSERIAL_RX 8
|
#define GWSERIAL_RX 8
|
||||||
#define GWSERIAL_MODE "UNI"
|
#define GWSERIAL_MODE "UNI"
|
||||||
|
#endif
|
||||||
|
#ifdef HARDWARE_LIGHT
|
||||||
|
// CAN NMEA2000
|
||||||
|
#define ESP32_CAN_TX_PIN 15
|
||||||
|
#define ESP32_CAN_RX_PIN 16
|
||||||
|
// Bus load in 50mA steps
|
||||||
|
#define N2K_LOAD_LEVEL 2 // 5x50mA = 100mA max bus load with back light on
|
||||||
|
// RS485 NMEA0183
|
||||||
|
#define GWSERIAL_TX 9
|
||||||
|
#define GWSERIAL_RX 14
|
||||||
|
#define GWSERIAL_MODE "UNI"
|
||||||
|
#endif
|
||||||
// Allowed to set a new password for access point
|
// Allowed to set a new password for access point
|
||||||
#define FORCE_AP_PWCHANGE
|
#define FORCE_AP_PWCHANGE
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ board_build.variants_dir = variants
|
||||||
#board = obp60_s3_n16 #ESP32-S3 N16,16MB flash, no PSRAM, zero series
|
#board = obp60_s3_n16 #ESP32-S3 N16,16MB flash, no PSRAM, zero series
|
||||||
#board = obp60_s3_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM
|
#board = obp60_s3_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM
|
||||||
board = obp60_s3_n16r8 #ESP32-S3 N16R8, 16MB flash, 8MB PSRAM, production series
|
board = obp60_s3_n16r8 #ESP32-S3 N16R8, 16MB flash, 8MB PSRAM, production series
|
||||||
|
#board = obp60_s3_light_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM, OBP60 clone
|
||||||
#board_build.partitions = default_8MB.csv #ESP32-S3 N8, 8MB flash
|
#board_build.partitions = default_8MB.csv #ESP32-S3 N8, 8MB flash
|
||||||
board_build.partitions = default_16MB.csv #ESP32-S3 N16, 16MB flash
|
board_build.partitions = default_16MB.csv #ESP32-S3 N16, 16MB flash
|
||||||
framework = arduino
|
framework = arduino
|
||||||
|
@ -44,15 +45,17 @@ build_flags=
|
||||||
# -D TIME=$UNIX_TIME #Set PC time for RTC (only settable via VSC)
|
# -D TIME=$UNIX_TIME #Set PC time for RTC (only settable via VSC)
|
||||||
-D DISABLE_DIAGNOSTIC_OUTPUT #Disable diagnostic output for GxEPD2 lib
|
-D DISABLE_DIAGNOSTIC_OUTPUT #Disable diagnostic output for GxEPD2 lib
|
||||||
-D BOARD_OBP60S3 #Board OBP60 V2.1 with ESP32S3
|
-D BOARD_OBP60S3 #Board OBP60 V2.1 with ESP32S3
|
||||||
# -D HARDWARE_V20 #Hardware revision V2.0
|
# -D HARDWARE_V20 #OBP60 hardware revision V2.0
|
||||||
-D HARDWARE_V21 #Hardware revision V2.1
|
-D HARDWARE_V21 #OBP60 hardware revision V2.1
|
||||||
|
# -D HARDWARE_LIGHT #OBP60 hardware clone
|
||||||
# -D DISPLAY_GDEW042T2 #old E-Ink display from Waveshare, R10 0.47 ohm
|
# -D DISPLAY_GDEW042T2 #old E-Ink display from Waveshare, R10 0.47 ohm
|
||||||
-D DISPLAY_GDEY042T81 #new E-Ink display from Waveshare, R10 2.2 ohm
|
-D DISPLAY_GDEY042T81 #new E-Ink display from Waveshare, R10 2.2 ohm
|
||||||
# -D DISPLAY_GYE042A87 #alternativ E-Ink display from Genyo Optical, R10 2.2 ohm
|
# -D DISPLAY_GYE042A87 #alternativ E-Ink display from Genyo Optical, R10 2.2 ohm
|
||||||
# -D DISPLAY_SE0420NQ04 #alternativ E-Ink display from SID Technology, R10 2.2 ohm
|
# -D DISPLAY_SE0420NQ04 #alternativ E-Ink display from SID Technology, R10 2.2 ohm
|
||||||
${env.build_flags}
|
${env.build_flags}
|
||||||
#CONFIG_ESP_TASK_WDT_TIMEOUT_S = 10 #Task Watchdog timeout period (seconds) [1...60] 5 default
|
#CONFIG_ESP_TASK_WDT_TIMEOUT_S = 10 #Task Watchdog timeout period (seconds) [1...60] 5 default
|
||||||
upload_port = /dev/ttyACM0
|
upload_port = /dev/ttyACM0 #OBP60 original
|
||||||
|
#upload_port = /dev/ttyUSB0 #OBP60 clone
|
||||||
upload_protocol = esptool #firmware upload via USB OTG seriell, by first upload need to set the ESP32-S3 in the upload mode with shortcut GND to Pin27
|
upload_protocol = esptool #firmware upload via USB OTG seriell, by first upload need to set the ESP32-S3 in the upload mode with shortcut GND to Pin27
|
||||||
upload_speed = 230400
|
upload_speed = 230400
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
[platformio]
|
||||||
|
#if you want a pio run to only build
|
||||||
|
#your special environments you can set this here
|
||||||
|
#by uncommenting the next line
|
||||||
|
default_envs = obp60_s3
|
||||||
|
[env:obp60_s3]
|
||||||
|
platform = espressif32@6.8.1
|
||||||
|
board_build.variants_dir = variants
|
||||||
|
#board = obp60_s3_n8 #ESP32-S3 N8, 8MB flash, no PSRAM
|
||||||
|
#board = obp60_s3_n16 #ESP32-S3 N16,16MB flash, no PSRAM, zero series
|
||||||
|
#board = obp60_s3_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM
|
||||||
|
#board = obp60_s3_n16r8 #ESP32-S3 N16R8, 16MB flash, 8MB PSRAM, production series
|
||||||
|
board = obp60_s3_light_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM, OBP60 clone
|
||||||
|
board_build.partitions = default_8MB.csv #ESP32-S3 N8, 8MB flash
|
||||||
|
#board_build.partitions = default_16MB.csv #ESP32-S3 N16, 16MB flash
|
||||||
|
framework = arduino
|
||||||
|
lib_deps =
|
||||||
|
${basedeps.lib_deps}
|
||||||
|
Wire
|
||||||
|
SPI
|
||||||
|
esphome/AsyncTCP-esphome@2.0.1
|
||||||
|
robtillaart/PCF8574@0.3.9
|
||||||
|
adafruit/Adafruit Unified Sensor @ 1.1.13
|
||||||
|
blemasle/MCP23017@2.0.0
|
||||||
|
adafruit/Adafruit BusIO@1.5.0
|
||||||
|
adafruit/Adafruit GFX Library@1.11.9
|
||||||
|
#zinggjm/GxEPD2@1.5.8
|
||||||
|
#https://github.com/ZinggJM/GxEPD2
|
||||||
|
https://github.com/thooge/GxEPD2
|
||||||
|
sstaub/Ticker@4.4.0
|
||||||
|
adafruit/Adafruit BMP280 Library@2.6.2
|
||||||
|
adafruit/Adafruit BME280 Library@2.2.2
|
||||||
|
adafruit/Adafruit BMP085 Library@1.2.1
|
||||||
|
enjoyneering/HTU21D@1.2.1
|
||||||
|
robtillaart/INA226@0.2.0
|
||||||
|
paulstoffregen/OneWire@2.3.8
|
||||||
|
milesburton/DallasTemperature@3.11.0
|
||||||
|
signetica/SunRise@2.0.2
|
||||||
|
adafruit/Adafruit FRAM I2C@^2.0.3
|
||||||
|
build_flags=
|
||||||
|
#https://thingpulse.com/usb-settings-for-logging-with-the-esp32-s3-in-platformio/?srsltid=AfmBOopGskbkr4GoeVkNlFaZXe_zXkLceKF6Rn-tmoXABCeAR2vWsdHL
|
||||||
|
# -D ARDUINO_USB_MODE=1 #0=OTG (to implement other external devices), 1=CDC (is a serial device)
|
||||||
|
# -D ARDUINO_USB_CDC_ON_BOOT=1 #0=JTAG, 1=CDC (serial device)
|
||||||
|
# -D CORE_DEBUG_LEVEL=1 #Debug level for CPU core via CDC (seral device)
|
||||||
|
# -D TIME=$UNIX_TIME #Set PC time for RTC (only settable via VSC)
|
||||||
|
-D DISABLE_DIAGNOSTIC_OUTPUT #Disable diagnostic output for GxEPD2 lib
|
||||||
|
-D BOARD_OBP60S3 #Board OBP60 V2.1 with ESP32S3
|
||||||
|
# -D HARDWARE_V20 #OBP60 hardware revision V2.0
|
||||||
|
# -D HARDWARE_V21 #OBP60 hardware revision V2.1
|
||||||
|
-D HARDWARE_LIGHT #OBP60 hardware clone
|
||||||
|
# -D DISPLAY_GDEW042T2 #old E-Ink display from Waveshare, R10 0.47 ohm
|
||||||
|
-D DISPLAY_GDEY042T81 #new E-Ink display from Waveshare, R10 2.2 ohm
|
||||||
|
# -D DISPLAY_GYE042A87 #alternativ E-Ink display from Genyo Optical, R10 2.2 ohm
|
||||||
|
# -D DISPLAY_SE0420NQ04 #alternativ E-Ink display from SID Technology, R10 2.2 ohm
|
||||||
|
${env.build_flags}
|
||||||
|
#CONFIG_ESP_TASK_WDT_TIMEOUT_S = 10 #Task Watchdog timeout period (seconds) [1...60] 5 default
|
||||||
|
#upload_port = /dev/ttyACM0 #OBP60 original
|
||||||
|
upload_port = /dev/ttyUSB0 #OBP60 clone
|
||||||
|
upload_protocol = esptool #firmware upload via USB OTG seriell, by first upload need to set the ESP32-S3 in the upload mode with shortcut GND to Pin27
|
||||||
|
upload_speed = 230400
|
||||||
|
monitor_speed = 115200
|
|
@ -0,0 +1,61 @@
|
||||||
|
[platformio]
|
||||||
|
#if you want a pio run to only build
|
||||||
|
#your special environments you can set this here
|
||||||
|
#by uncommenting the next line
|
||||||
|
default_envs = obp60_s3
|
||||||
|
[env:obp60_s3]
|
||||||
|
platform = espressif32@6.8.1
|
||||||
|
board_build.variants_dir = variants
|
||||||
|
#board = obp60_s3_n8 #ESP32-S3 N8, 8MB flash, no PSRAM
|
||||||
|
#board = obp60_s3_n16 #ESP32-S3 N16,16MB flash, no PSRAM, zero series
|
||||||
|
#board = obp60_s3_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM
|
||||||
|
board = obp60_s3_n16r8 #ESP32-S3 N16R8, 16MB flash, 8MB PSRAM, production series
|
||||||
|
#board = obp60_s3_light_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM, OBP60 clone
|
||||||
|
#board_build.partitions = default_8MB.csv #ESP32-S3 N8, 8MB flash
|
||||||
|
board_build.partitions = default_16MB.csv #ESP32-S3 N16, 16MB flash
|
||||||
|
framework = arduino
|
||||||
|
lib_deps =
|
||||||
|
${basedeps.lib_deps}
|
||||||
|
Wire
|
||||||
|
SPI
|
||||||
|
esphome/AsyncTCP-esphome@2.0.1
|
||||||
|
robtillaart/PCF8574@0.3.9
|
||||||
|
adafruit/Adafruit Unified Sensor @ 1.1.13
|
||||||
|
blemasle/MCP23017@2.0.0
|
||||||
|
adafruit/Adafruit BusIO@1.5.0
|
||||||
|
adafruit/Adafruit GFX Library@1.11.9
|
||||||
|
#zinggjm/GxEPD2@1.5.8
|
||||||
|
#https://github.com/ZinggJM/GxEPD2
|
||||||
|
https://github.com/thooge/GxEPD2
|
||||||
|
sstaub/Ticker@4.4.0
|
||||||
|
adafruit/Adafruit BMP280 Library@2.6.2
|
||||||
|
adafruit/Adafruit BME280 Library@2.2.2
|
||||||
|
adafruit/Adafruit BMP085 Library@1.2.1
|
||||||
|
enjoyneering/HTU21D@1.2.1
|
||||||
|
robtillaart/INA226@0.2.0
|
||||||
|
paulstoffregen/OneWire@2.3.8
|
||||||
|
milesburton/DallasTemperature@3.11.0
|
||||||
|
signetica/SunRise@2.0.2
|
||||||
|
adafruit/Adafruit FRAM I2C@^2.0.3
|
||||||
|
build_flags=
|
||||||
|
#https://thingpulse.com/usb-settings-for-logging-with-the-esp32-s3-in-platformio/?srsltid=AfmBOopGskbkr4GoeVkNlFaZXe_zXkLceKF6Rn-tmoXABCeAR2vWsdHL
|
||||||
|
# -D ARDUINO_USB_MODE=1 #0=OTG (to implement other external devices), 1=CDC (is a serial device)
|
||||||
|
# -D ARDUINO_USB_CDC_ON_BOOT=1 #0=JTAG, 1=CDC (serial device)
|
||||||
|
# -D CORE_DEBUG_LEVEL=1 #Debug level for CPU core via CDC (seral device)
|
||||||
|
# -D TIME=$UNIX_TIME #Set PC time for RTC (only settable via VSC)
|
||||||
|
-D DISABLE_DIAGNOSTIC_OUTPUT #Disable diagnostic output for GxEPD2 lib
|
||||||
|
-D BOARD_OBP60S3 #Board OBP60 V2.1 with ESP32S3
|
||||||
|
# -D HARDWARE_V20 #OBP60 hardware revision V2.0
|
||||||
|
-D HARDWARE_V21 #OBP60 hardware revision V2.1
|
||||||
|
# -D HARDWARE_LIGHT #OBP60 hardware clone
|
||||||
|
# -D DISPLAY_GDEW042T2 #old E-Ink display from Waveshare, R10 0.47 ohm
|
||||||
|
-D DISPLAY_GDEY042T81 #new E-Ink display from Waveshare, R10 2.2 ohm
|
||||||
|
# -D DISPLAY_GYE042A87 #alternativ E-Ink display from Genyo Optical, R10 2.2 ohm
|
||||||
|
# -D DISPLAY_SE0420NQ04 #alternativ E-Ink display from SID Technology, R10 2.2 ohm
|
||||||
|
${env.build_flags}
|
||||||
|
#CONFIG_ESP_TASK_WDT_TIMEOUT_S = 10 #Task Watchdog timeout period (seconds) [1...60] 5 default
|
||||||
|
upload_port = /dev/ttyACM0 #OBP60 original
|
||||||
|
#upload_port = /dev/ttyUSB0 #OBP60 clone
|
||||||
|
upload_protocol = esptool #firmware upload via USB OTG seriell, by first upload need to set the ESP32-S3 in the upload mode with shortcut GND to Pin27
|
||||||
|
upload_speed = 230400
|
||||||
|
monitor_speed = 115200
|
|
@ -0,0 +1,74 @@
|
||||||
|
#ifndef Pins_Arduino_h
|
||||||
|
#define Pins_Arduino_h
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include "soc/soc_caps.h"
|
||||||
|
|
||||||
|
#define USB_VID 0x303a
|
||||||
|
#define USB_PID 0x1001
|
||||||
|
|
||||||
|
/*
|
||||||
|
#define EXTERNAL_NUM_INTERRUPTS 46
|
||||||
|
#define NUM_DIGITAL_PINS 48
|
||||||
|
#define NUM_ANALOG_INPUTS 20
|
||||||
|
|
||||||
|
// Multi Function Display OBP60 V2.0
|
||||||
|
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48;
|
||||||
|
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||||
|
#define LED_BUILTIN LED_BUILTIN
|
||||||
|
#define RGB_BUILTIN LED_BUILTIN
|
||||||
|
#define RGB_BRIGHTNESS 64
|
||||||
|
|
||||||
|
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
|
||||||
|
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1)
|
||||||
|
#define digitalPinHasPWM(p) (p < 46)
|
||||||
|
*/
|
||||||
|
|
||||||
|
static const uint8_t TX = 43;
|
||||||
|
static const uint8_t RX = 44;
|
||||||
|
|
||||||
|
static const uint8_t SDA = 21;
|
||||||
|
static const uint8_t SCL = 38;
|
||||||
|
|
||||||
|
static const uint8_t SS = 45;
|
||||||
|
static const uint8_t MOSI = 11;
|
||||||
|
static const uint8_t MISO = 13;
|
||||||
|
static const uint8_t SCK = 12;
|
||||||
|
|
||||||
|
static const uint8_t A0 = 1;
|
||||||
|
static const uint8_t A1 = 2;
|
||||||
|
static const uint8_t A2 = 3;
|
||||||
|
static const uint8_t A3 = 4;
|
||||||
|
static const uint8_t A4 = 5;
|
||||||
|
static const uint8_t A5 = 6;
|
||||||
|
static const uint8_t A6 = 7;
|
||||||
|
static const uint8_t A7 = 8;
|
||||||
|
static const uint8_t A8 = 9;
|
||||||
|
static const uint8_t A9 = 10;
|
||||||
|
static const uint8_t A10 = 11;
|
||||||
|
static const uint8_t A11 = 12;
|
||||||
|
static const uint8_t A12 = 13;
|
||||||
|
static const uint8_t A13 = 14;
|
||||||
|
static const uint8_t A14 = 15;
|
||||||
|
static const uint8_t A15 = 16;
|
||||||
|
static const uint8_t A16 = 17;
|
||||||
|
static const uint8_t A17 = 18;
|
||||||
|
static const uint8_t A18 = 19;
|
||||||
|
static const uint8_t A19 = 20;
|
||||||
|
|
||||||
|
static const uint8_t T1 = 1;
|
||||||
|
static const uint8_t T2 = 2;
|
||||||
|
static const uint8_t T3 = 3;
|
||||||
|
static const uint8_t T4 = 4;
|
||||||
|
static const uint8_t T5 = 5;
|
||||||
|
static const uint8_t T6 = 6;
|
||||||
|
static const uint8_t T7 = 7;
|
||||||
|
static const uint8_t T8 = 8;
|
||||||
|
static const uint8_t T9 = 9;
|
||||||
|
static const uint8_t T10 = 10;
|
||||||
|
static const uint8_t T11 = 11;
|
||||||
|
static const uint8_t T12 = 12;
|
||||||
|
static const uint8_t T13 = 13;
|
||||||
|
static const uint8_t T14 = 14;
|
||||||
|
|
||||||
|
#endif /* Pins_Arduino_h */
|
Loading…
Reference in New Issue