GCC Code Coverage Report


Directory: ./
File: libfprint/drivers/aesx660.h
Date: 2024-05-04 14:54:39
Exec Total Coverage
Lines: 0 1 0.0%
Functions: 0 0 -%
Branches: 0 6 0.0%

Line Branch Exec Source
1 /*
2 * AuthenTec AES1660/AES2660 common definitions
3 * Copyright (c) 2012 Vasily Khoruzhick <anarsoul@gmail.com>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #pragma once
21
22 #define AESX660_HEADER_SIZE 3
23 #define AESX660_RESPONSE_TYPE_OFFSET 0x00
24 #define AESX660_RESPONSE_SIZE_LSB_OFFSET 0x01
25 #define AESX660_RESPONSE_SIZE_MSB_OFFSET 0x02
26
27 #define AESX660_CALIBRATE_RESPONSE 0x06
28 #define AESX660_FINGER_DET_RESPONSE 0x40
29 #define AESX660_FINGER_PRESENT_OFFSET 0x03
30 #define AESX660_FINGER_PRESENT 0x01
31
32 #define AESX660_IMAGE_OK_OFFSET 0x03
33 #define AESX660_IMAGE_OK 0x0d
34 #define AESX660_LAST_FRAME_OFFSET 0x04
35 #define AESX660_LAST_FRAME_BIT 0x01
36
37 #define AESX660_FRAME_DELTA_X_OFFSET 16
38 #define AESX660_FRAME_DELTA_Y_OFFSET 17
39
40 #define AESX660_IMAGE_OFFSET 43
41 #define AESX660_BULK_TRANSFER_SIZE 4096
42
43 #define AESX660_FRAME_HEIGHT 8
44
45 G_DECLARE_DERIVABLE_TYPE (FpiDeviceAesX660, fpi_device_aes_x660, FPI,
46 DEVICE_AES_X660, FpImageDevice)
47
48 #define FPI_TYPE_DEVICE_AES_X660 (fpi_device_aes_x660_get_type ())
49
50 struct _FpiDeviceAesX660Class
51 {
52 FpImageDeviceClass parent;
53
54 struct aesX660_cmd *init_seqs[2];
55 gsize init_seqs_len[2];
56 guint8 *start_imaging_cmd;
57 gsize start_imaging_cmd_len;
58 struct fpi_frame_asmbl_ctx *assembling_ctx;
59 };
60
61 struct aesX660_cmd
62 {
63 const guint8 *cmd;
64 gsize len;
65 };
66
67 /* 0x77 cmd seems to control LED, this sequence
68 * makes LED blink
69 */
70 static const guint8 led_blink_cmd[] = {
71 0x77, 0x18, 0x00,
72 0x00, 0x3f, 0x00, 0xff, 0x00,
73 0x01, 0x01, 0x00, 0x00, 0x00, 0xf3, 0x01, 0x00,
74 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0xf3,
75 0x01, 0x00, 0x7f
76 };
77
78 /* This sequence makes LED light solid
79 */
80 static const guint8 led_solid_cmd[] = {
81 0x77, 0x18, 0x00, 0x00, 0x3f, 0x00, 0xff, 0x00,
82 0x01, 0x01, 0x00, 0x00, 0x00, 0xe7, 0x03, 0x00,
83 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
84 0x00, 0x00, 0x7f
85 };
86
87 static const guint8 wait_for_finger_cmd[] = {
88 0x20,
89 0x40, 0x04, 0x00, 0x02, 0x1e, 0x00, 0x32
90 };
91
92 /* 0x40 cmd response
93 *
94 static const guint8 pkt1371[] = {
95 0x40, 0x01, 0x00, 0x01
96 };
97 */
98
99 static const guint8 set_idle_cmd[] = {
100 0x0d, /* Reset or "set idle"? */
101 };
102
103 static const guint8 read_id_cmd[] = {
104 0x44, 0x02, 0x00, 0x08, 0x00, /* Max transfer size is 8 */
105 0x07, /* Read ID? */
106 };
107
108 static const guint8 calibrate_cmd[] = {
109 0x44, 0x02, 0x00, 0x04, 0x00,
110 0x06,
111 };
112