Commit 439a2007 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev
Browse files

initial and not operational

parent 1b608ba2
Loading
Loading
Loading
Loading

ext/elphel/CREDITS

0 → 100644
+1 −0
Original line number Diff line number Diff line
elphel
 No newline at end of file
+0 −0

Empty file added.

ext/elphel/autoexp.h

0 → 100644
+66 −0
Original line number Diff line number Diff line
#ifndef __H_AUTOEXP__
#define __H_AUTOEXP__

#define AUTOEXP_DEV_NAME	"/dev/autoexp"

#define TABLES_LEN	8192

#define OFFSET_HIST_C	(4096 + 256 * 6 * 2)
#define OFFSET_GAMMA_C	(OFFSET_HIST_C + 4)

#define IOC_AUTOEXP_SET			0x01
#define IOC_AUTOEXP_GET			0x02
#define IOC_AUTOEXP_GET_LOG		0x03
#define IOC_AUTOEXP_GAMMA_TABLE	0x10

#ifndef HIST_NOT_CHANGE
#define HIST_NOT_CHANGE	0xFFFF
#endif
//!Moved to c313a.h
#if 0
struct autoexp_t {
	unsigned long on;
	/*
	 * in percents: 1 == 1, 100 == 100
	 */
	unsigned long width;
	unsigned long height;
	unsigned long left;
	unsigned long top;
	/*
	 * start exposure time really not needed...
	 */
	unsigned long exp_max;		/* 100 usec == 1 etc... */
	unsigned long overexp_max;	/* percentages for overexposured pixels - 1% == 100, 5% == 500, 0.02% == 2 etc... */
	/*
	 * changed chema - balance exposition for set percent of pixels in needed index
	 */
	unsigned long s_percent;
	unsigned long s_index;
	/*
	 * return current state
	 */
	unsigned long exp;
	/*
	 * "sleep" settings
	 */
	unsigned long skip_pmin;	/* percent of delta for skip changes: 1% == 100 */
	unsigned long skip_pmax;	/* percent of changes for wait one frame before apply changes: 1% == 100 */
	unsigned long skip_t;		/* time for skip changes: 100 usec == 1 */
};
#endif
#define LOG_C	200
//#define LOG_C	11

struct autoexp_log_t {
	unsigned long tv_sec;		/* time of log (fill in driver) */
	unsigned long tv_usec;
	unsigned long s_index;		/* requested in settings index */
	unsigned long s_percent;	/* requested percent for s_index */
	unsigned long n_index;		/* searched new index with needed percent - if 0 - index not searched, and use linear scale */
	unsigned long n_percent;	/* percent in searched index */
	unsigned long t_scale;		/* scale of exposition - in FFFF.FFFF fixed point format */
	unsigned long t_value;		/* new time, requested for sensor - w/o real correction, in 0.1ms scale (1ms == 10 etc...) */
};	/* 8 * 4 == 32 bytes in record... */

#endif	// __H_AUTOEXP__

ext/elphel/c313a.h

0 → 100644
+1930 −0

File added.

Preview size limit exceeded, changes collapsed.

ext/elphel/config.m4

0 → 100644
+63 −0
Original line number Diff line number Diff line
dnl $Id$
dnl config.m4 for extension elphel

dnl Comments in this file start with the string 'dnl'.
dnl Remove where necessary. This file will not work
dnl without editing.

dnl If your extension references something external, use with:

dnl PHP_ARG_WITH(elphel, for elphel support,
dnl Make sure that the comment is aligned:
dnl [  --with-elphel             Include elphel support])

dnl Otherwise use enable:

PHP_ARG_ENABLE(elphel, whether to enable elphel support,
Make sure that the comment is aligned:
[  --enable-elphel           Enable elphel support])

if test "$PHP_ELPHEL" != "no"; then
  dnl Write more examples of tests here...

  dnl # --with-elphel -> check with-path
  dnl SEARCH_PATH="/usr/local /usr"     # you might want to change this
  dnl SEARCH_FOR="/include/elphel.h"  # you most likely want to change this
  dnl if test -r $PHP_ELPHEL/$SEARCH_FOR; then # path given as parameter
  dnl   ELPHEL_DIR=$PHP_ELPHEL
  dnl else # search default path list
  dnl   AC_MSG_CHECKING([for elphel files in default path])
  dnl   for i in $SEARCH_PATH ; do
  dnl     if test -r $i/$SEARCH_FOR; then
  dnl       ELPHEL_DIR=$i
  dnl       AC_MSG_RESULT(found in $i)
  dnl     fi
  dnl   done
  dnl fi
  dnl
  dnl if test -z "$ELPHEL_DIR"; then
  dnl   AC_MSG_RESULT([not found])
  dnl   AC_MSG_ERROR([Please reinstall the elphel distribution])
  dnl fi

  dnl # --with-elphel -> add include path
  dnl PHP_ADD_INCLUDE($ELPHEL_DIR/include)

  dnl # --with-elphel -> check for lib and symbol presence
  dnl LIBNAME=elphel # you may want to change this
  dnl LIBSYMBOL=elphel # you most likely want to change this 

  dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
  dnl [
  dnl   PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $ELPHEL_DIR/$PHP_LIBDIR, ELPHEL_SHARED_LIBADD)
  dnl   AC_DEFINE(HAVE_ELPHELLIB,1,[ ])
  dnl ],[
  dnl   AC_MSG_ERROR([wrong elphel lib version or lib not found])
  dnl ],[
  dnl   -L$ELPHEL_DIR/$PHP_LIBDIR -lm
  dnl ])
  dnl
  dnl PHP_SUBST(ELPHEL_SHARED_LIBADD)

  PHP_NEW_EXTENSION(elphel, elphel_php.c, $ext_shared)
fi
Loading