91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 4.06MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-08-12
  • 語言: 其他
  • 標簽: stm32??太陽能??

資源簡介

這是一個用stm32實現(xiàn)玉成控制家用太陽能或者是工業(yè)太陽能的遠程控制器,使用了AD轉(zhuǎn)換、看門狗、flash的讀寫,TCP/IP協(xié)議等。

資源截圖

代碼片段和文件信息

#include?“include.h“

#define??pgm_read_byte(ptr)??((char)*(ptr))

static?unsigned?short?wwwport?=?80;
static?unsigned?char?macaddr[6];
static?unsigned?char?ipaddr[4];
static?unsigned?int?info_hdr_len?=?0;
static?unsigned?int?info_data_len?=?0;
static?unsigned?char?seqnum?=?0xa;?//?my?initial?tcp?sequence?number

//?The?Ip?checksum?is?calculated?over?the?ip?header?only?starting
//?with?the?header?length?field?and?a?total?length?of?20?bytes
//?unitl?ip.dst
//?You?must?set?the?IP?checksum?field?to?zero?before?you?start
//?the?calculation.
//?len?for?ip?is?20.
//
//?For?UDP/TCP?we?do?not?make?up?the?required?pseudo?header.?Instead?we?
//?use?the?ip.src?and?ip.dst?fields?of?the?real?packet:
//?The?udp?checksum?calculation?starts?with?the?ip.src?field
//?Ip.src=4bytesIp.dst=4?bytesUdp?header=8bytes?+?data?length=16+len
//?In?other?words?the?len?here?is?8?+?length?over?which?you?actually
//?want?to?calculate?the?checksum.
//?You?must?set?the?checksum?field?to?zero?before?you?start
//?the?calculation.
//?len?for?udp?is:?8?+?8?+?data?length
//?len?for?tcp?is:?4+4?+?20?+?option?len?+?data?length
//
//?For?more?information?on?how?this?algorithm?works?see:
//?http://www.netfor2.com/checksum.html
//?http://www.msc.uky.edu/ken/cs471/notes/chap3.htm
//?The?RFC?has?also?a?C?code?example:?http://www.faqs.org/rfcs/rfc1071.html
unsigned??int?checksum(unsigned?char*?buf?unsigned??int?len?unsigned?char?type)
{
???//?type?0=ip?
???//??????1=udp
???//??????2=tcp
???unsigned?long?sum?=?0;

???//if(type==0){
???//????????//?do?not?add?anything
???//}
???if?(type?==?1)
???{
??????sum?+=?IP_PROTO_UDP_V;?//?protocol?udp
??????//?the?length?here?is?the?length?of?udp?(data+header?len)
??????//?=length?given?to?this?function?-?(IP.scr+IP.dst?length)
??????sum?+=?len?-?8;?//?=?real?tcp?len
???}
???if?(type?==?2)
???{
??????sum?+=?IP_PROTO_TCP_V;?
??????//?the?length?here?is?the?length?of?tcp?(data+header?len)
??????//?=length?given?to?this?function?-?(IP.scr+IP.dst?length)
??????sum?+=?len?-?8;?//?=?real?tcp?len
???}
???//?build?the?sum?of?16bit?words
???while?(len?>?1)
???{
??????sum?+=?0xFFFF?&?(*buf?<??????buf?+=?2;
??????len?-=?2;
???}
???//?if?there?is?a?byte?left?then?add?it?(padded?with?zero)
???if?(len)
???{
??????sum?+=?(0xFF?&?*buf)?<???}
???//?now?calculate?the?sum?over?the?bytes?in?the?sum
???//?until?the?result?is?only?16bit?long
???while?(sum?>>?16)
???{
??????sum?=?(sum?&?0xFFFF)?+?(sum?>>?16);
???}
???//?build?1‘s?complement:
???return((unsigned??int)?sum?^?0xFFFF);
}

//?you?must?call?this?function?once?before?you?use?any?of?the?other?functions:
void?init_ip_arp_udp_tcp(unsigned?char*?mymac?unsigned?char*?myip?unsigned?short?wwwp)
{
???unsigned?char?i?=?0;
???wwwport?=?wwwp;
???while?(i????{
??????ipaddr[i]?=?myip[i];
??????i++;
???}
???i?=?0;
???while?(i????{
??????macaddr[i]?=?mymac[i];
??????i++;
???}
}

void?set_tcp_port(

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-04-10?19:49??智能熱水工程控制系統(tǒng)(校驗版)\
?????文件????????9648??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\ENC28J60.C
?????文件????????9354??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\ENC28J60.H
?????目錄???????????0??2012-04-10?19:46??智能熱水工程控制系統(tǒng)(校驗版)\FATFS\
?????文件????????8252??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\FATFS\00readme.txt
?????文件???????25104??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\FATFS\SPI_SD_driver.c
?????文件????????2408??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\FATFS\SPI_SD_driver.h
?????文件????????6235??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\FATFS\diskio.c
?????文件????????1864??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\FATFS\diskio.h
?????文件???????67089??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\FATFS\ff.c
?????文件???????11811??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\FATFS\ff.h
?????文件?????????911??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\FATFS\integer.h
?????文件???????58520??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\FATFS\tff.c
?????文件???????10614??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\FATFS\tff.h
?????文件??????659780??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\FS_CM3.lib
?????文件???????12950??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\File_Config.h
?????文件??????319488??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\Flex.ocx
?????文件?????????677??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\JD.pic
?????文件?????????497??2012-04-10?19:48??智能熱水工程控制系統(tǒng)(校驗版)\Jlink?Regs?CM3.txt
?????文件??????327741??2012-04-10?19:49??智能熱水工程控制系統(tǒng)(校驗版)\JlinkLog.txt
?????文件?????????285??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\JlinkSettings.ini
?????目錄???????????0??2012-04-10?19:46??智能熱水工程控制系統(tǒng)(校驗版)\List\
?????文件??????256903??2012-04-10?19:48??智能熱水工程控制系統(tǒng)(校驗版)\List\DLP.map
?????文件???????91188??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\List\STM3210E-EVAL.map
?????文件???????26137??2012-04-10?19:48??智能熱水工程控制系統(tǒng)(校驗版)\List\cortexm3_macro.lst
?????文件???????36908??2012-04-10?19:48??智能熱水工程控制系統(tǒng)(校驗版)\List\stm32f10x_vector.lst
?????文件?????1081616??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\MSCOMCTL.OCX
?????文件??????162816??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\MSCOMM32.OCX
?????文件?????1388544??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\MSVBVM60.DLL
?????文件??????108336??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\MSWINSCK.OCX
?????文件???????49152??2012-04-05?22:09??智能熱水工程控制系統(tǒng)(校驗版)\NCset.exe
............此處省略223個文件信息

評論

共有 條評論