Init all ESP01 (module) WIFI pins (#17679)

This commit is contained in:
Bob Kuhn 2020-05-08 02:43:53 -05:00 committed by GitHub
parent 8fd3af0c79
commit 8f3d17699a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 7 deletions

View File

@ -23,13 +23,21 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#include "Delay.h" #include "Delay.h"
void esp_wifi_init(void) { void esp_wifi_init(void) { // init ESP01 WIFI module pins
#if PIN_EXISTS(ESP_WIFI_MODULE_GPIO0)
OUT_WRITE(ESP_WIFI_MODULE_GPIO0_PIN, HIGH);
#endif
#if PIN_EXISTS(ESP_WIFI_MODULE_GPIO2)
OUT_WRITE(ESP_WIFI_MODULE_GPIO2_PIN, HIGH);
#endif
#if PIN_EXISTS(ESP_WIFI_MODULE_RESET) #if PIN_EXISTS(ESP_WIFI_MODULE_RESET)
delay(1); // power up delay (0.1mS minimum)
OUT_WRITE(ESP_WIFI_MODULE_RESET_PIN, LOW); OUT_WRITE(ESP_WIFI_MODULE_RESET_PIN, LOW);
delay(1); delay(1);
OUT_WRITE(ESP_WIFI_MODULE_RESET_PIN, HIGH); OUT_WRITE(ESP_WIFI_MODULE_RESET_PIN, HIGH);
#endif #endif
#if PIN_EXISTS(ESP_WIFI_MODULE_ENABLE) #if PIN_EXISTS(ESP_WIFI_MODULE_ENABLE)
delay(1); // delay after reset released (0.1mS minimum)
OUT_WRITE(ESP_WIFI_MODULE_ENABLE_PIN, HIGH); OUT_WRITE(ESP_WIFI_MODULE_ENABLE_PIN, HIGH);
#endif #endif
} }

View File

@ -1415,3 +1415,9 @@
#if PIN_EXISTS(ESP_WIFI_MODULE_ENABLE) #if PIN_EXISTS(ESP_WIFI_MODULE_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, ESP_WIFI_MODULE_ENABLE_PIN) REPORT_NAME_DIGITAL(__LINE__, ESP_WIFI_MODULE_ENABLE_PIN)
#endif #endif
#if PIN_EXISTS(ESP_WIFI_MODULE_GPIO0)
REPORT_NAME_DIGITAL(__LINE__, ESP_WIFI_MODULE_GPIO0_PIN)
#endif
#if PIN_EXISTS(ESP_WIFI_MODULE_GPIO2)
REPORT_NAME_DIGITAL(__LINE__, ESP_WIFI_MODULE_GPIO2_PIN)
#endif

View File

@ -340,13 +340,15 @@
/** /**
* _____ * _____
* TX | 1 2 | GND Enable PG1 // Must be high for module to run * TX | 1 2 | GND Enable PG1 // Must be high for module to run
* Enable | 3 4 | GPIO2 Reset PG0 // Leave as unused (OK to leave floating) * Enable | 3 4 | GPIO2 Reset PG0 // active low, probably OK to leave floating
* Reset | 5 6 | GPIO0 GPIO2 PF15 // Leave as unused (best to leave floating) * Reset | 5 6 | GPIO0 GPIO2 PF15 // must be high (ESP3D software configures this with a pullup so OK to leave as floating)
* 3.3V| 7 8 | RX GPIO0 PF14 // Leave as unused (best to leave floating) * 3.3V| 7 8 | RX GPIO0 PF14 // Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating)
* *
* W1 * W1
*/ */
#define ESP_WIFI_MODULE_COM 6 // Must also set SERIAL_PORT or SERIAL_PORT_2 to this #define ESP_WIFI_MODULE_COM 6 // Must also set either SERIAL_PORT or SERIAL_PORT_2 to this
#define ESP_WIFI_MODULE_BAUDRATE BAUDRATE // Must use same BAUDRATE as SERIAL_PORT & SERIAL_PORT_2 #define ESP_WIFI_MODULE_BAUDRATE BAUDRATE // Must use same BAUDRATE as SERIAL_PORT & SERIAL_PORT_2
#define ESP_WIFI_MODULE_RESET_PIN -1 #define ESP_WIFI_MODULE_RESET_PIN PG0
#define ESP_WIFI_MODULE_ENABLE_PIN PG1 #define ESP_WIFI_MODULE_ENABLE_PIN PG1
#define ESP_WIFI_MODULE_GPIO0_PIN PF14
#define ESP_WIFI_MODULE_GPIO2_PIN PF15