00001 00002 //*************************************************************************** 00003 //* spi.h 00004 //* 00005 //* Mon Jul 31 21:46:47 2006 00006 //* Copyright 2006 User 00007 //* Email 00009 //****************************************************************************/ 00011 /* 00012 * This program is free software; you can redistribute it and/or modify 00013 * it under the terms of the GNU General Public License as published by 00014 * the Free Software Foundation; either version 2 of the License, or 00015 * (at your option) any later version. 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU General Public License 00023 * along with this program; if not, write to the Free Software 00024 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00025 */ 00026 00027 #ifndef _SPI_H 00028 #define _SPI_H 00029 00030 #include <avr/io.h> 00031 00032 unsigned int SPI_init( unsigned int Options ); 00033 unsigned char SPI_ReadWrite( unsigned char Data ); 00034 unsigned char SPI_GetInitState( void ); 00035 00036 #define SPI_NOT_INIT 0x00 00037 #define SPI_HALF_SPEED 0x01 00038 #define SPI_FULL_SPEED 0x02 00039 00040 #define SPI_PORT PORTB 00041 #define SPI_DDR DDRB 00042 #define SS PB4 00043 #define MISO PB6 00044 #define MOSI PB5 00045 #define SCK PB7 00046 00047 #endif /* _SPI_H */ 00048