packages/web/353/php_top/compressor.php

Go to the documentation of this file.
00001 <?php
00002 /*!*******************************************************************************
00003 *! FILE NAME  : compressor.php
00004 *! DESCRIPTION: Provides control of FPGA compressor/image acquisition
00005 *!              to the circular buffer (circbuf)
00006 *! Copyright (C) 2007 Elphel, Inc
00007 *! -----------------------------------------------------------------------------**
00008 *!
00009 *!  This program is free software: you can redistribute it and/or modify
00010 *!  it under the terms of the GNU General Public License as published by
00011 *!  the Free Software Foundation, either version 3 of the License, or
00012 *!  (at your option) any later version.
00013 *!
00014 *!  This program is distributed in the hope that it will be useful,
00015 *!  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 *!  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 *!  GNU General Public License for more details.
00018 *!
00019 *!  You should have received a copy of the GNU General Public License
00020 *!  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00021 *! -----------------------------------------------------------------------------**
00022 *!  $Log: compressor.php,v $
00023 *!  Revision 1.1.1.1  2008/11/27 20:04:03  elphel
00024 *!
00025 *!
00026 *!  Revision 1.1  2007/12/06 19:02:50  elphel
00027 *!  collected most of the camera PHP script into one  /packages/web/353/php_top directory
00028 *!
00029 *!  Revision 1.3  2007/10/31 04:59:41  elphel
00030 *!  Included changes by Diego
00031 *!
00032 *!  Revision 1.2  2007/10/11 08:35:17  elphel
00033 *!  fixed wrong file name in the header
00034 *!
00035 *!  Revision 1.1  2007/10/11 06:43:56  elphel
00036 *!  Added two small PHP scripts to controll compressor (all sensors) and trigger (CCD with 10347 board only)
00037 *!
00038 *!
00039 */
00040 
00041  $cmd=$_GET['cmd'];
00042  switch  ($cmd) {
00043    case "run":   $cmd=0xa; break;
00044    case "stop":  $cmd=0xd; break;
00045    case "reset": $cmd=0x10; break;
00046  }
00047  if (is_numeric ($cmd) && ($cmd >=1) && ($cmd <= 0x10)) {
00048    $cmdfile=fopen('/dev/sensorpars', 'r');
00049    fseek ($cmdfile, $cmd+0, SEEK_END) ;
00050    fclose($cmdfile);
00051    echo <<<STATUS
00052    OK
00053 STATUS;
00054  } else 
00055     echo <<<USAGE
00056    <p>This script controls FPGA compressor on the 10353 board. Sensor and input circuitry are supposed to be already programmed (for now use ccam.cgi).It accepts 3 mnemonic commands and numbers from 1 to 16 defined in <a href="http://elphel.cvs.sourceforge.net/elphel/elphel353-7.1/os/linux-2.6-tag--devboard-R2_10-4/include/asm-cris/elphel/c313a.h">os/linux-2.6/include/asm-cris/elphel/c313a.h</a>.</p>
00057    <ul>
00058     <li><b>cmd=run</b> - turn compressor on - it will compress all incoming sensor data and store it in circbuf, advancing write pointer and generating interrupts (that finish waits in imgsrv)</li>
00059     <li><b>cmd=stop</b> -  stop compressor (needed before changing of any acquisition (lake image size) or compression (quality) bparameters</li>
00060     <li><b>cmd=reset</b> - reset compressor circuitry, reinitialize circbuf</li>
00061     <li><b>cmd=1...16</b> - run command as described in c313.h, some commands may be outdated and/or not (yet) applicable to all sensors</li>
00062   </ul>
00063 USAGE;
00064 ?>

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