33 #ifndef CH101_SONICSYNC_H_ 34 #define CH101_SONICSYNC_H_ 41 #define CH101_SONICSYNC_REG_OPMODE 0x01 42 #define CH101_SONICSYNC_REG_TICK_INTERVAL 0x02 43 #define CH101_SONICSYNC_REG_PERIOD 0x05 44 #define CH101_SONICSYNC_REG_MAX_RANGE 0x07 45 #define CH101_SONICSYNC_REG_TIME_PLAN 0x09 46 #define CH101_SONICSYNC_REG_STAT_RANGE 0x12 47 #define CH101_SONICSYNC_REG_STAT_COEFF 0x13 48 #define CH101_SONICSYNC_REG_READY 0x14 49 #define CH101_SONICSYNC_REG_TOF_SF 0x16 50 #define CH101_SONICSYNC_REG_TOF 0x18 51 #define CH101_SONICSYNC_REG_AMPLITUDE 0x1A 52 #define CH101_SONICSYNC_REG_CAL_TRIG 0x06 53 #define CH101_SONICSYNC_REG_CAL_RESULT 0x0A 54 #define CH101_SONICSYNC_REG_DATA 0x1C 56 #define CH101_SONICSYNC_MAX_SAMPLES (150) 58 #define CH101_SONICSYNC_READY_FREQ_LOCKED (0x02 | 0x04) 60 extern const char * ch101_sonicsync_master_version;
61 extern const char * ch101_sonicsync_slave_version;
62 extern const uint8_t ch101_sonicsync_master_fw[CH101_FW_SIZE];
63 extern const uint8_t ch101_sonicsync_slave_fw[CH101_FW_SIZE];
65 uint16_t get_ch101_sonicsync_master_fw_ram_init_addr(
void);
66 uint16_t get_ch101_sonicsync_master_fw_ram_init_size(
void);
67 uint16_t get_ch101_sonicsync_slave_fw_ram_init_addr(
void);
68 uint16_t get_ch101_sonicsync_slave_fw_ram_init_size(
void);
70 const unsigned char * get_ram_ch101_sonicsync_master_init_ptr(
void);
71 const unsigned char * get_ram_ch101_sonicsync_slave_init_ptr(
void);
73 uint8_t ch101_sonicsync_master_init(
ch_dev_t *dev_ptr,
ch_group_t *grp_ptr, uint8_t i2c_addr, uint8_t dev_num, uint8_t i2c_bus_index);
74 uint8_t ch101_sonicsync_slave_init(
ch_dev_t *dev_ptr,
ch_group_t *grp_ptr, uint8_t i2c_addr, uint8_t dev_num, uint8_t i2c_bus_index);
76 uint8_t ch_sonicsync_get_locked_state(
ch_dev_t *dev_ptr);
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