-
Notifications
You must be signed in to change notification settings - Fork 0
/
C200S.h
72 lines (59 loc) · 1.57 KB
/
C200S.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/**
* FPC1102 finger print sensor module
*
* Copyright (c) 2018 by Jay Xu.
* All Rights Reserved.
*/
#ifndef C200S_H
#define C200S_H
#include <stm32f0xx_hal.h>
#include <Driver_USART.h>
typedef struct
{
ARM_DRIVER_USART *usart;
GPIO_TypeDef *irqPort;
uint16_t irqPin;
} C200S_Handle;
enum C200S_Command
{
C200S_CMD_GET_IMAGE = 0x01,
C200S_CMD_GEN_FEATURES = 0x02,
C200S_CMD_MERGE_FEATURES = 0x05,
C200S_CMD_STORE = 0x06,
C200S_CMD_SEARCH = 0x04,
C200S_CMD_DELETE = 0x0C,
C200S_CMD_CLEAR = 0x0D,
C200S_CMD_COUNT = 0x1D,
C200S_CMD_SLEEP = 0x33
};
typedef enum
{
C200S_OK = 0,
C200S_FAILED = 1,
C200S_ERR_DATA_LOST = 2,
C200S_ERR_NO_IMAGE = 3,
C200S_ERR_NOT_FOUND = 4
} C200S_Status;
#ifdef __cplusplus
extern "C"
{
#endif
extern void C200S_Init(
C200S_Handle *hnds,
ARM_DRIVER_USART *usartDrv,
GPIO_TypeDef *irqPort,
uint16_t irqPin);
extern bool C200S_GetFingerPrint(C200S_Handle *hnd);
extern bool C200S_GenerateFeatures(C200S_Handle *hnd, const uint8_t step);
extern bool C200S_MergeFeatures(C200S_Handle *hnd);
extern bool C200S_StoreFingerPrint(C200S_Handle *hnd, const uint8_t storeIdx);
extern bool C200S_SearchFingerPrint(C200S_Handle *hnd, uint16_t *idx, uint16_t *similarity);
extern bool C200S_EnterSleepMode(C200S_Handle *hnd);
extern bool C200S_DeleteFingerPrint(C200S_Handle *hnd, const uint16_t idx);
extern int32_t C200S_GetFingerPrintCount(C200S_Handle *hnd);
extern bool C200S_AddFingerPrint(C200S_Handle *hnd, const uint8_t id);
extern bool C200S_FindFingerPrint(C200S_Handle *hnd, uint16_t *idx, uint16_t *sim);
#ifdef __cplusplus
}
#endif
#endif