mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-28 21:26:33 +00:00
Add command Gpio 255
Add command Gpio 255 to show physical GPIO configuration of all non-flash pins (#6407)
This commit is contained in:
parent
4b36a8dd73
commit
9add6f8d7d
@ -1,6 +1,7 @@
|
||||
/*********************************************************************************************\
|
||||
* 6.6.0.17 20191009
|
||||
* Add command SetOption34 0..255 to set backlog delay. Default value is 200 (mSeconds) (#6562)
|
||||
* Add command Gpio 255 to show physical GPIO configuration of all non-flash pins (#6407)
|
||||
*
|
||||
* 6.6.0.16 20191008
|
||||
* Change PZEM004T default address mask from 0.0.0.x to 192.168.1.x for legacy reason (#6585)
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Подсветка"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Backlight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Backlight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Backlight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Backlight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Backlight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "RétroÉcl"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Backlight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Háttérfény"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Backlight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Backlight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Backlight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Backlight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Luz de fundo"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Luz negra"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Backlight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Backlight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Backlight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Backlight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Backlight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Backlight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -541,6 +541,9 @@
|
||||
#define D_SENSOR_SAIR_TX "SAir Tx"
|
||||
#define D_SENSOR_SPI_CS "SPI CS"
|
||||
#define D_SENSOR_SPI_DC "SPI DC"
|
||||
#define D_SENSOR_SPI_MISO "SPI MISO"
|
||||
#define D_SENSOR_SPI_MOSI "SPI MOSI"
|
||||
#define D_SENSOR_SPI_CLK "SPI CLK"
|
||||
#define D_SENSOR_BACKLIGHT "Backlight"
|
||||
#define D_SENSOR_PMS5003 "PMS5003"
|
||||
#define D_SENSOR_SDS0X1_RX "SDS0X1 Rx"
|
||||
|
@ -285,6 +285,10 @@ const char kSensorNames[] PROGMEM =
|
||||
D_SENSOR_SM2135_CLK "|" D_SENSOR_SM2135_DAT "|"
|
||||
;
|
||||
|
||||
const char kSensorNamesFixed[] PROGMEM =
|
||||
D_SENSOR_SPI_MISO "|" D_SENSOR_SPI_MOSI "|" D_SENSOR_SPI_CLK "|"
|
||||
D_SENSOR_USER;
|
||||
|
||||
// User selectable ADC0 functionality
|
||||
enum UserSelectableAdc0 {
|
||||
ADC0_NONE, // Not used
|
||||
|
@ -1067,11 +1067,16 @@ void SetModuleType()
|
||||
my_module_type = (USER_MODULE == Settings.module) ? Settings.user_template_base : Settings.module;
|
||||
}
|
||||
|
||||
bool FlashPin(uint32_t pin)
|
||||
{
|
||||
return (((pin > 5) && (pin < 9)) || (11 == pin));
|
||||
}
|
||||
|
||||
uint8_t ValidPin(uint32_t pin, uint32_t gpio)
|
||||
{
|
||||
uint8_t result = gpio;
|
||||
|
||||
if (((pin > 5) && (pin < 9)) || (11 == pin)) {
|
||||
if (FlashPin(pin)) {
|
||||
result = GPIO_NONE; // Disable flash pins GPIO6, GPIO7, GPIO8 and GPIO11
|
||||
}
|
||||
if ((WEMOS == Settings.module) && (!Settings.flag3.user_esp8285_enable)) {
|
||||
|
@ -868,11 +868,25 @@ void CmndGpio(void)
|
||||
Response_P(PSTR("{"));
|
||||
bool jsflg = false;
|
||||
for (uint32_t i = 0; i < sizeof(Settings.my_gp); i++) {
|
||||
if (ValidGPIO(i, cmodule.io[i])) {
|
||||
if (ValidGPIO(i, cmodule.io[i]) || ((GPIO_USER == XdrvMailbox.payload) && !FlashPin(i))) {
|
||||
if (jsflg) { ResponseAppend_P(PSTR(",")); }
|
||||
jsflg = true;
|
||||
uint8_t sensor_type = Settings.my_gp.io[i];
|
||||
if (!ValidGPIO(i, cmodule.io[i])) {
|
||||
sensor_type = cmodule.io[i];
|
||||
if (GPIO_USER == sensor_type) { // A user GPIO equals a not connected (=GPIO_NONE) GPIO here
|
||||
sensor_type = GPIO_NONE;
|
||||
}
|
||||
}
|
||||
uint8_t sensor_name_idx = sensor_type;
|
||||
const char *sensor_names = kSensorNames;
|
||||
if (sensor_type > GPIO_FIX_START) {
|
||||
sensor_name_idx = sensor_type - GPIO_FIX_START -1;
|
||||
sensor_names = kSensorNamesFixed;
|
||||
}
|
||||
char stemp1[TOPSZ];
|
||||
ResponseAppend_P(PSTR("\"" D_CMND_GPIO "%d\":{\"%d\":\"%s\"}"), i, Settings.my_gp.io[i], GetTextIndexed(stemp1, sizeof(stemp1), Settings.my_gp.io[i], kSensorNames));
|
||||
ResponseAppend_P(PSTR("\"" D_CMND_GPIO "%d\":{\"%d\":\"%s\"}"),
|
||||
i, sensor_type, GetTextIndexed(stemp1, sizeof(stemp1), sensor_name_idx, sensor_names));
|
||||
}
|
||||
}
|
||||
if (jsflg) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user