Skip to content

Commit

Permalink
Made usage of second UART/serial port more flexible for those boards …
Browse files Browse the repository at this point in the history
…that has support for it.
  • Loading branch information
terjeio committed Jan 29, 2024
1 parent f68b3e3 commit 94e1733
Show file tree
Hide file tree
Showing 19 changed files with 172 additions and 146 deletions.
29 changes: 15 additions & 14 deletions driver.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,21 @@
"pwm_spindle_aux": 2
}
},
{
"name": "MKS DLC32 2.0",
"symbol": "BOARD_MKS_DLC32_V2P0",
"URL": "https://github.com/makerbase-mks/MKS-DLC32",
"MAP": "main/boards/mks_dlc32_2_0_map.h",
"caps": {
"axes": 3,
"digital_in": 1,
"digital_out": 4,
"safety_door": 0,
"pwm_spindle_aux": 2,
"sdcard": 1,
"i2c": 0
}
},
{
"name": "MKS Tinybee V1.0",
"symbol": "BOARD_MKS_TINYBEE_V1",
Expand Down Expand Up @@ -164,20 +179,6 @@
"trinamic_spi_chain": 1
}
},
{
"name": "MKS DLC32 2.0",
"symbol": "BOARD_MKS_DLC32_V2P0",
"URL": "https://github.com/makerbase-mks/MKS-DLC32",
"MAP": "main/boards/mks_dlc32_2_0_map.h",
"caps": {
"axes": 3,
"digital_in": 1,
"digital_out": 4,
"pwm_spindle_aux": 2,
"sdcard": 1,
"i2c": 1
}
},
{
"name": "Root CNC v2.x",
"notes": "Not tested!",
Expand Down
20 changes: 8 additions & 12 deletions main/boards/BlackBoxX32_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
#error "Axis configuration is not supported!"
#endif

#if KEYPAD_ENABLE == 1
#error No free pins for I2C keypad!
#endif

#if TRINAMIC_ENABLE
#error BlackBox X32 does not use Trinamic drivers
#endif

#define BOARD_NAME "BlackBox X32"
#define BOARD_URL "https://docs.openbuilds.com/doku.php?id=docs:blackbox-x32:start"
#if N_AUTO_SQUARED || N_AXIS > 3
Expand Down Expand Up @@ -121,15 +129,3 @@
// #if SDCARD_ENABLE
#define PIN_NUM_CS GPIO_NUM_5
// #endif

#if MODBUS_ENABLE & MODBUS_RTU_ENABLED
#error BlackBox X32 does not support Modbus
#endif

#if KEYPAD_ENABLE
#error BlackBox X32 does not support Keypad
#endif

#if TRINAMIC_ENABLE
#error BlackBox X32 does not use Trinamic drivers
#endif
9 changes: 5 additions & 4 deletions main/boards/bdring_i2s_6_axis_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@

#define BOARD_NAME "BDRING 6-axis I2S"

#if KEYPAD_ENABLE == 1
#error No free pins for I2C keypad!
#endif

#define USE_I2S_OUT
#define I2S_OUT_PIN_BASE 64

Expand Down Expand Up @@ -121,7 +125,7 @@
#define MOTOR_CS_PIN I2SO(3)
#endif

#if MODBUS_ENABLE & MODBUS_RTU_ENABLED
#ifdef ADD_SERIAL2
#define UART2_RX_PIN GPIO_NUM_15
#define UART2_TX_PIN GPIO_NUM_14
#if MODBUS_ENABLE & MODBUS_RTU_DIR_ENABLED
Expand All @@ -134,6 +138,3 @@
#define PROBE_PIN GPIO_NUM_25
#endif

#if KEYPAD_ENABLE
#error No free pins for keypad!
#endif
2 changes: 1 addition & 1 deletion main/boards/bdring_i2s_6pack_ext_v2_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@

// N/A

#if MODBUS_ENABLE & MODBUS_RTU_ENABLED
#ifdef ADD_SERIAL2
#define UART2_RX_PIN GPIO_NUM_15
#define UART2_TX_PIN GPIO_NUM_14
#if MODBUS_ENABLE & MODBUS_RTU_DIR_ENABLED
Expand Down
9 changes: 5 additions & 4 deletions main/boards/bdring_v4_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#error "Axis configuration is not supported!"
#endif

#if KEYPAD_ENABLE == 1
#error No free pins for I2C keypad!
#endif

#define BOARD_NAME "BDRING v4"

// timer definitions
Expand Down Expand Up @@ -91,14 +95,11 @@
#define PIN_NUM_CS GPIO_NUM_5
#endif

#if MODBUS_ENABLE & MODBUS_RTU_ENABLED
#ifdef ADD_SERIAL2
#define UART2_RX_PIN GPIO_NUM_22
#define UART2_TX_PIN GPIO_NUM_21
#if MODBUS_ENABLE & MODBUS_RTU_DIR_ENABLED
#define MODBUS_DIRECTION_PIN GPIO_NUM_2
#endif
#endif

#if KEYPAD_ENABLE
#error No free pins for keypad!
#endif
24 changes: 11 additions & 13 deletions main/boards/cnc3040_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,24 @@
#error "Axis configuration is not supported!"
#endif

#if KEYPAD_ENABLE == 1
#error No free pins for I2C keypad!
#endif

#if SDCARD_ENABLE
#error SD card not supported!
#endif

#define BOARD_NAME "CNC3040 4-axis CNC"
#define BOARD_URL "https://github.com/shaise/GrblCNC/tree/master/Hardware/GrblCnc3040"

// timer definitions
#define STEP_TIMER_GROUP TIMER_GROUP_0
#define STEP_TIMER_INDEX TIMER_0

#if MODBUS_ENABLE
#error VFD Spindle not supported!
#endif

#if KEYPAD_ENABLE == 2
#define UART2_TX_PIN GPIO_NUM_17
#define UART2_RX_PIN GPIO_NUM_16
#elif KEYPAD_ENABLE == 1
#error I2C Keypad not supported!
#endif

#if SDCARD_ENABLE
#error SD card not supported!
#ifdef ADD_SERIAL2
#define UART2_TX_PIN GPIO_NUM_17
#define UART2_RX_PIN GPIO_NUM_16
#endif

// Define step pulse output pins.
Expand Down
13 changes: 6 additions & 7 deletions main/boards/cnc_boosterpack_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,16 @@
#define AUXINPUT0_PIN GPIO_NUM_33
#endif

#if MODBUS_ENABLE & MODBUS_RTU_ENABLED
#ifdef ADD_SERIAL2
#define UART2_RX_PIN GPIO_NUM_33
#if MPG_MODE == 1
#define MPG_ENABLE_PIN GPIO_NUM_25
#else
#define UART2_TX_PIN GPIO_NUM_25
#if MODBUS_ENABLE & MODBUS_RTU_DIR_ENABLED
#define MODBUS_DIRECTION_PIN GPIO_NUM_25
#endif
#if MODBUS_ENABLE & MODBUS_RTU_DIR_ENABLED
#define MODBUS_DIRECTION_PIN GPIO_NUM_25 //??
#endif

#if MPG_MODE == 1
#define UART2_RX_PIN GPIO_NUM_33
#define MPG_ENABLE_PIN GPIO_NUM_25
#endif

// Define I2C port/pins
Expand Down
2 changes: 1 addition & 1 deletion main/boards/cnc_boosterpack_s3_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
#define AUXINPUT0_PIN GPIO_NUM_33
#endif

#if MODBUS_ENABLE & MODBUS_RTU_ENABLED
#ifdef ADD_SERIAL2
#define UART2_RX_PIN GPIO_NUM_33
#define UART2_TX_PIN GPIO_NUM_25
#if MODBUS_ENABLE & MODBUS_RTU_DIR_ENABLED
Expand Down
2 changes: 1 addition & 1 deletion main/boards/espduino-32_wemos_d1_r32_uno_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
#define PROBE_PIN GPIO_NUM_39
#endif

#if MODBUS_ENABLE & MODBUS_RTU_ENABLED
#ifdef ADD_SERIAL2
#define UART2_RX_PIN GPIO_NUM_33
#define UART2_TX_PIN GPIO_NUM_32
#if MODBUS_ENABLE & MODBUS_RTU_DIR_ENABLED
Expand Down
9 changes: 5 additions & 4 deletions main/boards/fysetc_e4_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#error "Fystec E4 board does not have support for VFD spindle."
#endif

#if KEYPAD_ENABLE
#error No free pins for I2C keypad!
#endif

#define BOARD_NAME "Fysetc E4 v1.0"

// timer definitions
Expand Down Expand Up @@ -89,6 +93,7 @@
#define CYCLE_START_PIN GPIO_NUM_39
#if SAFETY_DOOR_ENABLE
#if !I2C_ENABLE
#define AUXINPUT0_PIN GPIO_NUM_22
#define SAFETY_DOOR_PIN GPIO_NUM_22
#else
#warning No free pin for safety door input!
Expand All @@ -104,10 +109,6 @@
#endif
#endif

#if KEYPAD_ENABLE
#error No free pins for keypad!
#endif

#if I2C_ENABLE
// Define I2C port/pins
#define I2C_PORT I2C_NUM_1
Expand Down
Loading

0 comments on commit 94e1733

Please sign in to comment.