M5Unit-FINGER 0.0.2 git rev:9f22200
Loading...
Searching...
No Matches
unit_Finger2.hpp File Reference

Finger2 unit for M5UnitUnified. More...

#include <M5UnitComponent.hpp>
#include <vector>
#include <array>

Go to the source code of this file.

Classes

struct  m5::unit::finger2::SystemBasicParams
 The module’s basic parameters. More...
 
class  m5::unit::UnitFinger2
 Fingerprint unit. More...
 
struct  m5::unit::UnitFinger2::config_t
 Settings for begin. More...
 

Namespaces

namespace  m5
 Top level namespace of M5stack.
 
namespace  finger2
 For UnitFinger2.
 
namespace  auto_enroll_flag
 Flags for autoEnroll.
 
namespace  auto_identify_flag
 Flags for autoIdentify.
 

Typedefs

using m5::unit::finger2::auto_enroll_flag_t = uint16_t
 Flags for autoEnroll.
 
using m5::unit::finger2::auto_identify_flag_t = uint16_t
 Flags for autoIdentify.
 
using m5::unit::finger2::auto_enroll_callback_t
 Callback function for autoEnroll.
 
using m5::unit::finger2::auto_identify_callback_t
 Callback function for autoIdentify.
 
using m5::unit::finger2::batch_callback_t
 Callback for batch read/write.
 

Enumerations

enum class  m5::unit::finger2::WorkMode : uint8_t { ScheduledSleep , AlwaysActive }
 Work mode. More...
 
enum class  m5::unit::finger2::LEDMode : uint8_t {
  None , Breath , Blink , On ,
  Off , Fadein , Fadeout , Rainbow ,
  Bleath = Breath
}
 LED operation mode. More...
 
enum class  m5::unit::finger2::LEDColor : uint8_t {
  Black , Blue , Green , Cyan ,
  Red , Magenta , Yellow , White
}
 Color for LED. More...
 
enum class  m5::unit::finger2::RegisterID : uint8_t { PacketSize = 6 }
 PS_WriteReg target register. More...
 
enum class  m5::unit::finger2::AutoEnrollStage : uint8_t {
  VerifyCommand , GetImage , GenerateCharacteristic , ReleasedFinger ,
  MergeTemplate , Inspection , StoreTemplate
}
 Interim stage of AutoEnroll. More...
 
enum class  m5::unit::finger2::AutoIdentifyStage : uint8_t { VerifyCommand , GetImage , Result = 0x05 }
 Interim stage of AutoIdentify. More...
 
enum class  m5::unit::finger2::ConfirmCode : uint8_t {
  OK , PacketError , NoFinger , ImageFailed ,
  ImageTooDry , ImageTooHumid , ImageTooAmorphous , ImageTooFew ,
  Unmatched , NotFound , MergeFailed , AddressOverflow ,
  ReadTemplateFailed , UploadFailed , ReceiveFailed , UploadImageFailed ,
  DeleteFailed , ClearFailed , LowPowerFailed , PasswordIncorrect ,
  ResetFailed , ResettFailed = ResetFailed , NoValidImage , UpgradeFailed ,
  IncompleteFinger , FlashError , RandomError , InvalidRegister ,
  RegisterError , NotepadPageError , PortError , AutoEnrollFailed ,
  DatabaseFull , IncorrectAddress , VerifyPassword , TemplateNotEmpty ,
  TemplateEmpty , DatabaseEmpty , IncorrectEnrollCount , Timeout ,
  AlreadyExists , FeatureAssociated , InitializeFailed , initializeFailed = InitializeFailed ,
  InformationNotEmpty , InformationEmpty , OTPFailed , KeyGenerateFailed ,
  KeyNotExist , AlgorithmFailed , IncorrectResult , MismatchFunction ,
  KeyLocked , SmallImage , StaticObjectInImage , IllegalData ,
  PacketTimeout = 0xF9 , PacketBad , PacketOverflow , OperationBlocked ,
  ParameterError , NotActive , PassiveActivation = 0xFF
}
 Confirmation code. More...
 

Variables

constexpr auto_enroll_flag_t m5::unit::finger2::auto_enroll_flag::DONT_RETURN_INTERMEDIATE_RESULTS {1U << 2}
 Do not return intermediate results.
 
constexpr auto_enroll_flag_t m5::unit::finger2::auto_enroll_flag::ALLOW_OVERWRITE_PAGE {1U << 3}
 Allow overwriting of page_id.
 
