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

Add support to M5 ATOMIC PortABC Extension Base #63

Closed
wants to merge 4 commits into from
Closed
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
39 changes: 39 additions & 0 deletions lib/hardware/GwHardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,45 @@
#define GWLED_BRIGHTNESS 64
#endif

//ATOM with PortABC
#ifdef BOARD_M5ATOM_PORT_ABC
#define M5_CANUNIT
#define M5_PORT_ABC
#define GWLED_BRIGHTNESS 64
#define PORT_A_PIN_1 GPIO_NUM_21
#define PORT_A_PIN_2 GPIO_NUM_25
#define PORT_B_PIN_1 GPIO_NUM_23
#define PORT_B_PIN_2 GPIO_NUM_33
#define PORT_C_PIN_1 GPIO_NUM_22
#define PORT_C_PIN_2 GPIO_NUM_19
#endif

//ATOMS3 with PortABC
#ifdef BOARD_M5ATOMS3_PORT_ABC
#define M5_CANUNIT
#define M5_PORT_ABC
#define GWLED_BRIGHTNESS 64
#define PORT_A_PIN_1 GPIO_NUM_39
#define PORT_A_PIN_2 GPIO_NUM_38
#define PORT_B_PIN_1 GPIO_NUM_7
#define PORT_B_PIN_2 GPIO_NUM_8
#define PORT_C_PIN_1 GPIO_NUM_5
#define PORT_C_PIN_2 GPIO_NUM_6
#endif

#ifdef M5_PORT_ABC
//PortA (i2c)
#define GWIIC_SCL PORT_A_PIN_1
#define GWIIC_SDA PORT_A_PIN_2
//PortB (Serial 1)
#define GWSERIAL_TX PORT_B_PIN_1
#define GWSERIAL_RX PORT_B_PIN_2
#define GWSERIAL_TYPE GWSERIAL_TYPE_BI
//PortC (Serial 2)
#define GWSERIAL2_TX PORT_C_PIN_1
#define GWSERIAL2_RX PORT_C_PIN_2
#define GWSERIAL2_TYPE GWSERIAL_TYPE_BI
#endif

#ifdef BOARD_M5ATOM_RS232_CANUNIT
#define M5_CANUNIT
Expand Down
2 changes: 1 addition & 1 deletion lib/iictask/GwIicTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void initIicTask(GwApi *api){
if ((*it)->preinit(api)) addTask=true;
}
if (addTask){
api->addUserTask(runIicTask,"iicTask",3000);
api->addUserTask(runIicTask,"iicTask",4000);
}
#endif
}
Expand Down
27 changes: 27 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,33 @@ build_flags =
upload_port = /dev/esp32s3
upload_protocol = esptool

[env:m5stack-atoms3-portabc]
board = m5stack-atoms3
extends = sensors
lib_deps =
${env.lib_deps}
${sensors.lib_deps}
build_flags =
-D BOARD_M5ATOMS3_PORT_ABC
-D GWSHT3X11
-D GWQMP698811
${env.build_flags}
upload_port = /dev/esp32s3
upload_protocol = esptool

[env:m5stack-atom-portabc]
board = m5stack-atom
extends = sensors
lib_deps =
${env.lib_deps}
${sensors.lib_deps}
build_flags =
-D BOARD_M5ATOM_PORT_ABC
-D GWSHT3X11
-D GWQMP698811
${env.build_flags}
upload_port = /dev/esp32
upload_protocol = esptool

[env:m5stack-atom-rs232-canunit]
board = m5stack-atom
Expand Down