33 #ifndef CH201_PRESENCE_H_ 34 #define CH201_PRESENCE_H_ 41 #define CH201_PRESENCE_REG_OPMODE (0x01) 42 #define CH201_PRESENCE_REG_TICK_INTERVAL (0x02) 43 #define CH201_PRESENCE_REG_PERIOD (0x05) 44 #define CH201_PRESENCE_REG_CAL_TRIG (0x06) 45 #define CH201_PRESENCE_REG_MAX_RANGE (0x07) 46 #define CH201_PRESENCE_REG_THRESH_LEN_0 (0x08) 47 #define CH201_PRESENCE_REG_THRESH_LEN_1 (0x09) 48 #define CH201_PRESENCE_REG_CAL_RESULT (0x0A) 49 #define CH201_PRESENCE_REG_THRESH_LEN_2 (0x0C) 50 #define CH201_PRESENCE_REG_THRESH_LEN_3 (0x0D) 51 #define CH201_PRESENCE_PMUTRINGLENGTH (0x12) 52 #define CH201_PRESENCE_DECIMATION (0x13) 53 #define CH201_PRESENCE_REG_READY (0x14) 54 #define CH201_PRESENCE_REG_THRESH_LEN_4 (0x15) 55 #define CH201_PRESENCE_REG_THRESHOLDS (0x16) // start of array of six 2-byte threshold levels 56 #define CH201_PRESENCE_REG_TOF_SF (0x22) 57 #define CH201_PRESENCE_REG_TOF (0x24) 58 #define CH201_PRESENCE_REG_AMPLITUDE (0x26) 59 #define CH201_PRESENCE_REG_DATA (0x28) 61 #define CH201_PRESENCE_MAX_SAMPLES (300) // max number of samples 62 #define CH201_PRESENCE_NUM_THRESHOLDS (6) // total number of thresholds 65 #define CH201_PRESENCE_DECIMATION_MASK (0x03) 66 #define CH201_PRESENCE_DECIMATION_NO (0x00) 67 #define CH201_PRESENCE_DECIMATION_2 (0x01) 68 #define CH201_PRESENCE_DECIMATION_3 (0x02) 69 #define CH201_PRESENCE_DECIMATION_4 (0x03) 71 #define CH201_PRESENCE_CORDIC_MASK (0x80) 72 #define CH201_PRESENCE_CORDIC_EN (0x80) 73 #define CH201_PRESENCE_CORDIC_DIS (0x00) 75 #define CH201_PRESENCE_READY_FREQ_LOCKED (0x04) 76 #define CH201_PRESENCE_FREQCOUNTERCYCLES (1150) 78 extern const char *ch201_presence_version;
79 extern const uint8_t ch201_presence_fw[CH201_FW_SIZE];
81 uint16_t get_ch201_presence_fw_ram_init_addr(
void);
82 uint16_t get_ch201_presence_fw_ram_init_size(
void);
84 const unsigned char * get_ram_ch201_presence_init_ptr(
void);
86 uint8_t ch201_presence_init(
ch_dev_t *dev_ptr,
ch_group_t *grp_ptr, uint8_t i2c_addr, uint8_t dev_num, uint8_t i2c_bus_index);
87 uint8_t ch201_presence_set_decimation(
ch_dev_t *dev_ptr, uint8_t decimation);
88 uint8_t ch201_presence_enable_cordic(
ch_dev_t *dev_ptr, uint8_t enable);
Chirp SonicLib public API and support functions for Chirp ultrasonic sensors.
Chirp sensor device structure.
Definition: soniclib.h:349
Chirp sensor group configuration structure.
Definition: soniclib.h:329
Internal definitions for the Chirp CH201 ultrasonic sensor.