constexpr auto_enroll_flag_t m5::unit::finger2::auto_enroll_flag::PROHIBIT_DUPLICATE_TEMPLATE {1U << 4}
 Template Duplication prohibited.
 
constexpr auto_enroll_flag_t m5::unit::finger2::auto_enroll_flag::NO_NEED_RELEASE_FINGER {1U << 5}
 No need to release finger.
 
constexpr auto_enroll_flag_t m5::unit::finger2::auto_enroll_flag::NO_NEED_RELAESE_FINGER
 
constexpr auto_identify_flag_t m5::unit::finger2::auto_identify_flag::DONT_RETURN_INTERMEDIATE_RESULTS {1U << 2}
 Do not return intermediate results.
 

Detailed Description

Finger2 unit for M5UnitUnified.

Typedef Documentation

◆ auto_enroll_callback_t

Initial value:
bool (*)(const uint16_t call_times, const uint16_t page_id, const ConfirmCode confirm,
const AutoEnrollStage stage, const uint8_t state)
ConfirmCode
Confirmation code.
Definition unit_Finger2.hpp:144
AutoEnrollStage
Interim stage of AutoEnroll.
Definition unit_Finger2.hpp:120

Callback function for autoEnroll.

Parameters
call_timesNumber of callback invocations (zero origin)
page_idpage_id being attempted to register
confirmConfirmCode
stageAutoEnrollStage
stateState value of the stage
Return values
trueContinue process
falseAbort process

◆ auto_identify_callback_t

Initial value:
bool (*)(const uint16_t call_times, const ConfirmCode confirm,
const AutoIdentifyStage stage)
AutoIdentifyStage
Interim stage of AutoIdentify.
Definition unit_Finger2.hpp:134

Callback function for autoIdentify.

Parameters
call_timesNumber of callback invocations (zero origin)
confirmConfirmCode
stageAutoIdentifyStage
Return values
trueContinue process
falseAbort process

◆ batch_callback_t

Initial value:
bool (*)(const uint16_t call_times, const uint16_t actual_size, const uint16_t batch_size,
const uint16_t total_size, const uint16_t planned_size, const bool completed)

Callback for batch read/write.

Parameters
call_timesNumber of callback invocations (zero origin)
actual_sizeSize processed in a single batch operation
batch_sizeProcessing size per batch
total_sizeTotal processed size
planned_sizePlanned size
completedIs this the final step?
Return values
trueContinue process
falseAbort process (If completed == true, ignore)

Enumeration Type Documentation

◆ AutoEnrollStage

enum class m5::unit::finger2::AutoEnrollStage : uint8_t
strong

Interim stage of AutoEnroll.

Enumerator
VerifyCommand 

Command verification.

GetImage 

PS_GetEnrollImage.

GenerateCharacteristic 

PS_GenChar.

ReleasedFinger 

Detected that the finger was released.

MergeTemplate 

PS_RegModel.

Inspection 

Inspection.

StoreTemplate 

PS_StoreChar.

◆ AutoIdentifyStage

enum class m5::unit::finger2::AutoIdentifyStage : uint8_t
strong

Interim stage of AutoIdentify.

Enumerator
VerifyCommand 

Command verification.

GetImage 

PS_GetImage.

Result 

Result.

◆ ConfirmCode

enum class m5::unit::finger2::ConfirmCode : uint8_t
strong

Confirmation code.

Enumerator
OK 

0x00:Instruction implementing end or OK

PacketError 

0x01:Data packet receiving error

NoFinger 

0x02:No finger on the sensor

ImageFailed 

0x03:Getting fingerprint image failed

ImageTooDry 

0x04:The fingerprint image is too dry or too light to generate feature

ImageTooHumid 

0x05:The fingerprint image is too humid or too blurry to generate feature

ImageTooAmorphous 

0x06:The fingerprint image is too amorphous to generate feature

ImageTooFew 

0x07:The fingerprint image is in order, but with too little minutiaes(or too small area)to generatefeature

Unmatched 

0x08:The fingerprint unmatched

NotFound 

0x09:No fingerprint searched

MergeFailed 

0x0A:The feature merging failed

AddressOverflow 

0x0B:The address SN exceeding the range of fingerprint database when accessing to it

ReadTemplateFailed 

0x0C:Template reading error or invalid from the fingerprint database

UploadFailed 

0x0D:Feature uploading failed

ReceiveFailed 

0x0E:The module cannot receive continue data packet

UploadImageFailed 

0x0F:Image uploading failed

DeleteFailed 

0x10:Module deleting failed

ClearFailed 

