BC20-TE-B NB-Iot 评估板评估板原厂原理图V1.2。完整对应实物装置。
上传时间: 2022-06-17
上传用户:
ASR M08-B设置软件 V3.2 arduino 2560+ASRM08-B测试程序 arduino UNO+ASRM08-B测试程序语音控制台灯电路图及C51源码(不带校验码) 继电器模块设置。 ASR M08-B是一款语音识别模块。首先对模块添加一些关键字,对着该模块说出关键字,串口会返回三位的数,如果是返回特定的三位数字,还会引起ASR M08-B的相关引脚电平的变化。【测试】①打开“ASR M08-B设置软件 V3.2.exe”。②选择“串口号”、“打开串口”、点选“十六进制显示”。③将USB转串口模块连接到语音识别模块上。接线方法如下:语音模块TXD --> USB模块RXD语音模块RXD --> USB模块TXD语音模块GND --> USB模块GND语音模块3V3 --> USB模块3V3(此端为3.3V电源供电端。)④将模块的开关拨到“A”端,最好再按一次上面的大按钮(按一次即可,为了确保模块工作在正确的模式)。⑤对着模块说“开灯”、“关灯”模块会返回“0B”、“0A”,表示正常(注意:0B对应返回值010,0B对应返回值010,返回是16进制显示的嘛,设置的时候是10进制设置的)。
标签: ASR M08-B
上传时间: 2022-07-06
上传用户:aben
基本信息 ·出版社:清华大学出版社 ·页码:360 页 ·出版日期:2005年10月 ·ISBN:7302115095 ·条形码:9787302115090 ·版本:第1版 ·装帧:平装 ·开本:16开 Pages Per Sheet -------------------------------------------------------------------------------- 内容简介 《电子设计从零开始》全书分为三大部分,共17章。第1章至第8章深入浅出地介绍了模拟电路的相关知识;第9章至第11章是数字电路部分,介绍了一些基本概念和系统开发过程中经常使用的器件;从第12章到结束是以51单片机为例的单片机应用技术介绍,其中有大量的实例和完整的程序。 电子设计涉及的知识面广、难度大,初学者往往不知从何入手。《电子设计从零开始》结合了作者多年的学习与辅导经验,全面系统地介绍了进行电子设计与制作所需要的各种知识,包括模拟电路、数字电路和单片机应用基础,并结合Multisim仿真软件对大部分实例进行了演示。 -------------------------------------------------------------------------------- 编辑推荐 《电子设计从零开始》通过“讲故事”的形式将这三部分内容逐步展开,并结合电路仿真软Multisim 2001对一些实例进行了演示和验证。着眼技术的应用,并不苛求计算和深刻的理论理解正是《电子设计从零开始》编写时的目的;讲求通俗易懂,在阅读时应当注意提取知识点和实例中蕴含的技巧。书中还有一个特点就是插图丰富,这对理解所讲内容是很有帮助的。 《电子设计从零开始》适合电类本、专科学生作为全面掌握电子设计基础知识的参考书;也可作为无线电爱好者的实例参考用书;对于学有余力的非电类工科学生以及对电子设计感兴趣的中学生朋友来说,也是一本很好的全面了解电子设计基础知识的入门读物。 -------------------------------------------------------------------------------- 目录 第一章 走进电子技术 第二章 收音机里蕴含知识 第三章 制作第一件电子作品 第四章 从扩音机中学放大器 第五章 制作一台多媒体音箱 第六章 振荡器丰富多彩 第七章 集成电路ABC 第八章 传感器及其他器件 第九章 数字启航 第十章 逻辑门应用 第十一章 翻转与计数 第十二章 单片机就在我们身边 第十三章 单片机和LED 第十四章 单片机下命令 第十五章 跑马灯 第十六章 马表与时钟 第十七章 采集我们的声音 附录A Multisim2001的安装 附录B Multisim2001的菜单栏 附录C Multisim2001中的虚拟仪表 附录D 数字电路综合设计——数字钟 附录E ASCⅡ码表 参考文献 ……
上传时间: 2013-06-05
上传用户:HGH77P99
微处理器及微型计算机的发展概况 第一代微处理器是以Intel公司1971年推出的4004,4040为代表的四位微处理机。 第二代微处理机(1973年~1977年),典型代表有:Intel 公司的8080、8085;Motorola公司的M6800以及Zlog公司的Z80。 第三代微处理机 第三代微机是以16位机为代表,基本上是在第二代微机的基础上发展起来的。其中Intel公司的8088。8086是在8085的基础发展起来的;M68000是Motorola公司在M6800 的基础发展起来的; 第四代微处理机 以Intel公司1984年10月推出的80386CPU和1989年4月推出的80486CPU为代表, 第五代微处理机的发展更加迅猛,1993年3月被命名为PENTIUM的微处理机面世,98年PENTIUM 2又被推向市场。 INTEL CPU 发展历史Intel第一块CPU 4004,4位主理器,主频108kHz,运算速度0.06MIPs(Million Instructions Per Second, 每秒百万条指令),集成晶体管2,300个,10微米制造工艺,最大寻址内存640 bytes,生产曰期1971年11月. 8085,8位主理器,主频5M,运算速度0.37MIPs,集成晶体管6,500个,3微米制造工艺,最大寻址内存64KB,生产曰期1976年 8086,16位主理器,主频4.77/8/10MHZ,运算速度0.75MIPs,集成晶体管29,000个,3微米制造工艺,最大寻址内存1MB,生产曰期1978年6月. 80486DX,DX2,DX4,32位主理器,主频25/33/50/66/75/100MHZ,总线频率33/50/66MHZ,运算速度20~60MIPs,集成晶体管1.2M个,1微米制造工艺,168针PGA,最大寻址内存4GB,缓存8/16/32/64KB,生产曰期1989年4月 Celeron一代, 主频266/300MHZ(266/300MHz w/o L2 cache, Covington芯心 (Klamath based),300A/333/366/400/433/466/500/533MHz w/128kB L2 cache, Mendocino核心 (Deschutes-based), 总线频率66MHz,0.25微米制造工艺,生产曰期1998年4月) Pentium 4 (478针),至今分为三种核心:Willamette核心(主频1.5G起,FSB400MHZ,0.18微米制造工艺),Northwood核心(主频1.6G~3.0G,FSB533MHZ,0.13微米制造工艺, 二级缓存512K),Prescott核心(主频2.8G起,FSB800MHZ,0.09微米制造工艺,1M二级缓存,13条全新指令集SSE3),生产曰期2001年7月. 更大的缓存、更高的频率、 超级流水线、分支预测、乱序执行超线程技术 微型计算机组成结构单片机简介单片机即单片机微型计算机,是将计算机主机(CPU、 内存和I/O接口)集成在一小块硅片上的微型机。 三、计算机编程语言的发展概况 机器语言 机器语言就是0,1码语言,是计算机唯一能理解并直接执行的语言。汇编语言 用一些助记符号代替用0,1码描述的某种机器的指令系统,汇编语言就是在此基础上完善起来的。高级语言 BASIC,PASCAL,C语言等等。用高级语言编写的程序称源程序,它们必须通过编译或解释,连接等步骤才能被计算机处理。 面向对象语言 C++,Java等编程语言是面向对象的语言。 1.3 微型计算机中信息的表示及运算基础(一) 十进制ND有十个数码:0~9,逢十进一。 例 1234.5=1×103 +2×102 +3×101 +4×100 +5×10-1加权展开式以10称为基数,各位系数为0~9,10i为权。 一般表达式:ND= dn-1×10n-1+dn-2×10n-2 +…+d0×100 +d-1×10-1+… (二) 二进制NB两个数码:0、1, 逢二进一。 例 1101.101=1×23+1×22+0×21+1×20+1×2-1+1×2-3 加权展开式以2为基数,各位系数为0、1, 2i为权。 一般表达式: NB = bn-1×2n-1 + bn-2×2n-2 +…+b0×20 +b-1×2-1+… (三)十六进制NH十六个数码0~9、A~F,逢十六进一。 例:DFC.8=13×162 +15×161 +12×160 +8×16-1 展开式以十六为基数,各位系数为0~9,A~F,16i为权。 一般表达式: NH= hn-1×16n-1+ hn-2×16n-2+…+ h0×160+ h-1×16-1+… 二、不同进位计数制之间的转换 (二)二进制与十六进制数之间的转换 24=16 ,四位二进制数对应一位十六进制数。举例:(三)十进制数转换成二、十六进制数整数、小数分别转换 1.整数转换法“除基取余”:十进制整数不断除以转换进制基数,直至商为0。每除一次取一个余数,从低位排向高位。举例: 2. 小数转换法“乘基取整”:用转换进制的基数乘以小数部分,直至小数为0或达到转换精度要求的位数。每乘一次取一次整数,从最高位排到最低位。举例: 三、带符号数的表示方法 机器数:机器中数的表示形式。真值: 机器数所代表的实际数值。举例:一个8位机器数与它的真值对应关系如下: 真值: X1=+84=+1010100B X2=-84= -1010100B 机器数:[X1]机= 01010100 [X2]机= 11010100(二)原码、反码、补码最高位为符号位,0表示 “+”,1表示“-”。 数值位与真值数值位相同。 例 8位原码机器数: 真值: x1 = +1010100B x2 =- 1010100B 机器数: [x1]原 = 01010100 [x2]原 = 11010100原码表示简单直观,但0的表示不唯一,加减运算复杂。 正数的反码与原码表示相同。 负数反码符号位为 1,数值位为原码数值各位取反。 例 8位反码机器数: x= +4: [x]原= 00000100 [x]反= 00000100 x= -4: [x]原= 10000100 [x]反= 111110113、补码(Two’s Complement)正数的补码表示与原码相同。 负数补码等于2n-abs(x)8位机器数表示的真值四、 二进制编码例:求十进制数876的BCD码 876= 1000 0111 0110 BCD 876= 36CH = 1101101100B 2、字符编码 美国标准信息交换码ASCII码,用于计算 机与计算机、计算机与外设之间传递信息。 3、汉字编码 “国家标准信息交换用汉字编码”(GB2312-80标准),简称国标码。 用两个七位二进制数编码表示一个汉字 例如“巧”字的代码是39H、41H汉字内码例如“巧”字的代码是0B9H、0C1H1·4 运算基础 一、二进制数的运算加法规则:“逢2进1” 减法规则:“借1当2” 乘法规则:“逢0出0,全1出1”二、二—十进制数的加、减运算 BCD数的运算规则 循十进制数的运算规则“逢10进1”。但计算机在进行这种运算时会出现潜在的错误。为了解决BCD数的运算问题,采取调整运算结果的措施:即“加六修正”和“减六修正”例:10001000(BCD)+01101001(BCD) =000101010111(BCD) 1 0 0 0 1 0 0 0 + 0 1 1 0 1 0 0 1 1 1 1 1 0 0 0 1 + 0 1 1 0 0 1 1 0 ……调整 1 0 1 0 1 0 1 1 1 进位 例: 10001000(BCD)- 01101001(BCD)= 00011001(BCD) 1 0 0 0 1 0 0 0 - 0 1 1 0 1 0 0 1 0 0 0 1 1 1 1 1 - 0 1 1 0 ……调整 0 0 0 1 1 0 0 1 三、 带符号二进制数的运算 1.5 几个重要的数字逻辑电路编码器译码器计数器微机自动工作的条件程序指令顺序存放自动跟踪指令执行1.6 微机基本结构微机结构各部分组成连接方式1、以CPU为中心的双总线结构;2、以内存为中心的双总线结构;3、单总线结构CPU结构管脚特点 1、多功能;2、分时复用内部结构 1、控制; 2、运算; 3、寄存器; 4、地址程序计数器堆栈定义 1、定义;2、管理;3、堆栈形式
上传时间: 2013-10-17
上传用户:erkuizhang
4.asm…… 响铃程序,输入一个数字字符N,响铃N次。(完成)ysk3.asm ……显示一个星型倒三角。m1.asm ………编程将键盘输入的8位无符号二进制数转化为十六进制数和十进制数,并输出结果form.asm ……采用子程序编程按以下三种格式(██,◣,◥)打印九九乘法表:(完成)char.asm ……小写字母a b c d ……x y z的ASCII码分别为61H 62H 63H 64H……78H 79H 7AH, 而大写字母A B C D ….X Y Z的ASCII码分别为41H 42H 43H 44H …58H 59H 5AH, 使用串处理指令编程从键盘输入16个字符(大小写字母及其它字母均有), 存入以BUF1开始的一片存储区中,并将其传送到以BUF2开始的一片存储区中, 在传送是将其中的小写字母均改为大写字母,并将第一个小写字母在串中的位置 (距串头BUF1的相对位移量)以十六进制形式输出。(完成)
上传时间: 2013-12-22
上传用户:zhyiroy
This section contains a brief introduction to the C language. It is intended as a tutorial on the language, and aims at getting a reader new to C started as quickly as possible. It is certainly not intended as a substitute for any of the numerous textbooks on C. 2. write a recursive function FIB (n) to find out the nth element in theFibanocci sequence number which is 1,1,2,3,5,8,13,21,34,55,…3. write the prefix and postfix form of the following infix expressiona + b – c / d + e * f – g * h / i ^ j4. write a function to count the number of nodes in a binary tr
标签: introduction the contains intended
上传时间: 2013-12-23
上传用户:liansi
Implemented BFS, DFS and A* To compile this project, use the following command: g++ -o search main.cpp Then you can run it: ./search The input is loaded from a input file in.txt Here is the format of the input file: The first line of the input file shoud contain two chars indicate the source and destination city for breadth first and depth first algorithm. The second line of input file shoud be an integer m indicate the number of connections for the map. Following m lines describe the map, each line represents to one connection in this form: dist city1 city2, which means there is a connection between city1 and city2 with the distance dist. The following input are for A* The following line contains two chars indicate the source and destination city for A* algorithm. Then there is an integer h indicate the number of heuristic. The following h lines is in the form: city dist which means the straight-line distance from the city to B is dist.
标签: Implemented following compile command
上传时间: 2014-01-01
上传用户:lhc9102
BNB20 Finds the constrained minimum of a function of several possibly integer variables. % Usage: [errmsg,Z,X,t,c,fail] = % BNB20(fun,x0,xstatus,xlb,xub,A,B,Aeq,Beq,nonlcon,settings,options,P1,P2,...) % % BNB solves problems of the form: % Minimize F(x) subject to: xlb <= x0 <=xub % A*x <= B Aeq*x=Beq % C(x)<=0 Ceq(x)=0 % x(i) is continuous for xstatus(i)=0 % x(i) integer for xstatus(i)= 1 % x(i) fixed for xstatus(i)=2 %
标签: constrained variables function possibly
上传时间: 2014-01-13
上传用户:youth25
/* ********************************************************************************************************* * uC/TCP-IP V2 * The Embedded TCP/IP Suite * * (c) Copyright 2003-2010; Micrium, Inc.; Weston, FL * * All rights reserved. Protected by international copyright laws. * * uC/TCP-IP is provided in source form to registered licensees ONLY. It is * illegal to distribute this source code to any third party unless you receive * written permission by an authorized Micrium representative. Knowledge of * the source code may NOT be used to develop a similar product. * * Please help us continue to provide the Embedded community with the finest * software available. Your honesty is greatly appreciated. * * You can contact us at www.micrium.com. ********************************************************************************************************* */ /* ********************************************************************************************************* * * NETWORK TCP LAYER * (TRANSMISSION CONTROL PROTOCOL) * * Filename : net_tcp.h * Version : V2.10 * Programmer(s) : ITJ ********************************************************************************************************* * Note(s) : (1) Supports Transmission Control Protocol as described in RFC #793 with the following * restrictions/constraints : * * (a) TCP Security & Precedence NOT supported RFC # 793, Section 3.6 * * (b) TCP Urgent Data NOT supported RFC # 793, Section 3.7 * 'The Communication of * Urgent Information' * * (c) The following TCP options NOT supported : * * (1) Window Scale RFC #1072, Section 2 * RFC #1323, Section 2 * (2) Selective Acknowledgement (SACK) RFC #1072, Section 3 * RFC #2018 * RFC #2883 * (3) TCP Echo RFC #1072, Section 4 * (4) Timestamp RFC #1323, Section 3.2 * (5) Protection Against Wrapped Sequences (PAWS) RFC #1323, Section 4 * * (d) #### IP-Options-to-TCP-Connection RFC #1122, Section 4.2.3.8 * Handling NOT supported * * (e) #### ICMP-Error-Message-to-TCP-Connection RFC #1122, Section 4.2.3.9 * Handling NOT currently supported * * (2) TCP Layer assumes/requires Network Socket Layer (see 'net_sock.h MODULE Note #1a2'). ********************************************************************************************************* */ /*$PAGE*/ /* ********************************************************************************************************* * MODULE * * Note(s) : (1) TCP Layer module is NOT required for UDP-to-Application API configuration. * * See also 'net_cfg.h TRANSPORT LAYER CONFIGURATION' * & 'net_cfg.h USER DATAGRAM PROTOCOL LAYER CONFIGURATION'. * * See also 'net_tcp.h Note #2'. * * (2) The following TCP-module-present configuration value MUST be pre-#define'd in * 'net_cfg_net.h' PRIOR to all other network modules that require TCP Layer * configuration (see 'net_cfg_net.h TCP LAYER CONFIGURATION Note #2b') : * * NET_TCP_MODULE_PRESENT ********************************************************************************************************* */ #ifdef NET_TCP_MODULE_PRESENT /* See Note #2. */ /* ********************************************************************************************************* * EXTERNS ********************************************************************************************************* */ #if ((defined(NET_TCP_MODULE)) && \ (defined(NET_GLOBALS_EXT))) #define NET_TCP_EXT #else #define NET_TCP_EXT extern #endif /*$PAGE*/ /* ********************************************************************************************************* * DEFINES ********************************************************************************************************* */ /* ********************************************************************************************************* * TCP HEADER DEFINES * * Note(s) : (1) The following TCP value MUST be pre-#define'd in 'net_def.h' PRIOR to 'net_buf.h' so that * the Network Buffer Module can configure maximum buffer header size (see 'net_def.h TCP * LAYER DEFINES' & 'net_buf.h NETWORK BUFFER INDEX & SIZE DEFINES Note #1') : * * (a) NET_TCP_HDR_SIZE_MAX 60 (NET_TCP_HDR_LEN_MAX * * NET_TCP_HDR_LEN_WORD_SIZE) * * (2) Urgent pointer & data NOT supported (see 'net_tcp.h Note #1b'). ********************************************************************************************************* */ #define NET_TCP_HDR_LEN_MASK 0xF000u #define NET_TCP_HDR_LEN_SHIFT 12u #define NET_TCP_HDR_LEN_NONE 0u #define NET_TCP_HDR_LEN_MIN 5u #define NET_TCP_HDR_LEN_MAX 15u #define NET_TCP_HDR_LEN_WORD_SIZE CPU_WORD_SIZE_32 #define NET_TCP_HDR_SIZE_MIN (NET_TCP_HDR_LEN_MIN * NET_TCP_HDR_LEN_WORD_SIZE) #if 0 /* See Note #1a. */ #define NET_TCP_HDR_SIZE_MAX (NET_TCP_HDR_LEN_MAX * NET_TCP_HDR_LEN_WORD_SIZE) #endif #define NET_TCP_HDR_SIZE_TOT_MIN (NET_IP_HDR_SIZE_TOT_MIN + NET_TCP_HDR_SIZE_MIN) #define NET_TCP_HDR_SIZE_TOT_MAX (NET_IP_HDR_SIZE_TOT_MAX + NET_TCP_HDR_SIZE_MAX) #define NET_TCP_PSEUDO_HDR_SIZE 12u /* = sizeof(NET_TCP_PSEUDO_HDR) */ #define NET_TCP_PORT_NBR_RESERVED NET_PORT_NBR_RESERVED #define NET_TCP_PORT_NBR_NONE NET_TCP_PORT_NBR_RESERVED #define NET_TCP_HDR_URG_PTR_NONE 0x0000u /* See Note #2. */ /*$PAGE*/ /* ********************************************************************************************************* * TCP HEADER FLAG DEFINES * * Note(s) : (1) See 'TCP HEADER Note #2' for flag fields. * * (2) Urgent pointer & data NOT supported (see 'net_tcp.h Note #1b'). ********************************************************************************************************* */ #define NET_TCP_HDR_FLAG_MASK 0x0FFFu #define NET_TCP_HDR_FLAG_NONE DEF_BIT_NONE #define NET_TCP_HDR_FLAG_RESERVED 0x0FE0u /* MUST be '0'. */ #define NET_TCP_HDR_FLAG_URGENT DEF_BIT_05 /* See Note #2. */ #define NET_TCP_HDR_FLAG_ACK DEF_BIT_04 #define NET_TCP_HDR_FLAG_PUSH DEF_BIT_03 #define NET_TCP_HDR_FLAG_RESET DEF_BIT_02 #define NET_TCP_HDR_FLAG_SYNC DEF_BIT_01 #define NET_TCP_HDR_FLAG_FIN DEF_BIT_00 #define NET_TCP_HDR_FLAG_CLOSE NET_TCP_HDR_FLAG_FIN /* ********************************************************************************************************* * TCP FLAG DEFINES ********************************************************************************************************* */ /* ------------------ NET TCP FLAGS ------------------- */ #define NET_TCP_FLAG_NONE DEF_BIT_NONE #define NET_TCP_FLAG_USED DEF_BIT_00 /* TCP conn cur used; i.e. NOT in free TCP conn pool. */ /* ------------------ TCP TX FLAGS ------------------- */ /* TCP tx flags copied from TCP hdr flags. */ #define NET_TCP_FLAG_TX_FIN NET_TCP_HDR_FLAG_FIN #define NET_TCP_FLAG_TX_CLOSE NET_TCP_FLAG_TX_FIN #define NET_TCP_FLAG_TX_SYNC NET_TCP_HDR_FLAG_SYNC #define NET_TCP_FLAG_TX_RESET NET_TCP_HDR_FLAG_RESET #define NET_TCP_FLAG_TX_PUSH NET_TCP_HDR_FLAG_PUSH #define NET_TCP_FLAG_TX_ACK NET_TCP_HDR_FLAG_ACK #define NET_TCP_FLAG_TX_URGENT NET_TCP_HDR_FLAG_URGENT #define NET_TCP_FLAG_TX_BLOCK DEF_BIT_07 /* ------------------ TCP RX FLAGS ------------------- */ #define NET_TCP_FLAG_RX_DATA_PEEK DEF_BIT_08 #define NET_TCP_FLAG_RX_BLOCK DEF_BIT_15 /*$PAGE*/ /* ********************************************************************************************************* * TCP TYPE DEFINES * * Note(s) : (1) NET_TCP_TYPE_&&& #define values specifically chosen as ASCII representations of the TCP * types. Memory displays of TCP types will display with their chosen ASCII names. ********************************************************************************************************* */ /* ------------------ NET TCP TYPES ------------------- */ #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) #define NET_TCP_TYPE_NONE 0x4E4F4E45u /* "NONE" in ASCII. */ #define NET_TCP_TYPE_CONN 0x54435020u /* "TCP " in ASCII. */ #else #if (CPU_CFG_DATA_SIZE == CPU_WORD_SIZE_32) #define NET_TCP_TYPE_NONE 0x454E4F4Eu /* "NONE" in ASCII. */ #define NET_TCP_TYPE_CONN 0x20504354u /* "TCP " in ASCII. */ #elif (CPU_CFG_DATA_SIZE == CPU_WORD_SIZE_16) #define NET_TCP_TYPE_NONE 0x4F4E454Eu /* "NONE" in ASCII. */ #define NET_TCP_TYPE_CONN 0x43542050u /* "TCP " in ASCII. */ #else /* Dflt CPU_WORD_SIZE_08. */ #define NET_TCP_TYPE_NONE 0x4E4F4E45u /* "NONE" in ASCII. */ #define NET_TCP_TYPE_CONN 0x54435020u /* "TCP " in ASCII. */ #endif #endif /* ********************************************************************************************************* * TCP SEQUENCE NUMBER DEFINES * * Note(s) : (1) TCP initial transmit sequence number is incremented by a fixed value, preferably a large * prime value or a large value with multiple unique factors. * * (a) One reasonable TCP initial transmit sequence number increment value example : * * 65527 = 37 * 23 * 11 * 7 * * * #### NET_TCP_TX_SEQ_NBR_CTR_INC could be developer-configured in 'net_cfg.h'. * * See also 'NET_TCP_TX_GET_SEQ_NBR() Notes #1b2 & #1c2'. ********************************************************************************************************* */ #define NET_TCP_SEQ_NBR_NONE 0u #define NET_TCP_ACK_NBR_NONE NET_TCP_SEQ_NBR_NONE #define NET_TCP_TX_SEQ_NBR_CTR_INC 65527u /* See Note #1. */ #define NET_TCP_ACK_NBR_DUP_WIN_SIZE_SCALE 4 /*$PAGE*/ /* ********************************************************************************************************* * TCP DATA/TOTAL LENGTH DEFINES * * Note(s) : (1) (a) TCP total length #define's (NET_TCP_TOT_LEN) relate to the total size of a complete * TCP packet, including the packet's TCP header. Note that a complete TCP packet MAY * be fragmented in multiple Internet Protocol packets. * * (b) TCP data length #define's (NET_TCP_DATA_LEN) relate to the data size of a complete * TCP packet, equal to the total TCP packet length minus its TCP header size. Note * that a complete TCP packet MAY be fragmented in multiple Internet Protocol packets. ********************************************************************************************************* */ /* See Notes #1a & #1b. */ #define NET_TCP_DATA_LEN_MIN 0u #define NET_TCP_TOT_LEN_MIN (NET_TCP_HDR_SIZE_MIN + NET_TCP_DATA_LEN_MIN) #define NET_TCP_TOT_LEN_MAX (NET_IP_TOT_LEN_MAX - NET_IP_HDR_SIZE_MIN ) #define NET_TCP_DATA_LEN_MAX (NET_TCP_TOT_LEN_MAX - NET_TCP_HDR_SIZE_MIN) /*$PAGE*/ /* ********************************************************************************************************* * TCP SEGMENT SIZE DEFINES * * Note(s) : (1) (a) RFC # 879, Section 3 states that the TCP Maximum Segment Size "counts only * data octets in the segment, ... not the TCP header or the IP header". * * (b) RFC #1122, Section 4.2.2.6 requires that : * * (1) "The MSS value to be sent in an MSS option must be less than or equal to * * (A) MMS_R - 20 * * where MMS_R is the maximum size for a transport-layer message that can * be received." * * (2) "If an MSS option is not received at connection setup, TCP MUST assume a * default send MSS of 536 (576 - 40)." * * See also 'net_ip.h IP DATA/TOTAL LENGTH DEFINES Note #1'. ********************************************************************************************************* */ /* See Note #1. */ #define NET_TCP_MAX_SEG_SIZE_DFLT (NET_IP_MAX_DATAGRAM_SIZE_DFLT - NET_IP_HDR_SIZE_MIN - NET_TCP_HDR_SIZE_MIN) #define NET_TCP_MAX_SEG_SIZE_DFLT_RX NET_TCP_DATA_LEN_MAX /* See Note #1b1. */ #define NET_TCP_MAX_SEG_SIZE_DFLT_TX NET_TCP_MAX_SEG_SIZE_DFLT /* See Note #1b2. */ #define NET_TCP_MAX_SEG_SIZE_NONE 0u #define NET_TCP_MAX_SEG_SIZE_MIN NET_TCP_MAX_SEG_SIZE_DFLT #define NET_TCP_MAX_SEG_SIZE_MAX NET_TCP_DATA_LEN_MAX #define NET_TCP_SEG_LEN_MIN NET_TCP_DATA_LEN_MIN #define NET_TCP_SEG_LEN_MAX NET_TCP_DATA_LEN_MAX #define NET_TCP_SEG_LEN_SYNC 1u #define NET_TCP_SEG_LEN_FIN 1u #define NET_TCP_SEG_LEN_CLOSE NET_TCP_SEG_LEN_FIN #define NET_TCP_SEG_LEN_ACK 0u #define NET_TCP_SEG_LEN_RESET 0u #define NET_TCP_SEG_LEN_PROBE 0u #define NET_TCP_DATA_LEN_TX_SYNC 0u #define NET_TCP_DATA_LEN_TX_FIN 0u #define NET_TCP_DATA_LEN_TX_CLOSE NET_TCP_DATA_LEN_TX_FIN #define NET_TCP_DATA_LEN_TX_ACK 0u #define NET_TCP_DATA_LEN_TX_PROBE_NO_DATA 0u #define NET_TCP_DATA_LEN_TX_PROBE_DATA 1u #define NET_TCP_DATA_LEN_TX_RESET 0u #define NET_TCP_TX_PROBE_DATA 0x00u /* ********************************************************************************************************* * TCP WINDOW SIZE DEFINES * * Note(s) : (1) Although NO RFC specifies the absolute minimum TCP connection window size value allowed, * RFC #793, Section 3.7 'Data Communication : Managing the Window' states that for "the * window ... there is an assumption that this is related to the currently available data * buffer space available for this connection". ********************************************************************************************************* */ #define NET_TCP_WIN_SIZE_NONE 0u #define NET_TCP_WIN_SIZE_MIN NET_TCP_MAX_SEG_SIZE_MIN #define NET_TCP_WIN_SIZE_MAX DEF_INT_16U_MAX_VAL /*$PAGE*/ /* ********************************************************************************************************* * TCP HEADER OPTIONS DEFINES * * Note(s) : (1) See the following RFC's for TCP options summary : * * (a) RFC # 793, Section 3.1 'Header Format : Options' * (b) RFC #1122; Sections 4.2.2.5, 4.2.2.6 * * (2) TCP option types are encoded in the first octet for each TCP option as follows : * * -------- * | TYPE | * -------- * * The TCP option type value determines the TCP option format : * * (a) The following TCP option types are single-octet TCP options -- i.e. the option type * octet is the ONLY octet for the TCP option. * * (1) TYPE = 0 End of Options List * (2) TYPE = 1 No Operation * * * (b) All other TCP options MUST be multi-octet TCP options (see RFC #1122, Section 4.2.2.5) : * * ------------------------------ * | TYPE | LEN | TCP OPT | * ------------------------------ * * where * TYPE Indicates the specific TCP option type * LEN Indicates the total TCP option length, in octets, including * the option type & the option length octets * TCP OPT Additional TCP option octets, if any, that contain the remaining * TCP option information * * The following TCP option types are multi-octet TCP options where the option's second * octet specify the total TCP option length, in octets, including the option type & the * option length octets : * * (1) TYPE = 2 Maximum Segment Size See RFC # 793, Section 3.1 'Header Format : * Options : Maximum Segment Size'; * RFC #1122, Section 4.2.2.6; * RFC # 879, Section 3 * * (2) TYPE = 3 Window Scale See 'net_tcp.h Note #1c1' * (3) TYPE = 4 SACK Allowed See 'net_tcp.h Note #1c2' * (4) TYPE = 5 SACK Option See 'net_tcp.h Note #1c2' * (5) TYPE = 6 Echo Request See 'net_tcp.h Note #1c3' * (6) TYPE = 7 Echo Reply See 'net_tcp.h Note #1c3' * (7) TYPE = 8 Timestamp See 'net_tcp.h Note #1c4' * * (3) TCP header allows for a maximum option list length of 40 octets : * * NET_TCP_HDR_OPT_SIZE_MAX = NET_TCP_HDR_SIZE_MAX - NET_TCP_HDR_SIZE_MIN * * = 60 - 20 * * = 40 * * (4) 'NET_TCP_OPT_SIZE' MUST be pre-defined PRIOR to all definitions that require TCP option * size data type. ********************************************************************************************************* */ /*$PAGE*/ #define NET_TCP_HDR_OPT_END_LIST 0u #define NET_TCP_HDR_OPT_NOP 1u #define NET_TCP_HDR_OPT_MAX_SEG_SIZE 2u #define NET_TCP_HDR_OPT_WIN_SCALE 3u #define NET_TCP_HDR_OPT_SACK_PERMIT 4u #define NET_TCP_HDR_OPT_SACK 5u #define NET_TCP_HDR_OPT_ECHO_REQ 6u #define NET_TCP_HDR_OPT_ECHO_REPLY 7u #define NET_TCP_HDR_OPT_TS 8u #define NET_TCP_HDR_OPT_PAD NET_TCP_HDR_OPT_END_LIST #define NET_TCP_HDR_OPT_LEN_END_LIST 1u #define NET_TCP_HDR_OPT_LEN_NOP 1u #define NET_TCP_HDR_OPT_LEN_MAX_SEG_SIZE 4u #define NET_TCP_HDR_OPT_LEN_WIN_SCALE 3u #define NET_TCP_HDR_OPT_LEN_SACK_PERMIT 2u #define NET_TCP_HDR_OPT_LEN_ECHO_REQ 6u #define NET_TCP_HDR_OPT_LEN_ECHO_REPLY 6u #define NET_TCP_HDR_OPT_LEN_TS 10u #define NET_TCP_HDR_OPT_LEN_SACK_MIN 6u #define NET_TCP_HDR_OPT_LEN_SACK_MAX 38u #define NET_TCP_HDR_OPT_LEN_MIN 1u #define NET_TCP_HDR_OPT_LEN_MIN_LEN 2u #define NET_TCP_HDR_OPT_LEN_MAX 38u typedef CPU_INT32U NET_TCP_OPT_SIZE; /* TCP opt size data type (see Note #4). */ #define NET_TCP_HDR_OPT_SIZE_WORD (sizeof(NET_TCP_OPT_SIZE)) #define NET_TCP_HDR_OPT_SIZE_MAX (NET_TCP_HDR_SIZE_MAX - NET_TCP_HDR_SIZE_MIN) #define NET_TCP_HDR_OPT_NBR_MIN 0u #define NET_TCP_HDR_OPT_NBR_MAX (NET_TCP_HDR_OPT_SIZE_MAX / NET_TCP_HDR_OPT_SIZE_WORD) #define NET_TCP_HDR_OPT_IX NET_TCP_HDR_SIZE_MIN /*$PAGE*/ /* ********************************************************************************************************* * TCP OPTION CONFIGURATION TYPE DEFINES * * Note(s) : (1) NET_TCP_OPT_CFG_TYPE_&&& #define values specifically chosen as ASCII representations of * the TCP option configuration types. Memory displays of TCP option configuration buffers * will display the TCP option configuration TYPEs with their chosen ASCII names. ********************************************************************************************************* */ /* ---------------- TCP OPT CFG TYPES ----------------- */ #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) #define NET_TCP_OPT_CFG_TYPE_NONE 0x4E4F4E45u /* "NONE" in ASCII. */ #define NET_TCP_OPT_CFG_TYPE_MAX_SEG_SIZE 0x4D535320u /* "MSS " in ASCII. */ #define NET_TCP_OPT_CFG_TYPE_WIN_SCALE 0x57494E20u /* "WIN " in ASCII (see 'net_tcp.h Note #1c1'). */ #define NET_TCP_OPT_CFG_TYPE_SACK_PERMIT 0x53434B50u /* "SCKP" in ASCII (see 'net_tcp.h Note #1c2'). */ #define NET_TCP_OPT_CFG_TYPE_SACK 0x5341434Bu /* "SACK" in ASCII (see 'net_tcp.h Note #1c2'). */ #define NET_TCP_OPT_CFG_TYPE_ECHO_REQ 0x45524551u /* "EREQ" in ASCII (see 'net_tcp.h Note #1c3'). */ #define NET_TCP_OPT_CFG_TYPE_ECHO_REPLY 0x4543484Fu /* "ECHO" in ASCII (see 'net_tcp.h Note #1c3'). */ #define NET_TCP_OPT_CFG_TYPE_TS 0x54532020u /* "TS " in ASCII (see 'net_tcp.h Note #1c4'). */ #else #if (CPU_CFG_DATA_SIZE == CPU_WORD_SIZE_32) #define NET_TCP_OPT_CFG_TYPE_NONE 0x454E4F4Eu /* "NONE" in ASCII. */ #define NET_TCP_OPT_CFG_TYPE_MAX_SEG_SIZE 0x2053534Du /* "MSS " in ASCII. */ #define NET_TCP_OPT_CFG_TYPE_WIN_SCALE 0x204E4957u /* "WIN " in ASCII (see 'net_tcp.h Note #1c1'). */ #define NET_TCP_OPT_CFG_TYPE_SACK_PERMIT 0x504B4353u /* "SCKP" in ASCII (see 'net_tcp.h Note #1c2'). */ #define NET_TCP_OPT_CFG_TYPE_SACK 0x4B434153u /* "SACK" in ASCII (see 'net_tcp.h Note #1c2'). */ #define NET_TCP_OPT_CFG_TYPE_ECHO_REQ 0x51455245u /* "EREQ" in ASCII (see 'net_tcp.h Note #1c3'). */ #define NET_TCP_OPT_CFG_TYPE_ECHO_REPLY 0x4F484345u /* "ECHO" in ASCII (see 'net_tcp.h Note #1c3'). */ #define NET_TCP_OPT_CFG_TYPE_TS 0x20205354u /* "TS " in ASCII (see 'net_tcp.h Note #1c4'). */ #elif (CPU_CFG_DATA_SIZE == CPU_WORD_SIZE_16) #define NET_TCP_OPT_CFG_TYPE_NONE 0x4F4E454Eu /* "NONE" in ASCII. */ #define NET_TCP_OPT_CFG_TYPE_MAX_SEG_SIZE 0x534D2053u /* "MSS " in ASCII. */ #define NET_TCP_OPT_CFG_TYPE_WIN_SCALE 0x4957204Eu /* "WIN " in ASCII (see 'net_tcp.h Note #1c1'). */ #define NET_TCP_OPT_CFG_TYPE_SACK_PERMIT 0x4353504Bu /* "SCKP" in ASCII (see 'net_tcp.h Note #1c2'). */ #define NET_TCP_OPT_CFG_TYPE_SACK 0x41534B43u /* "SACK" in ASCII (see 'net_tcp.h Note #1c2'). */ #define NET_TCP_OPT_CFG_TYPE_ECHO_REQ 0x52455145u /* "EREQ" in ASCII (see 'net_tcp.h Note #1c3'). */ #define NET_TCP_OPT_CFG_TYPE_ECHO_REPLY 0x43454F48u /* "ECHO" in ASCII (see 'net_tcp.h Note #1c3'). */ #define NET_TCP_OPT_CFG_TYPE_TS 0x53542020u /* "TS " in ASCII (see 'net_tcp.h Note #1c4'). */ #else /* Dflt CPU_WORD_SIZE_08. */ #define NET_TCP_OPT_CFG_TYPE_NONE 0x4E4F4E45u /* "NONE" in ASCII. */ #define NET_TCP_OPT_CFG_TYPE_MAX_SEG_SIZE 0x4D535320u /* "MSS " in ASCII. */ #define NET_TCP_OPT_CFG_TYPE_WIN_SCALE 0x57494E20u /* "WIN " in ASCII (see 'net_tcp.h Note #1c1'). */ #define NET_TCP_OPT_CFG_TYPE_SACK_PERMIT 0x53434B50u /* "SCKP" in ASCII (see 'net_tcp.h Note #1c2'). */ #define NET_TCP_OPT_CFG_TYPE_SACK 0x5341434Bu /* "SACK" in ASCII (see 'net_tcp.h Note #1c2'). */ #define NET_TCP_OPT_CFG_TYPE_ECHO_REQ 0x45524551u /* "EREQ" in ASCII (see 'net_tcp.h Note #1c3'). */ #define NET_TCP_OPT_CFG_TYPE_ECHO_REPLY 0x4543484Fu /* "ECHO" in ASCII (see 'net_tcp.h Note #1c3'). */ #define NET_TCP_OPT_CFG_TYPE_TS 0x54532020u /* "TS " in ASCII (see 'net_tcp.h Note #1c4'). */ #endif #endif /*$PAGE*/ /* ********************************************************************************************************* * TCP CONNECTION TIMEOUT DEFINES * * Note(s) : (1) (a) (1) RFC #1122, Section 4.2.2.13 'DISCUSSION' states that "the graceful close algorithm * of TCP requires that the connection state remain defined on (at least) one end of * the connection, for a timeout period of 2xMSL ... During this period, the (remote * socket, local socket) pair that defines the connection is busy and cannot be reused". * * (2) The following sections reiterate that the TIME-WAIT state timeout scalar is two * maximum segment lifetimes (2 MSL) : * * (A) RFC #793, Section 3.9 'Event Processing : SEGMENT ARRIVES : * Check Sequence Number : TIME-WAIT STATE' * (B) RFC #793, Section 3.9 'Event Processing : SEGMENT ARRIVES : * Check FIN Bit : TIME-WAIT STATE' * * (b) (1) RFC #793, Section 3.3 'Sequence Numbers : Knowing When to Keep Quiet' states that * "the Maximum Segment Lifetime (MSL) is ... to be 2 minutes. This is an engineering * choice, and may be changed if experience indicates it is desirable to do so". * * (2) Microsoft Corporation's Windows XP defaults MSL to 15 seconds. ********************************************************************************************************* */ /* Max seg timeout (see Note #1b) : */ #define NET_TCP_CONN_TIMEOUT_MAX_SEG_MIN_SEC ( 0u ) /* ... min = 0 seconds */ #define NET_TCP_CONN_TIMEOUT_MAX_SEG_MAX_SEC ( 2u * DEF_TIME_NBR_SEC_PER_MIN) /* ... max = 2 minutes */ #define NET_TCP_CONN_TIMEOUT_MAX_SEG_DFLT_SEC ( 15u ) /* ... dflt = 15 seconds */ #define NET_TCP_CONN_TIMEOUT_MAX_SEG_SCALAR 2u /* ... scalar (see Note #1a). */ #define NET_TCP_CONN_TIMEOUT_CONN_DFLT_SEC (120u * DEF_TIME_NBR_SEC_PER_MIN) /* Dflt conn timeout = 120 minutes */ #define NET_TCP_CONN_TIMEOUT_USER_DFLT_SEC ( 30u * DEF_TIME_NBR_SEC_PER_MIN) /* Dflt user timeout = 30 minutes */ /*$PAGE*/ /* ********************************************************************************************************* * TCP CONNECTION STATES * * Note(s) : (1) See the following RFC's for TCP state machine summary : * * (a) RFC # 793; Sections 3.2, 3.4, 3.5, 3.9 * (b) RFC #1122; Sections 4.2.2.8, 4.2.2.10, 4.2.2.11, 4.2.2.13, 4.2.2.18, 4.2.2.20 * * (2) (a) #### Additional closing-data-available state used for closing connections to allow the * application layer to receive any remaining data. * * See also 'net_tcp.c NetTCP_RxPktConnHandlerFinWait1() Note #2f5A2', * 'net_tcp.c NetTCP_RxPktConnHandlerFinWait2() Note #2f5B', * 'net_tcp.c NetTCP_RxPktConnHandlerClosing() Note #2d2B2a1B', * & 'net_tcp.c NetTCP_RxPktConnHandlerLastAck() Note #2d2A1b'. ********************************************************************************************************* */ #define NET_TCP_CONN_STATE_NONE 0u #define NET_TCP_CONN_STATE_FREE 1u #define NET_TCP_CONN_STATE_CLOSED 10u #define NET_TCP_CONN_STATE_LISTEN 20u #define NET_TCP_CONN_STATE_SYNC_RXD 30u #define NET_TCP_CONN_STATE_SYNC_RXD_PASSIVE 31u #define NET_TCP_CONN_STATE_SYNC_RXD_ACTIVE 32u #define NET_TCP_CONN_STATE_SYNC_TXD 35u #define NET_TCP_CONN_STATE_CONN 40u #define NET_TCP_CONN_STATE_FIN_WAIT_1 50u #define NET_TCP_CONN_STATE_FIN_WAIT_2 51u #define NET_TCP_CONN_STATE_CLOSING 52u #define NET_TCP_CONN_STATE_TIME_WAIT 53u #define NET_TCP_CONN_STATE_CLOSE_WAIT 55u #define NET_TCP_CONN_STATE_LAST_ACK 56u #define NET_TCP_CONN_STATE_CLOSING_DATA_AVAIL 59u /* See Note #2a. */ /* ********************************************************************************************************* * TCP CONNECTION QUEUE STATES ********************************************************************************************************* */ #define NET_TCP_RX_Q_STATE_NONE 0u #define NET_TCP_RX_Q_STATE_CLOSED 100u #define NET_TCP_RX_Q_STATE_CLOSING 101u #define NET_TCP_RX_Q_STATE_SYNC 110u #define NET_TCP_RX_Q_STATE_CONN 111u #define NET_TCP_TX_Q_STATE_NONE 0u #define NET_TCP_TX_Q_STATE_CLOSED 200u #define NET_TCP_TX_Q_STATE_CLOSING 201u #define NET_TCP_TX_Q_STATE_SYNC 210u #define NET_TCP_TX_Q_STATE_CONN 211u #define NET_TCP_TX_Q_STATE_SUSPEND 215u #define NET_TCP_TX_Q_STATE_CLOSED_SUSPEND 220u #define NET_TCP_TX_Q_STATE_CLOSING_SUSPEND 221u /*$PAGE*/ /* ********************************************************************************************************* * TCP CONNECTION CODE DEFINES **************
上传时间: 2015-11-22
上传用户:the same kong
Lithium–sulfur batteries are a promising energy-storage technology due to their relatively low cost and high theoretical energy density. However, one of their major technical problems is the shuttling of soluble polysulfides between electrodes, resulting in rapid capacity fading. Here, we present a metal–organic framework (MOF)-based battery separator to mitigate the shuttling problem. We show that the MOF-based separator acts as an ionic sieve in lithium–sulfur batteries, which selectively sieves Li+ ions while e ciently suppressing undesired polysulfides migrating to the anode side. When a sulfur-containing mesoporous carbon material (approximately 70 wt% sulfur content) is used as a cathode composite without elaborate synthesis or surface modification, a lithium–sulfur battery with a MOF-based separator exhibits a low capacity decay rate (0.019% per cycle over 1,500 cycles). Moreover, there is almost no capacity fading after the initial 100 cycles. Our approach demonstrates the potential for MOF-based materials as separators for energy-storage applications.
上传时间: 2017-11-23
上传用户:653357637