Skip to content

Commit bfc4e5d

Browse files
committed
Add HatFinger
1 parent 6bdb349 commit bfc4e5d

15 files changed

Lines changed: 292 additions & 42 deletions

File tree

.github/workflows/arduino-esp-v2-build-check.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ concurrency:
4646

4747
jobs:
4848
build:
49-
name: ${{ matrix.sketch }}:${{matrix.board}}@${{matrix.platform-version}}
49+
name: ${{ matrix.build-properties }}:${{ matrix.sketch }}:${{matrix.board}}@${{matrix.platform-version}}
5050
runs-on: ubuntu-latest
5151
timeout-minutes: 5
5252

@@ -60,8 +60,9 @@ jobs:
6060
sketch:
6161
- PlotToSerial
6262

63-
unit:
64-
- UnitFinger
63+
# unit:
64+
# - UnitFinger
65+
# - HatFinger
6566

6667
board:
6768
- m5stack-atom
@@ -81,6 +82,9 @@ jobs:
8182
archi:
8283
- esp32
8384

85+
build-properties:
86+
- "-DUSING_UNIT_FINGER"
87+
8488
include:
8589
# Specific sketches
8690
- sketch: Capture
@@ -89,18 +93,22 @@ jobs:
8993
archi: esp32
9094
platform-version: 2.0.17
9195
board: m5stack-core-esp32
96+
build-properties: "-DUSING_UNIT_FINGER"
9297
- sketch: Characteristic
9398
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
9499
platform: esp32
95100
archi: esp32
96101
platform-version: 2.0.17
97102
board: m5stack-core-esp32
103+
build-properties: "-DUSING_UNIT_FINGER"
98104
- sketch: User
99105
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
100106
platform: esp32
101107
archi: esp32
102108
platform-version: 2.0.17
103109
board: m5stack-core-esp32
110+
build-properties: "-DUSING_UNIT_FINGER"
111+
104112

105113
steps:
106114
- name: Checkout
@@ -117,7 +125,7 @@ jobs:
117125
platform-url: ${{ matrix.platform-url }}
118126
required-libraries: ${{ env.REQUIRED_LIBRARIES }}
119127
extra-arduino-cli-args: ${{ matrix.cli-args }}
120-
#build-properties: ${{ matrix.build-properties }}
128+
build-properties: ${{ matrix.build-properties }}
121129
sketch-names: ${{ matrix.sketch }}.ino
122130
sketch-names-find-start: ${{ env.SKETCH_NAMES_FIND_START }}/${{ matrix.unit }}
123131
#sketches-exclude: ${{ matrix.sketches-exclude }}

.github/workflows/arduino-esp-v3-build-check.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ concurrency:
4646

4747
jobs:
4848
build:
49-
name: ${{ matrix.sketch }}:${{matrix.board}}@${{matrix.platform-version}}
49+
name: ${{ matrix.build-properties }}:${{ matrix.sketch }}:${{matrix.board}}@${{matrix.platform-version}}
5050
runs-on: ubuntu-latest
5151
timeout-minutes: 5
5252

@@ -60,8 +60,9 @@ jobs:
6060
sketch:
6161
- PlotToSerial
6262

63-
unit:
64-
- UnitFinger
63+
# unit:
64+
# - UnitFinger
65+
# - HatFinger
6566

6667
board:
6768
- m5stack_atom
@@ -98,6 +99,9 @@ jobs:
9899
archi:
99100
- esp32
100101

102+
build-properties:
103+
- "-DUSING_UNIT_FINGER"
104+
101105
include:
102106
# Specific sketches
103107
- sketch: Capture
@@ -106,19 +110,42 @@ jobs:
106110
archi: esp32
107111
platform-version: 3.1.3
108112
board: m5stack_core
113+
build-properties: "-DUSING_UNIT_FINGER"
109114
- sketch: Characteristic
110115
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
111116
platform: esp32
112117
archi: esp32
113118
platform-version: 3.1.3
114119
board: m5stack_core
120+
build-properties: "-DUSING_UNIT_FINGER"
115121
- sketch: User
116122
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
117123
platform: esp32
118124
archi: esp32
119125
platform-version: 3.1.3
120126
board: m5stack_core
121-
127+
build-properties: "-DUSING_UNIT_FINGER"
128+
- sketch: Capture
129+
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
130+
platform: esp32
131+
archi: esp32
132+
platform-version: 3.1.3
133+
board: m5stack_stickc_plus2
134+
build-properties: "-DUSING_HAT_FINGER"
135+
- sketch: Characteristic
136+
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
137+
platform: esp32
138+
archi: esp32
139+
platform-version: 3.1.3
140+
board: m5stack_stickc_plus2
141+
build-properties: "-DUSING_HAT_FINGER"
142+
- sketch: User
143+
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
144+
platform: esp32
145+
archi: esp32
146+
platform-version: 3.1.3
147+
board: m5stack_stickc_plus2
148+
build-properties: "-DUSING_HAT_FINGER"
122149

