Chirp SonicLib
4.5.2
|
Chirp CH101 General Purpose Rangefinding firmware interface. More...
Functions | |
uint8_t | ch101_gpr_get_in_ringdown_idx (ch_dev_t *dev_ptr) |
Get the sample index that defines the "in ringdown" region. More... | |
uint16_t | ch101_gpr_get_in_ringdown_ths (ch_dev_t *dev_ptr) |
Get the amplitude threshold for "in ringdown" detection. More... | |
uint8_t | ch101_gpr_get_target_in_ringdown (ch_dev_t *dev_ptr) |
Get the target "in ringdown" status. More... | |
uint8_t | ch101_gpr_init (ch_dev_t *dev_ptr, fw_info_t **fw_info) |
void | ch101_gpr_set_in_ringdown_idx (ch_dev_t *dev_ptr, uint8_t in_ringdown_idx) |
Set the sample index for "in ringdown" status. More... | |
void | ch101_gpr_set_in_ringdown_ths (ch_dev_t *dev_ptr, uint16_t in_ringdown_ths) |
Set the amplitude threshold "in ringdown" status. More... | |
Chirp CH101 General Purpose Rangefinding firmware interface.
This file contains function definitions to interface a specific sensor firmware package to SonicLib, including the main initialization routine for the firmware. That routine initializes various fields within the ch_dev_t device descriptor and specifies the proper functions to implement SonicLib API calls. Those may either be common implementations or firmware-specific routines located in this file.
uint8_t ch101_gpr_get_in_ringdown_idx | ( | ch_dev_t * | dev_ptr | ) |
Get the sample index that defines the "in ringdown" region.
dev_ptr | pointer to the ch_dev_t descriptor structure |
uint16_t ch101_gpr_get_in_ringdown_ths | ( | ch_dev_t * | dev_ptr | ) |
Get the amplitude threshold for "in ringdown" detection.
dev_ptr | pointer to the ch_dev_t descriptor structure |
uint8_t ch101_gpr_get_target_in_ringdown | ( | ch_dev_t * | dev_ptr | ) |
Get the target "in ringdown" status.
dev_ptr | pointer to the ch_dev_t descriptor structure |
For both sensors, when ch101_gpr_get_target_in_ringdown() goes from 0->1, it will remain at 1 for at least 4 measurements, to prevent glitches. When the target leaves the ringdown region there will be a 4 sample latency before ch101_gpr_get_target_in_ringdown() returns 0.
void ch101_gpr_set_in_ringdown_idx | ( | ch_dev_t * | dev_ptr, |
uint8_t | in_ringdown_idx | ||
) |
Set the sample index for "in ringdown" status.
dev_ptr | pointer to the ch_dev_t descriptor structure in_ringdown_idx the sample index that defines the "in ringdown" region. Default value is 17 samples equals at about 130mm. |
void ch101_gpr_set_in_ringdown_ths | ( | ch_dev_t * | dev_ptr, |
uint16_t | in_ringdown_ths | ||
) |
Set the amplitude threshold "in ringdown" status.
dev_ptr | pointer to the ch_dev_t descriptor structure in_ringdown_ths the threshold in LSB applied to the second peak of the ringdown (sample 15) to recognize if a target is in the ringdown region. Default value is 3000 |