This repository has been archived by the owner on Jan 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
defines.h
149 lines (112 loc) · 5.25 KB
/
defines.h
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/****************************************************************************************************************************
defines.h
For nRF52 boards using ESP8266 AT WiFi Shields, using much less code to support boards with smaller memory
ESP_AT_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards (https://github.com/khoih-prog/ESP_AT_WM_Lite)
to enable store Credentials in EEPROM to easy configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services
without Hardcoding.
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
*****************************************************************************************************************************/
#ifndef defines_h
#define defines_h
/* Comment this out to disable prints and save space */
#define DRD_GENERIC_DEBUG true
#define USE_NEW_WEBSERVER_VERSION true //false
#define _ESP_AT_LOGLEVEL_ 1
/* Comment this out to disable prints and save space */
#define ESP_AT_DEBUG_OUTPUT Serial
#define ESP_AT_DEBUG true
#define _ESP_AT_WM_LOGLEVEL_ 3
// Uncomment to use ESP32-AT commands
//#define USE_ESP32_AT true
#if ( defined(NRF52840_FEATHER) || defined(NRF52832_FEATHER) || defined(NRF52_SERIES) || defined(ARDUINO_NRF52_ADAFRUIT) || \
defined(NRF52840_FEATHER_SENSE) || defined(NRF52840_ITSYBITSY) || defined(NRF52840_CIRCUITPLAY) || defined(NRF52840_CLUE) || \
defined(NRF52840_METRO) || defined(NRF52840_PCA10056) || defined(PARTICLE_XENON) || defined(NINA_B302_ublox) || defined(NINA_B112_ublox) )
#if defined(ESP8266_AT_USE_NRF528XX)
#undef ESP8266_AT_USE_NRF528XX
#endif
#define ESP8266_AT_USE_NRF528XX true
#else
#error This code is intended to run only on the nRF52 boards ! Please check your Tools->Board setting.
#endif
#if (ESP8266_AT_USE_NRF528XX)
#if defined(NRF52840_FEATHER)
#define BOARD_TYPE "NRF52840_FEATHER_EXPRESS"
#elif defined(NRF52832_FEATHER)
#define BOARD_TYPE "NRF52832_FEATHER"
#elif defined(NRF52840_FEATHER_SENSE)
#define BOARD_TYPE "NRF52840_FEATHER_SENSE"
#elif defined(NRF52840_ITSYBITSY)
#define BOARD_TYPE "NRF52840_ITSYBITSY_EXPRESS"
#elif defined(NRF52840_CIRCUITPLAY)
#define BOARD_TYPE "NRF52840_CIRCUIT_PLAYGROUND"
#elif defined(NRF52840_CLUE)
#define BOARD_TYPE "NRF52840_CLUE"
#elif defined(NRF52840_METRO)
#define BOARD_TYPE "NRF52840_METRO_EXPRESS"
#elif defined(NRF52840_PCA10056)
#define BOARD_TYPE "NORDIC_NRF52840DK"
#elif defined(NINA_B302_ublox)
#define BOARD_TYPE "NINA_B302_ublox"
#elif defined(NINA_B112_ublox)
#define BOARD_TYPE "NINA_B112_ublox"
#elif defined(PARTICLE_XENON)
#define BOARD_TYPE "PARTICLE_XENON"
#elif defined(MDBT50Q_RX)
#define BOARD_TYPE "RAYTAC_MDBT50Q_RX"
#elif defined(ARDUINO_NRF52_ADAFRUIT)
#define BOARD_TYPE "ARDUINO_NRF52_ADAFRUIT"
#else
#define BOARD_TYPE "nRF52 Unknown"
#endif
#define EspSerial Serial1
#endif //ESP8266_AT_USE_NRF528XX
#ifndef BOARD_NAME
#define BOARD_NAME BOARD_TYPE
#endif
/////////////////////////////////////////////
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
// Default is false (if not defined) => must input 2 sets of SSID/PWD
#define REQUIRE_ONE_SET_SSID_PW true //false
// Max times to try WiFi per loop() iteration. To avoid blocking issue in loop()
// Default 1 if not defined, and minimum 1.
//#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2
// Default no interval between recon WiFi if lost
// Max permitted interval will be 10mins
// Uncomment to use. Be careful, WiFi reconnect will be delayed if using this method
// Only use whenever urgent tasks in loop() can't be delayed. But if so, it's better you have to rewrite your code, e.g. using higher priority tasks.
#define WIFI_RECON_INTERVAL 30000
/////////////////////////////////////////////
#define USE_DYNAMIC_PARAMETERS false //true
#warning Disable USE_DYNAMIC_PARAMETERS for ESP_AT_SHIELD
/////////////////////////////////////////////
#define SCAN_WIFI_NETWORKS true
// To be able to manually input SSID, not from a scanned SSID lists
#define MANUAL_SSID_INPUT_ALLOWED true
// From 2-15
#define MAX_SSID_IN_LIST 4
/////////////////////////////////////////////
// Optional, to use Board Name in Menu
#define USING_BOARD_NAME false //true
/////////////////////////////////////////////
// Optional, to use Board Name in Menu
#define USING_CONFIG_MODE_LED true
#if USING_CONFIG_MODE_LED
#if defined(LED_BUILTIN)
#define CONFIG_MODE_LED LED_BUILTIN
#else
// Using default pin 13 for CONFIG_MODE_LED. To be changed as necessary
#define CONFIG_MODE_LED 13
#endif
#define LED_ON HIGH
#define LED_OFF LOW
#endif
/////////////////////////////////////////////
#include <Esp8266_AT_WM_Lite_nRF52.h>
#define HOST_NAME "nRF52-ESP_AT"
// SSID and PW for Config Portal
String portal_ssid = "CfgPrtl-SSID";
String portal_password = "CfgPrtl-PW";
// Your nRF52 <-> ESP8266 baud rate:
#define ESP8266_BAUD 115200
#endif //defines_h