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

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int fpga_io_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
int fpga_io_open (void)
int fpga_io_close (void)
ssize_t fpga_io_write (struct file *file, const char *buf, size_t count, loff_t *off)
loff_t fpga_io_lseek (struct file *file, loff_t offset, int orig)
ssize_t fpga_io_read (struct file *file, char *buf, size_t count, loff_t *off)
 Maybe make an "atomic" read/write FPGA sequence that is executed with IRQ down? How?
void fpga_table_write (unsigned long fpga_addr, unsigned long *data, int length)


Function Documentation

int fpga_io_close ( void   ) 

Definition at line 102 of file fpga_io.c.

int fpga_io_ioctl ( struct inode *  inode,
struct file *  file,
unsigned int  cmd,
unsigned long  arg 
)

Definition at line 206 of file fpga_io.c.

References canon_lens_io(), capture_pins(), capture_read(), ccam_cr_shadow, D, FPGACONF_CANON_IOBYTE, FPGACONF_CONTROL_REG, FPGACONF_CR_MODIFY, FPGACONF_CR_SHADOW, FPGACONF_CR_SHADOW1, FPGACONF_RD_WAITSTATES, FPGACONF_READ_CAPTURE, FPGACONF_READREG, FPGACONF_READREG4, FPGACONF_READREG_H, FPGACONF_READREG_H4, FPGACONF_READREG_L, FPGACONF_READREG_L4, FPGACONF_START_CAPTURE, FPGACONF_WR_WAITSTATES, FPGACONF_WRITEREG, FPGACONF_WRITEREG4, int, local_irq_restore, local_irq_save, port_csp0_addr, port_csp4_addr, printk, and X313_WA_WCTL.

Referenced by fpga_ioctl().

loff_t fpga_io_lseek ( struct file *  file,
loff_t  offset,
int  orig 
)

Definition at line 326 of file fpga_io.c.

References D, and printk.

Referenced by fpga_lseek().

int fpga_io_open ( void   ) 

Definition at line 99 of file fpga_io.c.

ssize_t fpga_io_read ( struct file *  file,
char *  buf,
size_t  count,
loff_t *  off 
)

Maybe make an "atomic" read/write FPGA sequence that is executed with IRQ down? How?

it is not safe to read data table if interrupts are - autoexposure may try to read FPGA tables and that will change the pointers. So these functions are provided for testing only, there will be special functions for reading/writing FPGA tables TODO: Make sure that these FPGA accesses do not disturb autoexposure (it should read histogram only while IRQ is off)

off is considered to be a register address, not a byte pointer

now read to the buffer

copy data to user space

dont modify *off, return number of bytes read

Definition at line 363 of file fpga_io.c.

References D, port_csp0_addr, port_csp4_addr, and printk.

Referenced by fpga_read().

ssize_t fpga_io_write ( struct file *  file,
const char *  buf,
size_t  count,
loff_t *  off 
)

Changing again: 1. Lseek selects a 32-bit register, Bit 13 selects between CSP0 and CSP4 (needed for buffer reads that increment buffer address - i.e. histogram) 2. Writes and Reads always start from register LSB (i.e. multiple one byte reads will each return LSB of the same register), addresses are not autoincremented 3. Writes with less than muptiple of 4 bytes will fill higher bytes with zeros, register addresses are not auto incremented

off is considered to be a register address, not a byte pointer

get data from user space

zero unused bytes in last partial word

now write to FPGA

dont modify *off, return number of bytes written

Definition at line 381 of file fpga_io.c.

References D, port_csp0_addr, port_csp4_addr, printk, and wbuf.

Referenced by fpga_write().

void fpga_table_write ( unsigned long  fpga_addr,
unsigned long *  data,
int  length 
)

Definition at line 402 of file fpga_io.c.

References local_irq_restore, local_irq_save, and port_csp0_addr.

Referenced by set_gamma().


Generated on Thu Aug 7 16:20:21 2008 for elphel by  doxygen 1.5.1