资源简介
8266的TCP、UDP协议的工程demo,http://blog.csdn.net/xh870189248/article/details/78739311
代码片段和文件信息
/*
* 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) <
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3697 2017-12-07 09:49 9_TcpAndUdp\.cproject
文件 832 2015-07-17 13:31 9_TcpAndUdp\.project
文件 455495 2017-12-07 16:05 9_TcpAndUdp\app\.output\eagle\debug\image\eagle.app.v6.out
文件 47920 2017-12-07 16:05 9_TcpAndUdp\app\driver\.output\eagle\debug\lib\libdriver.a
文件 1110 2017-12-07 16:05 9_TcpAndUdp\app\driver\.output\eagle\debug\obj\uart.d
文件 47236 2017-12-07 16:05 9_TcpAndUdp\app\driver\.output\eagle\debug\obj\uart.o
文件 1490 2015-07-03 20:29 9_TcpAndUdp\app\driver\Makefile
文件 27382 2016-04-10 13:47 9_TcpAndUdp\app\driver\uart.c
文件 3226 2015-05-22 15:09 9_TcpAndUdp\app\gen_misc.bat
文件 3276 2015-05-22 15:08 9_TcpAndUdp\app\gen_misc.sh
文件 6232 2015-07-03 20:29 9_TcpAndUdp\app\include\driver\uart.h
文件 7038 2015-07-03 20:29 9_TcpAndUdp\app\include\driver\uart_register.h
文件 1148 2015-07-03 20:29 9_TcpAndUdp\app\include\user_config.h
文件 2876 2015-07-14 05:42 9_TcpAndUdp\app\Makefile
文件 73478 2017-12-07 16:05 9_TcpAndUdp\app\user\.output\eagle\debug\lib\libuser.a
文件 1278 2017-12-07 16:05 9_TcpAndUdp\app\user\.output\eagle\debug\obj\TcpClient.d
文件 21956 2017-12-07 16:05 9_TcpAndUdp\app\user\.output\eagle\debug\obj\TcpClient.o
文件 1281 2017-12-07 16:05 9_TcpAndUdp\app\user\.output\eagle\debug\obj\TcpService.d
文件 16600 2017-12-07 16:05 9_TcpAndUdp\app\user\.output\eagle\debug\obj\TcpService.o
文件 1254 2017-12-07 16:05 9_TcpAndUdp\app\user\.output\eagle\debug\obj\UdpClient.d
文件 15328 2017-12-07 16:05 9_TcpAndUdp\app\user\.output\eagle\debug\obj\UdpClient.o
文件 1281 2017-12-07 16:05 9_TcpAndUdp\app\user\.output\eagle\debug\obj\UdpService.d
文件 13708 2017-12-07 16:05 9_TcpAndUdp\app\user\.output\eagle\debug\obj\UdpService.o
文件 1000 2017-12-07 16:05 9_TcpAndUdp\app\user\.output\eagle\debug\obj\user_main.d
文件 4872 2017-12-07 16:05 9_TcpAndUdp\app\user\.output\eagle\debug\obj\user_main.o
文件 1522 2015-07-03 20:29 9_TcpAndUdp\app\user\Makefile
文件 3335 2017-12-07 16:27 9_TcpAndUdp\app\user\TcpClient.c
文件 2577 2017-12-07 14:53 9_TcpAndUdp\app\user\TcpService.c
文件 2681 2017-12-07 11:06 9_TcpAndUdp\app\user\UdpClient.c
文件 1976 2017-12-07 10:26 9_TcpAndUdp\app\user\UdpService.c
............此处省略113个文件信息
相关资源
- Esp8266进阶之路Windows系统搭建8266的本
- 8266的SmartConfig与Airkiss一键配网的Dem
- ESP8266模块激活工具
- stm32 8266 局域网 控制灯的开关
- 实现乐鑫esp8266的无线OTA升级,实现远
- STM32 控制ESP8266 WIFI模块 连接OneNET
- ESP8266和stm32之四实现LCD联网
-
ESP8266_NONOS_SDK-2.2.1_ba
sed_USARTrevised. - 环境监测系统
- esp8266创建MQTT任务,订阅接收和发布发
- 正点原子mini开发板+DHT11测量温湿度上
- STM32&ESP8266;开发板电路图
- STM32f103 物联网OV2640摄像头wifi传送
- 安信可ESP8266模块调试工具V3.0.0
- 基于物联网的智慧宿舍的设计
- 百度云IoT物联网平台 -ESP8266-MQTT 1路开
- OneNet云IoT物联网平台 ESP8266 MQTT 1路开
- esp8266固件烧写.zip
- stm32esp8266连web服务器.rar
- ESP8266 SDK入门指南
- ESP8266原理图和封装
- esp8266-NONOS_SDK-2.2.1_AT
- ESP8266二次开发源码
- esp8266和stm32之五,能连接路由器和增
- f103 c8t6 esp8266连接阿里云.rar
- stm32通过esp8266把温湿度和gps地图上传
- 安信可ESP8266安卓手机测试软件
- ESP8266WiFi探针代码
- ESP8266参考书籍英文版
- ESP8266探针
评论
共有 条评论