123150
steps:
124151
- name: Checkout
@@ -135,7 +162,7 @@ jobs:
135162
platform-url: ${{ matrix.platform-url }}
136163
required-libraries: ${{ env.REQUIRED_LIBRARIES }}
137164
extra-arduino-cli-args: ${{ matrix.cli-args }}
138-
#build-properties: ${{ matrix.build-properties }}
165+
build-properties: ${{ matrix.build-properties }}
139166
sketch-names: ${{ matrix.sketch }}.ino
140167
sketch-names-find-start: ${{ env.SKETCH_NAMES_FIND_START }}/${{ matrix.unit }}
141168
#sketches-exclude: ${{ matrix.sketches-exclude }}

.github/workflows/arduino-m5-build-check.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ concurrency:
4646

4747
jobs:
4848
build:
49-
name: ${{ matrix.sketch }}:${{matrix.board}}@${{matrix.platform-version}}
49+
name: ${{ matrix.build-properties }}:${{ matrix.sketch }}:${{matrix.board}}@${{matrix.platform-version}}
5050
runs-on: ubuntu-latest
5151
timeout-minutes: 5
5252

@@ -60,8 +60,9 @@ jobs:
6060
sketch:
6161
- PlotToSerial
6262

63-
unit:
64-
- UnitFinger
63+
# unit:
64+
# - UnitFinger
65+
# - HatFinger
6566

6667
board:
6768
- m5stack_atom
@@ -99,6 +100,9 @@ jobs:
99100
archi:
100101
- esp32
101102

103+
build-properties:
104+
- "-DUSING_UNIT_FINGER"
105+
102106
include:
103107
# Specific sketches
104108
- sketch: Capture
@@ -107,18 +111,42 @@ jobs:
107111
archi: esp32
108112
platform-version: 3.2.1
109113
board: m5stack_core
114+
build-properties: "-DUSING_UNIT_FINGER"
110115
- sketch: Characteristic
111116
platform-url: https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
112117
platform: esp32
113118
archi: esp32
114119
platform-version: 3.2.1
115120
board: m5stack_core
121+
build-properties: "-DUSING_UNIT_FINGER"
116122
- sketch: User
117123
platform-url: https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
118124
platform: esp32
119125
archi: esp32
120126
platform-version: 3.2.1
121127
board: m5stack_core
128+
build-properties: "-DUSING_UNIT_FINGER"
129+
- sketch: Capture
130+
platform-url: https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
131+
platform: esp32
132+
archi: esp32
133+
platform-version: 3.2.1
134+
board: m5stack_stickc_plus2
135+
build-properties: "-DUSING_HAT_FINGER"
136+
- sketch: Characteristic
137+
platform-url: https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
138+
platform: esp32
139+
archi: esp32
140+
platform-version: 3.2.1
141+
board: m5stack_stickc_plus2
142+
build-properties: "-DUSING_HAT_FINGER"
143+
- sketch: User
144+
platform-url: https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
145+
platform: esp32
146+
archi: esp32
147+
platform-version: 3.2.1
148+
board: m5stack_stickc_plus2
149+
build-properties: "-DUSING_HAT_FINGER"
122150

123151

124152
steps:
@@ -136,7 +164,7 @@ jobs:
136164
platform-url: ${{ matrix.platform-url }}
137165
required-libraries: ${{ env.REQUIRED_LIBRARIES }}
138166
extra-arduino-cli-args: ${{ matrix.cli-args }}
139-
#build-properties: ${{ matrix.build-properties }}
167+
build-properties: ${{ matrix.build-properties }}
140168
sketch-names: ${{ matrix.sketch }}.ino
141169
sketch-names-find-start: ${{ env.SKETCH_NAMES_FIND_START }}/${{ matrix.unit }}
142170
#sketches-exclude: ${{ matrix.sketches-exclude }}

.github/workflows/platformio-build-check.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858

5959
unit:
6060
- UnitFinger
61+
# - HatFinger
6162

6263
board:
6364
- Core
@@ -98,6 +99,21 @@ jobs:
9899
board: Core
99100
framework: Arduino
100101
espressif32: latest
102+
- example: Capture
103+
unit: HatFinger
104+
board: StickCPlus2
105+
framework: Arduino
106+
espressif32: latest
107+
- example: Characteristic
108+
unit: HatFinger
109+
board: StickCPlus2
110+
framework: Arduino
111+
espressif32: latest
112+
- example: User
113+
unit: HatFinger
114+
board: StickCPlus2
115+
framework: Arduino
116+
espressif32: latest
101117

102118
steps:
103119
- name: Checkout

README.md

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,46 @@
1-
# Product Name
1+
# M5Unit - FINGER
22

33
## Overview
44

