os/linux-2.6-tag--devboard-R2_10-4/arch/cris/arch-v32/drivers/elphel/fpga_io.h

Go to the documentation of this file.
00001 //fpga_io.h
00002 #ifndef _FPGA_IO_H
00003 #define _FPGA_IO_H
00004 
00005 int fpga_io_ioctl(struct inode *inode, struct file *file,  unsigned int cmd, unsigned long arg);
00006 
00007 int fpga_io_open(void);
00008 int fpga_io_close (void);
00009 
00010 /* added read/write/lseek to read and write FPGA registers
00011  * write fromat (6 bytes per write):
00012  * byte 0 - address LSB
00013  * byte 1 - address MSB (high bit - 0 - ~=writereg, 1 -~=writereg4)
00014  * byte 2 - data LSB
00015  * ...
00016  * byte 5 - data MSB
00017  *
00018  * for reading registers - use lseek to 16-bit address (high bit readreg/readreg4)
00019  * byte address (for write - 32-bit address)
00020  * read data - 4 bytes (LSB first), reading again will not autoincrement registers
00021  *
00022  */
00029 ssize_t fpga_io_write  (struct file * file, const char * buf, size_t count, loff_t *off);
00030 loff_t  fpga_io_lseek  (struct file * file, loff_t offset, int orig);
00031 ssize_t fpga_io_read   (struct file * file, char * buf, size_t count, loff_t *off);
00032 
00033 ssize_t fpga_io_table_write  (struct file * file, const char * buf, size_t count, loff_t *off);
00034 loff_t  fpga_io_table_lseek  (struct file * file, loff_t offset, int orig);
00035 
00036 
00039 //extern void fpga_table_write_nice (int addr, int len, unsigned long * data);
00040 //extern void fpga_hist_read_nice   (int addr, int len, unsigned long * data);
00041 void fpga_table_write_nice (int addr, int len, unsigned long * data);
00042 void fpga_hist_read_nice   (int addr, int len, unsigned long * data);
00043 #endif

Generated on Fri Nov 28 00:06:23 2008 for elphel by  doxygen 1.5.1