Zephyr Project API 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

HZ-Grow GROW_R502A fingerprint sensor. More...

Files

file  grow_r502a.h
 Header file for extended sensor API of Grow R502A sensor.
 

Data Structures

struct  r502a_sys_param
 System parameter. More...
 
struct  r502a_template
 Fingerprint template. More...
 

Enumerations

enum  r502a_led_color_idx { R502A_LED_COLOR_RED = 0x01 , R502A_LED_COLOR_BLUE , R502A_LED_COLOR_PURPLE }
 
enum  r502a_sec_level {
  R502A_SEC_LEVEL_1 = 1 , R502A_SEC_LEVEL_2 , R502A_SEC_LEVEL_3 , R502A_SEC_LEVEL_4 ,
  R502A_SEC_LEVEL_5
}
 Security level. More...
 
enum  r502a_data_len { R502A_PKG_LEN_32 , R502A_PKG_LEN_64 , R502A_PKG_LEN_128 , R502A_PKG_LEN_256 }
 Data packet length. More...
 
enum  r502a_sys_param_set { R502A_BAUD_RATE = 4 , R502A_SECURITY_LEVEL , R502A_DATA_PKG_LEN }
 System parameter set. More...
 
enum  sensor_channel_grow_r502a { SENSOR_CHAN_FINGERPRINT = SENSOR_CHAN_PRIV_START }
 Custom sensor channels for Grow R502A. More...
 
enum  sensor_trigger_type_grow_r502a { SENSOR_TRIG_TOUCH = SENSOR_TRIG_PRIV_START }
 Custom trigger types for Grow R502A. More...
 
enum  sensor_attribute_grow_r502a {
  SENSOR_ATTR_R502A_CAPTURE = SENSOR_ATTR_PRIV_START , SENSOR_ATTR_R502A_TEMPLATE_CREATE , SENSOR_ATTR_R502A_RECORD_ADD , SENSOR_ATTR_R502A_RECORD_FIND ,
  SENSOR_ATTR_R502A_RECORD_DEL , SENSOR_ATTR_R502A_RECORD_FREE_IDX , SENSOR_ATTR_R502A_RECORD_EMPTY , SENSOR_ATTR_R502A_RECORD_LOAD ,
  SENSOR_ATTR_R502A_COMPARE , SENSOR_ATTR_R502A_SYS_PARAM
}
 Custom sensor attributes for Grow R502A. More...
 

Functions

int r502a_read_sys_param (const struct device *dev, struct r502a_sys_param *val)
 Read system parameters.
 
int fps_upload_char_buf (const struct device *dev, struct r502a_template *temp)
 Upload finger template.
 
int fps_download_char_buf (const struct device *dev, uint8_t char_buf_id, const struct r502a_template *temp)
 Download finger template.
 

Baud rates

#define R502A_BAUD_9600   1
 9600 bps
 
#define R502A_BAUD_19200   2
 19200 bps
 
#define R502A_BAUD_38400   4
 38400 bps
 
#define R502A_BAUD_57600   6
 57600 bps
 
#define R502A_BAUD_115200   12
 115200 bps
 

Detailed Description

HZ-Grow GROW_R502A fingerprint sensor.

Macro Definition Documentation

◆ R502A_BAUD_115200

#define R502A_BAUD_115200   12

◆ R502A_BAUD_19200

#define R502A_BAUD_19200   2

◆ R502A_BAUD_38400

#define R502A_BAUD_38400   4

◆ R502A_BAUD_57600

#define R502A_BAUD_57600   6

◆ R502A_BAUD_9600

#define R502A_BAUD_9600   1

Enumeration Type Documentation

◆ r502a_data_len

#include <include/zephyr/drivers/sensor/grow_r502a.h>

Data packet length.

This enumeration lists all the supported data packet lengths for when the sensor communicates with the host.

Enumerator
R502A_PKG_LEN_32 

32 bytes

R502A_PKG_LEN_64 

64 bytes

R502A_PKG_LEN_128 

128 bytes

R502A_PKG_LEN_256 

256 bytes

◆ r502a_led_color_idx

#include <include/zephyr/drivers/sensor/grow_r502a.h>

Enumerator
R502A_LED_COLOR_RED 
R502A_LED_COLOR_BLUE 
R502A_LED_COLOR_PURPLE 

◆ r502a_sec_level

#include <include/zephyr/drivers/sensor/grow_r502a.h>

Security level.

This enumeration lists all the supported security levels controlling the matching threshold value for fingerprint matching.

