Line No. | Rev | Author | Line |
---|---|---|---|
1 | 6 | kaklik | /*! \file spi.h \brief SPI interface driver. */ |
2 | //***************************************************************************** |
||
3 | // |
||
4 | // File Name : 'spi.h' |
||
5 | // Title : SPI interface driver |
||
6 | // Author : Pascal Stang - Copyright (C) 2000-2002 |
||
7 | // Created : 11/22/2000 |
||
8 | // Revised : 06/06/2002 |
||
9 | // Version : 0.6 |
||
10 | // Target MCU : Atmel AVR series |
||
11 | // Editor Tabs : 4 |
||
12 | // |
||
13 | // NOTE: This code is currently below version 1.0, and therefore is considered |
||
14 | // to be lacking in some functionality or documentation, or may not be fully |
||
15 | // tested. Nonetheless, you can expect most functions to work. |
||
16 | // |
||
17 | /// \ingroup driver_avr |
||
18 | /// \defgroup spi SPI (Serial Peripheral Interface) Function Library (spi.c) |
||
19 | /// \code #include "spi.h" \endcode |
||
20 | /// \par Overview |
||
21 | /// Provides basic byte and word transmitting and receiving via the AVR |
||
22 | /// SPI interface. Due to the nature of SPI, every SPI communication operation |
||
23 | /// is both a transmit and simultaneous receive. |
||
24 | /// |
||
25 | /// \note Currently, only MASTER mode is supported. |
||
26 | // |
||
27 | // This code is distributed under the GNU Public License |
||
28 | // which can be found at http://www.gnu.org/licenses/gpl.txt |
||
29 | // |
||
30 | //***************************************************************************** |
||
31 | |||
32 | #ifndef SPI_H |
||
33 | #define SPI_H |
||
34 | |||
35 | #include "global.h" |
||
36 | |||
37 | // function prototypes |
||
38 | |||
39 | // SPI interface initializer |
||
40 | void spiInit(void); |
||
41 | |||
42 | // spiSendByte(u08 data) waits until the SPI interface is ready |
||
43 | // and then sends a single byte over the SPI port. This command |
||
44 | // does not receive anything. |
||
45 | void spiSendByte(u08 data); |
||
46 | |||
47 | // spiTransferByte(u08 data) waits until the SPI interface is ready |
||
48 | // and then sends a single byte over the SPI port. The function also |
||
49 | // returns the byte that was received during transmission. |
||
50 | u08 spiTransferByte(u08 data); |
||
51 | |||
52 | // spiTransferWord(u08 data) works just like spiTransferByte but |
||
53 | // operates on a whole word (16-bits of data). |
||
54 | u16 spiTransferWord(u16 data); |
||
55 | |||
56 | #endif |
Powered by WebSVN v2.8.3