First branch for OBPP60 V2

This commit is contained in:
wt 2023-12-20 17:03:29 +01:00 committed by norbert-walter
parent b0e31ac284
commit 926a427f7f
6 changed files with 158 additions and 28 deletions

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"cmake.configureOnOpen": false
}

51
boards/obp60_s3.json Normal file
View File

@ -0,0 +1,51 @@
{
"build": {
"arduino":{
"ldscript": "esp32s3_out.ld",
"partitions": "default_8MB.csv"
},
"core": "esp32",
"extra_flags": [
"-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"
},
"connectivity": [
"wifi"
],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": [
"esp-builtin"
],
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "OBP60 ESP32-S3-N8 (8 MB QD, No PSRAM)",
"upload": {
"flash_size": "8MB",
"maximum_ram_size": 327680,
"maximum_size": 8388608,
"require_upload_port": true,
"speed": 460800
},
"url": "https://open-boat-projects.org/en/diy-multifunktionsdisplay-obp-60/",
"vendor": "Open Boat Projects"
}

View File

@ -1,5 +1,5 @@
// General hardware definitions // General hardware definitions
// CAN bus pin definitions see GwOBP60Task.h // CAN bus pin definitions see obp60task.h
// Direction pin for RS485 NMEA0183 // Direction pin for RS485 NMEA0183
#define OBP_DIRECTION_PIN 27 #define OBP_DIRECTION_PIN 27

View File

@ -1,7 +1,8 @@
#pragma once #pragma once
#include "GwApi.h" #include "GwApi.h"
//we only compile for some boards //we only compile for some boards
#ifdef BOARD_NODEMCU32S_OBP60 #ifdef BOARD_OBP60S3
#define USBSerial Serial
// CAN NMEA2000 // CAN NMEA2000
#define ESP32_CAN_TX_PIN GPIO_NUM_13 #define ESP32_CAN_TX_PIN GPIO_NUM_13
#define ESP32_CAN_RX_PIN GPIO_NUM_12 #define ESP32_CAN_RX_PIN GPIO_NUM_12
@ -22,5 +23,4 @@ DECLARE_INITFUNCTION(OBP60Init);
void OBP60Task(GwApi *param); void OBP60Task(GwApi *param);
DECLARE_USERTASK_PARAM(OBP60Task, 8000) // Need 8k RAM as stack size DECLARE_USERTASK_PARAM(OBP60Task, 8000) // Need 8k RAM as stack size
DECLARE_CAPABILITY(obp60,true); DECLARE_CAPABILITY(obp60,true);
#endif #endif

View File

@ -2,21 +2,24 @@
#if you want a pio run to only build #if you want a pio run to only build
#your special environments you can set this here #your special environments you can set this here
#by uncommenting the next line #by uncommenting the next line
default_envs = nodemcu32s_obp60 default_envs = obp60_s3
[env:nodemcu32s_obp60] [env:obp60_s3]
platform = espressif32@6.3.2 platform = espressif32@6.3.2
board_build.partitions = lib/obp60task/partitions_obp60.csv board = obp60_s3
board = nodemcu-32s board_build.variants_dir = variants
framework = arduino
lib_deps = lib_deps =
${env.lib_deps} ${env.lib_deps}
lib_deps = lib_deps =
Wire Wire
SPI SPI
fastled/FastLED@^3.6.0
robtillaart/PCF8574@^0.3.9
adafruit/Adafruit Unified Sensor @ 1.1.13 adafruit/Adafruit Unified Sensor @ 1.1.13
blemasle/MCP23017@2.0.0 blemasle/MCP23017@2.0.0
adafruit/Adafruit BusIO@1.5.0 adafruit/Adafruit BusIO@1.5.0
adafruit/Adafruit GFX Library@1.11.9 adafruit/Adafruit GFX Library@1.11.9
zinggjm/GxEPD@3.1.0 zinggjm/GxEPD@3.1.3
sstaub/Ticker@4.4.0 sstaub/Ticker@4.4.0
adafruit/Adafruit BMP280 Library@2.6.2 adafruit/Adafruit BMP280 Library@2.6.2
adafruit/Adafruit BME280 Library@2.2.2 adafruit/Adafruit BME280 Library@2.2.2
@ -25,8 +28,9 @@ lib_deps =
robtillaart/INA226@0.2.0 robtillaart/INA226@0.2.0
signetica/SunRise@2.0.2 signetica/SunRise@2.0.2
build_flags= build_flags=
-D BOARD_NODEMCU32S_OBP60 -DTIME=$UNIX_TIME
-D BOARD_OBP60S3
${env.build_flags} ${env.build_flags}
upload_port = //dev/ttyUSB0 upload_port = /dev/ttyACM0
upload_protocol = esptool upload_protocol = esptool
monitor_speed = 115200 monitor_speed = 115200

View File

@ -0,0 +1,72 @@
#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 = 47;
static const uint8_t SCL = 21;
static const uint8_t SS = 39;
static const uint8_t MOSI = 48;
static const uint8_t MISO = 11;
static const uint8_t SCK = 38;
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 */