Proyecto ABInBev para la tarjeta Guaria 1/2.

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers New_GT521Fx.hpp Source File

New_GT521Fx.hpp

Go to the documentation of this file.
00001 /**
00002  * @file New_GT521Fx.hpp
00003  * @author Felícito Manzano (felicito.manzano@detektor.com.sv)
00004  * @brief 
00005  * @version 0.1
00006  * @date 2021-02-13
00007  * 
00008  * @copyright Copyright (c) 2021
00009  * 
00010  */
00011 
00012 #ifndef __NEW_GT521FX_H
00013 #define __NEW_GT521FX_H
00014 
00015     #define COMMAND_PACKAGE_LENGTH  12 
00016     #define DATA_FP_PACKAGE_LENGTH  504
00017 
00018     #define COMMAND_START_CODE1 0x55
00019     #define COMMAND_START_CODE2 0xAA
00020     #define DATA_START_CODE1    0x5A
00021     #define DATA_START_CODE2    0xA5
00022     #define DEVICE_ID           0x0001
00023 
00024     #define OPEN                0x01  
00025     #define CLOSE               0x02
00026     #define CHANGE_BAUD         0x04
00027     #define UNKNOW              0x06
00028     #define CMOSLED             0x12
00029     #define GETENROLLCOUNT      0x20
00030     #define CHECK_ENROLLED      0x21
00031     #define ENROLLSTART         0x22
00032     #define ENROLL1             0x23
00033     #define ENROLL2             0x24
00034     #define ENROLL3             0x25
00035     #define ISPRESSFINGER       0x26
00036     #define DELETEALL           0x41
00037     #define DELETEID            0x40
00038     #define IDENTIFY            0x51
00039     #define CAPTURE_FINGER      0x60
00040     #define GETTEMPLATE         0x70
00041     #define SETTEMPLATE         0x71
00042     #define STANDBY_MODE        0xF9
00043     #define FP_ACK              0x30
00044     #define FP_NACK             0x31
00045 
00046     #define CEROS_INICIO        25
00047     #define TIEMPO_ESPERA       100000
00048 
00049     typedef struct {    
00050     unsigned char   Head1;         
00051     unsigned char   Head2;         
00052     unsigned short  wDevId;        
00053     unsigned long   nParam;          
00054     unsigned short  wCmd;          
00055     unsigned short  wChkSum;       
00056     } COMMAND_PACKAGE_STRUCTURE;
00057 
00058     typedef struct {    
00059     unsigned char   DHead1;         
00060     unsigned char   DHead2;         
00061     unsigned short  wDevId;        
00062     char *          nData;          
00063     unsigned short  wChkSum;       
00064     } DATA_PACKAGE_STRUCTURE;
00065 
00066     extern unsigned long    return_para;   
00067     extern unsigned short   return_ack;
00068     extern const char       TCA_ID_FP_FAILURE[10];
00069     extern const char       TCA_ID_FP_DISABLE[10];
00070     extern const char       GT521_ENGINE_UNLOCK[26];
00071     extern unsigned int     zero;
00072     extern unsigned int     first_cmd[];
00073 
00074     int  FP_Open();
00075     void FP_Close();
00076     int  FP_LED_open();
00077     int  FP_LED_close();
00078     int  FP_GetEnrollCount();
00079     int  FP_CheckEnrolled(int thisID);
00080     void FP_EnrollStart(int specify_ID);
00081     void FP_Enroll(int Enroll_define);
00082     int  FP_IsPressFinger();
00083     int  FP_DeleteAll();
00084     int  FP_DeleteID(int thisID);
00085     int  FP_Identify();
00086     void FP_Sleep();
00087     void FP_CaptureFinger(unsigned long picture_quality);
00088     int  FP_SetTemplate(int thisID, char *fingerData);
00089     void FP_Flush();
00090 
00091 #endif // __NEW_GT521FX_H