First version for OBP 60 Light
This commit is contained in:
parent
695013cb88
commit
71673e78bd
|
@ -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 "OBP60Hardware.h"
|
||||
|
||||
|
||||
class Color{
|
||||
public:
|
||||
uint8_t r;
|
||||
|
@ -92,5 +91,4 @@ class LedTaskData{
|
|||
//task function
|
||||
void createSpiLedTask(LedTaskData *param);
|
||||
|
||||
|
||||
#endif
|
|
@ -102,11 +102,6 @@ void hardwareInit(GwApi *api)
|
|||
}
|
||||
}
|
||||
|
||||
void startLedTask(GwApi *api){
|
||||
ledTaskData=new LedTaskData(api);
|
||||
createSpiLedTask(ledTaskData);
|
||||
}
|
||||
|
||||
void setPortPin(uint pin, bool value){
|
||||
pinMode(pin, OUTPUT);
|
||||
digitalWrite(pin, value);
|
||||
|
@ -117,6 +112,11 @@ void togglePortPin(uint pin){
|
|||
digitalWrite(pin, !digitalRead(pin));
|
||||
}
|
||||
|
||||
void startLedTask(GwApi *api){
|
||||
ledTaskData=new LedTaskData(api);
|
||||
createSpiLedTask(ledTaskData);
|
||||
}
|
||||
|
||||
// Valid colors see hue
|
||||
Color colorMapping(const String &colorString){
|
||||
Color color = COLOR_RED;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// General hardware definitions
|
||||
// CAN and RS485 bus pin definitions see obp60task.h
|
||||
|
||||
#ifdef HARDWARE_V21
|
||||
// Direction pin for RS485 NMEA0183
|
||||
#define OBP_DIRECTION_PIN 18
|
||||
// I2C
|
||||
|
@ -73,5 +74,88 @@
|
|||
#define OBP_BACKLIGHT_LED 15 // GPIO port
|
||||
// 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,167 +14,223 @@ 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 keycodeold = 0; // Old keycode
|
||||
int keycodeold2 = 0; // Old keycode for short pressed key
|
||||
int keystatus = 0; // Status of key [0...11]
|
||||
bool keyoff = false; // Disable all keys
|
||||
int keydelay = 250; // Delay after key pressed in [ms]
|
||||
bool keylock = false; // Key lock after pressed key is valid (repeat protection by conginous pressing)
|
||||
long starttime = 0; // Start time point for pressed key
|
||||
|
||||
#ifdef HARDWARE_V21
|
||||
// Keypad functions for original OBP60 hardware
|
||||
int readKeypad(uint thSensitivity) {
|
||||
|
||||
// Touch sensor values
|
||||
// 35000 - Not touched
|
||||
// 50000 - Light toched with fingertip
|
||||
// 70000 - Touched
|
||||
// 170000 - Strong touched
|
||||
uint32_t touchthreshold = (thSensitivity * -1200) + 170000; // thSensitivity 0...100%
|
||||
|
||||
int readKeypad(uint thSensitivity) {
|
||||
|
||||
// Touch sensor values
|
||||
// 35000 - Not touched
|
||||
// 50000 - Light toched with fingertip
|
||||
// 70000 - Touched
|
||||
// 170000 - Strong touched
|
||||
uint32_t touchthreshold = (thSensitivity * -1200) + 170000; // thSensitivity 0...100%
|
||||
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;
|
||||
|
||||
int 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;
|
||||
|
||||
// Read key code
|
||||
if(touchRead(14) > touchthreshold){ // Touch pad 1
|
||||
keypad[1] = 1;
|
||||
}
|
||||
else{
|
||||
keypad[1] = 0;
|
||||
}
|
||||
if(touchRead(13) > touchthreshold){ // Touch pad 2
|
||||
keypad[2] = 1;
|
||||
}
|
||||
else{
|
||||
keypad[2] = 0;
|
||||
}
|
||||
if(touchRead(12) > touchthreshold){ // Touch pad 3
|
||||
keypad[3] = 1;
|
||||
}
|
||||
else{
|
||||
keypad[3] = 0;
|
||||
}
|
||||
if(touchRead(11) > touchthreshold){ // Touch pad 4
|
||||
keypad[4] = 1;
|
||||
}
|
||||
else{
|
||||
keypad[4] = 0;
|
||||
}
|
||||
if(touchRead(10) > touchthreshold){ // Touch pad 5
|
||||
keypad[5] = 1;
|
||||
}
|
||||
else{
|
||||
keypad[5] = 0;
|
||||
}
|
||||
if(touchRead(9) > touchthreshold){ // Touch pad 6
|
||||
keypad[6] = 1;
|
||||
}
|
||||
else{
|
||||
keypad[6] = 0;
|
||||
}
|
||||
// Nothing touched
|
||||
if(keypad[1] == 0 && keypad[2] == 0 && keypad[3] == 0 && keypad[4] == 0 && keypad[5] == 0 && keypad[6] == 0){
|
||||
keypad[0] = 1;
|
||||
}
|
||||
else{
|
||||
keypad[0] = 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; i++) {
|
||||
if(i > 0){
|
||||
// Convert keypad to keycode
|
||||
if(keypad[i] == 1){
|
||||
key = 1;
|
||||
}
|
||||
else{
|
||||
key = 0;
|
||||
}
|
||||
keycode += key * i;
|
||||
}
|
||||
}
|
||||
|
||||
// Detect short keynumber
|
||||
if (keycode > 0 ){
|
||||
if(keylock == false){
|
||||
starttime = millis();
|
||||
keylock = true;
|
||||
// Read key code
|
||||
if(touchRead(14) > touchthreshold){ // Touch pad 1
|
||||
keypad[1] = 1;
|
||||
}
|
||||
if (keycode != keycodeold){
|
||||
keylock = false;
|
||||
else{
|
||||
keypad[1] = 0;
|
||||
}
|
||||
// Detect a very short keynumber (10ms)
|
||||
if (millis() > starttime + 10 && keycode == keycodeold && keylock == true) {
|
||||
// Process only valid keys
|
||||
if(keycode == 1 || keycode == 6){
|
||||
keycode2 = keycode;
|
||||
if(touchRead(13) > touchthreshold){ // Touch pad 2
|
||||
keypad[2] = 1;
|
||||
}
|
||||
else{
|
||||
keypad[2] = 0;
|
||||
}
|
||||
if(touchRead(12) > touchthreshold){ // Touch pad 3
|
||||
keypad[3] = 1;
|
||||
}
|
||||
else{
|
||||
keypad[3] = 0;
|
||||
}
|
||||
if(touchRead(11) > touchthreshold){ // Touch pad 4
|
||||
keypad[4] = 1;
|
||||
}
|
||||
else{
|
||||
keypad[4] = 0;
|
||||
}
|
||||
if(touchRead(10) > touchthreshold){ // Touch pad 5
|
||||
keypad[5] = 1;
|
||||
}
|
||||
else{
|
||||
keypad[5] = 0;
|
||||
}
|
||||
if(touchRead(9) > touchthreshold){ // Touch pad 6
|
||||
keypad[6] = 1;
|
||||
}
|
||||
else{
|
||||
keypad[6] = 0;
|
||||
}
|
||||
// Nothing touched
|
||||
if(keypad[1] == 0 && keypad[2] == 0 && keypad[3] == 0 && keypad[4] == 0 && keypad[5] == 0 && keypad[6] == 0){
|
||||
keypad[0] = 1;
|
||||
}
|
||||
else{
|
||||
keypad[0] = 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; i++) {
|
||||
if(i > 0){
|
||||
// Convert keypad to keycode
|
||||
if(keypad[i] == 1){
|
||||
key = 1;
|
||||
}
|
||||
else{
|
||||
key = 0;
|
||||
}
|
||||
keycode += key * i;
|
||||
}
|
||||
}
|
||||
|
||||
// Detect short keynumber
|
||||
if (keycode > 0 ){
|
||||
if(keylock == false){
|
||||
starttime = millis();
|
||||
keylock = true;
|
||||
}
|
||||
// Clear by unvalid keys
|
||||
else{
|
||||
if (keycode != keycodeold){
|
||||
keylock = false;
|
||||
}
|
||||
// Detect a very short keynumber (10ms)
|
||||
if (millis() > starttime + 10 && keycode == keycodeold && keylock == true) {
|
||||
// Process only valid keys
|
||||
if(keycode == 1 || keycode == 6){
|
||||
keycode2 = keycode;
|
||||
}
|
||||
// Clear by unvalid keys
|
||||
else{
|
||||
keycode2 = 0;
|
||||
keycodeold2 = 0;
|
||||
}
|
||||
}
|
||||
// Timeout for very short pressed key
|
||||
if(millis() > starttime + 200){
|
||||
keycode2 = 0;
|
||||
}
|
||||
// Detect a short keynumber (200ms)
|
||||
if (keyoff == false && millis() > starttime + 200 && keycode == keycodeold && keylock == true) {
|
||||
keystatus = keycode;
|
||||
keycode = 0;
|
||||
keycodeold = 0;
|
||||
keycode2 = 0;
|
||||
keycodeold2 = 0;
|
||||
buzzer(TONE4, 100);
|
||||
keylock = false;
|
||||
delay(keydelay);
|
||||
}
|
||||
}
|
||||
// Timeout for very short pressed key
|
||||
if(millis() > starttime + 200){
|
||||
keycode2 = 0;
|
||||
}
|
||||
// Detect a short keynumber (200ms)
|
||||
if (keyoff == false && millis() > starttime + 200 && keycode == keycodeold && keylock == true) {
|
||||
keystatus = keycode;
|
||||
|
||||
// Key lock with key 1 and 6 or 6 and 1 in fast series
|
||||
if((keycode2 == 1 && keycodeold2 == 6) || (keycode2 == 6 && keycodeold2 == 1)) {
|
||||
keycode = 0;
|
||||
keycodeold = 0;
|
||||
keycode2 = 0;
|
||||
keycodeold2 = 0;
|
||||
buzzer(TONE4, 100);
|
||||
buzzer(TONE4, 1000);
|
||||
keylock = false;
|
||||
delay(keydelay);
|
||||
keyoff = !keyoff;
|
||||
keystatus = 11;
|
||||
}
|
||||
|
||||
// Detect swipe right
|
||||
if (keyoff == false && keycode > 0 && keycodeold > 0 && keycode > keycodeold && !((keycode == 1 && keycodeold == 6) || (keycode == 6 && keycodeold == 1))){
|
||||
//if (keycode > 0 && keycodeold > 0 && keycode > keycodeold){
|
||||
keycode = 0;
|
||||
keycodeold = 0;
|
||||
keycode2 = 0;
|
||||
keycodeold2 = 0;
|
||||
keystatus = 9;
|
||||
buzzer(TONE3, 150);
|
||||
buzzer(TONE4, 150);
|
||||
}
|
||||
|
||||
// Detect swipe left
|
||||
if (keyoff == false && keycode > 0 && keycodeold > 0 && keycode < keycodeold && !((keycode == 1 && keycodeold == 6) || (keycode == 6 && keycodeold == 1))){
|
||||
//if (keycode > 0 && keycodeold > 0 && keycode < keycodeold){
|
||||
keycode = 0;
|
||||
keycodeold = 0;
|
||||
keycode2 = 0;
|
||||
keycodeold2 = 0;
|
||||
keystatus = 10;
|
||||
buzzer(TONE4, 150);
|
||||
buzzer(TONE3, 150);
|
||||
}
|
||||
|
||||
// Reset keylock after release
|
||||
if (keycode == 0){
|
||||
keylock = false;
|
||||
}
|
||||
|
||||
// Copy keycode
|
||||
keycodeold = keycode;
|
||||
keycodeold2 = keycode2;
|
||||
|
||||
return keystatus;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Key lock with key 1 and 6 or 6 and 1 in fast series
|
||||
if((keycode2 == 1 && keycodeold2 == 6) || (keycode2 == 6 && keycodeold2 == 1)) {
|
||||
keycode = 0;
|
||||
keycodeold = 0;
|
||||
keycode2 = 0;
|
||||
keycodeold2 = 0;
|
||||
buzzer(TONE4, 1000);
|
||||
keylock = false;
|
||||
delay(keydelay);
|
||||
keyoff = !keyoff;
|
||||
keystatus = 11;
|
||||
#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;
|
||||
}
|
||||
|
||||
// Detect swipe right
|
||||
if (keyoff == false && keycode > 0 && keycodeold > 0 && keycode > keycodeold && !((keycode == 1 && keycodeold == 6) || (keycode == 6 && keycodeold == 1))){
|
||||
//if (keycode > 0 && keycodeold > 0 && keycode > keycodeold){
|
||||
keycode = 0;
|
||||
keycodeold = 0;
|
||||
keycode2 = 0;
|
||||
keycodeold2 = 0;
|
||||
keystatus = 9;
|
||||
buzzer(TONE3, 150);
|
||||
buzzer(TONE4, 150);
|
||||
}
|
||||
|
||||
// Detect swipe left
|
||||
if (keyoff == false && keycode > 0 && keycodeold > 0 && keycode < keycodeold && !((keycode == 1 && keycodeold == 6) || (keycode == 6 && keycodeold == 1))){
|
||||
//if (keycode > 0 && keycodeold > 0 && keycode < keycodeold){
|
||||
keycode = 0;
|
||||
keycodeold = 0;
|
||||
keycode2 = 0;
|
||||
keycodeold2 = 0;
|
||||
keystatus = 10;
|
||||
buzzer(TONE4, 150);
|
||||
buzzer(TONE3, 150);
|
||||
}
|
||||
|
||||
// Reset keylock after release
|
||||
if (keycode == 0){
|
||||
keylock = false;
|
||||
}
|
||||
|
||||
// Copy keycode
|
||||
keycodeold = keycode;
|
||||
keycodeold2 = keycode2;
|
||||
|
||||
return keystatus;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -50,9 +50,11 @@ void OBP60Init(GwApi *api){
|
|||
api->getLogger()->logDebug(GwLog::DEBUG,"Power Mode is: %s", powermode.c_str());
|
||||
if(powermode == "Max Power" || powermode == "Only 5.0V"){
|
||||
setPortPin(OBP_POWER_50, true); // Power on 5.0V rail
|
||||
setPortPin(OBP_POWER_EPD, true);// Power on ePaper display
|
||||
}
|
||||
else{
|
||||
setPortPin(OBP_POWER_50, false); // Power off 5.0V rail
|
||||
setPortPin(OBP_POWER_EPD, false);// Power off ePaper display
|
||||
}
|
||||
|
||||
// Settings for e-paper display
|
||||
|
|
|
@ -3,15 +3,28 @@
|
|||
//we only compile for some boards
|
||||
#ifdef BOARD_OBP60S3
|
||||
#define USBSerial Serial
|
||||
// CAN NMEA2000
|
||||
#define ESP32_CAN_TX_PIN 46
|
||||
#define ESP32_CAN_RX_PIN 3
|
||||
// Bus load in 50mA steps
|
||||
#define N2K_LOAD_LEVEL 5 // 5x50mA = 250mA max bus load with back light on
|
||||
// RS485 NMEA0183
|
||||
#define GWSERIAL_TX 17
|
||||
#define GWSERIAL_RX 8
|
||||
#define GWSERIAL_MODE "UNI"
|
||||
#ifdef HARDWARE_V21
|
||||
// CAN NMEA2000
|
||||
#define ESP32_CAN_TX_PIN 46
|
||||
#define ESP32_CAN_RX_PIN 3
|
||||
// Bus load in 50mA steps
|
||||
#define N2K_LOAD_LEVEL 5 // 5x50mA = 250mA max bus load with back light on
|
||||
// RS485 NMEA0183
|
||||
#define GWSERIAL_TX 17
|
||||
#define GWSERIAL_RX 8
|
||||
#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
|
||||
#define FORCE_AP_PWCHANGE
|
||||
|
||||
|
|
|
@ -9,9 +9,10 @@ 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_build.partitions = default_8MB.csv #ESP32-S3 N8, 8MB flash
|
||||
board_build.partitions = default_16MB.csv #ESP32-S3 N16, 16MB flash
|
||||
#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}
|
||||
|
@ -44,15 +45,17 @@ build_flags=
|
|||
# -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 #Hardware revision V2.0
|
||||
-D HARDWARE_V21 #Hardware revision V2.1
|
||||
# -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
|
||||
#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