\section{aversive\_\-10-03-12/modules/comm/spi/spi.c File Reference}
\label{spi_8c}\index{aversive\_\-10-03-12/modules/comm/spi/spi.c@{aversive\_\-10-03-12/modules/comm/spi/spi.c}}
{\tt \#include $<$aversive.h$>$}\par
{\tt \#include $<$aversive/parts.h$>$}\par
{\tt \#include $<$aversive/error.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$spi.h$>$}\par
{\tt \#include $<$spi\_\-config.h$>$}\par
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef struct \_\-ss\_\-pin {\bf ss\_\-pin\_\-t}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int8\_\-t {\bf spi\_\-register\_\-ss\_\-line} (volatile uint8\_\-t $\ast$port, uint8\_\-t bitnum)
\item 
void {\bf spi\_\-set\_\-data\_\-order} (uint8\_\-t order)
\item 
uint8\_\-t {\bf spi\_\-get\_\-data\_\-order} (void)
\item 
void {\bf spi\_\-init} ({\bf spi\_\-mode\_\-t} mode, {\bf spi\_\-format\_\-t} format, {\bf spi\_\-clk\_\-rate\_\-t} clk\_\-rate)
\item 
{\bf spi\_\-mode\_\-t} {\bf spi\_\-get\_\-mode} (void)
\item 
uint8\_\-t {\bf spi\_\-send\_\-and\_\-receive\_\-byte} (uint8\_\-t byte)
\item 
void {\bf spi\_\-send\_\-byte} (uint8\_\-t byte)
\item 
uint8\_\-t {\bf spi\_\-receive\_\-byte} (void)
\item 
uint8\_\-t {\bf spi\_\-slave\_\-select} (uint8\_\-t slave)
\item 
void {\bf spi\_\-slave\_\-deselect} (uint8\_\-t slave)
\item 
void {\bf spi\_\-display\_\-ss\_\-lines} (void)
\end{CompactItemize}


\subsection{Typedef Documentation}
\index{spi.c@{spi.c}!ss\_\-pin\_\-t@{ss\_\-pin\_\-t}}
\index{ss\_\-pin\_\-t@{ss\_\-pin\_\-t}!spi.c@{spi.c}}
\subsubsection[ss\_\-pin\_\-t]{\setlength{\rightskip}{0pt plus 5cm}typedef struct \_\-ss\_\-pin  {\bf ss\_\-pin\_\-t}}\label{spi_8c_7c3898e7f3298a9313d2ae434d8522c6}




\subsection{Function Documentation}
\index{spi.c@{spi.c}!spi\_\-display\_\-ss\_\-lines@{spi\_\-display\_\-ss\_\-lines}}
\index{spi\_\-display\_\-ss\_\-lines@{spi\_\-display\_\-ss\_\-lines}!spi.c@{spi.c}}
\subsubsection[spi\_\-display\_\-ss\_\-lines]{\setlength{\rightskip}{0pt plus 5cm}void spi\_\-display\_\-ss\_\-lines (void)}\label{spi_8c_73caf97443a632aea62e315cf812cbe5}




Definition at line 213 of file spi.c.

References DEBUG, E\_\-SPI, and i.

Referenced by main().\index{spi.c@{spi.c}!spi\_\-get\_\-data\_\-order@{spi\_\-get\_\-data\_\-order}}
\index{spi\_\-get\_\-data\_\-order@{spi\_\-get\_\-data\_\-order}!spi.c@{spi.c}}
\subsubsection[spi\_\-get\_\-data\_\-order]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t spi\_\-get\_\-data\_\-order (void)\hspace{0.3cm}{\tt  [inline]}}\label{spi_8c_2bfdb2d2782e199eae9d0e50dd50759f}




Definition at line 88 of file spi.c.

References SPI\_\-LSB\_\-FIRST, and SPI\_\-MSB\_\-FIRST.\index{spi.c@{spi.c}!spi\_\-get\_\-mode@{spi\_\-get\_\-mode}}
\index{spi\_\-get\_\-mode@{spi\_\-get\_\-mode}!spi.c@{spi.c}}
\subsubsection[spi\_\-get\_\-mode]{\setlength{\rightskip}{0pt plus 5cm}{\bf spi\_\-mode\_\-t} spi\_\-get\_\-mode (void)\hspace{0.3cm}{\tt  [inline]}}\label{spi_8c_3a0f3ab141bdeba143a82de22fd6c6f2}




Definition at line 147 of file spi.c.

Referenced by cc2420\_\-init().\index{spi.c@{spi.c}!spi\_\-init@{spi\_\-init}}
\index{spi\_\-init@{spi\_\-init}!spi.c@{spi.c}}
\subsubsection[spi\_\-init]{\setlength{\rightskip}{0pt plus 5cm}void spi\_\-init ({\bf spi\_\-mode\_\-t} {\em mode}, \/  {\bf spi\_\-format\_\-t} {\em format}, \/  {\bf spi\_\-clk\_\-rate\_\-t} {\em clk\_\-rate})}\label{spi_8c_bdd061fa2024789d89478a39a4858a52}




Definition at line 99 of file spi.c.

References DDR, E\_\-SPI, FALSE, MISO\_\-BIT, MISO\_\-PORT, MOSI\_\-BIT, MOSI\_\-PORT, NOTICE, SCK\_\-BIT, SCK\_\-PORT, SPI2X\_\-REG, SPI\_\-MODE\_\-MASTER, SPR0\_\-REG, and SPR1\_\-REG.

Referenced by cc2420\_\-init(), and encoders\_\-spi\_\-init().\index{spi.c@{spi.c}!spi\_\-receive\_\-byte@{spi\_\-receive\_\-byte}}
\index{spi\_\-receive\_\-byte@{spi\_\-receive\_\-byte}!spi.c@{spi.c}}
\subsubsection[spi\_\-receive\_\-byte]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t spi\_\-receive\_\-byte (void)}\label{spi_8c_a17ae9268ad3cbc7d1cd243c1655380a}




Definition at line 181 of file spi.c.

References spi\_\-send\_\-and\_\-receive\_\-byte().

Referenced by cc2420\_\-read\_\-ram(), cc2420\_\-read\_\-register(), cc2420\_\-read\_\-rxfifo(), and encoders\_\-spi\_\-manage().\index{spi.c@{spi.c}!spi\_\-register\_\-ss\_\-line@{spi\_\-register\_\-ss\_\-line}}
\index{spi\_\-register\_\-ss\_\-line@{spi\_\-register\_\-ss\_\-line}!spi.c@{spi.c}}
\subsubsection[spi\_\-register\_\-ss\_\-line]{\setlength{\rightskip}{0pt plus 5cm}int8\_\-t spi\_\-register\_\-ss\_\-line (volatile uint8\_\-t $\ast$ {\em port}, \/  uint8\_\-t {\em bitnum})}\label{spi_8c_5e1519a4adf14f11293e0c7e2208480f}




Definition at line 55 of file spi.c.

References DEBUG, E\_\-SPI, and NOTICE.

Referenced by cc2420\_\-init(), and encoders\_\-spi\_\-init().\index{spi.c@{spi.c}!spi\_\-send\_\-and\_\-receive\_\-byte@{spi\_\-send\_\-and\_\-receive\_\-byte}}
\index{spi\_\-send\_\-and\_\-receive\_\-byte@{spi\_\-send\_\-and\_\-receive\_\-byte}!spi.c@{spi.c}}
\subsubsection[spi\_\-send\_\-and\_\-receive\_\-byte]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t spi\_\-send\_\-and\_\-receive\_\-byte (uint8\_\-t {\em byte})}\label{spi_8c_c1ec11a9dfdfd1567cf3f57e87cfeb1e}




Definition at line 156 of file spi.c.

Referenced by cc2420\_\-get\_\-status(), cc2420\_\-strobe\_\-register(), cc2420\_\-write\_\-rxfifo(), cc2420\_\-write\_\-txfifo(), spi\_\-receive\_\-byte(), and spi\_\-send\_\-byte().\index{spi.c@{spi.c}!spi\_\-send\_\-byte@{spi\_\-send\_\-byte}}
\index{spi\_\-send\_\-byte@{spi\_\-send\_\-byte}!spi.c@{spi.c}}
\subsubsection[spi\_\-send\_\-byte]{\setlength{\rightskip}{0pt plus 5cm}void spi\_\-send\_\-byte (uint8\_\-t {\em byte})\hspace{0.3cm}{\tt  [inline]}}\label{spi_8c_19fa0dda561fdb432494fbe12917f05f}




Definition at line 173 of file spi.c.

References spi\_\-send\_\-and\_\-receive\_\-byte().

Referenced by cc2420\_\-init(), cc2420\_\-read\_\-ram(), cc2420\_\-read\_\-register(), cc2420\_\-read\_\-rxfifo(), cc2420\_\-write\_\-ram(), cc2420\_\-write\_\-register(), cc2420\_\-write\_\-rxfifo(), and cc2420\_\-write\_\-txfifo().\index{spi.c@{spi.c}!spi\_\-set\_\-data\_\-order@{spi\_\-set\_\-data\_\-order}}
\index{spi\_\-set\_\-data\_\-order@{spi\_\-set\_\-data\_\-order}!spi.c@{spi.c}}
\subsubsection[spi\_\-set\_\-data\_\-order]{\setlength{\rightskip}{0pt plus 5cm}void spi\_\-set\_\-data\_\-order (uint8\_\-t {\em order})\hspace{0.3cm}{\tt  [inline]}}\label{spi_8c_f07d8dee9f403be2a32d674f2e9b3c9d}




Definition at line 77 of file spi.c.

References SPI\_\-LSB\_\-FIRST.

Referenced by encoders\_\-spi\_\-init().\index{spi.c@{spi.c}!spi\_\-slave\_\-deselect@{spi\_\-slave\_\-deselect}}
\index{spi\_\-slave\_\-deselect@{spi\_\-slave\_\-deselect}!spi.c@{spi.c}}
\subsubsection[spi\_\-slave\_\-deselect]{\setlength{\rightskip}{0pt plus 5cm}void spi\_\-slave\_\-deselect (uint8\_\-t {\em slave})}\label{spi_8c_b4724ed091315803d0e894f95960a423}




Definition at line 204 of file spi.c.

References FALSE.

Referenced by encoders\_\-spi\_\-manage().\index{spi.c@{spi.c}!spi\_\-slave\_\-select@{spi\_\-slave\_\-select}}
\index{spi\_\-slave\_\-select@{spi\_\-slave\_\-select}!spi.c@{spi.c}}
\subsubsection[spi\_\-slave\_\-select]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t spi\_\-slave\_\-select (uint8\_\-t {\em slave})}\label{spi_8c_171e51c040e2197f5eb069f402e849e4}




Definition at line 189 of file spi.c.

References E\_\-SPI, EBUSY, ERROR, ESUCCESS, and TRUE.

Referenced by encoders\_\-spi\_\-manage().