亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? avr.tex

?? RT-Thread是發展中的下一代微內核嵌入式實時操作系統
?? TEX
字號:
This section describes how to implement Efsl on a AVR $\mu C$ connected toan SD-Card (SPI). For getting efsl to compile, the avr-gcc compiler and avr-libc library are required. On Windows you should install WinAVR (http://winavr.sourceforge.net/), on Linux you can install the packages separately (see http://www.nongnu.org/avr-libc/user-manual/install\_tools.htmlfor a nice howto).\subsubsection{Hardware}First, you need set up a prototype in which you connect the CD, CMD, DAT0\& CLK lines from the SD-Card to /CS, MOSI, MISO \& SCK from the Atmega.\newline\includegraphics[scale=0.65]{pics/sdcard.eps}\newline%\parbox[c]{.4\textwidth}{\begin{center}\includegraphics[width=.4\textwidth]{pics/sdconnection}\end{center}}\parbox[c]{.5\textwidth}{Connect the following lines on the SD-card:\begin{itemize}	\item{Pin 9 (DAT2) - NC\\(or pull-up to 3.3V)}	\item{Pin 1 (CD) - Any pin on the Atmega128}	\item{Pin 2 (CMD) - MOSI\\(pin 12 on the Atmega128)}	\item{Pin 3 (Vss) - GND}	\item{Pin 4 (Vdd) - +3.3V}	\item{Pin 5 (CLK) - SCK\\(pin 11 on the Atmega128)}	\item{Pin 6 (Vss) - GND}	\item{Pin 7 (DAT0) - MISO\\(pin 12 on the Atmega128)}	\item{Pin 8 (DAT1) - NC\\(or pull-up to 3.3V)}\end{itemize}}\parbox[c]{.5\textwidth}{\begin{center}	\includegraphics[width=.5\textwidth]{pics/sdconnection}	\newline\newline	Remark: this schematic includes pull-up's to 3.3V, which	can be left off.\end{center}}\newlineRemark 1: Make sure that your $\mu C$ is running on 3,3V, so you don'tdamage your SD-Card.\newline\newlineRemark 2: CD is currently static set to PB0, but will become variablein future releases.\subsubsection{Download \& Compile}Let's get started:\begin{enumerate}	\item{Get the latest release of efsl on http://www.sf.net/projects/efsl/}	\item{Unpack the library (on Windows, you can use WinACE or WinRAR)}	\item{Copy in directory \filename{conf} the file 		\filename{config-avr.h} to \filename{config.h}}	\item{Copy in directory \filename{conf} the file 		\filename{config-avr.makefile} to \filename{config.makefile}}	\item{Compile the library (\code{make avr})}\end{enumerate}Now you should have the following files in a directory called {lib}:\begin{itemize}	\item{\filename{libefsl-base.a}}	\item{\filename{libefsl-fs-vfat.a}}	\item{\filename{libefsl-prot-sdspi.a}}	\item{\filename{libefsl-hwd-atmega\_spi.a}}\end{itemize}\subsubsection{Example}Since Efsl itself is only a library, it's not supposed to do anything out of the box, than just compile. To get started, we'll show here a small exampleprogram that opens an existing file and writes the content to a new file.\newline\newlineFirst, create a new directory in which you put the compiled efsl-library (\filename{libefsl.a}) and create a new file called \filename{avrtest.c} containing:\lstset{numbers=left, stepnumber=1, numberstyle=\small, numbersep=5pt, tabsize=4}\begin{lstlisting}	#include <efs.h>	#include <sd.h>	#include <atmega_spi.h>	void hang(void);	void main(void)	{		efsl_storage_conf storage_conf;		efsl_fs_conf fs_conf;		efsl_storage storage;		efsl_fs fs;		File file_r;		File file_w;		atmegaSpiInterface spi_interface;		SdSpiProtocol sd_protocol;		char buf[512];		unsigned short e;		/* Init */		spi_interface.pinSelect=0x01;		sd_protocol.spiHwInterface=&spi_interface;		sd_protocol.spiHwInit=(void *)atmega_spi_init;		sd_protocol.spiSendByte=(void *)atmega_spi_send;		storage_conf.hwObject=&sd_protocol;		storage_conf.if_init_fptr=(void *)sd_Init;		storage_conf.if_read_fptr=(void *)sd_readSector;		storage_conf.if_write_fptr=(void *)sd_writeSector;		storage_conf.if_ioctl_fptr=(void *)sd_ioctl;		storage_conf.ioman_bufmem=0;		fs_conf.no_partitions=0;		fs_conf.storage=&storage;		if(efsl_initStorage(&storage,&storage_conf)){			hang();		}		if(efsl_initFs(&fs,&fs_conf)){			hang();		}		if(file_fopen(&file_r,&fs.filesystem,"orig.txt",'r')!=0){			hang();		}		if(file_fopen(&file_w,&fs.filesystem,"copy.txt",'w')!=0){			hang();		}				if(file_fopen(&file_r,&efs.myFs,"orig.txt",'r')!=0){			hang();		}		while((e=file_read(&file_r,512,buf))){			file_write(&file_w,e,buf);		}		file_fclose(&file_r);		file_fclose(&file_w);		fs_umount(&fs.filesystem);		hang();	}	void hang(void)	{		while((1))			_NOP();	}\end{lstlisting}$ $\newlineSome extra information on the code above: TODO%\begin{itemize}%	\item{Line 1: The header file for efsl is included here. When using the%		basic efsl functions, \filename{efs.h} is the only header file on the %		efsl library that needs to be included.}%	\item{Line 7: The object efs is created, this object will contain%		information about the hardware layer, the partition table and%		the disc.}%	\item{Line 8: The objects \code{file\_r} and \code{file\_w} are created, these objects %		will contain information about the files that we will open on the %		efs-object.}%	\item{Line 9: A buffer of 512 bytes is allocated. This buffer will be%		used for reading and writing blocks of data.}%	\item{Line 12: Call of \code{efs\_init()}, which will initialize the efs-object.%		To this function we pass:%		\begin{enumerate}%			\item{A pointer to the efs-object.}%			\item{A pointer to the file that contains the partition table /%				file system (in this example, we select a device as file).}%		\end{enumerate}%		If this function returns 0, it means that a valid fat partition is%		found on the SD-card connected.%		If no valid fat-filesystem is found, or the file does not exist, the%		function returns a negative value. In this example we then go to an%		infinite loop to prevent the program to continue.}%	\item{Line 16 \& 20: Call of \code{file\_fopen()}, which will initialize the%		file-objects. To this function we pass:%		\begin{enumerate}%			\item{A pointer to the file-object.}%			\item{A pointer to the filesystem-object.}%			\item{A pointer to the filename.}%			\item{A char containing the the mode (read, write, append).}%		\end{enumerate}%		If this function returns 0, it means the file has successfully been%		opened for reading / writing / appending.%	 	If the file could not be opened (because for example a file already %		exists), a negative value is returned.}%	\item{Line 24: Call of \code{file\_read()}, which will read a given value of%		bytes (in this example 512) from a file and put it's content into%		the buffer passed (in this example called buf). This function returns%		the amount of bytes read, so the while-loop will be executed as long%		as there are bytes left in the file.}%	\item{Line 25: Call of \code{file\_write()}, which will write a given value%		of bytes (in this example, the amount of bytes that was read%		by \code{file\_read()}) from the buffer passed to a file. This function returns%		the amount of bytes written.}%	\item{Line 28 \& 29: Call of \code{file\_fclose()}, which will close the%		file-objects.}%	\item{Line 31: Call of \code{fs\_umount()}, which will write all buffers to%		the the SD-card.}%\end{itemize}\subsubsection{Testing}So now let's test the program:\begin{enumerate}	\item	{	Compile the program:		\begin{itemize}			\item{On Linux (with avr-gcc): avr-gcc -I/home/user/src/base/include -I/home/user/src/include -I/home/user/src/fs/vfat/include -I/home/user/src/hwdrivers/atmega\_spi/include -I/home/user/src/protocols/sdcard\_spi/include -I/home/user/conf -ffreestanding -mmcu=atmega128 -Os -o avrtest.o avrtest.c -L/home/user/lib -lefsl-base -lefsl-fs-vfat -lefsl-hwd-atmega\_spi -lefsl-prot-sdspi}			\item{On Windows (with WinAVR): replace all slashes with backslashes} 		\end{itemize}	}	\item{Generate a hexfile 		(avr-objcopy -j .text -j .data -O ihex avrtest.o avrtest.hex)}	\item{Connect an SD-card to your Atmega128 with a file called 		\filename{orig.txt} on it.}	\item	{		Flash the hex file into your $\mu C$.		\begin{itemize}			\item{On Linux: avrdude -P /dev/ttyUSB0 -c stk500 -p m128 -Uflash:w:avrtest.hex}			\item{On Windows: use Atmel AVR-Studio}		\end{itemize}	}	\item{Reset your $\mu C$ and wait some time (depending on how big		the file \filename{orig.txt} is).}	\item{Disconnect the SD-card, so you can put it in your card reader		and find out if the file \filename{orig.txt} is copied to 		\filename{copy.txt}.}\end{enumerate}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品日产第一区二区三区高清版 | 午夜国产不卡在线观看视频| 偷拍一区二区三区| 国产91精品久久久久久久网曝门| 精品毛片乱码1区2区3区| 激情小说欧美图片| 中文字幕电影一区| 成人精品免费视频| 亚洲午夜激情av| 精品少妇一区二区三区在线视频| 精品一区二区三区视频| 国产农村妇女毛片精品久久麻豆 | 亚洲精品午夜久久久| 欧美三级电影精品| 国产在线日韩欧美| 亚洲欧美成aⅴ人在线观看| 亚洲一区av在线| 国产精品毛片无遮挡高清| 色天天综合久久久久综合片| 亚洲成av人影院在线观看网| 久久久影院官网| 56国语精品自产拍在线观看| 国产成人av一区二区| 日本不卡一区二区三区| 1024成人网| 国产欧美精品日韩区二区麻豆天美| 欧美体内she精高潮| www.色精品| 国内久久精品视频| 国内精品国产成人| 美国十次综合导航| 偷拍与自拍一区| 亚洲444eee在线观看| 1024成人网| 一区二区三区波多野结衣在线观看 | 国产99久久久国产精品| 三级久久三级久久| 天天综合网天天综合色| 亚洲成a天堂v人片| 午夜精品福利一区二区三区av | 欧美日韩久久久| 欧美专区亚洲专区| 成人v精品蜜桃久久一区| 欧美变态口味重另类| 91麻豆精品国产自产在线观看一区| 欧美日韩精品系列| 精品福利视频一区二区三区| 国产精品毛片高清在线完整版 | 日本黄色一区二区| 日韩欧美不卡在线观看视频| 国产精品美女www爽爽爽| 亚洲激情男女视频| 国内精品国产成人| 色综合久久综合网97色综合| 欧美岛国在线观看| 亚洲国产成人av好男人在线观看| 久久国产欧美日韩精品| 久久成人免费电影| 青青草精品视频| 樱花草国产18久久久久| 国产欧美精品在线观看| 久久久噜噜噜久久中文字幕色伊伊| 欧美浪妇xxxx高跟鞋交| 日本福利一区二区| 51午夜精品国产| 日韩美女一区二区三区四区| 中文一区二区完整视频在线观看| 亚洲一区视频在线观看视频| 久国产精品韩国三级视频| 成人av网站在线观看| 3d成人h动漫网站入口| 亚洲美女少妇撒尿| 不卡电影一区二区三区| 久久免费的精品国产v∧| 精品一区二区av| 日韩午夜激情视频| 免费看黄色91| 欧美一区二区福利在线| 一区二区三区四区蜜桃| 精东粉嫩av免费一区二区三区| 欧美日韩一卡二卡| 亚洲va在线va天堂| 色婷婷亚洲婷婷| 亚洲人午夜精品天堂一二香蕉| 国产精品影视网| 亚洲国产精品黑人久久久| 国产一区二区三区在线观看免费视频| 欧美精选在线播放| 成人免费毛片嘿嘿连载视频| 久久午夜羞羞影院免费观看| 国产精品99久久久久久宅男| 国产性做久久久久久| 国产一区二区在线看| 国产精品素人视频| 色综合久久中文字幕| 日韩av不卡在线观看| 久久免费电影网| 欧美日韩一区在线观看| 高清免费成人av| 亚洲综合视频网| 91精品欧美综合在线观看最新 | 色美美综合视频| 国产精品影音先锋| 一区二区三区中文字幕| 亚洲精品在线免费播放| av网站一区二区三区| 亚洲成av人片在线观看无码| 欧美成人三级在线| 99r国产精品| 国产精品一品二品| 五月天丁香久久| 亚洲九九爱视频| 国产精品伦理一区二区| 国产性色一区二区| 日韩一区二区三区在线观看| 在线精品视频小说1| 高清在线观看日韩| 丰满少妇在线播放bd日韩电影| 亚洲一区二区四区蜜桃| 亚洲欧美另类小说| 精品国产一二三| 精品国产成人系列| 欧美电视剧免费观看| 久久欧美中文字幕| 久久久久久99精品| 久久久99久久| 国产精品久久久久桃色tv| 欧美日韩电影一区| 成人高清视频在线观看| 久久国产精品第一页| 国产在线播精品第三| 国产夫妻精品视频| 国产高清久久久| 色综合咪咪久久| 欧美视频一区二区三区四区| 日韩小视频在线观看专区| 久久一二三国产| 中文字幕制服丝袜一区二区三区 | 美女视频黄免费的久久| 福利一区二区在线观看| 色综合亚洲欧洲| 91精品国产一区二区人妖| 欧美高清一级片在线观看| 亚洲综合视频在线| 久久成人免费网站| 在线精品国精品国产尤物884a| 久久久精品tv| 午夜精品福利一区二区蜜股av| 成人一区二区三区中文字幕| 欧美一区二区三区免费| 欧美国产1区2区| 免费成人性网站| 欧美日高清视频| 亚洲欧美激情小说另类| 不卡一区中文字幕| 日本一区二区三区免费乱视频| 同产精品九九九| www.久久久久久久久| 久久综合久色欧美综合狠狠| 日韩电影在线看| 日韩视频一区二区| 蜜桃在线一区二区三区| 日韩三级av在线播放| 蜜桃在线一区二区三区| 精品国精品自拍自在线| 麻豆精品新av中文字幕| 欧美成人激情免费网| 国产精品亚洲一区二区三区妖精| 久久一夜天堂av一区二区三区| 成人高清视频在线观看| 亚洲婷婷在线视频| 欧美三级日韩三级| 日韩高清国产一区在线| 精品久久国产字幕高潮| 成人性生交大片免费看中文| 亚洲男人天堂av网| 日韩欧美国产综合| 91欧美一区二区| 亚洲狠狠丁香婷婷综合久久久| 一本久道中文字幕精品亚洲嫩| 中文字幕视频一区二区三区久| 91国偷自产一区二区开放时间| 日韩电影在线免费看| 亚洲女性喷水在线观看一区| 欧美高清www午色夜在线视频| 免费观看久久久4p| 中文字幕一区在线| 欧美一区二区美女| 一本一道久久a久久精品| 国产乱人伦精品一区二区在线观看| 国产精品国产三级国产普通话三级| 欧洲另类一二三四区| 99热在这里有精品免费| 久久精品久久综合| 日韩成人一区二区三区在线观看| 最新不卡av在线| 国产欧美一区二区在线观看| 欧美精品亚洲一区二区在线播放| 91麻豆自制传媒国产之光| 国产高清久久久|