5-
### SKU:xxx
5+
Library for Meters using [M5UnitUnified](https://github.com/m5stack/M5UnitUnified).
6+
M5UnitUnified is a library for unified handling of various M5 units products.
67

7-
Description of the product
8+
### SKU:U008
9+
Unit Finger is a fingerprint recognition sensor. It integrates the FPC1020A capacitive fingerprint recognition module, featuring multi-fingerprint entry, image processing, feature extraction, fingerprint comparison, and search functions.
810

9-
## Related Link
10-
11-
- [Document & Datasheet](https://docs.m5stack.com/en/unit/product_Link)
12-
13-
## Required Libraries:
11+
### SKU:U074
1412

15-
- [Adafruit_BMP280_Library](https://github.com/adafruit/Required_Libraries_Link)
16-
17-
## License
13+
Hat Finger is a fingerprint recognition sensor. It integrates the FPC1020SC capacitive fingerprint recognition module, featuring multi-fingerprint entry, image processing, feature extraction, fingerprint matching, and search functions.
1814

19-
- [Product Name- MIT](LICENSE)
2015

21-
## Remaining steps(Editorial Staff Look,After following the steps, remember to delete all the content below)
16+
## Related Link
17+
See also examples using conventional methods here.
2218

23-
1. Change [clang format check path](./.github/workflows/clang-format-check.yml#L42-L47).
24-
2. Add License content to [LICENSE](/LICENSE).
25-
3. Change link on line 78 of [bug-report.yml](./.github/ISSUE_TEMPLATE/bug-report.yml#L79).
19+
- [Unit Finger Document & Datasheet](https://docs.m5stack.com/en/unit/finger)
20+
- [Hat Finger Document & Datasheet](https://docs.m5stack.com/en/hat/hat-finger)
2621

27-
```cpp
28-
Example
29-
# M5Unit-ENV
3022

31-
## Overview
23+
## License
3224

33-
### SKU:U001 & U001-B & U001-C
25+
- [M5Unit-FINGER - MIT](LICENSE)
3426

35-
Contains M5Stack-**UNIT ENV** series related case programs.ENV is an environmental sensor with integrated SHT30 and QMP6988 internally to detect temperature, humidity, and atmospheric pressure data.
27+
## Examples
28+
See also [examples/UnitUnified](examples/UnitUnified)
3629

37-
## Related Link
30+
## Doxygen document
31+
[GitHub Pages](https://m5stack.github.io/M5Unit-FINGER/)
3832

39-
- [Document & Datasheet](https://docs.m5stack.com/en/unit/envIII)
33+
If you want to generate documents on your local machine, execute the following command
4034

41-
## Required Libraries:
35+
```
36+
bash docs/doxy.sh
37+
```
4238

43-
- [Adafruit_BMP280_Library](https://github.com/adafruit/Adafruit_BMP280_Library)
39+
It will output it under docs/html
40+
If you want to output Git commit hashes to html, do it for the git cloned folder.
4441

45-
## License
42+
### Required
43+
- [Doxyegn](https://www.doxygen.nl/)
44+
- [pcregrep](https://formulae.brew.sh/formula/pcre2)
45+
- [Git](https://git-scm.com/) (Output commit hash to html)
4646

47-
- [M5Unit-ENV - MIT](LICENSE)
48-
```

examples/UnitUnified/UnitFinger/Capture/Capture.ino

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,12 @@
66
/*
77
Capture finger example using M5UnitUnified for UnitFinger
88
*/
9+
// *************************************************************
10+
// Choose one define symbol to match the unit you are using
11+
// *************************************************************
12+
#if !defined(USING_UNIT_FINGER) && !defined(USING_HAT_FINGER)
13+
// #define USING_UNIT_FINGER
14+
// #define USING_HAT_FINGER
15+
#endif
16+
// *************************************************************
917
#include "main/Capture.cpp"

examples/UnitUnified/UnitFinger/Capture/main/Capture.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,29 @@
1111
#include <M5UnitUnifiedFINGER.h>
1212
#include <M5Utility.hpp>
1313

14+
// *************************************************************
15+
// Choose one define symbol to match the unit you are using
16+
// *************************************************************
17+
#if !defined(USING_UNIT_FINGER) && !defined(USING_HAT_FINGER)
18+
// #define USING_UNIT_FINGER
19+
// #define USING_HAT_FINGER
20+
#endif
21+
// *************************************************************
22+
1423
using namespace m5::unit::fpc1xxx;
1524

1625
namespace {
1726
auto& lcd = M5.Display;
1827
LGFX_Sprite sprite4, sprite8;
1928

2029
m5::unit::UnitUnified Units;
30+
#if defined(USING_UNIT_FINGER)
2131
m5::unit::UnitFinger unit;
32+
#elif defined(USING_HAT_FINGER)
33+
m5::unit::HatFinger unit;
34+
#else
35+
#error Please choose unit!
36+
#endif
2237

2338
void make_sprite8(LGFX_Sprite& s, const std::vector<uint8_t>& v, const uint16_t wid, const uint16_t hgt)
2439
{
@@ -53,8 +68,13 @@ void setup()
5368
lcd.setRotation(1);
5469
}
5570

71+
#if defined(USING_HAT_FINGER)
72+
auto pin_num_in = 26;
73+
auto pin_num_out = 0;
74+
#else
5675
auto pin_num_in = M5.getPin(m5::pin_name_t::port_c_rxd);
5776
auto pin_num_out = M5.getPin(m5::pin_name_t::port_c_txd);
77+
#endif
5878
if (pin_num_in < 0 || pin_num_out < 0) {
5979
M5_LOGW("PortC is not available");
6080
Wire.end();

0 commit comments

Comments
 (0)