资源简介
之前的资源自动涨到50积分,现重新上传
1、本例程所用的SDK版本:ESP8266_RTOS_SDK-1.4.x 2、创建MQTT任务,连接MQTT服务器,订阅(接收)和发布(发送)信息 3、具有UART发送和接收功能 4、具有Smartconfig功能,可通过按键和UART命令触发一键配置连接WIFI
代码片段和文件信息
/*
* ESPRSSIF MIT License
*
* Copyright (c) 2015
*
* Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only in which case
* it is free of charge to any person obtaining a copy of this software and associated
* documentation files (the “Software“) to deal in the Software without restriction including
* without limitation the rights to use copy modify merge publish distribute sublicense
* and/or sell copies of the Software and to permit persons to whom the Software is furnished
* to do so subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or
* substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
* IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER LIABILITY WHETHER
* IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#include “espressif/esp_common.h“
#include “freertos/portmacro.h“
#include “driver/gpio.h“
void gpio_config(GPIO_ConfigTypeDef *pGPIOConfig)
{
uint16 gpio_pin_mask = pGPIOConfig->GPIO_Pin;
uint32 io_reg;
uint8 io_num = 0;
uint32 pin_reg;
if (pGPIOConfig->GPIO_Mode == GPIO_Mode_Input) {
GPIO_AS_INPUT(gpio_pin_mask);
} else if (pGPIOConfig->GPIO_Mode == GPIO_Mode_Output) {
GPIO_AS_OUTPUT(gpio_pin_mask);
}
do {
if ((gpio_pin_mask >> io_num) & 0x1) {
io_reg = GPIO_PIN_REG(io_num);
if ((0x1 << io_num) & (GPIO_Pin_0 | GPIO_Pin_2 | GPIO_Pin_4 | GPIO_Pin_5)) {
PIN_FUNC_SELECT(io_reg 0);
} else {
PIN_FUNC_SELECT(io_reg 3);
}
if (pGPIOConfig->GPIO_Pullup) {
PIN_PULLUP_EN(io_reg);
} else {
PIN_PULLUP_DIS(io_reg);
}
if (pGPIOConfig->GPIO_Mode == GPIO_Mode_Out_OD) {
portENTER_CRITICAL();
pin_reg = GPIO_REG_READ(GPIO_PIN_ADDR(io_num));
pin_reg &= (~GPIO_PIN_DRIVER_MASK);
pin_reg |= (GPIO_PAD_DRIVER_ENABLE << GPIO_PIN_DRIVER_LSB);
GPIO_REG_WRITE(GPIO_PIN_ADDR(io_num) pin_reg);
portEXIT_CRITICAL();
} else if (pGPIOConfig->GPIO_Mode == GPIO_Mode_Sigma_Delta) {
portENTER_CRITICAL();
pin_reg = GPIO_REG_READ(GPIO_PIN_ADDR(io_num));
pin_reg &= (~GPIO_PIN_SOURCE_MASK);
pin_reg |= (0x1 << GPIO_PIN_SOURCE_LSB);
GPIO_REG_WRITE(GPIO_PIN_ADDR(io_num) pin_reg);
GPIO_REG_WRITE(GPIO_SIGMA_DELTA_ADDRESS SIGMA_DELTA_ENABLE);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 495477 2016-12-05 11:01 esp8266_mqtt_demo\.output\eagle\debug\image\eagle.app.v6.out
文件 358 2016-07-04 01:59 esp8266_mqtt_demo\airkiss.txt
文件 1802448 2016-12-05 11:01 esp8266_mqtt_demo\bin\eagle.dump
文件 29152 2016-12-05 11:01 esp8266_mqtt_demo\bin\eagle.flash.bin
文件 290045 2016-12-05 11:01 esp8266_mqtt_demo\bin\eagle.irom0text.bin
文件 5411488 2016-12-05 11:01 esp8266_mqtt_demo\bin\eagle.S
文件 28800 2016-07-19 10:49 esp8266_mqtt_demo\bin\_temp_by_dltool\downloadPanel1\eagle.flash.bin_rep
....... 71438 2016-12-05 11:01 esp8266_mqtt_demo\driver\.output\eagle\debug\lib\libdriver.a
I.A.... 6238 2016-12-05 11:01 esp8266_mqtt_demo\driver\.output\eagle\debug\obj\gpio.d
I.A.... 19000 2016-12-05 11:01 esp8266_mqtt_demo\driver\.output\eagle\debug\obj\gpio.o
I.A.... 6187 2016-12-05 11:01 esp8266_mqtt_demo\driver\.output\eagle\debug\obj\key.d
I.A.... 16252 2016-12-05 11:01 esp8266_mqtt_demo\driver\.output\eagle\debug\obj\key.o
I.A.... 6190 2016-12-05 11:01 esp8266_mqtt_demo\driver\.output\eagle\debug\obj\uart.d
I.A.... 35172 2016-12-05 11:01 esp8266_mqtt_demo\driver\.output\eagle\debug\obj\uart.o
文件 7335 2016-07-18 11:43 esp8266_mqtt_demo\driver\gpio.c
文件 6868 2016-03-01 01:40 esp8266_mqtt_demo\driver\key.c
文件 1471 2016-07-04 01:59 esp8266_mqtt_demo\driver\Makefile
文件 15110 2016-12-05 10:59 esp8266_mqtt_demo\driver\uart.c
文件 3744 2016-07-04 01:59 esp8266_mqtt_demo\gen_misc.bat
文件 1114 2016-12-05 10:51 esp8266_mqtt_demo\gen_misc.sh
文件 3776 2016-07-14 08:41 esp8266_mqtt_demo\gen_misc_bak.sh
文件 1378 2015-11-15 01:18 esp8266_mqtt_demo\include\dmsg.h
文件 9922 2016-09-28 09:14 esp8266_mqtt_demo\include\driver\gpio.h
文件 688 2016-03-01 01:40 esp8266_mqtt_demo\include\driver\key.h
文件 8560 2016-12-01 14:35 esp8266_mqtt_demo\include\driver\uart.h
文件 2614 2016-12-01 14:41 esp8266_mqtt_demo\include\mqtt\MQTTClient.h
文件 4367 2015-11-15 01:18 esp8266_mqtt_demo\include\mqtt\MQTTConnect.h
文件 1545 2015-11-15 01:18 esp8266_mqtt_demo\include\mqtt\MQTTESP8266.h
文件 2038 2016-12-01 14:42 esp8266_mqtt_demo\include\mqtt\MQTTFormat.h
文件 3957 2015-11-15 01:18 esp8266_mqtt_demo\include\mqtt\MQTTPacket.h
............此处省略93个文件信息
相关资源
- 玩转STM32F103+W5500 MQTT
- ESP8266全部开发资料
- mqtt发包工具-压力测试工具
- ESP8266如何使用自己的云服务器进行云
- stm32+esp8266上传数据到移动onenet平台
- ESP8266无线模块资料
- 使用QT官方库的mqtt客户端
- ESP8266 OLED 4Pin0.96 IIC测试程序.rar
- ESP8266 wifi模块驱动代码
- ESP8266 调试工具
- ESP8266和STM32做server收发数据代码
- Mqtt for Unity 完整工程包
- ESP8266原理图及库文件 altium designer
- ESP8266安卓APP
- ESP8266开发固件MQTT服务器
- andriod-MQTT客户端
- ESP8266-01-01sRelay继电器模块的使用.zi
- STM32+OV2640+ESP8266图片传输
- STM32F407_ESP8266连接机智云
- STM32+ESP8266+smartconfig配网.zip
- STM32F4x7+freertos+lwip+ssl+MQTT完整代码
- STM32+ESP8266实现物联网
- ESP8266开发,实现MQTT客户端,与MQTT服
- STM32+ESP8266智能农场i项目开发程序
- ESP8266_RTOS_SDK-3.0
- ESP8266控制APP+源码合集.zip
- 乐鑫8266官方开发资料
- esp8266 所有例程
- STM32 OV2640 ESP8266图像传输
- 基于DHT11的室内温湿度检测系统毕业设
评论
共有 条评论