User Manual

- 37 -
3.6.2 Running result
3.7 Get ROI group/get current ROI group ID
3.7.1 Sample code
uint8_t group_id = 0;
/*select group ID*/
HPS3D_SelectROIGroup(&handle, 3);
/*get group ID*/
HPS3D_GetROIGroupID(&handle, &group_id);
printf
("group_id = %d\n",group_id);
3.7.2 Running result
3.8 ROI relative settings
3.8.1 Sample code
ROIConfTypeDef roi_conf1, roi_conf2;
HysteresisSingleConfTypeDef hysteresis_conf1, hysteresis_conf2;
/*group id = 0,roi_id = 0, threshold_id = 2, GPIO alarm enable = true, ROI
reference is distance min.*/
/*group id = 0,roi_id = 2, threshold_id = 1, GPIO alarm enable = false, ROI
reference is vaild amplitude */
/*set ROI alarm type*/
HPS3D_SetROIAlarmType(&handle, 0, 2,
ROI_ALARM_GPIO
);
HPS3D_SetROIAlarmType(&handle, 2, 1,
ROI_ALARM_DISABLE
);
/*set ROI reference type*/
HPS3D_SetROIReferenceType(&handle, 0, 2,
ROI_REF_DIST_MIN
);
HPS3D_SetROIReferenceType(&handle, 2, 1,
ROI_REF_VAILD_AMPLITUDE
);
/*set ROI config*/