forked from xoseperez/espurna
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom.h.example
95 lines (76 loc) · 3.65 KB
/
custom.h.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// ------------------------------------------------------------------------------
// Example file for custom.h
// Either copy and paste this file then rename removing the .example or create your
// own file: 'custom.h'
// This file allows users to create their own configurations.
// See 'code/espurna/config/general.h' for default settings.
//
// See: https://github.com/xoseperez/espurna/wiki/Software-features#enabling-features
// and 'code/platformio_override.ini.example' for more details.
// ------------------------------------------------------------------------------
// Example of a Sonoff Basic board with some options disabled to reduce firmware size.
#if defined(MY_SONOFF_BUILD01) // This matches the 'src_build_flags = -DMY_SONOFF_BUILD01'
// in 'platformio_override.ini'
#define MANUFACTURER "ITEAD"
#define DEVICE "SONOFF_BASIC_BUILD01"
// Disable these
#define DEBUG_SERIAL_SUPPORT 0
#define ALEXA_SUPPORT 0
#define DOMOTICZ_SUPPORT 0
#define HOMEASSISTANT_SUPPORT 0
#define THINGSPEAK_SUPPORT 0
// Buttons
#define BUTTON1_PIN 0
#define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON1_RELAY 1
// Relays
#define RELAY1_PIN 12
#define RELAY1_TYPE RELAY_TYPE_NORMAL
// LEDs
#define LED1_PIN 13
#define LED1_PIN_INVERSE 1
// Example of the Sonoff Basic board above but with two buttons on different GPIOs.
// The two buttons both toggle the one RELAY but ALL button events send MQTT values.
// An MQTT based system can then carry out differnt functions depending on
// the 'DOUBLE CLICK, LONG CLICK OR LONG-LONG CLICK' trigger. A BMX280 environment
// sensor is also connected using I2C on GPIO 1 and 3.
#elif defined(MY_SONOFF_BUILD02)
// Info - Custom Basic with BMX280 I2C on GPIO 1 and 3
#define MANUFACTURER "ITEAD"
#define DEVICE "SONOFF_BASIC_BMX280" // Your own name here
// Disable these
#define DEBUG_SERIAL_SUPPORT 0
#define ALEXA_SUPPORT 0
#define DOMOTICZ_SUPPORT 0
#define HOMEASSISTANT_SUPPORT 0
#define THINGSPEAK_SUPPORT 0
// Buttons
#define BUTTON_MQTT_SEND_ALL_EVENTS 1
#define BUTTON1_PIN 0 // Built in button.
#define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON1_RELAY 1
#define BUTTON1_PRESS BUTTON_MODE_NONE
#define BUTTON1_CLICK BUTTON_MODE_TOGGLE
#define BUTTON1_DBLCLICK BUTTON_MODE_NONE
#define BUTTON1_LNGCLICK BUTTON_MODE_OFF
#define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
#define BUTTON2_PIN 2 // External push button connected between IO2 and GND.
#define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
#define BUTTON2_RELAY 1
#define BUTTON2_PRESS BUTTON_MODE_NONE
#define BUTTON2_CLICK BUTTON_MODE_TOGGLE
#define BUTTON2_DBLCLICK BUTTON_MODE_NONE
#define BUTTON2_LNGCLICK BUTTON_MODE_NONE
#define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
// Relays
#define RELAY1_PIN 12
#define RELAY1_TYPE RELAY_TYPE_NORMAL
// LEDs
#define LED1_PIN 13
#define LED1_PIN_INVERSE 1
// Extras
#define BMX280_SUPPORT 1
#define BMX280_ADDRESS 0x76
#define I2C_SDA_PIN 1 //TX PIN **DISABLE DEBUG_SERIAL_SUPPORT**
#define I2C_SCL_PIN 3 //RX PIN **DISABLE DEBUG_SERIAL_SUPPORT**
#endif