|
Revision 140, 0.8 KB
(checked in by follower, 11 months ago)
|
|
Add author, license and copyright details. (Which weren't permitted in competition entry source.)
|
| Line | |
|---|
| 1 | /* |
|---|
| 2 | |
|---|
| 3 | SPI Configuration |
|---|
| 4 | |
|---|
| 5 | Author: |
|---|
| 6 | |
|---|
| 7 | Philip Lindsay <follower@rancidbacon.com> |
|---|
| 8 | |
|---|
| 9 | License: |
|---|
| 10 | |
|---|
| 11 | Copyright 2007-2008 // LGPL |
|---|
| 12 | |
|---|
| 13 | */ |
|---|
| 14 | |
|---|
| 15 | #ifndef _SPI_H_ |
|---|
| 16 | #define _SPI_H_ |
|---|
| 17 | |
|---|
| 18 | // Define SPI-related pins |
|---|
| 19 | #define PIN_DATA_OUT 11 // MOSI (Master Out / Slave In) |
|---|
| 20 | #define PIN_DATA_IN 12 // MISO (Master In / Slave Out) |
|---|
| 21 | #define PIN_SPI_CLOCK 13 // SCK (Serial Clock) |
|---|
| 22 | // TODO: Define this elsewhere as this is specific to the network module. |
|---|
| 23 | #define PIN_SLAVE_SELECT 10 // SS (Slave Select) |
|---|
| 24 | |
|---|
| 25 | // Required for use in Arduino environment |
|---|
| 26 | #include <WConstants.h> |
|---|
| 27 | |
|---|
| 28 | class SpiConfiguration { |
|---|
| 29 | /* |
|---|
| 30 | |
|---|
| 31 | Handles SPI configuration with an API consistent |
|---|
| 32 | with the style of existing Arduino 'HardwareSerial' class. |
|---|
| 33 | |
|---|
| 34 | Needs to be used before SPI functionality is accessed. |
|---|
| 35 | |
|---|
| 36 | */ |
|---|
| 37 | |
|---|
| 38 | public: |
|---|
| 39 | SpiConfiguration(); |
|---|
| 40 | void begin(void); |
|---|
| 41 | }; |
|---|
| 42 | |
|---|
| 43 | #endif |
|---|