-
Notifications
You must be signed in to change notification settings - Fork 3k
M2351: Integrate ESP8266 power on/off logic into ESP8266 driver main… #11299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…line On the NuMaker-PFM-M2351 board, the RST pin of the on-board ESP8266 module is not connected. Instead, a GPIO PD_7 is used to power on/off the module. This commit integrates the power control logic into ESP8266 driver mainline and has the following purposes: 1. Application code can exempt from the power control logic. 2. Support reset in ESP8266 driver
@ccli8, thank you for your changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll wait for ipcore team to review but seeing TARGET_ in interface code does not look good to me.
I admit, I also don't fully understand this PR. |
Board circuit is not to change. Without this PR, application needs to write ESP8266 initialization code like: WiFiInterface *WiFiInterface::get_target_default_instance()
{
static DigitalOut esp_pwr_off(PD_7, 1); // Disable power to on-board ESP8266
static ESP8266Interface esp(PD_1, PD_0, false, PD_3, PD_2, NC);
esp_pwr_off = 1; // Disable power to on-board ESP8266
wait_ms(2);
esp_pwr_off = 0; // Enable power to on-board ESP8266
} And there is no way for ESP8266 driver to re-power the ESP8266 module through But with this PR, application just needs to configure ESP8266 in mbed_app.json: "esp8266.rx" : "PD_1", "esp8266.tx" : "PD_0", "esp8266.rst" : "PD_7", "esp8266.rts" : "PD_3", "esp8266.cts" : "PD_2", "esp8266.provide-default" : true,
|
If there is no way to alternate the logic elsewhere, then I suggest to add some kind of RST_PIN_POLARITY setting in mbed_lib.json, so that this can be configured per target in mbed_app.json. EDIT: there is very similar case under discussion in #11302, where I gave a more detailed instructions. @ccli8 , please let us know if you understand the point of the changes and if you have any doubts on how to achieve them, feel free to ask. |
@michalpasztamobica OK. I will add |
Create #11331 to replace this one. |
Close via #11343 |
Description
On the NuMaker-PFM-M2351 board, the RST pin of the on-board ESP8266 module is not connected. Instead, a GPIO
PD_7
is used to power on/off the module. This PR tries to integrate the power on/off logic into ESP8266 driver mainline. It has the following purposes:Related PR
This PR relies on #11288 for M2351 target renaming.
Pull request type
Release Notes