Felícito Manzano
/
DTK_Guaria2_ABInBev
Proyecto ABInBev para la tarjeta Guaria 1/2.
Diff: GT521Fx/New_GT521Fx.hpp
- Revision:
- 1:9e821e640117
- Child:
- 12:5881f350b4da
diff -r 2d7ac38345d8 -r 9e821e640117 GT521Fx/New_GT521Fx.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GT521Fx/New_GT521Fx.hpp Fri Jul 01 12:45:55 2022 -0600 @@ -0,0 +1,94 @@ +/** + * @file New_GT521Fx.hpp + * @author Felícito Manzano (felicito.manzano@detektor.com.sv) + * @brief + * @version 0.1 + * @date 2021-02-13 + * + * @copyright Copyright (c) 2021 + * + */ + +#ifndef __NEW_GT521FX_H +#define __NEW_GT521FX_H + + #include <ctype.h> + #include "BufferedSerial.h" + + #define COMMAND_PACKAGE_LENGTH 12 + #define DATA_FP_PACKAGE_LENGTH 504 + + #define COMMAND_START_CODE1 0x55 + #define COMMAND_START_CODE2 0xAA + #define DATA_START_CODE1 0x5A + #define DATA_START_CODE2 0xA5 + #define DEVICE_ID 0x0001 + + #define OPEN 0x01 + #define CLOSE 0x02 + #define CHANGE_BAUD 0x04 + #define UNKNOW 0x06 + #define CMOSLED 0x12 + #define GETENROLLCOUNT 0x20 + #define CHECK_ENROLLED 0x21 + #define ENROLLSTART 0x22 + #define ENROLL1 0x23 + #define ENROLL2 0x24 + #define ENROLL3 0x25 + #define ISPRESSFINGER 0x26 + #define DELETEALL 0x41 + #define DELETEID 0x40 + #define IDENTIFY 0x51 + #define CAPTURE_FINGER 0x60 + #define GETTEMPLATE 0x70 + #define SETTEMPLATE 0x71 + #define STANDBY_MODE 0xF9 + #define ACK 0x30 + #define NACK 0x31 + + #define CEROS_INICIO 25 + #define TIEMPO_ESPERA 100000 + + typedef struct { + unsigned char Head1; + unsigned char Head2; + unsigned short wDevId; + unsigned long nParam; + unsigned short wCmd; + unsigned short wChkSum; + } COMMAND_PACKAGE_STRUCTURE; + + typedef struct { + unsigned char DHead1; + unsigned char DHead2; + unsigned short wDevId; + char * nData; + unsigned short wChkSum; + } DATA_PACKAGE_STRUCTURE; + + extern unsigned long return_para; + extern unsigned short return_ack; + extern const char TCA_ID_FP_FAILURE[10]; + extern const char TCA_ID_FP_DISABLE[10]; + extern const char GT521_ENGINE_UNLOCK[26]; + extern unsigned int zero; + extern unsigned int first_cmd[]; + + int FP_Open(); + void FP_Close(); + int FP_LED_open(); + int FP_LED_close(); + int FP_GetEnrollCount(); + int FP_CheckEnrolled(int thisID); + void FP_EnrollStart(int specify_ID); + void FP_Enroll(int Enroll_define); + int FP_IsPressFinger(); + int FP_DeleteAll(); + int FP_DeleteID(int thisID); + int FP_Identify(); + void FP_Sleep(); + void FP_CaptureFinger(unsigned long picture_quality); + int FP_SetTemplate(int thisID, char *fingerData); + void FP_Flush(); + +#endif // __NEW_GT521FX_H \ No newline at end of file