Skip to content

Commit

Permalink
Merge pull request #53 from free-x/twai
Browse files Browse the repository at this point in the history
Add AtomS3 Lite to ENV
  • Loading branch information
wellenvogel authored Aug 30, 2023
2 parents 3c9670b + 9178499 commit 882bc55
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
steps:
Expand Down
7 changes: 7 additions & 0 deletions doc/Hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ Can be used e.g. as an NMEA2000 Adapter for a laptop running e.g. OpenCPN with t
![OpenCPN on Laptop via USB and MFD on Android via WiFi](in_action1.jpg)
![OpenCPN on Laptop via USB and AvNav on Android via WiFi](in_action2.jpg)

M5 Stack AtomS3Lite Canunit (experimental since dev20230826)
---------------------
* Hardware: [M5_ATOMS3 Lite](http://docs.m5stack.com/en/core/AtomS3%20Lite) + [CAN Unit](http://docs.m5stack.com/en/unit/can)
* Prebuild Binary: m5stack-atoms3-canunit-all.bin
* Build Define: BOARD_M5ATOMS3_CANUNIT
* Power: Via USB

M5 Stick C Canunit
------------------
* Hardware: [M5_StickC+](http://docs.m5stack.com/en/core/m5stickc_plus) + [CAN Unit](http://docs.m5stack.com/en/unit/can)
Expand Down
20 changes: 20 additions & 0 deletions lib/hardware/GwHardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
//brightness 0...255
#define GWLED_BRIGHTNESS 64
#endif

#ifdef BOARD_M5ATOM_CANUNIT
#define ESP32_CAN_TX_PIN GPIO_NUM_26
#define ESP32_CAN_RX_PIN GPIO_NUM_32
Expand All @@ -58,6 +59,25 @@
#define GWLED_BRIGHTNESS 64
#endif

#ifdef BOARD_M5ATOMS3_CANUNIT
#define ESP32_CAN_TX_PIN GPIO_NUM_2
#define ESP32_CAN_RX_PIN GPIO_NUM_1
#define GWBUTTON_PIN GPIO_NUM_41
#define GWBUTTON_ACTIVE LOW
//if GWBUTTON_PULLUPDOWN we enable a pulup/pulldown
#define GWBUTTON_PULLUPDOWN
//led handling
//if we define GWLED_FASTNET the arduino fastnet lib is used
#define GWLED_FASTLED
#define GWLED_TYPE WS2812
//color schema for fastled
#define GWLED_SCHEMA GRB
#define GWLED_PIN GPIO_NUM_35
//brightness 0...255
#define GWLED_BRIGHTNESS 64
#endif


#ifdef BOARD_M5ATOM_RS232_CANUNIT
#define ESP32_CAN_TX_PIN GPIO_NUM_26
#define ESP32_CAN_RX_PIN GPIO_NUM_32
Expand Down
13 changes: 12 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ lib_deps =
ttlappalainen/NMEA0183 @ 1.7.1
ArduinoJson @ 6.18.5
ottowinter/[email protected]
fastled/FastLED @ 3.4.0
#fastled/FastLED @ 3.4.0
fastled/FastLED @ 3.6.0
board_build.embed_files =
lib/generated/index.html.gz
lib/generated/index.js.gz
Expand Down Expand Up @@ -62,6 +63,16 @@ build_flags =
upload_port = /dev/esp32
upload_protocol = esptool

[env:m5stack-atoms3-canunit]
board = m5stack-atoms3
lib_deps = ${env.lib_deps}
build_flags =
-D BOARD_M5ATOMS3_CANUNIT
${env.build_flags}
upload_port = /dev/esp32s3
upload_protocol = esptool


[env:m5stack-atom-rs232-canunit]
board = m5stack-atom
lib_deps = ${env.lib_deps}
Expand Down
2 changes: 2 additions & 0 deletions tools/99-usb-serial.rules
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="esp32"
SUBSYSTEM=="tty", ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", SYMLINK+="esp32s3"

0 comments on commit 882bc55

Please sign in to comment.