\hypertarget{diskio_8c}{
\section{diskio.c File Reference}
\label{diskio_8c}\index{diskio.c@{diskio.c}}
}
{\tt \#include $<$avr/io.h$>$}\par
{\tt \#include \char`\"{}diskio.h\char`\"{}}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{diskio_8c_938c1466755f12fb04ac0d1b775584d1}{CMD0}~(0x40+0)
\item 
\#define \hyperlink{diskio_8c_ca9979f299fa78c1128d778084478673}{CMD1}~(0x40+1)
\item 
\#define \hyperlink{diskio_8c_9b6fdfed1b57ac31269b6b9987e0761b}{ACMD41}~(0xC0+41)
\item 
\#define \hyperlink{diskio_8c_c75b3e0ad1fb013ea946fb49bbe65668}{CMD8}~(0x40+8)
\item 
\#define \hyperlink{diskio_8c_1fac6a251d7e7dc204d21639bf521459}{CMD9}~(0x40+9)
\item 
\#define \hyperlink{diskio_8c_e7b800ed8e7bd52e6f570a5ce72b8104}{CMD10}~(0x40+10)
\item 
\#define \hyperlink{diskio_8c_8d6283c9b060afbaa0e6d1ff7e5ea7b8}{CMD12}~(0x40+12)
\item 
\#define \hyperlink{diskio_8c_4be8f501d86d24b02923846db618fc71}{ACMD13}~(0xC0+13)
\item 
\#define \hyperlink{diskio_8c_aeab261b94f2031ba41a1d4d857c3541}{CMD16}~(0x40+16)
\item 
\#define \hyperlink{diskio_8c_6bbfe7dc16a19b7f40efcf554b5666ad}{CMD17}~(0x40+17)
\item 
\#define \hyperlink{diskio_8c_3d32c27a6be061b865ba539127278f14}{CMD18}~(0x40+18)
\item 
\#define \hyperlink{diskio_8c_14506e981f38b6177bc36f72c2ca18b1}{CMD23}~(0x40+23)
\item 
\#define \hyperlink{diskio_8c_a38144d651e2880f92c65bb683621f78}{ACMD23}~(0xC0+23)
\item 
\#define \hyperlink{diskio_8c_252300302c6f7960df547a7f5c25be85}{CMD24}~(0x40+24)
\item 
\#define \hyperlink{diskio_8c_ee2c673fba987178f4642531fdeefe9e}{CMD25}~(0x40+25)
\item 
\#define \hyperlink{diskio_8c_78289a7a85ffcfddd626694105dc0780}{CMD55}~(0x40+55)
\item 
\#define \hyperlink{diskio_8c_a7a26b2cf17e1ff5967820a1fa41a7aa}{CMD58}~(0x40+58)
\item 
\#define \hyperlink{diskio_8c_56e8d2ffde94d0c5fdf14b772a32a77f}{SELECT}()~PORTB \&= $\sim$(1$<$$<$PB2)
\item 
\#define \hyperlink{diskio_8c_1cbd972fc333e07d29999e284020c362}{DESELECT}()~PORTB $|$= (1$<$$<$PB2)
\item 
\#define \hyperlink{diskio_8c_e3d9176798d1718d779e2db397de4bb5}{FCLK\_\-SLOW}()
\item 
\#define \hyperlink{diskio_8c_1ffcdd6f111fd9b4229f49a5e37046b7}{FCLK\_\-FAST}()
\item 
\#define \hyperlink{diskio_8c_e53eb472945c81aa68af66d586fa0523}{xmit\_\-spi}(dat)~SPDR=(dat); loop\_\-until\_\-bit\_\-is\_\-set(SPSR,SPIF)
\item 
\#define \hyperlink{diskio_8c_317ab656a06a309fbb136df11cb83535}{rcvr\_\-spi\_\-m}(dst)~SPDR=0xFF; loop\_\-until\_\-bit\_\-is\_\-set(SPSR,SPIF); $\ast$(dst)=SPDR
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hyperlink{diskio__008_8h_dba6790898ce4029c20a34b898ce73c1}{DSTATUS} \hyperlink{diskio_8c_8e429a29bdbb73f5bc9e2ab2335a5112}{disk\_\-initialize} (\hyperlink{integer_8h_4ae1dab0fb4b072a66584546209e7d58}{BYTE} drv)
\item 
\hyperlink{diskio__008_8h_dba6790898ce4029c20a34b898ce73c1}{DSTATUS} \hyperlink{diskio_8c_21ad8e9a107ea2000705a3edfebaaa2d}{disk\_\-status} (\hyperlink{integer_8h_4ae1dab0fb4b072a66584546209e7d58}{BYTE} drv)
\item 
\hyperlink{diskio_8h_acdfef1dad6565f65c26d12fe0ea4b2b}{DRESULT} \hyperlink{diskio_8c_42043c0f462756dbdf1f3bd1bdb5fa50}{disk\_\-read} (\hyperlink{integer_8h_4ae1dab0fb4b072a66584546209e7d58}{BYTE} drv, \hyperlink{integer_8h_4ae1dab0fb4b072a66584546209e7d58}{BYTE} $\ast$buff, \hyperlink{integer_8h_d342ac907eb044443153a22f964bf0af}{DWORD} sector, \hyperlink{integer_8h_4ae1dab0fb4b072a66584546209e7d58}{BYTE} count)
\item 
\hyperlink{diskio_8h_acdfef1dad6565f65c26d12fe0ea4b2b}{DRESULT} \hyperlink{diskio_8c_0045ef2f87f7c45d77bcdef38eae7b67}{disk\_\-write} (\hyperlink{integer_8h_4ae1dab0fb4b072a66584546209e7d58}{BYTE} drv, const \hyperlink{integer_8h_4ae1dab0fb4b072a66584546209e7d58}{BYTE} $\ast$buff, \hyperlink{integer_8h_d342ac907eb044443153a22f964bf0af}{DWORD} sector, \hyperlink{integer_8h_4ae1dab0fb4b072a66584546209e7d58}{BYTE} count)
\item 
\hyperlink{diskio_8h_acdfef1dad6565f65c26d12fe0ea4b2b}{DRESULT} \hyperlink{diskio_8c_e342f09a55603a5053750e2fd040f4a8}{disk\_\-ioctl} (\hyperlink{integer_8h_4ae1dab0fb4b072a66584546209e7d58}{BYTE} drv, \hyperlink{integer_8h_4ae1dab0fb4b072a66584546209e7d58}{BYTE} ctrl, void $\ast$buff)
\item 
void \hyperlink{diskio_8c_045f8898a243c16aca4e64e069c49c03}{disk\_\-timerproc} (void)
\end{CompactItemize}


\subsection{Define Documentation}
\hypertarget{diskio_8c_4be8f501d86d24b02923846db618fc71}{
\index{diskio.c@{diskio.c}!ACMD13@{ACMD13}}
\index{ACMD13@{ACMD13}!diskio.c@{diskio.c}}
\subsubsection[{ACMD13}]{\setlength{\rightskip}{0pt plus 5cm}\#define ACMD13~(0xC0+13)}}
\label{diskio_8c_4be8f501d86d24b02923846db618fc71}


\hypertarget{diskio_8c_a38144d651e2880f92c65bb683621f78}{
\index{diskio.c@{diskio.c}!ACMD23@{ACMD23}}
\index{ACMD23@{ACMD23}!diskio.c@{diskio.c}}
\subsubsection[{ACMD23}]{\setlength{\rightskip}{0pt plus 5cm}\#define ACMD23~(0xC0+23)}}
\label{diskio_8c_a38144d651e2880f92c65bb683621f78}


\hypertarget{diskio_8c_9b6fdfed1b57ac31269b6b9987e0761b}{
\index{diskio.c@{diskio.c}!ACMD41@{ACMD41}}
\index{ACMD41@{ACMD41}!diskio.c@{diskio.c}}
\subsubsection[{ACMD41}]{\setlength{\rightskip}{0pt plus 5cm}\#define ACMD41~(0xC0+41)}}
\label{diskio_8c_9b6fdfed1b57ac31269b6b9987e0761b}


\hypertarget{diskio_8c_938c1466755f12fb04ac0d1b775584d1}{
\index{diskio.c@{diskio.c}!CMD0@{CMD0}}
\index{CMD0@{CMD0}!diskio.c@{diskio.c}}
\subsubsection[{CMD0}]{\setlength{\rightskip}{0pt plus 5cm}\#define CMD0~(0x40+0)}}
\label{diskio_8c_938c1466755f12fb04ac0d1b775584d1}


\hypertarget{diskio_8c_ca9979f299fa78c1128d778084478673}{
\index{diskio.c@{diskio.c}!CMD1@{CMD1}}
\index{CMD1@{CMD1}!diskio.c@{diskio.c}}
\subsubsection[{CMD1}]{\setlength{\rightskip}{0pt plus 5cm}\#define CMD1~(0x40+1)}}
\label{diskio_8c_ca9979f299fa78c1128d778084478673}


\hypertarget{diskio_8c_e7b800ed8e7bd52e6f570a5ce72b8104}{
\index{diskio.c@{diskio.c}!CMD10@{CMD10}}
\index{CMD10@{CMD10}!diskio.c@{diskio.c}}
\subsubsection[{CMD10}]{\setlength{\rightskip}{0pt plus 5cm}\#define CMD10~(0x40+10)}}
\label{diskio_8c_e7b800ed8e7bd52e6f570a5ce72b8104}


\hypertarget{diskio_8c_8d6283c9b060afbaa0e6d1ff7e5ea7b8}{
\index{diskio.c@{diskio.c}!CMD12@{CMD12}}
\index{CMD12@{CMD12}!diskio.c@{diskio.c}}
\subsubsection[{CMD12}]{\setlength{\rightskip}{0pt plus 5cm}\#define CMD12~(0x40+12)}}
\label{diskio_8c_8d6283c9b060afbaa0e6d1ff7e5ea7b8}


\hypertarget{diskio_8c_aeab261b94f2031ba41a1d4d857c3541}{
\index{diskio.c@{diskio.c}!CMD16@{CMD16}}
\index{CMD16@{CMD16}!diskio.c@{diskio.c}}
\subsubsection[{CMD16}]{\setlength{\rightskip}{0pt plus 5cm}\#define CMD16~(0x40+16)}}
\label{diskio_8c_aeab261b94f2031ba41a1d4d857c3541}


\hypertarget{diskio_8c_6bbfe7dc16a19b7f40efcf554b5666ad}{
\index{diskio.c@{diskio.c}!CMD17@{CMD17}}
\index{CMD17@{CMD17}!diskio.c@{diskio.c}}
\subsubsection[{CMD17}]{\setlength{\rightskip}{0pt plus 5cm}\#define CMD17~(0x40+17)}}
\label{diskio_8c_6bbfe7dc16a19b7f40efcf554b5666ad}


\hypertarget{diskio_8c_3d32c27a6be061b865ba539127278f14}{
\index{diskio.c@{diskio.c}!CMD18@{CMD18}}
\index{CMD18@{CMD18}!diskio.c@{diskio.c}}
\subsubsection[{CMD18}]{\setlength{\rightskip}{0pt plus 5cm}\#define CMD18~(0x40+18)}}
\label{diskio_8c_3d32c27a6be061b865ba539127278f14}


\hypertarget{diskio_8c_14506e981f38b6177bc36f72c2ca18b1}{
\index{diskio.c@{diskio.c}!CMD23@{CMD23}}
\index{CMD23@{CMD23}!diskio.c@{diskio.c}}
\subsubsection[{CMD23}]{\setlength{\rightskip}{0pt plus 5cm}\#define CMD23~(0x40+23)}}
\label{diskio_8c_14506e981f38b6177bc36f72c2ca18b1}


\hypertarget{diskio_8c_252300302c6f7960df547a7f5c25be85}{
\index{diskio.c@{diskio.c}!CMD24@{CMD24}}
\index{CMD24@{CMD24}!diskio.c@{diskio.c}}
\subsubsection[{CMD24}]{\setlength{\rightskip}{0pt plus 5cm}\#define CMD24~(0x40+24)}}
\label{diskio_8c_252300302c6f7960df547a7f5c25be85}


\hypertarget{diskio_8c_ee2c673fba987178f4642531fdeefe9e}{
\index{diskio.c@{diskio.c}!CMD25@{CMD25}}
\index{CMD25@{CMD25}!diskio.c@{diskio.c}}
\subsubsection[{CMD25}]{\setlength{\rightskip}{0pt plus 5cm}\#define CMD25~(0x40+25)}}
\label{diskio_8c_ee2c673fba987178f4642531fdeefe9e}


\hypertarget{diskio_8c_78289a7a85ffcfddd626694105dc0780}{
\index{diskio.c@{diskio.c}!CMD55@{CMD55}}
\index{CMD55@{CMD55}!diskio.c@{diskio.c}}
\subsubsection[{CMD55}]{\setlength{\rightskip}{0pt plus 5cm}\#define CMD55~(0x40+55)}}
\label{diskio_8c_78289a7a85ffcfddd626694105dc0780}


\hypertarget{diskio_8c_a7a26b2cf17e1ff5967820a1fa41a7aa}{
\index{diskio.c@{diskio.c}!CMD58@{CMD58}}
\index{CMD58@{CMD58}!diskio.c@{diskio.c}}
\subsubsection[{CMD58}]{\setlength{\rightskip}{0pt plus 5cm}\#define CMD58~(0x40+58)}}
\label{diskio_8c_a7a26b2cf17e1ff5967820a1fa41a7aa}


\hypertarget{diskio_8c_c75b3e0ad1fb013ea946fb49bbe65668}{
\index{diskio.c@{diskio.c}!CMD8@{CMD8}}
\index{CMD8@{CMD8}!diskio.c@{diskio.c}}
\subsubsection[{CMD8}]{\setlength{\rightskip}{0pt plus 5cm}\#define CMD8~(0x40+8)}}
\label{diskio_8c_c75b3e0ad1fb013ea946fb49bbe65668}


\hypertarget{diskio_8c_1fac6a251d7e7dc204d21639bf521459}{
\index{diskio.c@{diskio.c}!CMD9@{CMD9}}
\index{CMD9@{CMD9}!diskio.c@{diskio.c}}
\subsubsection[{CMD9}]{\setlength{\rightskip}{0pt plus 5cm}\#define CMD9~(0x40+9)}}
\label{diskio_8c_1fac6a251d7e7dc204d21639bf521459}


\hypertarget{diskio_8c_1cbd972fc333e07d29999e284020c362}{
\index{diskio.c@{diskio.c}!DESELECT@{DESELECT}}
\index{DESELECT@{DESELECT}!diskio.c@{diskio.c}}
\subsubsection[{DESELECT}]{\setlength{\rightskip}{0pt plus 5cm}\#define DESELECT()~PORTB $|$= (1$<$$<$PB2)}}
\label{diskio_8c_1cbd972fc333e07d29999e284020c362}


\hypertarget{diskio_8c_1ffcdd6f111fd9b4229f49a5e37046b7}{
\index{diskio.c@{diskio.c}!FCLK\_\-FAST@{FCLK\_\-FAST}}
\index{FCLK\_\-FAST@{FCLK\_\-FAST}!diskio.c@{diskio.c}}
\subsubsection[{FCLK\_\-FAST}]{\setlength{\rightskip}{0pt plus 5cm}\#define FCLK\_\-FAST()}}
\label{diskio_8c_1ffcdd6f111fd9b4229f49a5e37046b7}


\hypertarget{diskio_8c_e3d9176798d1718d779e2db397de4bb5}{
\index{diskio.c@{diskio.c}!FCLK\_\-SLOW@{FCLK\_\-SLOW}}
\index{FCLK\_\-SLOW@{FCLK\_\-SLOW}!diskio.c@{diskio.c}}
\subsubsection[{FCLK\_\-SLOW}]{\setlength{\rightskip}{0pt plus 5cm}\#define FCLK\_\-SLOW()}}
\label{diskio_8c_e3d9176798d1718d779e2db397de4bb5}


\hypertarget{diskio_8c_317ab656a06a309fbb136df11cb83535}{
\index{diskio.c@{diskio.c}!rcvr\_\-spi\_\-m@{rcvr\_\-spi\_\-m}}
\index{rcvr\_\-spi\_\-m@{rcvr\_\-spi\_\-m}!diskio.c@{diskio.c}}
\subsubsection[{rcvr\_\-spi\_\-m}]{\setlength{\rightskip}{0pt plus 5cm}\#define rcvr\_\-spi\_\-m(dst)~SPDR=0xFF; loop\_\-until\_\-bit\_\-is\_\-set(SPSR,SPIF); $\ast$(dst)=SPDR}}
\label{diskio_8c_317ab656a06a309fbb136df11cb83535}


\hypertarget{diskio_8c_56e8d2ffde94d0c5fdf14b772a32a77f}{
\index{diskio.c@{diskio.c}!SELECT@{SELECT}}
\index{SELECT@{SELECT}!diskio.c@{diskio.c}}
\subsubsection[{SELECT}]{\setlength{\rightskip}{0pt plus 5cm}\#define SELECT()~PORTB \&= $\sim$(1$<$$<$PB2)}}
\label{diskio_8c_56e8d2ffde94d0c5fdf14b772a32a77f}


\hypertarget{diskio_8c_e53eb472945c81aa68af66d586fa0523}{
\index{diskio.c@{diskio.c}!xmit\_\-spi@{xmit\_\-spi}}
\index{xmit\_\-spi@{xmit\_\-spi}!diskio.c@{diskio.c}}
\subsubsection[{xmit\_\-spi}]{\setlength{\rightskip}{0pt plus 5cm}\#define xmit\_\-spi(dat)~SPDR=(dat); loop\_\-until\_\-bit\_\-is\_\-set(SPSR,SPIF)}}
\label{diskio_8c_e53eb472945c81aa68af66d586fa0523}




\subsection{Function Documentation}
\hypertarget{diskio_8c_8e429a29bdbb73f5bc9e2ab2335a5112}{
\index{diskio.c@{diskio.c}!disk\_\-initialize@{disk\_\-initialize}}
\index{disk\_\-initialize@{disk\_\-initialize}!diskio.c@{diskio.c}}
\subsubsection[{disk\_\-initialize}]{\setlength{\rightskip}{0pt plus 5cm}{\bf DSTATUS} disk\_\-initialize ({\bf BYTE} {\em drv})}}
\label{diskio_8c_8e429a29bdbb73f5bc9e2ab2335a5112}


\hypertarget{diskio_8c_e342f09a55603a5053750e2fd040f4a8}{
\index{diskio.c@{diskio.c}!disk\_\-ioctl@{disk\_\-ioctl}}
\index{disk\_\-ioctl@{disk\_\-ioctl}!diskio.c@{diskio.c}}
\subsubsection[{disk\_\-ioctl}]{\setlength{\rightskip}{0pt plus 5cm}{\bf DRESULT} disk\_\-ioctl ({\bf BYTE} {\em drv}, \/  {\bf BYTE} {\em ctrl}, \/  void $\ast$ {\em buff})}}
\label{diskio_8c_e342f09a55603a5053750e2fd040f4a8}


\hypertarget{diskio_8c_42043c0f462756dbdf1f3bd1bdb5fa50}{
\index{diskio.c@{diskio.c}!disk\_\-read@{disk\_\-read}}
\index{disk\_\-read@{disk\_\-read}!diskio.c@{diskio.c}}
\subsubsection[{disk\_\-read}]{\setlength{\rightskip}{0pt plus 5cm}{\bf DRESULT} disk\_\-read ({\bf BYTE} {\em drv}, \/  {\bf BYTE} $\ast$ {\em buff}, \/  {\bf DWORD} {\em sector}, \/  {\bf BYTE} {\em count})}}
\label{diskio_8c_42043c0f462756dbdf1f3bd1bdb5fa50}


\hypertarget{diskio_8c_21ad8e9a107ea2000705a3edfebaaa2d}{
\index{diskio.c@{diskio.c}!disk\_\-status@{disk\_\-status}}
\index{disk\_\-status@{disk\_\-status}!diskio.c@{diskio.c}}
\subsubsection[{disk\_\-status}]{\setlength{\rightskip}{0pt plus 5cm}{\bf DSTATUS} disk\_\-status ({\bf BYTE} {\em drv})}}
\label{diskio_8c_21ad8e9a107ea2000705a3edfebaaa2d}


\hypertarget{diskio_8c_045f8898a243c16aca4e64e069c49c03}{
\index{diskio.c@{diskio.c}!disk\_\-timerproc@{disk\_\-timerproc}}
\index{disk\_\-timerproc@{disk\_\-timerproc}!diskio.c@{diskio.c}}
\subsubsection[{disk\_\-timerproc}]{\setlength{\rightskip}{0pt plus 5cm}void disk\_\-timerproc (void)}}
\label{diskio_8c_045f8898a243c16aca4e64e069c49c03}


\hypertarget{diskio_8c_0045ef2f87f7c45d77bcdef38eae7b67}{
\index{diskio.c@{diskio.c}!disk\_\-write@{disk\_\-write}}
\index{disk\_\-write@{disk\_\-write}!diskio.c@{diskio.c}}
\subsubsection[{disk\_\-write}]{\setlength{\rightskip}{0pt plus 5cm}{\bf DRESULT} disk\_\-write ({\bf BYTE} {\em drv}, \/  const {\bf BYTE} $\ast$ {\em buff}, \/  {\bf DWORD} {\em sector}, \/  {\bf BYTE} {\em count})}}
\label{diskio_8c_0045ef2f87f7c45d77bcdef38eae7b67}


