OB1203 basic mbed driver

Dependents:   OB1203_IDT

Committer:
laserdad
Date:
Thu Jul 23 20:19:25 2020 +0000
Revision:
25:ca9caacd0f9f
Parent:
19:a27b98998edf
removed manual trim and overwrite digital trim

Who changed what in which revision?

UserRevisionLine numberNew contents of line
laserdad 0:2da1f69b38fd 1 #ifndef __OB1203_H__
laserdad 0:2da1f69b38fd 2 #define __OB1203_H__
laserdad 0:2da1f69b38fd 3
laserdad 0:2da1f69b38fd 4 #include "mbed.h"
laserdad 4:f25ca600a0e6 5 //#include "SoftI2C.h"
laserdad 0:2da1f69b38fd 6
laserdad 1:99ca9c464503 7 //#define DEBUG
laserdad 0:2da1f69b38fd 8
laserdad 0:2da1f69b38fd 9 #define OB1203_ADDR 0xA6
laserdad 0:2da1f69b38fd 10
laserdad 0:2da1f69b38fd 11 //Define registers
laserdad 0:2da1f69b38fd 12 #define REG_STATUS_0 0x00
laserdad 0:2da1f69b38fd 13 #define REG_STATUS_1 0x01
laserdad 0:2da1f69b38fd 14 #define REG_PS_DATA 0x02
laserdad 0:2da1f69b38fd 15 #define REG_LS_W_DATA 0x04
laserdad 0:2da1f69b38fd 16 #define REG_LS_G_DATA 0x07
laserdad 0:2da1f69b38fd 17 #define REG_LS_B_DATA 0x0A
laserdad 0:2da1f69b38fd 18 #define REG_LS_R_DATA 0x0D
laserdad 0:2da1f69b38fd 19 #define REG_LS_C_DATA 0x10
laserdad 4:f25ca600a0e6 20 #define REG_TEMP_DATA 0x13
laserdad 0:2da1f69b38fd 21 #define REG_MAIN_CTRL_0 0x15
laserdad 0:2da1f69b38fd 22 #define REG_MAIN_CTRL_1 0x16
laserdad 0:2da1f69b38fd 23 #define REG_PS_LED_CURR 0x17
laserdad 0:2da1f69b38fd 24 #define REG_PS_CAN_PULSES 0x19
laserdad 0:2da1f69b38fd 25 #define REG_PS_PWIDTH_RATE 0x1A
laserdad 0:2da1f69b38fd 26 #define REG_PS_CAN_DIG 0x1B
laserdad 0:2da1f69b38fd 27 #define REG_PS_MOV_AVG_HYS 0x1D
laserdad 0:2da1f69b38fd 28 #define REG_PS_THRES_HI 0x1E
laserdad 0:2da1f69b38fd 29 #define REG_PS_THRES_LO 0x20
laserdad 0:2da1f69b38fd 30 #define REG_LS_RES_RATE 0x22
laserdad 0:2da1f69b38fd 31 #define REG_LS_GAIN 0x23
laserdad 0:2da1f69b38fd 32 #define REG_LS_THRES_HI 0x24
laserdad 0:2da1f69b38fd 33 #define REG_LS_THRES_LO 0x27
laserdad 0:2da1f69b38fd 34 #define REG_LS_THRES_VAR 0x2A
laserdad 0:2da1f69b38fd 35 #define REG_INT_CFG_0 0x2B
laserdad 0:2da1f69b38fd 36 #define REG_PS_INT_CFG_1 0x2C
laserdad 0:2da1f69b38fd 37 #define REG_INT_PST 0x2D
laserdad 0:2da1f69b38fd 38 #define REG_PPG_PS_GAIN 0x2E
laserdad 0:2da1f69b38fd 39 #define REG_PPG_PS_CFG 0x2F
laserdad 0:2da1f69b38fd 40 #define REG_PPG_IRLED_CURR 0x30
laserdad 0:2da1f69b38fd 41 #define REG_PPG_RLED_CURR 0x32
laserdad 0:2da1f69b38fd 42 #define REG_PPG_CAN_ANA 0x34
laserdad 0:2da1f69b38fd 43 #define REG_PPG_AVG 0x35
laserdad 0:2da1f69b38fd 44 #define REG_PPG_PWIDTH_RATE 0x36
laserdad 0:2da1f69b38fd 45 #define REG_FIFO_CFG 0x37
laserdad 0:2da1f69b38fd 46 #define REG_FIFO_WR_PTR 0x38
laserdad 0:2da1f69b38fd 47 #define REG_FIFO_RD_PTR 0x39
laserdad 0:2da1f69b38fd 48 #define REG_FIFO_OVF_CNT 0x3A
laserdad 0:2da1f69b38fd 49 #define REG_FIFO_DATA 0x3B
laserdad 0:2da1f69b38fd 50 #define REG_PART_ID 0x3D
laserdad 0:2da1f69b38fd 51 #define REG_DEVICE_CFG 0x4D
laserdad 8:6c19c052b053 52 #define REG_OSC_TRIM 0x3E
laserdad 9:0c3d2eea1c79 53 #define REG_LED_TRIM 0x3F
laserdad 9:0c3d2eea1c79 54 #define REG_BIO_TRIM 0x40
laserdad 25:ca9caacd0f9f 55 #define REG_DIG_LED1_TRIM 0x42
laserdad 25:ca9caacd0f9f 56 #define REG_DIG_LED2_TRIM 0x43
laserdad 0:2da1f69b38fd 57
laserdad 0:2da1f69b38fd 58 //Define settings
laserdad 0:2da1f69b38fd 59 //STATUS_0
laserdad 4:f25ca600a0e6 60 #define POR_STATUS 0x80
laserdad 4:f25ca600a0e6 61 #define LS_INT_STATUS 0x02
laserdad 0:2da1f69b38fd 62 #define LS_NEW_DATA 0x01
laserdad 0:2da1f69b38fd 63 //STATUS_1
laserdad 0:2da1f69b38fd 64 #define LED_DRIVER_STATUS 0x40
laserdad 0:2da1f69b38fd 65 #define FIFO_AFULL_STATUS 0x20
laserdad 0:2da1f69b38fd 66 #define PPG_DATA_STATUS 0x10
laserdad 0:2da1f69b38fd 67 #define PS_LOGIC_STATUS 0x04
laserdad 0:2da1f69b38fd 68 #define PS_INT_STATUS 0x02
laserdad 0:2da1f69b38fd 69 #define PS_NEW_DATA 0x01
laserdad 0:2da1f69b38fd 70 //MAIN_CTRL_0
laserdad 0:2da1f69b38fd 71 #define SW_RESET 0x01<<7
laserdad 0:2da1f69b38fd 72 #define LS_SAI_ON 0x01<<3
laserdad 0:2da1f69b38fd 73 #define LS_SAI_OFF 0x00
laserdad 0:2da1f69b38fd 74 #define ALS_MODE 0x00
laserdad 0:2da1f69b38fd 75 #define RGB_MODE 0x01<<1
laserdad 0:2da1f69b38fd 76 #define LS_OFF 0x00
laserdad 0:2da1f69b38fd 77 #define LS_ON 0x01
laserdad 0:2da1f69b38fd 78 //MAIN_CTRL_1
laserdad 0:2da1f69b38fd 79 #define PS_SAI_ON 0x01<<3
laserdad 0:2da1f69b38fd 80 #define PS_SAI_OFF 0x00
laserdad 0:2da1f69b38fd 81 #define PS_MODE 0x00
laserdad 0:2da1f69b38fd 82 #define HR_MODE 0x01<<1
laserdad 0:2da1f69b38fd 83 #define SPO2_MODE 0x02<<1
laserdad 0:2da1f69b38fd 84 #define PPG_PS_ON 0x01
laserdad 0:2da1f69b38fd 85 #define PPG_PS_OFF 0x00
laserdad 4:f25ca600a0e6 86 #define TEMP_ON 0x01<<7
laserdad 4:f25ca600a0e6 87 #define TEMP_OFF 0x00
laserdad 0:2da1f69b38fd 88 //PS_CAN_PULSES
laserdad 0:2da1f69b38fd 89 #define PS_CAN_ANA_0 0x00 //off
laserdad 0:2da1f69b38fd 90 #define PS_CAN_ANA_1 0x01<<6 //50% of FS
laserdad 0:2da1f69b38fd 91 #define PS_CAN_ANA_2 0x02<<6 //100% of FS
laserdad 0:2da1f69b38fd 92 #define PS_CAN_ANA_3 0x03<<6 //150% of FS
laserdad 1:99ca9c464503 93 #define PS_PULSES(x) (( (x) & (0x07) )<<3) //where x = 0..5 and num pulses = 2^x
laserdad 0:2da1f69b38fd 94 //PS_PWIDTH_RATE
laserdad 0:2da1f69b38fd 95 #define PS_PWIDTH(x) (x & 0x03)<<4 //where x = 0..3
laserdad 0:2da1f69b38fd 96 #define PS_RATE(x) (x & 0x07) //where x = 0..7
laserdad 0:2da1f69b38fd 97 //PS_MOV_AVG_HYS
laserdad 0:2da1f69b38fd 98 #define PS_AVG_ON 1<<7
laserdad 0:2da1f69b38fd 99 #define PS_AVG_OFF 0
laserdad 0:2da1f69b38fd 100 #define PS_HYS_LEVEL(x) x>>1 //where x=0..256
laserdad 0:2da1f69b38fd 101 //LS_RES_RATE
laserdad 0:2da1f69b38fd 102 #define LS_RES(x) (x & 0x07)<<4 //where x=0..7
laserdad 0:2da1f69b38fd 103 #define LS_RATE(x) (x & 0x07) //where x=0..7
laserdad 16:d5fe5debb5d2 104
laserdad 16:d5fe5debb5d2 105 #define LS_RES_20 0x00
laserdad 16:d5fe5debb5d2 106 #define LS_RES_19 0x01
laserdad 16:d5fe5debb5d2 107 #define LS_RES_18 0x02
laserdad 16:d5fe5debb5d2 108 #define LS_RES_17 0x03
laserdad 18:85dd16f99c3a 109 #define LS_RES_16 0x04
laserdad 16:d5fe5debb5d2 110 #define LS_RES_13 0x05
laserdad 16:d5fe5debb5d2 111
laserdad 0:2da1f69b38fd 112 //LS_GAIN
laserdad 0:2da1f69b38fd 113 #define LS_GAIN(x) (x & 0x03)
laserdad 16:d5fe5debb5d2 114 #define LS_GAIN_1 0x00
laserdad 16:d5fe5debb5d2 115 #define LS_GAIN_3 0x01
laserdad 16:d5fe5debb5d2 116 #define LS_GAIN_6 0x10
laserdad 16:d5fe5debb5d2 117 #define LS_GAIN_20 0x11
laserdad 16:d5fe5debb5d2 118
laserdad 0:2da1f69b38fd 119 //LS_THRES_VAR
laserdad 0:2da1f69b38fd 120 #define LS_THRES_VAR(x) (x & 0x07)
laserdad 0:2da1f69b38fd 121 //INT_CFG_0
laserdad 0:2da1f69b38fd 122 #define LS_INT_SEL_W 0
laserdad 0:2da1f69b38fd 123 #define LS_INT_SEL_G 1<<4
laserdad 0:2da1f69b38fd 124 #define LS_INT_SEL_R 2<<4
laserdad 0:2da1f69b38fd 125 #define LS_INT_SEL_B 3<<4
laserdad 0:2da1f69b38fd 126 #define LS_THRES_INT_MODE 0
laserdad 0:2da1f69b38fd 127 #define LS_VAR_INT_MODE 1<<1
laserdad 0:2da1f69b38fd 128 #define LS_INT_ON 1
laserdad 0:2da1f69b38fd 129 #define LS_INT_OFF 0
laserdad 0:2da1f69b38fd 130 //INT_CFG_1
laserdad 0:2da1f69b38fd 131 #define AFULL_INT_ON 1<<5
laserdad 0:2da1f69b38fd 132 #define AFULL_INT_OFF 0
laserdad 0:2da1f69b38fd 133 #define PPG_INT_ON 1<<4
laserdad 0:2da1f69b38fd 134 #define PPG_INT_OFF 0
laserdad 2:3cba0fe6db60 135 #define PS_INT_READ_CLEARS 0<<1
laserdad 16:d5fe5debb5d2 136 #define PS_INT_LOGIC 1
laserdad 0:2da1f69b38fd 137 #define PS_INT_ON 1
laserdad 0:2da1f69b38fd 138 #define PS_INT_OFF 0
laserdad 16:d5fe5debb5d2 139
laserdad 0:2da1f69b38fd 140 //INT_PST
laserdad 0:2da1f69b38fd 141 #define LS_PERSIST(x) (x & 0x0F)<<4
laserdad 0:2da1f69b38fd 142 #define PS_PERSIST(x) (x & 0x0F)
laserdad 0:2da1f69b38fd 143 //PPG_PS_GAIN
laserdad 0:2da1f69b38fd 144 #define PPG_PS_GAIN_1 0
laserdad 0:2da1f69b38fd 145 #define PPG_PS_GAIN_1P5 1<<4
laserdad 0:2da1f69b38fd 146 #define PPG_PS_GAIN_2 2<<4
laserdad 0:2da1f69b38fd 147 #define PPG_PS_GAIN_4 3<<4
laserdad 8:6c19c052b053 148 #define PPG_LED_SETTLING(x) (x & 0x03)<<2 // 0=0us, 1 = 5us, 2 = 10us (Default), 3=20us
laserdad 8:6c19c052b053 149 #define PPG_ALC_TRACK(x) (x & 0x03) // 0 = 10us, 1 (20us) DEFAULT ,2 = 30us, 3 = 60us
laserdad 0:2da1f69b38fd 150 //PPG_PS_CFG
laserdad 0:2da1f69b38fd 151 #define PPG_POW_SAVE_ON 1<<6
laserdad 0:2da1f69b38fd 152 #define PPG_POW_SAVE_OFF 0
laserdad 0:2da1f69b38fd 153 #define LED_FLIP_ON 1<<3
laserdad 0:2da1f69b38fd 154 #define LED_FLIP_OFF 0
laserdad 10:6703d2cdeabc 155 #define DIFF_OFF 2
laserdad 10:6703d2cdeabc 156 #define ALC_OFF 1
laserdad 10:6703d2cdeabc 157 #define DIFF_ON 0
laserdad 10:6703d2cdeabc 158 #define ALC_ON 0
laserdad 10:6703d2cdeabc 159 #define SIGNAL_OUT 1<<2
laserdad 10:6703d2cdeabc 160 #define OFFSET_OUT 0
laserdad 0:2da1f69b38fd 161 //PPG_CAN_ANA
laserdad 0:2da1f69b38fd 162 #define PPG_CH1_CAN(x) (x & 0x03)<<2
laserdad 0:2da1f69b38fd 163 #define PPG_CH2_CAN(x) (x & 0x03)
laserdad 0:2da1f69b38fd 164 //PPG_AVG
laserdad 0:2da1f69b38fd 165 #define PPG_AVG(x) (x & 0x07)<<4
laserdad 0:2da1f69b38fd 166 //PPG_PWIDTH_RATE
laserdad 0:2da1f69b38fd 167 #define PPG_PWIDTH(x) (x & 0x07)<<4
laserdad 25:ca9caacd0f9f 168 #define PPG_FREQ_PREPRODUCTION 0
laserdad 25:ca9caacd0f9f 169 #define PPG_FREQ_PRODUCTION 1
laserdad 0:2da1f69b38fd 170 #define PPG_RATE(x) (x & 0x07)
laserdad 0:2da1f69b38fd 171 //FIFO_CFG
laserdad 0:2da1f69b38fd 172 #define FIFO_ROLL_ON 1<<4
laserdad 0:2da1f69b38fd 173 #define FIFO_ROLL_OFF 0
laserdad 12:573f7ce91a0d 174 #define AFULL_ADVANCE_WARNING(x) (x & 0x0F)
laserdad 0:2da1f69b38fd 175
laserdad 0:2da1f69b38fd 176
laserdad 0:2da1f69b38fd 177
laserdad 0:2da1f69b38fd 178
laserdad 0:2da1f69b38fd 179
laserdad 0:2da1f69b38fd 180 #define POR_TIME_MS 5 //a guess
laserdad 0:2da1f69b38fd 181
laserdad 0:2da1f69b38fd 182
laserdad 19:a27b98998edf 183 #define IR_TARGET_COUNTS 196608
laserdad 19:a27b98998edf 184 #define R_TARGET_COUNTS 196608
laserdad 19:a27b98998edf 185 #define TOL1 6000
laserdad 19:a27b98998edf 186 #define TOL2 40000
laserdad 19:a27b98998edf 187 #define STEP 8
laserdad 19:a27b98998edf 188 #define IN_RANGE_PERSIST 4
laserdad 19:a27b98998edf 189 #define IR_MAX_CURRENT 0x02AF
laserdad 19:a27b98998edf 190 #define R_MAX_CURRENT 0x01FF
laserdad 19:a27b98998edf 191
laserdad 0:2da1f69b38fd 192
laserdad 0:2da1f69b38fd 193 class OB1203
laserdad 0:2da1f69b38fd 194 {
laserdad 0:2da1f69b38fd 195 I2C *i2c;
laserdad 0:2da1f69b38fd 196
laserdad 4:f25ca600a0e6 197 public:
laserdad 8:6c19c052b053 198 char osc_trim;
laserdad 4:f25ca600a0e6 199 char ls_res;
laserdad 4:f25ca600a0e6 200 char ls_rate;
laserdad 4:f25ca600a0e6 201 char ls_gain;
laserdad 4:f25ca600a0e6 202 uint32_t ls_thres_hi;
laserdad 4:f25ca600a0e6 203 uint32_t ls_thres_lo;
laserdad 4:f25ca600a0e6 204 char ls_sai;
laserdad 4:f25ca600a0e6 205 char ls_mode;
laserdad 4:f25ca600a0e6 206 char ls_en;
laserdad 4:f25ca600a0e6 207 char ls_int_sel;
laserdad 4:f25ca600a0e6 208 char ls_var_mode;
laserdad 4:f25ca600a0e6 209 char ps_sai_en;
laserdad 4:f25ca600a0e6 210 char temp_en;
laserdad 4:f25ca600a0e6 211 char ppg_ps_mode;
laserdad 4:f25ca600a0e6 212 char ppg_ps_en;
laserdad 4:f25ca600a0e6 213 char ps_can_ana;
laserdad 4:f25ca600a0e6 214 char afull_int_en;
laserdad 4:f25ca600a0e6 215 char ppg_int_en;
laserdad 4:f25ca600a0e6 216 char ps_logic_mode;
laserdad 4:f25ca600a0e6 217 uint16_t ps_digital_can;
laserdad 4:f25ca600a0e6 218 char ps_int_en;
laserdad 4:f25ca600a0e6 219 char ls_persist;
laserdad 4:f25ca600a0e6 220 char ps_persist;
laserdad 4:f25ca600a0e6 221 uint16_t ps_thres_hi;
laserdad 4:f25ca600a0e6 222 uint16_t ps_thres_lo;
laserdad 4:f25ca600a0e6 223 uint16_t ps_current;
laserdad 25:ca9caacd0f9f 224 volatile uint16_t ir_current;
laserdad 25:ca9caacd0f9f 225 volatile uint16_t r_current;
laserdad 4:f25ca600a0e6 226 char ppg_ps_gain;
laserdad 4:f25ca600a0e6 227 char ppg_pow_save;
laserdad 4:f25ca600a0e6 228 char led_flip;
laserdad 4:f25ca600a0e6 229 char ch1_can_ana;
laserdad 4:f25ca600a0e6 230 char ch2_can_ana;
laserdad 4:f25ca600a0e6 231 char ppg_avg;
laserdad 4:f25ca600a0e6 232 char ppg_pwidth;
laserdad 4:f25ca600a0e6 233 char ppg_freq;
laserdad 4:f25ca600a0e6 234 char ppg_rate;
laserdad 8:6c19c052b053 235 char ppg_LED_settling;
laserdad 8:6c19c052b053 236 char ppg_ALC_track;
laserdad 4:f25ca600a0e6 237 char ps_pulses;
laserdad 4:f25ca600a0e6 238 char ps_pwidth;
laserdad 4:f25ca600a0e6 239 char ps_rate;
laserdad 4:f25ca600a0e6 240 char ps_avg_en;
laserdad 4:f25ca600a0e6 241 char ps_hys_level;
laserdad 4:f25ca600a0e6 242 char ls_int_en;
laserdad 4:f25ca600a0e6 243 char fifo_rollover_en;
laserdad 12:573f7ce91a0d 244 char fifo_afull_advance_warning;
laserdad 4:f25ca600a0e6 245 char writePointer;
laserdad 4:f25ca600a0e6 246 char readPointer;
laserdad 4:f25ca600a0e6 247 char fifoOverflow;
laserdad 9:0c3d2eea1c79 248 char bio_trim;
laserdad 9:0c3d2eea1c79 249 char led_trim;
laserdad 10:6703d2cdeabc 250 char diff;
laserdad 10:6703d2cdeabc 251 char alc;
laserdad 10:6703d2cdeabc 252 char sig_out;
laserdad 25:ca9caacd0f9f 253 char led1_trim;
laserdad 25:ca9caacd0f9f 254 char led2_trim;
laserdad 9:0c3d2eea1c79 255
laserdad 4:f25ca600a0e6 256 OB1203 (I2C *);
laserdad 0:2da1f69b38fd 257
laserdad 4:f25ca600a0e6 258 // Low-level operations
laserdad 4:f25ca600a0e6 259 void reset();
laserdad 4:f25ca600a0e6 260 uint16_t get_status();
laserdad 4:f25ca600a0e6 261 void writeRegister(int, char, char);
laserdad 4:f25ca600a0e6 262 void writeBlock(int, char, char *, char);
laserdad 4:f25ca600a0e6 263 void readBlock(int, char, char *, int);
laserdad 4:f25ca600a0e6 264 uint32_t bytes2uint32(char *, int);
laserdad 6:337ee64ca7ab 265 uint32_t twoandhalfBytes2uint32(char *, int);
laserdad 4:f25ca600a0e6 266
laserdad 4:f25ca600a0e6 267 // High-level operations
laserdad 8:6c19c052b053 268 void setOscTrim();
laserdad 4:f25ca600a0e6 269 bool dataIsNew();
laserdad 6:337ee64ca7ab 270 bool lsIsNew();
laserdad 6:337ee64ca7ab 271 bool psIsNew();
laserdad 6:337ee64ca7ab 272 bool tempIsNew();
laserdad 5:527556d05aa8 273 bool bioIsNew();
laserdad 4:f25ca600a0e6 274 void setMainConfig();
laserdad 4:f25ca600a0e6 275 void setIntConfig();
laserdad 4:f25ca600a0e6 276 void setLSthresh();
laserdad 4:f25ca600a0e6 277 void setPSthresh();
laserdad 4:f25ca600a0e6 278 void setPScurrent();
laserdad 4:f25ca600a0e6 279 void setPPGcurrent();
laserdad 4:f25ca600a0e6 280 void setPPG_PSgain_cfg();
laserdad 4:f25ca600a0e6 281 void setPPGana_can();
laserdad 4:f25ca600a0e6 282 void setDigitalCan();
laserdad 4:f25ca600a0e6 283 void setPPGavg_and_rate();
laserdad 4:f25ca600a0e6 284 void setFifoConfig();
laserdad 9:0c3d2eea1c79 285 void setBioTrim();
laserdad 9:0c3d2eea1c79 286 void setLEDTrim();
laserdad 4:f25ca600a0e6 287 char get_ps_data(uint32_t *);
laserdad 4:f25ca600a0e6 288 char get_ls_data(uint32_t *);
laserdad 4:f25ca600a0e6 289 char get_ps_ls_data(uint32_t *);
laserdad 12:573f7ce91a0d 290 void resetFIFO();
laserdad 4:f25ca600a0e6 291 void init_ps();
laserdad 4:f25ca600a0e6 292 void init_rgb();
laserdad 4:f25ca600a0e6 293 void init_ps_rgb();
laserdad 4:f25ca600a0e6 294 void init_hr();
laserdad 4:f25ca600a0e6 295 void init_spo2();
laserdad 4:f25ca600a0e6 296 void getFifoInfo(char *fifo_info);
laserdad 25:ca9caacd0f9f 297 void getNumFifoSamplesAvailable(char *fifo_info, char *sample_info);
laserdad 4:f25ca600a0e6 298 void getFifoSamples(uint8_t, char *);
laserdad 4:f25ca600a0e6 299 void parseFifoSamples(char, char *, uint32_t *);
laserdad 4:f25ca600a0e6 300 char get_part_ID(char *);
laserdad 25:ca9caacd0f9f 301 void setDigTrim(void);
laserdad 19:a27b98998edf 302
laserdad 19:a27b98998edf 303 //agc functions
laserdad 19:a27b98998edf 304 void do_agc(uint32_t,bool);
laserdad 19:a27b98998edf 305
laserdad 4:f25ca600a0e6 306 //variables
laserdad 4:f25ca600a0e6 307 uint16_t rate;
laserdad 4:f25ca600a0e6 308 char res;
laserdad 4:f25ca600a0e6 309 char gain;
laserdad 4:f25ca600a0e6 310 uint32_t data_max;
laserdad 4:f25ca600a0e6 311 uint32_t reg_max;
laserdad 19:a27b98998edf 312
laserdad 19:a27b98998edf 313
laserdad 19:a27b98998edf 314 // const uint32_t targetCounts[2];
laserdad 19:a27b98998edf 315
laserdad 19:a27b98998edf 316 bool update;
laserdad 0:2da1f69b38fd 317
laserdad 0:2da1f69b38fd 318 };
laserdad 0:2da1f69b38fd 319
laserdad 0:2da1f69b38fd 320
laserdad 0:2da1f69b38fd 321 #endif