42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
67#define FINGERPRINT3_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
69 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
70 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
71 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT );
78#define FINGERPRINT3_RETVAL uint8_t
80#define FINGERPRINT3_OK 0x00
81#define FINGERPRINT3_INIT_ERROR 0xFF
89#define FINGERPRINT3_CMD_GET_IMAGE 0x01
90#define FINGERPRINT3_CMD_IMAGE_2_TZ 0x02
91#define FINGERPRINT3_CMD_MATCH 0x03
92#define FINGERPRINT3_CMD_SEARCH 0x04
93#define FINGERPRINT3_CMD_REG_MODEL 0x05
94#define FINGERPRINT3_CMD_STORE 0x06
95#define FINGERPRINT3_CMD_LOAD_CHAR 0x07
96#define FINGERPRINT3_CMD_UPLOAD_CHAR 0x08
97#define FINGERPRINT3_CMD_DOWNLOAD_CHAR 0x09
98#define FINGERPRINT3_CMD_UPLOAD_IMAGE 0x0A
99#define FINGERPRINT3_CMD_DOWNLOAD_IMAGE 0x0B
100#define FINGERPRINT3_CMD_DELETE_CHAR 0x0C
101#define FINGERPRINT3_CMD_EMPTY 0x0D
102#define FINGERPRINT3_CMD_SET_SYS_PARAM 0x0E
103#define FINGERPRINT3_CMD_READ_SYS_PARAM 0x0F
104#define FINGERPRINT3_CMD_SET_PASSWORD 0x12
105#define FINGERPRINT3_CMD_VERIFY_PASSWORD 0x13
106#define FINGERPRINT3_CMD_GET_RANDOM_CODE 0x14
107#define FINGERPRINT3_CMD_SET_ADDRESS 0x15
108#define FINGERPRINT3_CMD_READ_INFO_PAGE 0x16
109#define FINGERPRINT3_CMD_PORT_CONTROL 0x17
110#define FINGERPRINT3_CMD_WRITE_NOTEPAD 0x18
111#define FINGERPRINT3_CMD_READ_NOTEPAD 0x19
112#define FINGERPRINT3_CMD_TEMPLATE_NUM 0x1D
113#define FINGERPRINT3_CMD_READ_INDEX_TEMPLATE 0x1F
114#define FINGERPRINT3_CMD_GET_IMAGE_EXT 0x28
115#define FINGERPRINT3_CMD_CANCEL 0x30
116#define FINGERPRINT3_CMD_AURA_CONTROL 0x35
117#define FINGERPRINT3_CMD_CHECK_SENSOR 0x36
118#define FINGERPRINT3_CMD_GET_ALG_VERSION 0x39
119#define FINGERPRINT3_CMD_GET_FW_VERSION 0x3A
120#define FINGERPRINT3_CMD_READ_PRODUCT_INFO 0x3C
121#define FINGERPRINT3_CMD_SOFT_RESET 0x3D
122#define FINGERPRINT3_CMD_HAND_SHAKE 0x40
129#define FINGERPRINT3_CONF_CMD_OK 0x00
130#define FINGERPRINT3_CONF_PACKET_RECEIVE_ERROR 0x01
131#define FINGERPRINT3_CONF_NO_FINGER 0x02
132#define FINGERPRINT3_CONF_ENROLL_FAIL 0x03
133#define FINGERPRINT3_CONF_OVER_DISORDERLY_FAIL 0x06
134#define FINGERPRINT3_CONF_OVER_SMALLNESS_FAIL 0x07
135#define FINGERPRINT3_CONF_NO_MATCH 0x08
136#define FINGERPRINT3_CONF_NOT_FOUND 0x09
137#define FINGERPRINT3_CONF_FAIL_TO_COMBINE 0x0A
138#define FINGERPRINT3_CONF_BAD_LOCATION 0x0B
139#define FINGERPRINT3_CONF_READ_TEMPLATE_FAIL 0x0C
140#define FINGERPRINT3_CONF_UPLOAD_TEMPLATE_FAIL 0x0D
141#define FINGERPRINT3_CONF_PACKET_RECEIVE_FAIL 0x0E
142#define FINGERPRINT3_CONF_UPLOAD_IMAGE_FAIL 0x0F
143#define FINGERPRINT3_CONF_DELETE_TEMPLATE_FAIL 0x10
144#define FINGERPRINT3_CONF_LIBRARY_CLEAR_FAIL 0x11
145#define FINGERPRINT3_CONF_WRONG_PASSWORD 0x13
146#define FINGERPRINT3_CONF_GENERATE_IMAGE_FAIL 0x15
147#define FINGERPRINT3_CONF_FLASH_WRITE_ERROR 0x18
148#define FINGERPRINT3_CONF_NO_DEFINITION_ERROR 0x19
149#define FINGERPRINT3_CONF_INVALID_REG_NUM 0x1A
150#define FINGERPRINT3_CONF_INCORRECT_REG_CONFIG 0x1B
151#define FINGERPRINT3_CONF_WRONG_PAGE_NUM 0x1C
152#define FINGERPRINT3_CONF_COM_PORT_FAIL 0x1D
159#define FINGERPRINT3_HEADER 0xEF01
160#define FINGERPRINT3_HEADER_MSB 0xEF
161#define FINGERPRINT3_HEADER_LSB 0x01
168#define FINGERPRINT3_DEFAULT_ADDRESS 0xFFFFFFFFul
169#define FINGERPRINT3_DEFAULT_PASSWORD 0x00000000ul
176#define FINGERPRINT3_COMMAND_PACKET 0x01
177#define FINGERPRINT3_DATA_PACKET 0x02
178#define FINGERPRINT3_ACK_PACKET 0x07
179#define FINGERPRINT3_END_DATA_PACKET 0x08
186#define FINGERPRINT3_DETECT_FINGER 0x00
187#define FINGERPRINT3_DETECT_NO_FINGER 0x01
194#define FINGERPRINT3_ERR_TIMEOUT 0xFB
195#define FINGERPRINT3_ERR_PACKAGE_LEN 0xFC
196#define FINGERPRINT3_ERR_CHKSUM 0xFD
197#define FINGERPRINT3_ERR_RESPONSE 0xFE
198#define FINGERPRINT3_ERR_HEADER 0xFF
205#define FINGERPRINT3_AURA_LED_RED 0x01
206#define FINGERPRINT3_AURA_LED_BLUE 0x02
207#define FINGERPRINT3_AURA_LED_PURPLE 0x03
209#define FINGERPRINT3_AURA_CTRL_BREATH 0x01
210#define FINGERPRINT3_AURA_CTRL_FLASH 0x02
211#define FINGERPRINT3_AURA_CTRL_ON 0x03
212#define FINGERPRINT3_AURA_CTRL_OFF 0x04
213#define FINGERPRINT3_AURA_CTRL_GRADUAL_ON 0x05
214#define FINGERPRINT3_AURA_CTRL_GRADUAL_OFF 0x06
216#define FINGERPRINT3_AURA_TIME_INFINITE 0x00
223#define FINGERPRINT3_MAX_PACKAGE_LENGTH 256
230#define FINGERPRINT3_DRV_TX_BUFFER_SIZE 500
231#define FINGERPRINT3_DRV_RX_BUFFER_SIZE 500
238#define FINGERPRINT3_TIMEOUT 500
269 uint8_t module_type[ 16 ];
270 uint8_t module_batch_number[ 4 ];
271 uint8_t module_serial_number[ 8 ];
272 uint8_t hardware_version[ 2 ];
273 uint8_t sensor_type[ 8 ];
468 uint8_t color, uint8_t times );
#define FINGERPRINT3_DRV_TX_BUFFER_SIZE
Definition fingerprint3.h:230
#define FINGERPRINT3_DRV_RX_BUFFER_SIZE
Definition fingerprint3.h:231
#define FINGERPRINT3_MAX_PACKAGE_LENGTH
Definition fingerprint3.h:223
uint8_t fingerprint3_match_finger(fingerprint3_t *ctx, uint16_t *score)
Empty the library function.
uint8_t fingerprint3_finger_indicator(fingerprint3_t *ctx)
Finger indicator function.
void fingerprint3_generic_write(fingerprint3_t *ctx, uint8_t *data_buf, uint16_t len)
Generic write function.
uint8_t fingerprint3_delete_template(fingerprint3_t *ctx, uint16_t location)
Delete template function.
uint8_t fingerprint3_soft_reset(fingerprint3_t *ctx)
Soft reset function.
uint8_t fingerprint3_aura_control(fingerprint3_t *ctx, uint8_t control, uint8_t speed, uint8_t color, uint8_t times)
Aura LED control function.
uint8_t fingerprint3_load_template(fingerprint3_t *ctx, uint8_t char_buffer, uint16_t location)
Create template function.
uint8_t fingerprint3_search_finger(fingerprint3_t *ctx, uint8_t char_buffer, uint16_t *location, uint16_t *score)
Empty the library function.
uint8_t fingerprint3_read_product_info(fingerprint3_t *ctx)
Read product info function.
uint8_t fingerprint3_check_sensor(fingerprint3_t *ctx)
Check sensor function.
uint8_t fingerprint3_set_security_lvl(fingerprint3_t *ctx, uint8_t lvl)
Set security level function.
uint8_t fingerprint3_read_sys_param(fingerprint3_t *ctx)
Read system parameter function.
uint8_t fingerprint3_read_index_table(fingerprint3_t *ctx, uint8_t *table, uint8_t page)
Read index table function.
uint8_t fingerprint3_extract_features(fingerprint3_t *ctx, uint8_t char_buffer)
Extract features function.
void fingerprint3_set_rst_pin(fingerprint3_t *ctx, uint8_t rst_pin)
Set RST pin state function.
uint8_t fingerprint3_set_config(fingerprint3_t *ctx, uint32_t addr, uint32_t pass)
Set config function.
void fingerprint3_cfg_setup(fingerprint3_cfg_t *cfg)
Config Object Initialization function.
uint8_t fingerprint3_store_template(fingerprint3_t *ctx, uint8_t char_buffer, uint16_t location)
Create template function.
err_t fingerprint3_init(fingerprint3_t *ctx, fingerprint3_cfg_t *cfg)
Initialization function.
uint8_t fingerprint3_create_template(fingerprint3_t *ctx)
Create template function.
uint8_t fingerprint3_send_package(fingerprint3_t *ctx, uint8_t pkg_id, uint8_t *pkg_content, uint16_t pkg_len)
Send package function.
uint8_t fingerprint3_verify_password(fingerprint3_t *ctx, uint32_t pass)
Verify password function.
uint8_t fingerprint3_hand_shake(fingerprint3_t *ctx)
Hand shake function.
int32_t fingerprint3_generic_read(fingerprint3_t *ctx, uint8_t *data_buf, uint16_t max_len)
Generic read function.
uint8_t fingerprint3_take_image(fingerprint3_t *ctx)
Take image function.
uint8_t fingerprint3_empty_library(fingerprint3_t *ctx)
Empty the library function.
Click configuration structure definition.
Definition fingerprint3.h:325
uint32_t baud_rate
Definition fingerprint3.h:335
bool uart_blocking
Definition fingerprint3.h:336
uart_data_bits_t data_bit
Definition fingerprint3.h:337
pin_name_t tx_pin
Definition fingerprint3.h:328
pin_name_t rx_pin
Definition fingerprint3.h:327
uart_stop_bits_t stop_bit
Definition fingerprint3.h:339
pin_name_t int_pin
Definition fingerprint3.h:332
uart_parity_t parity_bit
Definition fingerprint3.h:338
pin_name_t rst
Definition fingerprint3.h:331
Package structure.
Definition fingerprint3.h:254
uint16_t header
Definition fingerprint3.h:255
uint16_t checksum
Definition fingerprint3.h:260
uint8_t pkg_id
Definition fingerprint3.h:257
uint32_t addr
Definition fingerprint3.h:256
uint16_t pkg_len
Definition fingerprint3.h:258
Product Info structure.
Definition fingerprint3.h:268
uint16_t sensor_height
Definition fingerprint3.h:275
uint16_t database_size
Definition fingerprint3.h:277
uint16_t sensor_width
Definition fingerprint3.h:274
uint16_t template_size
Definition fingerprint3.h:276
System Parameters structure.
Definition fingerprint3.h:285
uint16_t system_identifier_code
Definition fingerprint3.h:287
uint32_t device_address
Definition fingerprint3.h:290
uint16_t security_level
Definition fingerprint3.h:289
uint16_t finger_library_size
Definition fingerprint3.h:288
uint16_t status_register
Definition fingerprint3.h:286
uint16_t data_package_size
Definition fingerprint3.h:291
uint32_t baudrate
Definition fingerprint3.h:292
Click ctx object definition.
Definition fingerprint3.h:300
fingerprint3_product_info_t product_info
Definition fingerprint3.h:314
uart_t uart
Definition fingerprint3.h:308
fingerprint3_pkg_t rsp
Definition fingerprint3.h:313
digital_in_t int_pin
Definition fingerprint3.h:305
uint32_t password
Definition fingerprint3.h:317
uint32_t address
Definition fingerprint3.h:316
digital_out_t rst
Definition fingerprint3.h:302
fingerprint3_sys_parameter_t system_parameters
Definition fingerprint3.h:315