Main Page | Data Structures | File List | Data Fields | Globals

spi_io.h

Go to the documentation of this file.
00001 
00010   /****************************************************************************
00011 *
00012 *     Axis 2 PCI Linux Kernel driver
00013 *     File:    spi_io.c
00014 *     Version: 1.0
00015 *     Copyright 2004 Heber Limited (http://www.heber.co.uk)
00016 *
00017 *     This program is free software; you can redistribute it and/or modify it
00018 *     under the terms of the GNU General Public License as published by the
00019 *     Free Software Foundation; either version 2, or (at your option) any
00020 *     later version.
00021 *
00022 *     This program is distributed in the hope that it will be useful, but
00023 *     WITHOUT ANY WARRANTY; without even the implied warranty of
00024 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00025 *     General Public License for more details.
00026 *
00027 *     You should have received a copy of the GNU General Public License along
00028 *     with this program; if not, write to the Free Software Foundation, Inc.,
00029 *     675 Mass Ave, Cambridge, MA 02139, USA.
00030 *
00031 *     Changes:
00032 *
00033 ****************************************************************************/
00034 #ifndef AXIS_SPI_IO_H
00035 #define AXIS_SPI_IO_H
00036 #ifndef _LINUX_KERNEL_H
00037 
00038 #include <linux/kernel.h>
00039 #include <linux/sched.h>
00040 #include <linux/version.h>
00041 #include <linux/module.h>
00042 #include <linux/proc_fs.h>
00043 #include <linux/delay.h>
00044 #include <linux/pci.h>
00045 #include <linux/list.h>
00046 #include <linux/ioport.h>
00047 #include <linux/serial.h>
00048 #include <linux/interrupt.h>
00049 #include <linux/string.h>
00050 #include <linux/spinlock.h>
00051 #include <linux/mtd/mtd.h>
00052 #include <linux/crypto.h>
00053 #include <asm/uaccess.h>
00054 
00055 #endif  //_LINUX_KERNEL_H
00056 
00057 #ifndef AXIS_HARDWARE_H
00058 #include "axis_hardware.h"
00059 #endif //AXIS_HARDWARE_H
00060 
00061 /*---------------------------spi defines--------------------------*/
00062 #define MAX_AXIS_SPI_DEVICES 4
00063 #define SPI_DATA_REGISTER_OFFSET 0x60
00064 #define SPI_CONTROL_REGISTER_1_OFFSET (SPI_DATA_REGISTER_OFFSET+1)
00065 #define SPI_CONTROL_REGISTER_2_OFFSET (SPI_DATA_REGISTER_OFFSET+2)
00066 #define     SPI_ADDRESS_REGISTER_OFFSET (SPI_DATA_REGISTER_OFFSET+3)
00067 #define     SPI_ENABLE_BIT (1<<7)
00068 #define     SPI_ERROR_CLEAR_BIT (1<<0)
00069 #define     SPI_MASTER_ACTIVE (1<<3)
00070 #define     SPI_TX_REG_EMPTY (1<<2)
00071 #define     SPI_RX_REG_READY (1<<1)
00072 #define     SPI_OVERRUN (1<<0)
00073 #define     SPI_INTERRUPT_ENABLE (1<<7)
00074 #define     SPI_MASTER_MODE (1<<6)
00075 #define     SPI_LSB_FIRST (1<<5)
00076 
00077 
00078 struct spi_op ;
00086 struct spi_channel
00087 {
00088     atomic_t open_count                             ; 
00089     struct axis_pci_device_entry * parent_device    ; 
00090     unsigned char   channel_number                  ; 
00091     unsigned char   control                         ; 
00092     long            minimum_inter_char_time         ; 
00093 } ;
00094 
00104 struct spi_op
00105 {
00106     struct spi_channel *    channel         ;       
00107     unsigned char *         data            ;       
00108     unsigned long           number_to_do    ;       
00109     unsigned char           status          ;       
00110 } ;
00111 
00112 void init_spi(struct axis_pci_device_entry * device);
00113 
00114 extern struct file_operations spi_file_operations ;
00115 
00116 #endif  //AXIS_SPI_IO_H
00117 
00118 

Generated on Fri Jan 28 12:33:48 2005 for Axis Kernel Driver by doxygen 1.3.6