资源简介
ESP8266的NONOS SDK开发,串口发送、接收与中断工程,配合博客http://blog.csdn.net/d521000121/article/details/66475439使用更佳哦~由于时代久远,本人很多都忘了,诚意与大家交流。

代码片段和文件信息
/*
* File : uart.c
* Copyright (C) 2013 - 2016 Espressif Systems
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of version 3 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not see .
*/
#include “ets_sys.h“
#include “osapi.h“
#include “driver/uart.h“
#include “osapi.h“
#include “os_type.h“
// UartDev is defined and initialized in rom code.
extern UartDevice UartDev;
LOCAL struct UartBuffer* pTxBuffer = NULL;
LOCAL struct UartBuffer* pRxBuffer = NULL;
/*uart demo with a system task to output what uart receives*/
/*this is a example to process uart data from taskplease change the priority to fit your application task if exists*/
/*it might conflict with your task if soplease arrange the priority of different task or combine it to a different event in the same task. */
#define uart_recvTaskPrio 0
#define uart_recvTaskQueueLen 10
os_event_t uart_recvTaskQueue[uart_recvTaskQueueLen];
#define DBG
#define DBG1 uart1_sendStr_no_wait
#define DBG2 os_printf
LOCAL void uart0_rx_intr_handler(void *para);
/******************************************************************************
* FunctionName : uart_config
* Description : Internal used function
* UART0 used for data TX/RX RX buffer size is 0x100 interrupt enabled
* UART1 just used for debug output
* Parameters : uart_no use UART0 or UART1 defined ahead
* Returns : NONE
*******************************************************************************/
LOCAL void ICACHE_FLASH_ATTR
uart_config(uint8 uart_no)
{
if (uart_no == UART1){
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO2_U FUNC_U1TXD_BK);
}else{
/* rcv_buff size if 0x100 */
ETS_UART_INTR_ATTACH(uart0_rx_intr_handler &(UartDev.rcv_buff));
PIN_PULLUP_DIS(PERIPHS_IO_MUX_U0TXD_U);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0TXD_U FUNC_U0TXD);
#if UART_HW_RTS
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDO_U FUNC_U0RTS); //HW FLOW CONTROL RTS PIN
#endif
#if UART_HW_CTS
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U FUNC_U0CTS); //HW FLOW CONTROL CTS PIN
#endif
}
uart_div_modify(uart_no UART_CLK_FREQ / (UartDev.baut_rate));//SET BAUDRATE
WRITE_PERI_REG(UART_CONF0(uart_no) ((UartDev.exist_parity & UART_PARITY_EN_M) << UART_PARITY_EN_S) //SET BIT AND PARITY MODE
| ((UartDev.parity & UART_PARITY_M) <
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4584 2015-08-23 15:53 INTR\.cproject
文件 832 2015-09-12 19:47 INTR\.project
文件 453972 2017-03-26 20:48 INTR\app\.output\eagle\debug\image\eagle.app.v6.out
文件 45884 2017-03-26 20:48 INTR\app\driver\.output\eagle\debug\lib\libdriver.a
文件 1110 2017-03-26 20:48 INTR\app\driver\.output\eagle\debug\obj\uart.d
文件 45200 2017-03-26 20:48 INTR\app\driver\.output\eagle\debug\obj\uart.o
文件 1490 2015-07-03 20:29 INTR\app\driver\Makefile
文件 25726 2017-03-26 15:25 INTR\app\driver\uart.c
文件 3226 2015-05-22 15:09 INTR\app\gen_misc.bat
文件 3276 2015-05-22 15:08 INTR\app\gen_misc.sh
文件 6232 2015-07-03 20:29 INTR\app\include\driver\uart.h
文件 7038 2015-07-03 20:29 INTR\app\include\driver\uart_register.h
文件 1132 2015-09-12 21:03 INTR\app\include\hw_timer.h
文件 1148 2015-07-03 20:29 INTR\app\include\user_config.h
文件 2876 2015-07-14 05:42 INTR\app\Makefile
文件 20308 2017-03-26 12:38 INTR\app\user\.output\eagle\debug\lib\libuser.a
文件 1032 2017-03-26 12:38 INTR\app\user\.output\eagle\debug\obj\hw_timer.d
文件 8268 2017-03-26 12:38 INTR\app\user\.output\eagle\debug\obj\hw_timer.o
文件 1120 2017-03-26 12:38 INTR\app\user\.output\eagle\debug\obj\user_main.d
文件 11716 2017-03-26 12:38 INTR\app\user\.output\eagle\debug\obj\user_main.o
文件 3675 2015-09-12 21:03 INTR\app\user\hw_timer.c
文件 1522 2015-07-03 20:29 INTR\app\user\Makefile
文件 1578 2015-09-12 21:09 INTR\app\user\user_main.c
文件 32320 2015-07-03 20:52 INTR\bin\at\eagle.flash.bin
文件 222808 2015-07-03 20:52 INTR\bin\at\eagle.irom0text.bin
文件 962 2015-07-03 21:20 INTR\bin\at\readme.txt
文件 261168 2015-07-03 20:52 INTR\bin\at\user1.1024.new.2.bin
文件 261168 2015-07-03 20:52 INTR\bin\at\user2.1024.new.2.bin
文件 4096 2015-07-03 20:29 INTR\bin\blank.bin
文件 1936 2015-01-23 15:19 INTR\bin\boot_v1.2.bin
............此处省略80个文件信息
- 上一篇:VFP 工资管理系统 不错哦
- 下一篇:锥齿轮传动计算 -windows版本
相关资源
- esp8266 win10驱动 cp2102
- CSDN文件---ESP8266.rar
- stm32103c8t6ESP8266串口转WIFI模块TCP服务器
- ESP8266ESP8266安卓控制端源代码
- 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.
- ESP8266连接云平台
- STM32C8T6通过扫描二维码进行智能开锁
- ESP8266微信配网以及公众号绑定
- ESP8266一键烧写工具
- 手机与ESP8266WiFi模块进行通信
- ESP8266搭建MQTT客户端源码
- STM32接入OneNET代码
- STM32-ESP8266-AT
- 毕设-基于ESP8266-12F家电控制系统设计
- 使用MSP432-ESP8266实现小车红外测距和数
- ESP8266_8285_32系列透传固件 JFirmwareESP
- ESP32、ESP8266/85增强型透传固件 JFirmw
- ESP8266-WIFI数据透传
- 基于stm32与esp8266智能家居应用
- ESP8266一键配置app端源码iOS、安卓
评论
共有 条评论