apps/fpcf/fpcf.c File Reference

#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <asm/elphel/c313a.h>
#include <asm/elphel/autoexp.h>
#include <asm/elphel/fpgaclocks.h>
#include <asm/elphel/fpgactrl.h>

Include dependency graph for fpcf.c:

Go to the source code of this file.

Defines

#define X313_WA_SD_MODE   0x27
#define X313__RA__STATUS   0x10
#define X313_WA_DCM   8
#define X313_SR__DCM_OVFL   22
#define X313_SR__DCM_LOCKED   21
#define X313_SR__DCM_RDY   20
#define X313_SR__DCM_EARLY   19
#define X313_SR__DCM_LATE   18
#define IS_DCM_OVFL(x)   ( x & (1 << X313_SR__DCM_OVFL ))
#define IS_DCM_LOCK(x)   ( x & (1 << X313_SR__DCM_LOCKED ))
#define IS_DCM_RDY(x)   ( x & (1 << X313_SR__DCM_RDY ))
#define DCM_ERR(x)   (( x >> X313_SR__DCM_LATE ) & 3)
#define IS_DCM_GOOD(x)   (IS_DCM_LOCK(x) && IS_DCM_RDY(x) && !(IS_DCM_OVFL(x)))
#define CLOCK_LOW   20
#define CLOCK_HIGH   127
#define CY22393_SA   0xd2
#define FPCF_SDBUFFER_SIZE   0x800
#define DCM_RETRY   100
#define phase_noise_margin   5

Functions

int readSDRAMdummy (void)
void usleepFPGA (int devfd, int dly)
int main (int argc, char *argv[])

Variables

static char * usage
static char * short_usage = "Use fpcf -help for options\n"


Define Documentation

#define CLOCK_HIGH   127

Definition at line 164 of file fpcf.c.

Referenced by main().

#define CLOCK_LOW   20

Definition at line 163 of file fpcf.c.

Referenced by main().

#define CY22393_SA   0xd2

Definition at line 165 of file fpcf.c.

Referenced by main().

#define DCM_ERR ( x   )     (( x >> X313_SR__DCM_LATE ) & 3)

Definition at line 143 of file fpcf.c.

Referenced by main().

#define DCM_RETRY   100

Referenced by main().

#define FPCF_SDBUFFER_SIZE   0x800

Definition at line 303 of file fpcf.c.

Referenced by main().

#define IS_DCM_GOOD ( x   )     (IS_DCM_LOCK(x) && IS_DCM_RDY(x) && !(IS_DCM_OVFL(x)))

Definition at line 144 of file fpcf.c.

Referenced by main().

#define IS_DCM_LOCK ( x   )     ( x & (1 << X313_SR__DCM_LOCKED ))

Definition at line 141 of file fpcf.c.

Referenced by main().

#define IS_DCM_OVFL ( x   )     ( x & (1 << X313_SR__DCM_OVFL ))

Definition at line 139 of file fpcf.c.

#define IS_DCM_RDY ( x   )     ( x & (1 << X313_SR__DCM_RDY ))

Definition at line 142 of file fpcf.c.

#define phase_noise_margin   5

#define X313__RA__STATUS   0x10

Definition at line 128 of file fpcf.c.

Referenced by main(), and x313_JPEG_dump().

#define X313_SR__DCM_EARLY   19

Definition at line 135 of file fpcf.c.

#define X313_SR__DCM_LATE   18

Definition at line 136 of file fpcf.c.

#define X313_SR__DCM_LOCKED   21

Definition at line 133 of file fpcf.c.

#define X313_SR__DCM_OVFL   22

Definition at line 132 of file fpcf.c.

#define X313_SR__DCM_RDY   20

Definition at line 134 of file fpcf.c.

#define X313_WA_DCM   8

Definition at line 129 of file fpcf.c.

Referenced by main().

#define X313_WA_SD_MODE   0x27

