Minor cleanup.
[goodfet] / firmware / include / twe.h
1 /*! \file spi.h
2   \author EiNSTeiN_ <einstein@g3nius.org>
3   \brief Definitions for the Atmel 2-wire EEPROM application.
4 */
5
6 #ifndef TWE_H
7 #define TWE_H
8
9 #include "app.h"
10
11 #define TWE 0x05
12
13 //Pins and I/O
14 #define SDA BIT1
15 #define SCL BIT3
16
17 #define SETSDA SPIOUT |= SDA
18 #define CLRSDA SPIOUT &= ~SDA
19 #define SETSCL SPIOUT |= SCL
20 #define CLRSCL SPIOUT &= ~SCL
21
22 //! Set up the pins for SPI mode.
23 void twe_setup();
24
25 //! Read and write an SPI byte.
26 unsigned char twe_trans8(unsigned char byte);
27
28 void twe_handle_fn( uint8_t const app,
29                                         uint8_t const verb,
30                                         uint32_t const len);
31
32 extern app_t const twe_app;
33
34 #endif /* TWE_H */