Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp32 impl #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions esp32/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
web/node_modules
web/build
data
10 changes: 10 additions & 0 deletions esp32/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
11 changes: 11 additions & 0 deletions esp32/extra_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Import("env")
import os

def before_build_spiffs(source, target, env):
print("Removing old SPIFFS image...")
env.Execute("rm -rf data")

print("Copying web app to SPIFFS...")
env.Execute("cp -pr web data")

env.AddPreAction("$BUILD_DIR/spiffs.bin", before_build_spiffs)
37 changes: 37 additions & 0 deletions esp32/include/vdisp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#ifndef _VDISP_H
#define _VDISP_H
#include <Arduino.h>

#define LCD_ADDRESS 0x27
#define LCD_LENGTH 80
#define DDRAM 0
#define CGRAM 1
#define PUBLISH_THRESHOLD 100

extern bool dirty;
extern unsigned long cleanTime;
extern bool published;

extern char ddram[LCD_LENGTH];
extern bool ramIndex;
extern uint8_t currentAddress;
extern bool entryModeIncrement;
extern bool entryModeShift;
extern bool nibbleIndex;
extern uint8_t loNibble;
extern uint8_t hiNibble;

void onReceive(int);
void handleCommand(bool, bool, uint8_t);
void clearDisplay();
void cursorHome();
void setEntryMode(bool, bool);
void setOnOff(bool, bool, bool);
void setShift(bool, bool);
void setFunction(bool, bool, bool);
void setCGAddress(uint8_t);
void setDDAddress(uint8_t);
void writeData(char);


#endif
27 changes: 27 additions & 0 deletions esp32/platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:az-delivery-devkit-v4]
platform = espressif32
board = az-delivery-devkit-v4
framework = arduino
monitor_speed = 115200
upload_speed = 921600
build_flags = -DVDISP -DEDISP -DOTA_USER=\"ota\" -DOTA_PASSWORD=\"${sysenv.OTA_PASSWORD:ota}\"
lib_deps =
SPIFFS
bblanchon/ArduinoJson@^6.21.0
Wire
https://github.com/tzapu/WiFiManager.git
https://github.com/me-no-dev/ESPAsyncWebServer.git
https://github.com/IPdotSetAF/ESPAsyncHTTPUpdateServer
https://github.com/adafruit/Adafruit_SSD1306.git
https://github.com/adafruit/Adafruit-GFX-Library.git
extra_scripts = extra_script.py
Loading