*************************************************************************** ! FILE NAME : fpcf.c ! DESCRIPTION: A big set of different FPGA-related commands ! Copyright (C) 2002-2007 Elphel, Inc. ! -----------------------------------------------------------------------------** ! This program is free software: you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation, either version 3 of the License, or ! (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program. If not, see <http://www.gnu.org/licenses/>. ! -----------------------------------------------------------------------------** !

Log
fpcf.c,v
! Revision 1.7 2008/08/01 23:52:44 spectr_rain ! add result=OK string to output of SDRAM phase settings and SDRAM memory test ! ! Revision 1.6 2008/04/29 06:24:06 elphel ! used strtoll() instead of strtol to handle unsigned long >=0x7fffffff ! ! Revision 1.5 2008/04/09 19:46:59 elphel ! added fflush ! ! Revision 1.4 2008/04/09 19:35:08 elphel ! removed "test error" ! ! Revision 1.3 2008/04/09 19:33:07 elphel ! added system memory test, more wait state registers ! ! Revision 1.2 2008/01/25 07:13:01 elphel ! typo ! ! Revision 1.1.1.1 2007/09/30 03:20:25 elphel ! This is a fresh tree based on elphel353-2.10 ! ! Revision 1.5 2007/09/30 03:20:25 elphel ! fixed comment typo ! ! Revision 1.4 2007/09/16 06:15:42 elphel ! Just debug info (disabled by define) to troubleshoot sctl.cgi ! ! Revision 1.3 2007/08/17 12:12:22 spectr_rain ! switch to GPL3 license ! ! Revision 1.2 2007/07/10 08:25:44 spectr_rain ! *** empty log message *** ! ! Revision 1.3 2007/04/17 21:37:16 elphel ! added short output for "fpcf -c <bit_number>" ! ! Revision 1.2 2007/04/04 03:58:57 elphel ! support for new i2c features (hello.c - control i2c timing, fpcf - character device access to i2c) ! ! Revision 1.1.1.1 2007/02/23 10:11:49 elphel ! initial import into CVS ! ! Revision 1.12 2006/04/06 07:46:33 elphel ! control for canon lenses ! ! Revision 1.11 2006/02/18 18:55:28 elphel ! addet FPGA 6 i/o pins capture mode ! ! Revision 1.10 2006/01/11 17:10:05 elphel ! *** empty log message *** ! ! Revision 1.9 2006/01/05 05:07:46 spectr_rain ! load precalculated gamma table ! ! Revision 1.8 2005/11/23 05:07:42 spectr_rain ! up limit for sensor clock ! ! Revision 1.7 2005/08/28 15:46:55 elphel ! bug fix in "fpcf -?" ! ! Revision 1.6 2005/08/27 00:46:08 elphel ! continue on histograms ! ! Revision 1.5 2005/08/26 02:59:06 elphel ! working on histogram ! ! Revision 1.4 2005/07/11 01:33:05 elphel ! improved DDR SDRAM phase adjustment ! ! Revision 1.3 2005/05/15 17:39:07 elphel ! made DDR SDRAM clock phase adjustment - same as in Theora for model 333 branch ! ! Revision 1.2 2005/05/10 21:08:46 elphel ! *** empty log message *** ! ! Revision 1.2 2004/06/18 21:34:13 elphel ! added "JPEG_CMD_JUST_STOP" command to stop continuous acquisition mode (actually just a line in help) !

Definition at line 127 of file fpcf.c.

Referenced by main(), x313_fpn_readline(), x313_fpn_writeline(), and x313_frame_readline().


Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 304 of file fpcf.c.

References _CCCMD, AUTOEXP_DEV_NAME, CCAM_WPARS, CLOCK_HIGH, CLOCK_LOW, CMOSCAM_IOCTYPE, CY22393_SA, DCM_ERR, DCM_RETRY, FPCF_SDBUFFER_SIZE, FPGA_CLOCK_I2C_READREG, FPGA_CLOCK_I2C_WRITEREG, FPGA_CLOCK_IOCTYPE, FPGA_CLOCK_IOCTYPE_RD, FPGA_JTAG, FPGA_JTAG_ARG, FPGA_PA_RD, FPGA_PA_WR, FPGA_PGM, FPGA_STAT, FPGACONF_CANON_IOBYTE, FPGACONF_CONTROL_REG, FPGACONF_CR_MODIFY, FPGACONF_CR_SHADOW, FPGACONF_CR_SHADOW1, FPGACONF_GETSTATE, FPGACONF_IOCTYPE, 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, free(), I2C_READARG, I2C_WRITEARG, IO_CCAM_DMA, IO_CCAM_JPEG, IO_CCAM_JPEG_CTRL, IO_CCAM_JPEG_GET_L, IO_CCAM_JPEG_GET_N, IOC_AUTOEXP_GAMMA_TABLE, IS_DCM_GOOD, IS_DCM_LOCK, malloc(), P_CLK_FPGA, P_CLK_SENSOR, read, readSDRAMdummy(), short_usage, state, usage, write, X313__RA__STATUS, X313_WA_DCM, X313_WA_SD_MODE, and xa0.

int readSDRAMdummy ( void   ) 

Definition at line 270 of file fpcf.c.

References read.

Referenced by main().

void usleepFPGA ( int  devfd,
int  dly 
)

Definition at line 283 of file fpcf.c.

References FPGACONF_READREG, and FPGACONF_WRITEREG.


Variable Documentation

char* short_usage = "Use fpcf -help for options\n" [static]

Definition at line 255 of file fpcf.c.

Referenced by main().

char* usage [static]

Definition at line 170 of file fpcf.c.


Generated on Thu Aug 7 16:19:44 2008 for elphel by  doxygen 1.5.1