📄 fps200ctl.h
字号:
#ifndef FPS200CTL_H#define FPS200CTL_H/*****************************************************************************//* * fps200ctl.h -- Control Codes for the FPS200 Sensor * * Copyright (C) 2002, 2003 - Cristiano Rodrigues de Carvalho * (crc@cefala.org) * Developed at the Federal University of Minas Gerais (www.ufm.br) * Laboratory of the Center for Research in Speech, Acoustics, * Language and Music (www.cefala.org) * * The Author thanks CNPq - Brazil for the financial support * * 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 2 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * * * *//*****************************************************************************//* the maximum width of the image */#define FPS200_WIDTH 256/* the maximum height of the image */#define FPS200_HEIGHT 300/* Portable Graymap File Format */#define FPS200_FILEFORMAT_PGM 0/* The file is written in raw format, no header */#define FPS200_FILEFORMAT_RAW 1/* The file is written in BMP (version 2) file format */#define FPS200_FILEFORMAT_BMP 2/* the default file format */#define FPS200_FILEFORMAT_DEFAULT 0struct fps200_dimension { int x; /* the start row (0-255) */ int y; /* the start line (0-299) */ int width; /* the width (0-256) - multiple of 64 */ int height; /* the height (0-300) */};/* mask that identifies read ioctl operations */#define FPS200_IOCTL_READ 0x8000/* returns the version of the driver * arg: * reserved (write 0 to this) * return: * version of the driver */#define FPS200_IOCTL_VERSION 0/* this command enable or disables the sensor which is at this state by default arg: 0 : disable the sensor 1 : enable the sensor (default when the sensor is plugged) return: 0 : sucess < 0: error */#define FPS200_IOCTL_ENABLE 1/* this command reads the enable state of the sensor arg: reserved. Write 0 to the argument return: 1 if sensor is enabled or 0 if sensor is disabled -1 in case of error This operation reads the data directly from the sensor. */#define FPS200_IOCTL_GETENABLESTATE (FPS200_IOCTL_READ | FPS200_IOCTL_ENABLE)/* configure the size of the image to be acquired arg: points to an fps200_dimension struct return: 0 : sucess < 0: error (including erros due to incorrect parameters) default when the sensor is plugged: full image */#define FPS200_IOCTL_SETRECT 2/* Reads the configuration for the area to be scanned arg: points to an fps200_dimension struct previously allocated return: 0 : success < 0: error This function retrieves the values that are stored in RAM and not in the device. */#define FPS200_IOCTL_GETRECT (FPS200_IOCTL_READ | FPS200_IOCTL_SETRECT)/* configure the output file format arg: specifies a file format from one of those defined by FPS200_FILEFORMAT_XXX return: 0 : sucess < 0: error (including erros due to incorrect parameters) */#define FPS200_IOCTL_SETFORMAT 3/* retrieves the file format configured for output arg: reserved: write 0 to this parameter. return: the file format configured */#define FPS200_IOCTL_GETFILEFORMAT (FPS200_IOCTL_READ | FPS200_IOCTL_SETFORMAT)/* configure the DTR (Discharge Time Register) arg: specifies an unsigned int ranging from 0 to 127 return: 0 : sucess < 0: error */#define FPS200_IOCTL_SETDTR 4/* retrieves the DTR value from the sensor arg: reserved. Write 0 to this parameter. return: the DTR value or -1 if error */#define FPS200_IOCTL_GETDTR (FPS200_IOCTL_READ | FPS200_IOCTL_SETDTR)/* configure the DCR (Discharge Current Register) arg: specifies an unsigned int ranging from 0 to 31 return: 0 : sucess < 0: error */#define FPS200_IOCTL_SETDCR 5/* retrieves the DCR value from the sensor arg: reserved. Write 0 to this parameter. return: the DCR value or -1 if error */#define FPS200_IOCTL_GETDCR (FPS200_IOCTL_READ | FPS200_IOCTL_SETDCR)/* configure the PGC (Programmable Gain Control) arg: specifies an unsigned int ranging from 0 to 15 return: 0 : sucess < 0: error */#define FPS200_IOCTL_SETPGC 6/* retrieves the PGC value from the sensor arg: reserved. Write 0 to this parameter. return: the PGC value or -1 if error */#define FPS200_IOCTL_GETPGC (FPS200_IOCTL_READ | FPS200_IOCTL_SETPGC)/* configure the THR (Threshold Register) arg: specifies an unsigned int ranging from 0 to 127 return: 0 : sucess < 0: error */#define FPS200_IOCTL_SETTHR 7/* retrieves the THR value from the sensor arg: reserved. Write 0 to this paramter. return: the THR value or -1 if error */#define FPS200_IOCTL_GETTHR (FPS200_IOCTL_READ | FPS200_IOCTL_SETTHR)/* reset the parameters DTR, DCR, PGC and THR to those specified when the driver was loaded. */#define FPS200_IOCTL_RESET_PARAMETERS 8/* this function can be used to write directly to registers in the FPS200 sensor. arg: an 16 bit integer where the most significant byte defines the register and the lower signficiant byte the value to be written. return: 0 if success or < 0 if error Note that this function can be disabled at compile time. The default state is disabled. */#define FPS200_IOCTL_WRITEREG 9/* this function can be used to read directly one register from the FPS200 sensor. arg: an 16 bit integer where the most significant byte defines the register and the lower signficiant byte is set to zero. return: the value of the register in the lower significant byte or -1 in case of error.*/#define FPS200_IOCTL_READREG (FPS200_IOCTL_READ | FPS200_IOCTL_WRITEREG)/* this function reads the value of the Analog input of the sensor * arg: * reserved. Write 0 to this parameter. * return: * return the value at the analog input in the lower 8 bits or -1 in * case of error. */#define FPS200_IOCTL_READAIN (FPS200_IOCTL_READ | 10)/* this register allow the control of the pins P0 and P1 of the * fingerprint sensor. * arg: * defines the function and state of the pins. Use the defines * FPS200_PIN_PX_XXXX oring them to get the desired behavior. * return: * return 0 if success or < 0 in case of error. */#define FPS200_IOCTL_CONTROLOUTPUTPINS 11#endif /* FPS200CTL_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -