Skip to content

Commit

Permalink
Prep for Software SPI
Browse files Browse the repository at this point in the history
Prep for Software SPI used by some displays
  • Loading branch information
arendst committed Nov 27, 2018
1 parent fd20706 commit be358b3
Show file tree
Hide file tree
Showing 20 changed files with 109 additions and 2 deletions.
5 changes: 5 additions & 0 deletions sonoff/language/bg-BG.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
5 changes: 5 additions & 0 deletions sonoff/language/cs-CZ.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
5 changes: 5 additions & 0 deletions sonoff/language/de-DE.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
5 changes: 5 additions & 0 deletions sonoff/language/el-GR.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
6 changes: 6 additions & 0 deletions sonoff/language/en-GB.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,12 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"


// Units
#define D_UNIT_AMPERE "A"
Expand Down
5 changes: 5 additions & 0 deletions sonoff/language/es-AR.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
5 changes: 5 additions & 0 deletions sonoff/language/fr-FR.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
5 changes: 5 additions & 0 deletions sonoff/language/he-HE.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
5 changes: 5 additions & 0 deletions sonoff/language/hu-HU.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
5 changes: 5 additions & 0 deletions sonoff/language/it-IT.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
5 changes: 5 additions & 0 deletions sonoff/language/nl-NL.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
5 changes: 5 additions & 0 deletions sonoff/language/pl-PL.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
5 changes: 5 additions & 0 deletions sonoff/language/pt-BR.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
5 changes: 5 additions & 0 deletions sonoff/language/pt-PT.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"


// Units
Expand Down
5 changes: 5 additions & 0 deletions sonoff/language/ru-RU.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"

// Units
#define D_UNIT_AMPERE "А"
Expand Down
5 changes: 5 additions & 0 deletions sonoff/language/tr-TR.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
5 changes: 5 additions & 0 deletions sonoff/language/uk-UK.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"

// Units
#define D_UNIT_AMPERE "А"
Expand Down
5 changes: 5 additions & 0 deletions sonoff/language/zh-CN.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"

// Units
#define D_UNIT_AMPERE "安"
Expand Down
5 changes: 5 additions & 0 deletions sonoff/language/zh-TW.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@
#define D_SENSOR_TUYA_RX "Tuya Rx"
#define D_SENSOR_MGC3130_XFER "MGC3130 Xfer"
#define D_SENSOR_MGC3130_RESET "MGC3130 Reset"
#define D_SENSOR_SSPI_MISO "SSPI MISO"
#define D_SENSOR_SSPI_MOSI "SSPI MOSI"
#define D_SENSOR_SSPI_SCLK "SSPI SCLK"
#define D_SENSOR_SSPI_CS "SSPI CS"
#define D_SENSOR_SSPI_DC "SSPI DC"

// Units
#define D_UNIT_AMPERE "安"
Expand Down
15 changes: 13 additions & 2 deletions sonoff/sonoff_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ enum UserSelectablePins {
GPIO_TUYA_RX, // Tuya Serial interface
GPIO_MGC3130_XFER, // MGC3130 Transfer
GPIO_MGC3130_RESET, // MGC3130 Reset
GPIO_SSPI_MISO, // Software SPI Master Input Slave Output
GPIO_SSPI_MOSI, // Software SPI Master Output Slave Input
GPIO_SSPI_SCLK, // Software SPI Serial Clock
GPIO_SSPI_CS, // Software SPI Chip Select
GPIO_SSPI_DC, // Software SPI Data or Command
GPIO_SENSOR_END };

// Programmer selectable GPIO functionality offset by user selectable GPIOs
Expand Down Expand Up @@ -193,7 +198,8 @@ const char kSensorNames[] PROGMEM =
D_SENSOR_TX20_TX "|"
D_SENSOR_RFSEND "|" D_SENSOR_RFRECV "|"
D_SENSOR_TUYA_TX "|" D_SENSOR_TUYA_RX "|"
D_SENSOR_MGC3130_XFER "|" D_SENSOR_MGC3130_RESET;
D_SENSOR_MGC3130_XFER "|" D_SENSOR_MGC3130_RESET "|"
D_SENSOR_SSPI_MISO "|" D_SENSOR_SSPI_MOSI "|" D_SENSOR_SSPI_SCLK "|" D_SENSOR_SSPI_CS "|" D_SENSOR_SSPI_DC;

/********************************************************************************************/

Expand Down Expand Up @@ -349,6 +355,11 @@ const uint8_t kGpioNiceList[] PROGMEM = {
#ifdef USE_SPI
GPIO_SPI_CS, // SPI Chip Select
GPIO_SPI_DC, // SPI Data Direction
GPIO_SSPI_MISO, // Software SPI Master Input Slave Output
GPIO_SSPI_MOSI, // Software SPI Master Output Slave Input
GPIO_SSPI_SCLK, // Software SPI Serial Clock
GPIO_SSPI_CS, // Software SPI Chip Select
GPIO_SSPI_DC, // Software SPI Data or Command
#endif
#ifdef USE_DISPLAY
GPIO_BACKLIGHT, // Display backlight control
Expand Down Expand Up @@ -1276,7 +1287,7 @@ const mytmplt kModules[MAXMODULE] PROGMEM = {
GPIO_REL1, // GPIO15 Relay (0 = Off, 1 = On)
0, 0
},
{ "PS-16-DZ", // PS-16-DZ Dimmer (ESP8266 w/ separate Nuvoton MCU dimmer)
{ "PS-16-DZ", // PS-16-DZ Dimmer (ESP8266 w/ separate Nuvoton MCU dimmer)
// https://www.aliexpress.com/item/SM-Smart-WIFI-Wall-Dimmer-Light-Switch-US-Ewelink-APP-Remote-Control-Wi-Fi-Wirele-Work/32871151902.html
GPIO_USER,
GPIO_TXD, // GPIO01 MCU serial control
Expand Down

1 comment on commit be358b3

@andrethomas
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't wait to see a use case example/template for this one :)

Please sign in to comment.