Enumerator
R502A_SEC_LEVEL_1 

Level 1 (lowest security)

R502A_SEC_LEVEL_2 

Level 2.

R502A_SEC_LEVEL_3 

Level 3.

R502A_SEC_LEVEL_4 

Level 4.

R502A_SEC_LEVEL_5 

Level 5 (highest security)

◆ r502a_sys_param_set

#include <include/zephyr/drivers/sensor/grow_r502a.h>

System parameter set.

This enumeration lists all the system parameters that can be set.

Enumerator
R502A_BAUD_RATE 

Baud rate.

R502A_SECURITY_LEVEL 

Security level.

R502A_DATA_PKG_LEN 

Data package length.

◆ sensor_attribute_grow_r502a

#include <include/zephyr/drivers/sensor/grow_r502a.h>

Custom sensor attributes for Grow R502A.

Enumerator
SENSOR_ATTR_R502A_CAPTURE 

To capture finger and store as feature file in RAM buffers char_buf_1 and char_buf_2.

SENSOR_ATTR_R502A_TEMPLATE_CREATE 

create template from feature files at RAM buffers char_buf_1 & char_buf_2 and store a template data back in both RAM buffers char_buf_1 and char_buf_2.

SENSOR_ATTR_R502A_RECORD_ADD 

Add template to the sensor record storage.

   sensor_value.val1 is the record index for template to be stored in the sensor device's
   flash
SENSOR_ATTR_R502A_RECORD_FIND 

Find requested data in record storage.

   sensor_value.val1 is the matched record index.
   sensor_value.val2 is the matching score.
SENSOR_ATTR_R502A_RECORD_DEL 

Delete mentioned data from record storage.

   sensor_value.val1 is the record start index to be deleted.
   sensor_value.val2 is the number of records to be deleted.
SENSOR_ATTR_R502A_RECORD_FREE_IDX 

Get available position to store data on record storage.

SENSOR_ATTR_R502A_RECORD_EMPTY 

Empty the storage record.

SENSOR_ATTR_R502A_RECORD_LOAD 

Load template from storage to RAM buffer of sensor.

   sensor_value.val1 is the record start index to be loaded in
   device internal RAM buffer.
SENSOR_ATTR_R502A_COMPARE 

Template data stored in sensor's RAM buffer.

   sensor_value.val1 is the match result (R502A_FINGER_MATCH_FOUND or
   R502A_FINGER_MATCH_NOT_FOUND)
   sensor_value.val2 is the matching score.
SENSOR_ATTR_R502A_SYS_PARAM 

Set device's system parameters.

   sensor_value.val1 is the parameter number from enum r502a_sys_param_set.
   sensor_value.val2 is the content to be written for the respective parameter.

◆ sensor_channel_grow_r502a

#include <include/zephyr/drivers/sensor/grow_r502a.h>

Custom sensor channels for Grow R502A.

Enumerator
SENSOR_CHAN_FINGERPRINT 

Fingerprint template count, ID number for enrolling and searching.

◆ sensor_trigger_type_grow_r502a

#include <include/zephyr/drivers/sensor/grow_r502a.h>

Custom trigger types for Grow R502A.

Enumerator
SENSOR_TRIG_TOUCH 

Trigger fires when a touch is detected.

Function Documentation

◆ fps_download_char_buf()

int fps_download_char_buf ( const struct device dev,
uint8_t  char_buf_id,
const struct r502a_template temp 
)

#include <include/zephyr/drivers/sensor/grow_r502a.h>

Download finger template.

This function downloads a finger template from the sensor.

Parameters
devPointer to the sensor device
char_buf_idCharacter buffer ID (1 or 2)
tempPointer to the template structure
Return values
0success
-errnonegative error code on failure

◆ fps_upload_char_buf()

int fps_upload_char_buf ( const struct device dev,
struct r502a_template temp 
)

#include <include/zephyr/drivers/sensor/grow_r502a.h>

Upload finger template.

This function uploads a finger template to the sensor.

Parameters
devPointer to the sensor device
tempPointer to the template structure
Return values
0success
-errnonegative error code on failure

◆ r502a_read_sys_param()

int r502a_read_sys_param ( const struct device dev,
struct r502a_sys_param val 
)

#include <include/zephyr/drivers/sensor/grow_r502a.h>

Read system parameters.

This function reads the system parameters from the sensor.

Parameters
devPointer to the sensor device
valPointer to the system parameter structure
Return values
0success
-errnonegative error code on failure