mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-28 04:07:47 +00:00
[ESP32P4] Add extra HW serial ports supported by ESP32P4
This commit is contained in:
@@ -17,6 +17,15 @@ const __FlashStringHelper* ESPEasySerialPort_toString(ESPEasySerialPort port, bo
|
||||
#if USABLE_SOC_UART_NUM > 2
|
||||
case ESPEasySerialPort::serial2: return shortName ? F("serial2") : F("HW Serial2");
|
||||
#endif // if USABLE_SOC_UART_NUM > 2
|
||||
#if USABLE_SOC_UART_NUM > 3
|
||||
case ESPEasySerialPort::serial3: return shortName ? F("serial3") : F("HW Serial3");
|
||||
#endif
|
||||
#if USABLE_SOC_UART_NUM > 4
|
||||
case ESPEasySerialPort::serial4: return shortName ? F("serial4") : F("HW Serial4");
|
||||
#endif
|
||||
#if USABLE_SOC_UART_NUM > 5
|
||||
case ESPEasySerialPort::serial5: return shortName ? F("serial5") : F("HW Serial5");
|
||||
#endif
|
||||
#if USES_SW_SERIAL
|
||||
case ESPEasySerialPort::software: return shortName ? F("serialsw") : F("SW Serial");
|
||||
#endif // if USES_SW_SERIAL
|
||||
@@ -49,6 +58,15 @@ bool isHWserial(ESPEasySerialPort port)
|
||||
#if USABLE_SOC_UART_NUM > 2
|
||||
case ESPEasySerialPort::serial2:
|
||||
#endif // if USABLE_SOC_UART_NUM > 2
|
||||
#if USABLE_SOC_UART_NUM > 3
|
||||
case ESPEasySerialPort::serial3:
|
||||
#endif
|
||||
#if USABLE_SOC_UART_NUM > 4
|
||||
case ESPEasySerialPort::serial4:
|
||||
#endif
|
||||
#if USABLE_SOC_UART_NUM > 5
|
||||
case ESPEasySerialPort::serial5:
|
||||
#endif
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
@@ -69,6 +87,15 @@ bool useGPIOpins(ESPEasySerialPort port)
|
||||
#if USABLE_SOC_UART_NUM > 2
|
||||
case ESPEasySerialPort::serial2:
|
||||
#endif // if USABLE_SOC_UART_NUM > 2
|
||||
#if USABLE_SOC_UART_NUM > 3
|
||||
case ESPEasySerialPort::serial3:
|
||||
#endif
|
||||
#if USABLE_SOC_UART_NUM > 4
|
||||
case ESPEasySerialPort::serial4:
|
||||
#endif
|
||||
#if USABLE_SOC_UART_NUM > 5
|
||||
case ESPEasySerialPort::serial5:
|
||||
#endif
|
||||
#if USES_SW_SERIAL
|
||||
case ESPEasySerialPort::software:
|
||||
#endif // if USES_SW_SERIAL
|
||||
@@ -96,6 +123,15 @@ bool validSerialPort(ESPEasySerialPort port)
|
||||
#if USABLE_SOC_UART_NUM > 2
|
||||
case ESPEasySerialPort::serial2:
|
||||
#endif // if USABLE_SOC_UART_NUM > 2
|
||||
#if USABLE_SOC_UART_NUM > 3
|
||||
case ESPEasySerialPort::serial3:
|
||||
#endif
|
||||
#if USABLE_SOC_UART_NUM > 4
|
||||
case ESPEasySerialPort::serial4:
|
||||
#endif
|
||||
#if USABLE_SOC_UART_NUM > 5
|
||||
case ESPEasySerialPort::serial5:
|
||||
#endif
|
||||
#if USES_SW_SERIAL
|
||||
case ESPEasySerialPort::software:
|
||||
#endif // if USES_SW_SERIAL
|
||||
|
||||
@@ -20,6 +20,16 @@ enum class ESPEasySerialPort : uint8_t {
|
||||
#if USABLE_SOC_UART_NUM > 2
|
||||
serial2 = 5,
|
||||
#endif // if USABLE_SOC_UART_NUM > 2
|
||||
#if USABLE_SOC_UART_NUM > 3
|
||||
serial3 = 10,
|
||||
#endif
|
||||
#if USABLE_SOC_UART_NUM > 4
|
||||
serial4 = 11,
|
||||
#endif
|
||||
#if USABLE_SOC_UART_NUM > 5
|
||||
serial5 = 12,
|
||||
#endif
|
||||
|
||||
#if USES_SW_SERIAL
|
||||
software = 6,
|
||||
#endif // if USES_SW_SERIAL
|
||||
|
||||
@@ -16,6 +16,15 @@ bool ESPeasySerialType::getSerialTypePins(ESPEasySerialPort serType, int& rxPin,
|
||||
# if USABLE_SOC_UART_NUM > 2
|
||||
case ESPEasySerialPort::serial2: rxPin = SOC_RX2; txPin = SOC_TX2; return true;
|
||||
# endif // if USABLE_SOC_UART_NUM > 2
|
||||
# if USABLE_SOC_UART_NUM > 3
|
||||
case ESPEasySerialPort::serial3: return true;
|
||||
# endif
|
||||
# if USABLE_SOC_UART_NUM > 4
|
||||
case ESPEasySerialPort::serial4: return true;
|
||||
# endif
|
||||
# if USABLE_SOC_UART_NUM > 5
|
||||
case ESPEasySerialPort::serial5: return true;
|
||||
# endif
|
||||
# if USES_I2C_SC16IS752
|
||||
case ESPEasySerialPort::sc16is752: return true;
|
||||
# endif // if USES_I2C_SC16IS752
|
||||
|
||||
@@ -40,6 +40,16 @@ void Port_ESPEasySerial_HardwareSerial_t::resetConfig(const ESPEasySerialConfig&
|
||||
#if USABLE_SOC_UART_NUM > 2
|
||||
case ESPEasySerialPort::serial2:
|
||||
#endif // if USABLE_SOC_UART_NUM > 2
|
||||
#if USABLE_SOC_UART_NUM > 3
|
||||
case ESPEasySerialPort::serial3:
|
||||
#endif
|
||||
#if USABLE_SOC_UART_NUM > 4
|
||||
case ESPEasySerialPort::serial4:
|
||||
#endif
|
||||
#if USABLE_SOC_UART_NUM > 5
|
||||
case ESPEasySerialPort::serial5:
|
||||
#endif
|
||||
|
||||
_config.port = config.port;
|
||||
break;
|
||||
default:
|
||||
@@ -64,6 +74,18 @@ void Port_ESPEasySerial_HardwareSerial_t::resetConfig(const ESPEasySerialConfig&
|
||||
} else if (_config.port == ESPEasySerialPort::serial2) {
|
||||
_serial = &Serial2;
|
||||
#endif // if USABLE_SOC_UART_NUM > 2
|
||||
#if USABLE_SOC_UART_NUM > 3
|
||||
} else if (_config.port == ESPEasySerialPort::serial3) {
|
||||
_serial = &Serial3;
|
||||
#endif
|
||||
#if USABLE_SOC_UART_NUM > 4
|
||||
} else if (_config.port == ESPEasySerialPort::serial4) {
|
||||
_serial = &Serial4;
|
||||
#endif
|
||||
#if USABLE_SOC_UART_NUM > 5
|
||||
} else if (_config.port == ESPEasySerialPort::serial5) {
|
||||
_serial = &Serial5;
|
||||
#endif
|
||||
} else {
|
||||
_config.port = ESPEasySerialPort::not_set;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <ESPEasySerialType.h>
|
||||
|
||||
|
||||
String serialHelper_getSerialTypeLabel(ESPEasySerialPort serType, bool shortName) {
|
||||
const __FlashStringHelper* serialHelper_getSerialTypeLabel(ESPEasySerialPort serType, bool shortName) {
|
||||
return ESPEasySerialPort_toString(serType, shortName);
|
||||
}
|
||||
|
||||
@@ -227,6 +227,18 @@ void serialHelper_webformLoad(ESPEasySerialPort port, int rxPinDef, int txPinDef
|
||||
//" document.querySelector('#taskdevicepin2').value =" STRINGIFY(SOC_TX2) ";"
|
||||
" style = '';"
|
||||
#endif
|
||||
# if USABLE_SOC_UART_NUM > 3
|
||||
" } else if (elem.value == 10) {"
|
||||
" style = '';"
|
||||
#endif
|
||||
# if USABLE_SOC_UART_NUM > 4
|
||||
" } else if (elem.value == 11) {"
|
||||
" style = '';"
|
||||
#endif
|
||||
# if USABLE_SOC_UART_NUM > 5
|
||||
" } else if (elem.value == 12) {"
|
||||
" style = '';"
|
||||
#endif
|
||||
#if USES_SW_SERIAL
|
||||
" } else if (elem.value == 6) {"
|
||||
" style = '';"
|
||||
@@ -256,6 +268,15 @@ void serialHelper_webformLoad(ESPEasySerialPort port, int rxPinDef, int txPinDef
|
||||
#if USABLE_SOC_UART_NUM > 2
|
||||
,static_cast<int>(ESPEasySerialPort::serial2)
|
||||
#endif // if USABLE_SOC_UART_NUM > 2
|
||||
#if USABLE_SOC_UART_NUM > 3
|
||||
,static_cast<int>(ESPEasySerialPort::serial3)
|
||||
#endif
|
||||
#if USABLE_SOC_UART_NUM > 4
|
||||
,static_cast<int>(ESPEasySerialPort::serial4)
|
||||
#endif
|
||||
#if USABLE_SOC_UART_NUM > 5
|
||||
,static_cast<int>(ESPEasySerialPort::serial5)
|
||||
#endif
|
||||
#if USES_SW_SERIAL
|
||||
,static_cast<int>(ESPEasySerialPort::software)
|
||||
#endif // if USES_SW_SERIAL
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
struct ESPeasySerialType;
|
||||
|
||||
String serialHelper_getSerialTypeLabel(ESPEasySerialPort serType,
|
||||
const __FlashStringHelper* serialHelper_getSerialTypeLabel(ESPEasySerialPort serType,
|
||||
bool shortName = false);
|
||||
|
||||
void serialHelper_log_GpioDescription(ESPEasySerialPort typeHint,
|
||||
|
||||
Reference in New Issue
Block a user