Chirp SonicLib  4.5.2
ch201_gprmt.h
Go to the documentation of this file.
1 
13 /*
14  Copyright 2016-2023, InvenSense, Inc. All rights reserved.
15 
16  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  DISCLAIMED.
20 
21  */
22 
23 #ifndef CH201_GPRMT_H_
24 #define CH201_GPRMT_H_
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #include <stdint.h>
31 #include "ch201.h"
33 #include <invn/soniclib/soniclib.h>
34 
35 /* GPR with multi thresholds firmware registers */
36 #define CH201_GPRMT_REG_OPMODE 0x01
37 #define CH201_GPRMT_REG_TICK_INTERVAL 0x02
38 #define CH201_GPRMT_REG_LOW_GAIN_RXLEN 0x04
39 #define CH201_GPRMT_REG_PERIOD 0x05
40 #define CH201_GPRMT_REG_CAL_TRIG 0x06
41 #define CH201_GPRMT_REG_MAX_RANGE 0x07
42 #define CH201_GPRMT_REG_THRESH_LEN_0 0x08
43 #define CH201_GPRMT_REG_THRESH_LEN_1 0x09
44 #define CH201_GPRMT_REG_CAL_RESULT 0x0A
45 #define CH201_GPRMT_REG_THRESH_LEN_2 0x0C
46 #define CH201_GPRMT_REG_THRESH_LEN_3 0x0D
47 #define CH201_GPRMT_REG_TX_LENGTH 0x10
48 #define CH201_GPRMT_REG_ST_RANGE 0x12
49 #define CH201_GPRMT_REG_READY 0x14
50 #define CH201_GPRMT_REG_THRESH_LEN_4 0x15
51 #define CH201_GPRMT_REG_THRESHOLDS 0x16 // start of array of six 2-byte threshold levels
52 #define CH201_GPRMT_REG_TOF_SF 0x22
53 #define CH201_GPRMT_REG_TOF 0x24
54 #define CH201_GPRMT_REG_AMPLITUDE 0x26
55 #define CH201_GPRMT_REG_DATA 0x28
56 
57 #define CH201_GPRMT_MAX_SAMPLES (450) // max number of samples
58 #define CH201_GPRMT_NUM_THRESHOLDS (6) // total number of thresholds
59 
60 extern const char *ch201_gprmt_version; // version string in fw .c file
61 extern const uint8_t ch201_gprmt_fw_text[];
62 extern const uint8_t ch201_gprmt_fw_vec[];
63 extern const uint16_t ch201_gprmt_text_size;
64 extern const uint16_t ch201_gprmt_vec_size;
65 
66 uint16_t get_ch201_gprmt_fw_ram_init_addr(void);
67 uint16_t get_ch201_gprmt_fw_ram_init_size(void);
68 
69 const unsigned char *get_ram_ch201_gprmt_init_ptr(void);
70 
71 uint8_t ch201_gprmt_init(ch_dev_t *dev_ptr, fw_info_t **fw_info);
72 
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif
Internal definitions for the Chirp CH201 ultrasonic sensor.
Internal driver functions for operation with the Chirp ultrasonic sensor.
SonicLib public API and support functions for TDK/InvenSense ultrasonic sensors (originally developed...
Chirp sensor device descriptor structure.
Definition: soniclib.h:732
Definition: soniclib.h:658