[−][src]Crate hzgrow_r502
hzgrow-r502 is an embedded-hal driver for the HZ Grow R502 (and likely similar) fingerprint module.
This is a work in progress and does not strive to meet all use cases of the device. However, it should cover the basics, and may possibly become a basis for other drivers for HZ Grow and similar modules, provided that the suppliers of those use a rougly similar API.
Example
To authenticate with the R502:
let (mut tx, mut rx) = serial.split(); let mut r502 = R502::new(tx, rx, 0xffffffff); match r502.send_command(Command::VfyPwd { password: 0x00000000 }) { Ok(reply) => println!("Reply: {:#?}", reply), Err(err) => panic!("Error: {:#?}", err), }
Structs
GenImgResult | Result struct for the |
Img2TzResult | Result struct for the |
R502 | Represents a R502 device connected to a U(S)ART. |
ReadSysParaResult | Result struct for the |
SearchResult | Result struct for the |
SystemParameters | System status and configuration. |
VfyPwdResult | Result struct for the |
Enums
Command | Commands that one can send to the R502. Command naming and some field names are taken from the R502 datasheet. |
GenImgStatus | Enum for the |
Img2TzStatus | Enum for the |
PasswordVerificationState | Enum for the password handshake result |
Reply | Responses to commands returned by the R502. Names are the same as commands. |
SearchStatus | Enum for the |