0x11:The fingerprint database clearing failed

LowPowerFailed 

0x12:Cannot be in low power consumption

PasswordIncorrect 

0x13:The password incorrect

ResetFailed 

0x14:The system reset failed

ResettFailed 
Deprecated
Use ResetFailed
NoValidImage 

0x15:There is no valid original image in buffer to generate image

UpgradeFailed 

0x16:On-line upgrading failed;

IncompleteFinger 

0x17:There are incomplete fingerprint or finger stay still between twice image capturing

FlashError 

0x18:Read-write FLASH error

RandomError 

0x19:Random number generation failed

InvalidRegister 

0x1A:Invalid register number

RegisterError 

0x1B:Register distributing content wrong number

NotepadPageError 

0x1C:Notepad page number appointing error

PortError 

0x1D:Port operation failed

AutoEnrollFailed 

0x1E:Automatic enroll failed

DatabaseFull 

0x1F:Fingerprint database is full

IncorrectAddress 

0x20:Incorrect device address

VerifyPassword 

0x21:Must verify password first

TemplateNotEmpty 

0x22:Fingerprint template is NOT empty

TemplateEmpty 

0x23:Fingerprint template is empty

DatabaseEmpty 

0x24:The fingerprint database is empty

IncorrectEnrollCount 

0x25;Incorrect entry count setting

Timeout 

0x26:Timeout

AlreadyExists 

0x27:Fingerprint already exists

FeatureAssociated 

0x28:Fingerprint features are associated

InitializeFailed 

0x29:Sensor initialization failed

initializeFailed 
Deprecated
Use InitializeFailed
InformationNotEmpty 

0x2A:Module information is NOT empty

InformationEmpty 

0x2B:Module information is empty

OTPFailed 

0x2C:OTP operation failed

KeyGenerateFailed 

0x2D:Key generation failed

KeyNotExist 

0x2E:The key does not exist

AlgorithmFailed 

0x2F:Security algorithm execution failed

IncorrectResult 

0x30:The encryption/decryption results of the security algorithm are incorrect

MismatchFunction 

0x31:Functionality does not match the encryption level

KeyLocked 

0x32:The key has been locked

SmallImage 

0x33:Image too small

StaticObjectInImage 

0x34:Static foreign object in the image (Orange)

IllegalData 

0x35:The data is illegal

PacketTimeout 

0xF9:Receive packet timeout

PacketBad 

0xFA:Error Packet (e.g., data not fully received, other packet received)

PacketOverflow 

0xFB:Packet overflow (e.g., when a packet exceeds the maximum length)

OperationBlocked 

0xFC:This operation has been blocked

ParameterError 

0xFD:Parameter error

NotActive 

0xFE:The fingerprint module is not activated

PassiveActivation 

0xFF:Passive activation

◆ LEDColor

enum class m5::unit::finger2::LEDColor : uint8_t
strong

Color for LED.

Enumerator
Black 

Lights off.

Blue 

Blue (as default)

Green 

Green.

Cyan 

Cyan.

Red 

Red.

Magenta 

Magenta.

Yellow 

Yellow.

White 

White.

◆ LEDMode

enum class m5::unit::finger2::LEDMode : uint8_t
strong

LED operation mode.

Enumerator
None 

None.

Breath 

Roundtrip between light up and out gradually (as default)

Blink 

Blinking.

On 

Light up.

Off 

Light out.

Fadein 

Light up gradually.

Fadeout 

Light out gradually.

Rainbow 

Roundtrip rainbow color.

Bleath 
Deprecated
Use Breath

◆ RegisterID

enum class m5::unit::finger2::RegisterID : uint8_t
strong

PS_WriteReg target register.

Enumerator
PacketSize 

0x06:Data packet size (0:32,1:64,2:128,3:256) (1 as default)

◆ WorkMode

enum class m5::unit::finger2::WorkMode : uint8_t
strong

Work mode.

Enumerator
ScheduledSleep 

Automatic activation upon fingerprint detection. Go to sleep mode if no fingerprint is detected for a certain period of time

AlwaysActive 

Always active.

Variable Documentation

◆ NO_NEED_RELAESE_FINGER

auto_enroll_flag_t m5::unit::finger2::auto_enroll_flag::NO_NEED_RELAESE_FINGER
constexpr
Initial value:
=
constexpr auto_enroll_flag_t NO_NEED_RELEASE_FINGER
No need to release finger.
Definition unit_Finger2.hpp:100
Deprecated
Use NO_NEED_RELEASE_FINGER