资源简介
Esp8266 源码分析 MQTT 实现过程,实现移植 MQTT协议在 esp8266 rtos实时系统,可断线重连。https://blog.csdn.net/xh870189248/article/details/81181707
代码片段和文件信息
/*
* 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 “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);
port
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-07-23 20:53 23_ESP8266_Rtos_Mqtt\
文件 4480 2018-07-26 10:46 23_ESP8266_Rtos_Mqtt\.cproject
文件 2574 2018-05-25 15:41 23_ESP8266_Rtos_Mqtt\.gitlab-ci.yml
文件 805 2018-07-11 14:44 23_ESP8266_Rtos_Mqtt\.project
目录 0 2018-07-23 20:52 23_ESP8266_Rtos_Mqtt\.settings\
文件 1226 2018-07-26 10:46 23_ESP8266_Rtos_Mqtt\.settings\language.settings.xm
目录 0 2018-07-23 20:52 23_ESP8266_Rtos_Mqtt\bin\
文件 4096 2018-05-25 15:41 23_ESP8266_Rtos_Mqtt\bin\blank.bin
文件 3856 2018-05-25 15:41 23_ESP8266_Rtos_Mqtt\bin\boot_v1.6.bin
文件 4080 2018-05-25 15:41 23_ESP8266_Rtos_Mqtt\bin\boot_v1.7.bin
文件 128 2018-05-25 15:41 23_ESP8266_Rtos_Mqtt\bin\esp_init_data_default.bin
目录 0 2018-07-23 20:52 23_ESP8266_Rtos_Mqtt\bin\upgrade\
文件 0 2018-05-25 15:41 23_ESP8266_Rtos_Mqtt\bin\upgrade\readme.txt
文件 298228 2018-07-23 20:16 23_ESP8266_Rtos_Mqtt\bin\upgrade\user1.4096.new.6.bin
文件 1753325 2018-07-23 20:16 23_ESP8266_Rtos_Mqtt\bin\upgrade\user1.4096.new.6.dump
文件 4943483 2018-07-23 20:16 23_ESP8266_Rtos_Mqtt\bin\upgrade\user1.4096.new.6.S
目录 0 2018-07-23 20:52 23_ESP8266_Rtos_Mqtt\bin\upgrade\_temp_by_dltool\
目录 0 2018-07-23 20:52 23_ESP8266_Rtos_Mqtt\bin\upgrade\_temp_by_dltool\downloadPanel1\
文件 337220 2018-07-21 17:46 23_ESP8266_Rtos_Mqtt\bin\upgrade\_temp_by_dltool\downloadPanel1\user1.4096.new.6.bin_rep
目录 0 2018-07-23 20:52 23_ESP8266_Rtos_Mqtt\bin\_temp_by_dltool\
目录 0 2018-07-23 20:52 23_ESP8266_Rtos_Mqtt\bin\_temp_by_dltool\downloadPanel1\
文件 4080 2018-07-21 17:46 23_ESP8266_Rtos_Mqtt\bin\_temp_by_dltool\downloadPanel1\boot_v1.7.bin_rep
目录 0 2018-07-23 20:52 23_ESP8266_Rtos_Mqtt\driver_lib\
目录 0 2018-07-23 20:52 23_ESP8266_Rtos_Mqtt\driver_lib\driver\
文件 7328 2018-05-25 15:41 23_ESP8266_Rtos_Mqtt\driver_lib\driver\gpio.c
文件 4098 2018-05-25 15:41 23_ESP8266_Rtos_Mqtt\driver_lib\driver\hw_timer.c
文件 9539 2018-05-25 15:41 23_ESP8266_Rtos_Mqtt\driver_lib\driver\i2c_master.c
文件 1428 2018-05-25 15:41 23_ESP8266_Rtos_Mqtt\driver_lib\driver\Makefile
文件 17433 2018-05-25 15:41 23_ESP8266_Rtos_Mqtt\driver_lib\driver\spi_interface.c
目录 0 2018-07-23 20:52 23_ESP8266_Rtos_Mqtt\driver_lib\include\
文件 9617 2018-05-25 15:41 23_ESP8266_Rtos_Mqtt\driver_lib\include\gpio.h
............此处省略709个文件信息
相关资源
- S32K144使用printf格式化输出
- 基于MSP430单片机的实时多任务操作系
- TI-RTOS开放教程,中文资料
- TI-RTOS开发教程
- esp8266 win10驱动 cp2102
- ESP32蓝牙架构官方
- CSDN文件---ESP8266.rar
- stm32103c8t6ESP8266串口转WIFI模块TCP服务器
- ESP8266ESP8266安卓控制端源代码
- STM32L476 FreeRTOS系统移植项目
- RTOS RTX(V1)keil自带的操作系统STM32可
- nudemcu相关工具和固件测试稳定
- 单片机通过ESP8266上传温湿度数据
- STM32F407ZG_ESP8266例程
- ESP8266最新稳定版固件
- ESP8266AP模式控制51单片机亮灯.docx
- ESP8266使用MQTT协议连接阿里云
- 贝壳物联arduino esp8266 demo版本
- ESP8266程序加上MQTT调试工具
- ESP8266_NONOS_SDK-3.0
- ESP8266+OLED屏实现天气预报+温度显示
- stm32f7的esp8266spi并口源程序,速率1.
- weixin_41918266_10384576.zip
- ESP8266连接云平台
- STM32C8T6通过扫描二维码进行智能开锁
- ESP8266微信配网以及公众号绑定
- 中英两版FreeRTOS_Reference_Manual_V10.0.0.
- ESP8266一键烧写工具
- 手机与ESP8266WiFi模块进行通信
- STM32F103_FREERTOS_MPU6050DMP_USART_Timer输入捕
评论
共有 条评论