41 #define CH101_GPPC_REG_OPMODE 0x01 42 #define CH101_GPPC_REG_TICK_INTERVAL 0x02 43 #define CH101_GPPC_REG_PERIOD 0x05 44 #define CH101_GPPC_REG_CAL_TRIG 0x06 45 #define CH101_GPPC_REG_MAX_RANGE 0x07 46 #define CH101_GPPC_REG_TX_LENGTH 0x08 47 #define CH101_GPPC_REG_CAL_RESULT 0x0A 48 #define CH101_GPPC_REG_DCO_SET 0x0C 49 #define CH101_GPPC_REG_THRESHOLD 0x0E 50 #define CH101_GPPC_REG_RX_HOLDOFF 0x11 51 #define CH101_GPPC_REG_ST_COEFF 0x13 52 #define CH101_GPPC_REG_READY 0x14 53 #define CH101_GPPC_REG_TOF_SF 0x16 54 #define CH101_GPPC_REG_TOF 0x18 55 #define CH101_GPPC_REG_AMPLITUDE 0x1A 56 #define CH101_GPPC_REG_RX_PULSE_LENGTH 0x1C 57 #define CH101_GPPC_REG_DATA 0x1E 59 #define CH101_GPPC_MAX_SAMPLES (350) 61 #define CH101_GPPC_READY_FREQ_LOCKED (0x04) 63 #define CH101_GPPC_THRESHOLD_NUMBER 1 65 #define CH_SF_LOCK_FOUND (0) 66 #define CH_SF_LOCK_START (1) 67 #define CH_DCO_LOW 100 68 #define CH_DCO_HIGH 250 69 #define CH_DCO_SEARCH_THRESHOLD 100 //Hz, if error is above this, do a search 70 #define DEBUG_DCO_SEARCH(X) X 73 extern const char *ch101_gppc_version;
74 extern const uint8_t ch101_gppc_fw[CH101_FW_SIZE];
76 uint16_t get_ch101_gppc_fw_ram_init_addr(
void);
77 uint16_t get_ch101_gppc_fw_ram_init_size(
void);
79 const unsigned char * get_ram_ch101_gppc_init_ptr(
void);
81 uint8_t ch101_gppc_init(
ch_dev_t *dev_ptr,
ch_group_t *grp_ptr, uint8_t i2c_addr, uint8_t dev_num, uint8_t i2c_bus_index);
83 uint32_t ch101_gppc_set_new_dco_code(
ch_dev_t *dev_ptr, uint16_t dcocode);
84 uint8_t ch101_gppc_set_frequency(
ch_dev_t *dev_ptr, uint32_t target_freq_Hz);
Chirp SonicLib public API and support functions for Chirp ultrasonic sensors.
Internal definitions for the Chirp CH101 ultrasonic sensor.
Chirp sensor device structure.
Definition: soniclib.h:349
Chirp sensor group configuration structure.
Definition: soniclib.h:329