📄 fpsensor.h
字号:
/*********************************************************************
*
* Copyright:
* MOTOROLA, INC. All Rights Reserved.
* You are hereby granted a copyright license to use, modify, and
* distribute the SOFTWARE so long as this entire notice is
* retained without alteration in any modified and/or redistributed
* versions, and that such modified versions are clearly identified
* as such. No licenses are granted by implication, estoppel or
* otherwise under any patents or trademarks of Motorola, Inc. This
* software is provided on an "AS IS" basis and without warranty.
*
* To the maximum extent permitted by applicable law, MOTOROLA
* DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, INCLUDING
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
* PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH REGARD TO THE
* SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF) AND ANY
* ACCOMPANYING WRITTEN MATERIALS.
*
* To the maximum extent permitted by applicable law, IN NO EVENT
* SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING
* WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS
* INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY
* LOSS) ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
*
* Motorola assumes no responsibility for the maintenance and support
* of this software
********************************************************************/
/*
* File: FPsensor.h
*
* Purpose: Header file for FPsensor.c
*
* Notes:
*
* Modifications:
*
*/
/*--- MBF200 Fingerprint Storage ---*/
#define FP_MAX_COLUMN (256) //Maximum column value for the sensor array
#define FP_MAX_ROW (300) //Maximum row value for the sensor array
typedef uint8 FP_ROW[FP_MAX_COLUMN];
typedef FP_ROW FP_IMAGE[FP_MAX_ROW];
/*--- MBF200 Register Offset Definitions ---*/
#define FP_RAH (0x00) //read/write Row Address High
#define FP_RAL (0x01) //read/write Row Address Low
#define FP_CAL (0x02) //read/write Column Address
#define FP_REH (0x03) //read/write Row address End High
#define FP_REL (0x04) //read/write Row address End Low
#define FP_CEL (0x05) //read/write Column address End
#define FP_DTR (0x06) //read/write Discharge Time Register
#define FP_DCR (0x07) //read/write Discharge Current Register
#define FP_CTRLA (0x08) //read/write Control A
#define FP_CTRLB (0x09) //read/write Control B
#define FP_CTRLC (0x0a) //read/write Control C
#define FP_SRA (0x0b) //read Status Register A
#define FP_PGC (0x0c) //read/write Programmable Gain Control
#define FP_ICR (0x0d) //read/write Interrupt Control Register
#define FP_ISR (0x0e) //read/write Interrupt Status Register
#define FP_THR (0x0f) //read/write THreshold Register
#define FP_CIDH (0x10) //read Chip Identification High
#define FP_CIDL (0x11) //read Chip Identification Low
#define FP_TST (0x12) //read/write Test Mode Register
/*--- MBF200 Register Bits ---*/
/*--- CRTLA ---*/
#define FP_GET_SUB (0x04) //Initiates sub-image retrieval
#define FP_GET_IMG (0x02) //Initiates whole image retrieval
#define FP_GET_ROW (0x01) //Initiates row retrieval
/*--- CRTLB ---*/
#define AFDEN (0x08) //Enables the automatic finger detection circuit
#define FP_AUTOINCEN (0x04) //Enables the column address auto incrementer
#define FP_XTALSEL (0x02) //Selects the clock source
#define FP_ENABLE (0x01) //Enables the array, digital and analog blocks
/*--- ICR ---*/
#define FP_IP_FINGER (0x40) //Finger detect interrupt polarity
#define FP_IT_FINGER (0x10) //Finger detect interrupt is edge or level
#define FP_IM_FINGER (0x04) //Finger detect interrupt mask
#define FP_IE_FINGER (0x01) //Finger detect interrupt enable
/*--- MBF200 Index and Data Register Base Addresses ---*/
#define FP_INDEX_REG (0x50000000) //INDEX register address in the MCF5249 memory map
#define FP_DATA_REG (0x50000002) //DATA register address in the MCF5249 memory map
#ifdef _FPSENSOR
/*--- MBF200 Register Read and Write Macros ---*/
#define FPWriteIndexReg(REG) (cpu_iowr_8(FP_INDEX_REG,REG)) //Write to the INDEX register
#define FPWriteDataReg(DATA) (cpu_iowr_8(FP_DATA_REG, DATA)) //Write to the DATA register
#define FPReadDataReg() (cpu_iord_8(FP_DATA_REG)) //Read from the DATA register
/*--- MBF200 parameter startup values ---*/
#define FP_DT_STARTUP (0x08)//(55) //discharge time provided by Fujitsu
#define FP_DC_STARTUP (0x03)//(1) //discharge current provided by Fujitsu
#define FP_GAIN_STARTUP (0x3)//(0) //gain value provided by Fujitsu
#define FP_THV_STARTUP (0x0) //Threshold voltage provided by Fujitsu
#define FP_THC_STARTUP (0xf) //Capacitor value provided by Fujitsu
/*--- MBF200 Read and Write Function Declarations ---*/
void FPWriteReg(uint8, uint8); //Write to a register
uint8 FPReadReg(uint8); //Read from a register
/*--- Sensor Basic Functions ---*/
void FPEnable(void); //Enable the sensor
void FPLowPower(void); //Put the sensor into low power mode
void FPSensorInit(); //Initialise sensor control
void FPAdjustParams(uint8, uint8, uint8); //Adjust the sensors parameters
void FPMCUFingerDetect(void); //Only returns when a finger is detected
/*--- Image retrieval Functions ---*/
void FPMCUGetRow(FP_ROW, uint8, uint8); //Retrieve a ROW of image data
void FPMCUGetWhole(FP_IMAGE); //Retrieve the WHOLE image
void FPMCUGetSub(FP_IMAGE data, uint8 row_MSB, uint8 row_LSB, uint8 column,
uint8 end_row_MSB, uint8 end_row_LSB, uint8 end_column); //Retrieve a SUB image
#else /*--- external access ---*/
/*--- MBF200 Read and Write Function Declarations ---*/
extern void FPWriteReg(uint8, uint8); //Write to a register
extern uint8 FPReadReg(uint8); //Read from a register
/*--- Sensor Basic Functions ---*/
extern void FPEnable(void); //Enable the sensor
extern void FPLowPower(void); //Put the sensor into low power mode
extern void FPSensorInit(); //Initialise sensor control
extern void FPAdjustParams(uint8, uint8, uint8); //Adjust the sensors parameters
extern void FPMCUFingerDetect(void); //Only returns when a finger is detected
/*--- Image retrieval Functions ---*/
extern void FPMCUGetRow(FP_ROW, uint8, uint8); //Retrieve a ROW of image data
extern void FPMCUGetWhole(FP_IMAGE); //Retrieve the WHOLE image
extern void FPMCUGetSub(FP_IMAGE data, uint8 row_MSB, uint8 row_LSB, uint8 column,
uint8 end_row_MSB, uint8 end_row_LSB, uint8 end_column); //Retrieve a SUB image
#endif /*--- _FPSENSOR ---*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -