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?
ssize_t fpga_io_table_write (struct file *file, const char *buf, size_t count, loff_t *off)
loff_t fpga_io_table_lseek (struct file *file, loff_t offset, int orig)
void fpga_table_write_nice (int addr, int len, unsigned long *data)
void fpga_hist_read_nice (int addr, int len, unsigned long *data)


Function Documentation

void fpga_hist_read_nice ( int  addr,
int  len,
unsigned long *  data 
)

reading histograms really does not need disabling IRQs - they only could interfere with other process, reading histograms

Write start address, read first word from the memory to the output buffer (will be read out during next read)

needed before reading from FPGA after writing to it (for the writes that influence reads only)

will autoincrement FPGA table address)

Definition at line 457 of file fpga_io.c.

References flags, FPGA_TABLE_CHUNK, local_irq_restore, local_irq_save, MDF13, port_csp0_addr, port_csp4_addr, printk, X313_RA_HIST_DATA, X313_WA_HIST_ADDR, and X3X3_AFTERWRITE.

Referenced by set_histograms().

int fpga_io_close ( void   ) 

Definition at line 154 of file fpga_io.c.

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

Definition at line 258 of file fpga_io.c.

References canon_lens_io(), capture_pins(), capture_read(), D, d, FPGACONF_CANON_IOBYTE, 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, port_csp0_addr, port_csp4_addr, and printk.

Referenced by fpga_ioctl().

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

Definition at line 359 of file fpga_io.c.

References D, printk, SEEK_CUR, SEEK_END, SEEK_SET, and size.

Referenced by fpga_lseek().

int fpga_io_open ( void   ) 

Definition at line 151 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 396 of file fpga_io.c.

References D, port_csp0_addr, port_csp4_addr, and printk.

Referenced by fpga_read().

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

Definition at line 499 of file fpga_io.c.

References CX313_FPGA_TABLES_SIZE.

Referenced by fpga_lseek().

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

Definition at line 477 of file fpga_io.c.

References CX313_FPGA_TABLES_SIZE, D, fpga_table_write_nice(), fpga_tables_buffer, printk, and sa.

Referenced by fpga_write().

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 414 of file fpga_io.c.

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

Referenced by fpga_write().

void fpga_table_write_nice ( int  addr,
int  len,
unsigned long *  data 
)

extern void fpga_table_write(unsigned long fpga_addr, unsigned long *data, int length); - was only in hist353.c write FPGA tables/read histograms

will autoincrement FPGA table address

Definition at line 438 of file fpga_io.c.

References flags, FPGA_TABLE_CHUNK, local_irq_restore, local_irq_save, MDF12, port_csp0_addr, printk, X313_WA_COMP_TA, and X313_WA_COMP_TD.

Referenced by fpga_io_table_write(), jpeg_htable_fpga_pgm(), pgm_focusmode(), pgm_gammaload(), and set_qtable_fpga().


Generated on Fri Nov 28 00:07:49 2008 for elphel by  doxygen 1.5.1