Boost C++ Libraries Free peer-reviewed portable C++ source libraries Boost C++ Libraries 基本上是一個(gè)免費(fèi)的 C++ 的跨平臺(tái)函式庫(kù)集合,基本上應(yīng)該可以把它視為 C++ STL 的功能再延伸;他最大的特色在於他是一個(gè)經(jīng)過(guò)「同行評(píng)審」(peer review,可參考維基百科)、開(kāi)放原始碼的函式庫(kù),而且有許多 Boost 的函式庫(kù)是由 C++ 標(biāo)準(zhǔn)委員會(huì)的人開(kāi)發(fā)的,同時(shí)部分函式庫(kù)的功能也已經(jīng)成為 C++ TR1 (Technical Report 1,參考維基百科)、TR2、或是 C++ 0x 的標(biāo)準(zhǔn)了。 它的官方網(wǎng)站是:http://www.boost.org/,包含了 104 個(gè)不同的 library;由於他提供的函式庫(kù)非常地多,的內(nèi)容也非常地多元,根據(jù)官方的分類,大致上可以分為下面這二十類: 字串和文字處理(String and text processing) 容器(Containers) Iterators 演算法(Algorithms) Function objects and higher-order programming 泛型(Generic Programming) Template Metaprogramming Preprocessor Metaprogramming Concurrent Programming 數(shù)學(xué)與數(shù)字(Math and numerics) 正確性與測(cè)試(Correctness and testing) 資料結(jié)構(gòu)(Data structures) 影像處理(Image processing) 輸入、輸出(Input/Output) Inter-language support 記憶體(Memory) 語(yǔ)法分析(Parsing) 程式介面(Programming Interfaces) 其他雜項(xiàng) Broken compiler workarounds 其中每一個(gè)分類,又都包含了一個(gè)或多個(gè)函式庫(kù),可以說(shuō)是功能相當(dāng)豐富。
標(biāo)簽: Boost C++ Libraries
上傳時(shí)間: 2015-05-15
上傳用戶:fangfeng
本文針對(duì)嵌入式流行存儲(chǔ)設(shè)備Fl鵲h存儲(chǔ)器的特點(diǎn),設(shè) 計(jì)并實(shí)現(xiàn)了Flash為存儲(chǔ)設(shè)備和ucosII系統(tǒng)為運(yùn)行平臺(tái)的嵌入式文件系統(tǒng)。系統(tǒng)采用日志文件系統(tǒng)設(shè)計(jì)思想,使Flash存儲(chǔ)設(shè)備得到更加合理的利用。系統(tǒng)實(shí)現(xiàn)代碼精簡(jiǎn),資源占用率低,執(zhí)行效率高,安全性能好。
標(biāo)簽: 嵌入式系統(tǒng) ucosii 文件系統(tǒng)
上傳時(shí)間: 2015-05-25
上傳用戶:wzg01@126.com
/* ********************************************************************************************************* * 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 **************
上傳時(shí)間: 2015-11-22
上傳用戶:the same kong
感生電動(dòng)勢(shì)、動(dòng)生電動(dòng)勢(shì) 物理電磁學(xué)相關(guān)整理
標(biāo)簽: 感生電動(dòng)勢(shì)、動(dòng)生電動(dòng)勢(shì)
上傳時(shí)間: 2016-01-04
上傳用戶:1032298562
經(jīng)濟(jì)學(xué)人雜誌 April 9, 2016
標(biāo)簽: Economist April 2016 The
上傳時(shí)間: 2016-04-30
上傳用戶:luzmike
這個(gè)程式可以求出字串佔(zhàn)了幾個(gè)位元組 歡迎多加使用
上傳時(shí)間: 2016-06-15
上傳用戶:aa111
flash俄羅斯方塊代碼代碼代碼代碼代碼搜索斯
標(biāo)簽: 俄羅斯
上傳時(shí)間: 2016-12-25
上傳用戶:1260384954
1-1前言一般人所能夠感受到聲音的頻率約介於5H2-20KHz,超音波(Ultrasonic wave)即爲(wèi)頻率超過(guò)20KHz以上的音波或機(jī)械振動(dòng),因此超音波馬達(dá)就是利用超音波的彈性振動(dòng)頻率所構(gòu)成的制動(dòng)力。超音波馬達(dá)的內(nèi)部主要是以壓電陶瓷材料作爲(wèi)激發(fā)源,其成份是由鉛(Pb)、結(jié)(Zr)及鈦(Ti)的氧化物皓鈦酸鉛(Lead zirconate titanate,PZT)製成的。將歷電材料上下方各黏接彈性體,如銅或不銹鋼,並施以交流電壓於壓電陶瓷材料作爲(wèi)驅(qū)動(dòng)源,以激振彈性體,稱此結(jié)構(gòu)爲(wèi)定子(Stator),將其用彈簧與轉(zhuǎn)子Rotor)接觸,將所産生摩擦力來(lái)驅(qū)使轉(zhuǎn)子轉(zhuǎn)動(dòng),由於壓電材料的驅(qū)動(dòng)能量很大,並足以抗衡轉(zhuǎn)子與定子間的正向力,雖然伸縮振幅大小僅有數(shù)徵米(um)的程度,但因每秒之伸縮達(dá)數(shù)十萬(wàn)次,所以相較於同型的電磁式馬達(dá)的驅(qū)動(dòng)能量要大的許多。超音波馬達(dá)的優(yōu)點(diǎn)爲(wèi):1,轉(zhuǎn)子慣性小、響應(yīng)時(shí)間短、速度範(fàn)圍大。2,低轉(zhuǎn)速可產(chǎn)生高轉(zhuǎn)矩及高轉(zhuǎn)換效率。3,不受磁場(chǎng)作用的影響。4,構(gòu)造簡(jiǎn)單,體積大小可控制。5,不須經(jīng)過(guò)齒輸作減速機(jī)構(gòu),故較爲(wèi)安靜。實(shí)際應(yīng)用上,超音波馬達(dá)具有不同於傳統(tǒng)電磁式馬達(dá)的特性,因此在不適合應(yīng)用傳統(tǒng)馬達(dá)的場(chǎng)合,例如:間歇性運(yùn)動(dòng)的裝置、空間或形狀受到限制的場(chǎng)所;另外包括一些高磁場(chǎng)的場(chǎng)合,如核磁共振裝置、斷層掃描儀器等。所以未來(lái)在自動(dòng)化設(shè)備、視聽(tīng)音響、照相機(jī)及光學(xué)儀器等皆可應(yīng)用超音波馬達(dá)來(lái)取代。
標(biāo)簽: 超聲波電機(jī)
上傳時(shí)間: 2022-06-17
上傳用戶:
[摘要]在天線單元設(shè)計(jì)中采用了高頻、低噪聲放大器,以減弱天線熱噪聲及前面幾級(jí)單元電路對(duì)接收機(jī)性能的影響;基于超外差式電路結(jié)構(gòu)、鏡頻抑制和信道選擇原理,選用G P2010芯片實(shí)現(xiàn)了射頻單元的三級(jí)變頻方案,并介紹了高穩(wěn)定度本振蕩信號(hào)的合成和采樣量化器的工作原理,得到了導(dǎo)航電文相關(guān)提取所需要的二進(jìn)制數(shù)字中頻衛(wèi)星信號(hào)。[被屏蔽廣告]關(guān)鍵詞:GPS接收機(jī)靈敏度超外差鎖相環(huán)頻率合成利用GPS衛(wèi)星實(shí)現(xiàn)導(dǎo)航定位時(shí),用戶接收機(jī)的主要任務(wù)是提取衛(wèi)星信號(hào)中的偽隨機(jī)噪聲碼和數(shù)據(jù)碼,以進(jìn)一步解算得到接收機(jī)載體的位置、速度和時(shí)間(PVT)等導(dǎo)航信息。因此,GPS接收機(jī)是至關(guān)重要的用戶設(shè)備。目前實(shí)際應(yīng)用的GPS接收機(jī)電路一般由天線單元、射頻單元、通信單元和解算單元等四部分組成,如圖1所示。本文在分析GPS衛(wèi)星信號(hào)組成的基礎(chǔ)上,給出了射頻前端GP2010的原理及應(yīng)用。1GPS 衛(wèi)星信號(hào)的組成GPS衛(wèi)星信號(hào)采用典型的碼分多址(CDMA)調(diào)制技術(shù)進(jìn)行合成(如圖2所示),其完整信號(hào)主要包括載波、偽隨機(jī)碼和數(shù)據(jù)碼等三種分量。信號(hào)載波處于L波段,兩載波的中心頓率分別記作L1和1.2,衛(wèi)星信號(hào)參考時(shí)鐘頻率f0為10.23MHz,信號(hào)載波L1的中心頻率為ro的154倍頻,即:fL.1=154×f0-1575,42MHz(1)其波長(zhǎng)A 1-19.03cm:信號(hào)載波12的中心頻率為f0的120倍頻,即:fL.2-120X f0-1227.60M1z(2)其波長(zhǎng)A 2-24.42cm.兩載波的頻率差為347.82M1z,大約是12的28.3%,這樣選擇載波頻率便于測(cè)得或消除導(dǎo)航信號(hào)從GPS衛(wèi)星傳播至接收機(jī)時(shí)由于電離層效應(yīng)而引起的傳播延遲誤差,偽隨機(jī)噪聲碼(PR N)即測(cè)距碼主要有精測(cè)距碼(P碼)和粗測(cè)距碼(C/A碼)兩種。其中P碼的碼率為10.23M12、C/A碼的碼率為1.023MHz。數(shù)據(jù)碼是GPS衛(wèi)星以二進(jìn)制形式發(fā)送給用戶接收機(jī)的導(dǎo)航定位數(shù)據(jù),又叫導(dǎo)航電文或D碼,它主要包括衛(wèi)星歷、衛(wèi)星鐘校正、電離層延遲校正、工作狀態(tài)信息、C/A碼轉(zhuǎn)換到捕獲P碼的信息和全部衛(wèi)星的概略星歷:總電文由1500位組成,分為5個(gè)子幀,每個(gè)子幀在6s內(nèi)發(fā)射10個(gè)字,每個(gè)字30位,共計(jì)300位,因此數(shù)據(jù)碼的波特率為50bps.
上傳時(shí)間: 2022-06-19
上傳用戶:zhaiyawei
JQ8400 串口MP3模塊(芯片)資料
標(biāo)簽: jq8400 語(yǔ)音芯片 flash
上傳時(shí)間: 2022-06-19
上傳用戶:
蟲(chóng)蟲(chóng)下載站版權(quán)所有 京ICP備2021023401號(hào)-1