vcpmonitor3  2.0.0.0
vcpmonitor3.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2020 MikroElektronika d.o.o.
3 ** Contact: https://www.mikroe.com/contact
4 **
5 ** Permission is hereby granted, free of charge, to any person obtaining a copy
6 ** of this software and associated documentation files (the "Software"), to deal
7 ** in the Software without restriction, including without limitation the rights
8 ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 ** copies of the Software, and to permit persons to whom the Software is
10 ** furnished to do so, subject to the following conditions:
11 ** The above copyright notice and this permission notice shall be
12 ** included in all copies or substantial portions of the Software.
13 **
14 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16 ** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 ** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
19 ** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 ** USE OR OTHER DEALINGS IN THE SOFTWARE.
21 ****************************************************************************/
22 
28 #ifndef VCPMONITOR3_H
29 #define VCPMONITOR3_H
30 
31 #ifdef __cplusplus
32 extern "C"{
33 #endif
34 
35 #include "mikrosdk_version.h"
36 
37 #ifdef __GNUC__
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
40 #else
41 #include "delays.h"
42 #endif
43 #endif
44 
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_i2c_master.h"
48 #include "drv_spi_master.h"
49 #include "spi_specifics.h"
50 
71 #define VCPMONITOR3_REG_GPIOSTATCL 0x67
72 #define VCPMONITOR3_REG_STATUS 0x80
73 #define VCPMONITOR3_REG_STATVT 0x81
74 #define VCPMONITOR3_REG_STATIP 0x82
75 #define VCPMONITOR3_REG_STATC 0x83
76 #define VCPMONITOR3_REG_STATE 0x84
77 #define VCPMONITOR3_REG_STATCEOF 0x85
78 #define VCPMONITOR3_REG_STATTB 0x86
79 #define VCPMONITOR3_REG_STATVDVCC 0x87
80 #define VCPMONITOR3_REG_STATUSM 0x88
81 #define VCPMONITOR3_REG_STATVTM 0x89
82 #define VCPMONITOR3_REG_STATIPM 0x8A
83 #define VCPMONITOR3_REG_STATCM 0x8B
84 #define VCPMONITOR3_REG_STATEM 0x8C
85 #define VCPMONITOR3_REG_STATCEOFM 0x8D
86 #define VCPMONITOR3_REG_STATTBM 0x8E
87 #define VCPMONITOR3_REG_STATVDVCCM 0x8F
88 #define VCPMONITOR3_REG_ACCICTL 0xE1
89 #define VCPMONITOR3_REG_ACCGPCTL 0xE3
90 #define VCPMONITOR3_REG_ACCIDB 0xE4
91 #define VCPMONITOR3_REG_ALERTBCTL 0xE8
92 #define VCPMONITOR3_REG_TBCTL 0xE9
93 #define VCPMONITOR3_REG_OPCTL 0xF0
94 #define VCPMONITOR3_REG_PGCTL 0xFF
95 
100 #define VCPMONITOR3_REG_C1_47_40 0x00
101 #define VCPMONITOR3_REG_C1_39_32 0x01
102 #define VCPMONITOR3_REG_C1_31_24 0x02
103 #define VCPMONITOR3_REG_C1_23_16 0x03
104 #define VCPMONITOR3_REG_C1_15_8 0x04
105 #define VCPMONITOR3_REG_C1_7_0 0x05
106 #define VCPMONITOR3_REG_E1_47_40 0x06
107 #define VCPMONITOR3_REG_E1_39_32 0x07
108 #define VCPMONITOR3_REG_E1_31_24 0x08
109 #define VCPMONITOR3_REG_E1_23_16 0x09
110 #define VCPMONITOR3_REG_E1_15_8 0x0A
111 #define VCPMONITOR3_REG_E1_7_0 0x0B
112 #define VCPMONITOR3_REG_TB1_31_24 0x0C
113 #define VCPMONITOR3_REG_TB1_23_16 0x0D
114 #define VCPMONITOR3_REG_TB1_15_8 0x0E
115 #define VCPMONITOR3_REG_TB1_7_0 0x0F
116 #define VCPMONITOR3_REG_C2_47_40 0x10
117 #define VCPMONITOR3_REG_C2_39_32 0x11
118 #define VCPMONITOR3_REG_C2_31_24 0x12
119 #define VCPMONITOR3_REG_C2_23_16 0x13
120 #define VCPMONITOR3_REG_C2_15_8 0x14
121 #define VCPMONITOR3_REG_C2_7_0 0x15
122 #define VCPMONITOR3_REG_E2_47_40 0x16
123 #define VCPMONITOR3_REG_E2_39_32 0x17
124 #define VCPMONITOR3_REG_E2_31_24 0x18
125 #define VCPMONITOR3_REG_E2_23_16 0x19
126 #define VCPMONITOR3_REG_E2_15_8 0x1A
127 #define VCPMONITOR3_REG_E2_7_0 0x1B
128 #define VCPMONITOR3_REG_TB2_31_24 0x1C
129 #define VCPMONITOR3_REG_TB2_23_16 0x1D
130 #define VCPMONITOR3_REG_TB2_15_8 0x1E
131 #define VCPMONITOR3_REG_TB2_7_0 0x1F
132 #define VCPMONITOR3_REG_IMAX_15_8 0x40
133 #define VCPMONITOR3_REG_IMAX_7_0 0x41
134 #define VCPMONITOR3_REG_IMIN_15_8 0x42
135 #define VCPMONITOR3_REG_IMIN_7_0 0x43
136 #define VCPMONITOR3_REG_PMAX_15_8 0x44
137 #define VCPMONITOR3_REG_PMAX_7_0 0x45
138 #define VCPMONITOR3_REG_PMIN_15_8 0x46
139 #define VCPMONITOR3_REG_PMIN_7_0 0x47
140 #define VCPMONITOR3_REG_VMAX_15_8 0x50
141 #define VCPMONITOR3_REG_VMAX_7_0 0x51
142 #define VCPMONITOR3_REG_VMIN_15_8 0x52
143 #define VCPMONITOR3_REG_VMIN_7_0 0x53
144 #define VCPMONITOR3_REG_TEMPMAX_15_8 0x54
145 #define VCPMONITOR3_REG_TEMPMAX_7_0 0x55
146 #define VCPMONITOR3_REG_TEMPMIN_15_8 0x56
147 #define VCPMONITOR3_REG_TEMPMIN_7_0 0x57
148 #define VCPMONITOR3_REG_VDVCCMAX_15_8 0x58
149 #define VCPMONITOR3_REG_VDVCCMAX_7_0 0x59
150 #define VCPMONITOR3_REG_VDVCCMIN_15_8 0x5A
151 #define VCPMONITOR3_REG_VDVCCMIN_7_0 0x5B
152 #define VCPMONITOR3_REG_I_23_16 0x90
153 #define VCPMONITOR3_REG_I_15_8 0x91
154 #define VCPMONITOR3_REG_I_7_0 0x92
155 #define VCPMONITOR3_REG_P_23_16 0x93
156 #define VCPMONITOR3_REG_P_15_8 0x94
157 #define VCPMONITOR3_REG_P_7_0 0x95
158 #define VCPMONITOR3_REG_V_15_8 0xA0
159 #define VCPMONITOR3_REG_V_7_0 0xA1
160 #define VCPMONITOR3_REG_TEMP_15_8 0xA2
161 #define VCPMONITOR3_REG_TEMP_7_0 0xA3
162 #define VCPMONITOR3_REG_VDVCC_15_8 0xA4
163 #define VCPMONITOR3_REG_VDVCC_7_0 0xA5
164 #define VCPMONITOR3_REG_IH1_23_16 0xB0
165 #define VCPMONITOR3_REG_IH1_15_8 0xB1
166 #define VCPMONITOR3_REG_IH1_7_0 0xB2
167 #define VCPMONITOR3_REG_IH2_23_16 0xB3
168 #define VCPMONITOR3_REG_IH2_15_8 0xB4
169 #define VCPMONITOR3_REG_IH2_7_0 0xB5
170 #define VCPMONITOR3_REG_IH3_23_16 0xB6
171 #define VCPMONITOR3_REG_IH3_15_8 0xB7
172 #define VCPMONITOR3_REG_IH3_7_0 0xB8
173 #define VCPMONITOR3_REG_IH4_23_16 0xB9
174 #define VCPMONITOR3_REG_IH4_15_8 0xBA
175 #define VCPMONITOR3_REG_IH4_7_0 0xBB
176 #define VCPMONITOR3_REG_IH5_23_16 0xBC
177 #define VCPMONITOR3_REG_IH5_15_8 0xBD
178 #define VCPMONITOR3_REG_IH5_7_0 0xBE
179 
184 #define VCPMONITOR3_REG_C1TH_47_40 0x00
185 #define VCPMONITOR3_REG_C1TH_39_32 0x01
186 #define VCPMONITOR3_REG_C1TH_31_24 0x02
187 #define VCPMONITOR3_REG_C1TH_23_16 0x03
188 #define VCPMONITOR3_REG_C1TH_15_8 0x04
189 #define VCPMONITOR3_REG_C1TH_7_0 0x05
190 #define VCPMONITOR3_REG_C1TL_47_40 0x06
191 #define VCPMONITOR3_REG_C1TL_39_32 0x07
192 #define VCPMONITOR3_REG_C1TL_31_24 0x08
193 #define VCPMONITOR3_REG_C1TL_23_16 0x09
194 #define VCPMONITOR3_REG_C1TL_15_8 0x0A
195 #define VCPMONITOR3_REG_C1TL_7_0 0x0B
196 #define VCPMONITOR3_REG_TB1TH_31_24 0x0C
197 #define VCPMONITOR3_REG_TB1TH_23_16 0x0D
198 #define VCPMONITOR3_REG_TB1TH_15_8 0x0E
199 #define VCPMONITOR3_REG_TB1TH_7_0 0x0F
200 #define VCPMONITOR3_REG_E1TH_47_40 0x10
201 #define VCPMONITOR3_REG_E1TH_39_32 0x11
202 #define VCPMONITOR3_REG_E1TH_31_24 0x12
203 #define VCPMONITOR3_REG_E1TH_23_16 0x13
204 #define VCPMONITOR3_REG_E1TH_15_8 0x14
205 #define VCPMONITOR3_REG_E1TH_7_0 0x15
206 #define VCPMONITOR3_REG_E1TL_47_40 0x16
207 #define VCPMONITOR3_REG_E1TL_39_32 0x17
208 #define VCPMONITOR3_REG_E1TL_31_24 0x18
209 #define VCPMONITOR3_REG_E1TL_23_16 0x19
210 #define VCPMONITOR3_REG_E1TL_15_8 0x1A
211 #define VCPMONITOR3_REG_E1TL_7_0 0x1B
212 #define VCPMONITOR3_REG_C2TH_47_40 0x20
213 #define VCPMONITOR3_REG_C2TH_39_32 0x21
214 #define VCPMONITOR3_REG_C2TH_31_24 0x22
215 #define VCPMONITOR3_REG_C2TH_23_16 0x23
216 #define VCPMONITOR3_REG_C2TH_15_8 0x24
217 #define VCPMONITOR3_REG_C2TH_7_0 0x25
218 #define VCPMONITOR3_REG_C2TL_47_40 0x26
219 #define VCPMONITOR3_REG_C2TL_39_32 0x27
220 #define VCPMONITOR3_REG_C2TL_31_24 0x28
221 #define VCPMONITOR3_REG_C2TL_23_16 0x29
222 #define VCPMONITOR3_REG_C2TL_15_8 0x2A
223 #define VCPMONITOR3_REG_C2TL_7_0 0x2B
224 #define VCPMONITOR3_REG_TB2TH_31_24 0x2C
225 #define VCPMONITOR3_REG_TB2TH_23_16 0x2D
226 #define VCPMONITOR3_REG_TB2TH_15_8 0x2E
227 #define VCPMONITOR3_REG_TB2TH_7_0 0x2F
228 #define VCPMONITOR3_REG_E2TH_47_40 0x30
229 #define VCPMONITOR3_REG_E2TH_39_32 0x31
230 #define VCPMONITOR3_REG_E2TH_31_24 0x32
231 #define VCPMONITOR3_REG_E2TH_23_16 0x33
232 #define VCPMONITOR3_REG_E2TH_15_8 0x34
233 #define VCPMONITOR3_REG_E2TH_7_0 0x35
234 #define VCPMONITOR3_REG_E2TL_47_40 0x36
235 #define VCPMONITOR3_REG_E2TL_39_32 0x37
236 #define VCPMONITOR3_REG_E2TL_31_24 0x38
237 #define VCPMONITOR3_REG_E2TL_23_16 0x39
238 #define VCPMONITOR3_REG_E2TL_15_8 0x3A
239 #define VCPMONITOR3_REG_E2TL_7_0 0x3B
240 #define VCPMONITOR3_REG_ITH_15_8 0x80
241 #define VCPMONITOR3_REG_ITH_7_0 0x81
242 #define VCPMONITOR3_REG_ITL_15_8 0x82
243 #define VCPMONITOR3_REG_ITL_7_0 0x83
244 #define VCPMONITOR3_REG_PTH_15_8 0x84
245 #define VCPMONITOR3_REG_PTH_7_0 0x85
246 #define VCPMONITOR3_REG_PTL_15_8 0x86
247 #define VCPMONITOR3_REG_PTL_7_0 0x87
248 #define VCPMONITOR3_REG_VTH_15_8 0x90
249 #define VCPMONITOR3_REG_VTH_7_0 0x91
250 #define VCPMONITOR3_REG_VTL_15_8 0x92
251 #define VCPMONITOR3_REG_VTL_7_0 0x93
252 #define VCPMONITOR3_REG_TEMPTH_15_8 0x94
253 #define VCPMONITOR3_REG_TEMPTH_7_0 0x95
254 #define VCPMONITOR3_REG_TEMPTL_15_8 0x96
255 #define VCPMONITOR3_REG_TEMPTL_7_0 0x97
256 #define VCPMONITOR3_REG_VDVCCTH_15_8 0x98
257 #define VCPMONITOR3_REG_VDVCCTH_7_0 0x99
258 #define VCPMONITOR3_REG_VDVCCTL_15_8 0x9A
259 #define VCPMONITOR3_REG_VDVCCTL_7_0 0x9B
260 #define VCPMONITOR3_REG_TEMPTFANH_15_8 0x9C
261 #define VCPMONITOR3_REG_TEMPTFANH_7_0 0x9D
262 #define VCPMONITOR3_REG_TEMPTFANL_15_8 0x9E
263 #define VCPMONITOR3_REG_TEMPTFANL_7_0 0x9F
264  // vcpmonitor3_reg
266 
285 #define VCPMONITOR3_VAL_C1 0x00
286 #define VCPMONITOR3_VAL_E1 0x06
287 #define VCPMONITOR3_VAL_TB1 0x0C
288 #define VCPMONITOR3_VAL_C2 0x10
289 #define VCPMONITOR3_VAL_E2 0x16
290 #define VCPMONITOR3_VAL_TB2 0x1C
291 #define VCPMONITOR3_VAL_IMAX 0x40
292 #define VCPMONITOR3_VAL_IMIN 0x42
293 #define VCPMONITOR3_VAL_PMAX 0x44
294 #define VCPMONITOR3_VAL_PMIN 0x46
295 #define VCPMONITOR3_VAL_VMAX 0x50
296 #define VCPMONITOR3_VAL_VMIN 0x52
297 #define VCPMONITOR3_VAL_TEMPMAX 0x54
298 #define VCPMONITOR3_VAL_TEMPMIN 0x56
299 #define VCPMONITOR3_VAL_VDVCCMAX 0x58
300 #define VCPMONITOR3_VAL_VDVCCMIN 0x5A
301 #define VCPMONITOR3_VAL_I 0x90
302 #define VCPMONITOR3_VAL_P 0x93
303 #define VCPMONITOR3_VAL_V 0xA0
304 #define VCPMONITOR3_VAL_TEMP 0xA2
305 #define VCPMONITOR3_VAL_VDVCC 0xA4
306 #define VCPMONITOR3_VAL_IH1 0xB0
307 #define VCPMONITOR3_VAL_IH2 0xB3
308 #define VCPMONITOR3_VAL_IH3 0xB6
309 #define VCPMONITOR3_VAL_IH4 0xB9
310 #define VCPMONITOR3_VAL_IH5 0xBC
311 
317 #define VCPMONITOR3_VAL_C1TH 0x00
318 #define VCPMONITOR3_VAL_C1TL 0x06
319 #define VCPMONITOR3_VAL_TB1TH 0x0C
320 #define VCPMONITOR3_VAL_E1TH 0x10
321 #define VCPMONITOR3_VAL_E1TL 0x16
322 #define VCPMONITOR3_VAL_C2TH 0x20
323 #define VCPMONITOR3_VAL_C2TL 0x26
324 #define VCPMONITOR3_VAL_TB2TH 0x2C
325 #define VCPMONITOR3_VAL_E2TH 0x30
326 #define VCPMONITOR3_VAL_E2TL 0x36
327 #define VCPMONITOR3_VAL_ITH 0x80
328 #define VCPMONITOR3_VAL_ITL 0x82
329 #define VCPMONITOR3_VAL_PTH 0x84
330 #define VCPMONITOR3_VAL_PTL 0x86
331 #define VCPMONITOR3_VAL_VTH 0x90
332 #define VCPMONITOR3_VAL_VTL 0x92
333 #define VCPMONITOR3_VAL_TEMPTH 0x94
334 #define VCPMONITOR3_VAL_TEMPTL 0x96
335 #define VCPMONITOR3_VAL_VDVCCTH 0x98
336 #define VCPMONITOR3_VAL_VDVCCTL 0x9A
337 #define VCPMONITOR3_VAL_TEMPTFANH 0x9C
338 #define VCPMONITOR3_VAL_TEMPTFANL 0x9E
339 
344 #define VCPMONITOR3_LSB_IMAX 12.0
345 #define VCPMONITOR3_LSB_IMIN 12.0
346 #define VCPMONITOR3_LSB_PMAX 200.0
347 #define VCPMONITOR3_LSB_PMIN 200.0
348 #define VCPMONITOR3_LSB_VMAX 2.0
349 #define VCPMONITOR3_LSB_VMIN 2.0
350 #define VCPMONITOR3_LSB_TEMPMAX 0.204
351 #define VCPMONITOR3_OFFS_TEMPMAX 5.5
352 #define VCPMONITOR3_LSB_TEMPMIN 0.204
353 #define VCPMONITOR3_OFFS_TEMPMIN 5.5
354 #define VCPMONITOR3_LSB_VDVCCMAX 145.0
355 #define VCPMONITOR3_LSB_VDVCCMIN 145.0
356 #define VCPMONITOR3_LSB_I 3.0
357 #define VCPMONITOR3_LSB_P 50.0
358 #define VCPMONITOR3_LSB_V 2.0
359 #define VCPMONITOR3_LSB_TEMP 0.204
360 #define VCPMONITOR3_OFFS_TEMP 5.5
361 #define VCPMONITOR3_LSB_VDVCC 145.0
362 #define VCPMONITOR3_LSB_IH1 3.0
363 #define VCPMONITOR3_LSB_IH2 3.0
364 #define VCPMONITOR3_LSB_IH3 3.0
365 #define VCPMONITOR3_LSB_IH4 3.0
366 #define VCPMONITOR3_LSB_IH5 3.0
367 #define VCPMONITOR3_LSB_C1 0.0000011933326
368 #define VCPMONITOR3_LSB_E1 0.000019888856
369 #define VCPMONITOR3_LSB_TB1 0.0003977765
370 #define VCPMONITOR3_LSB_C2 0.0000011933326
371 #define VCPMONITOR3_LSB_E2 0.000019888856
372 #define VCPMONITOR3_LSB_TB2 0.0003977765
373 
378 #define VCPMONITOR3_NORM_OP 0x00
379 #define VCPMONITOR3_SHDN 0x01
380 #define VCPMONITOR3_CLR 0x02
381 #define VCPMONITOR3_SSHOT 0x04
382 #define VCPMONITOR3_CONT 0x08
383 #define VCPMONITOR3_RST 0x80
384 
389 #define VCPMONITOR3_UVLOA 0x01
390 #define VCPMONITOR3_PORA 0x02
391 #define VCPMONITOR3_UVLOSTBY 0x04
392 #define VCPMONITOR3_UVLOD 0x08
393 #define VCPMONITOR3_UPDATE 0x10
394 #define VCPMONITOR3_ADCERR 0x20
395 #define VCPMONITOR3_TBERR 0x40
396 
401 #define VCPMONITOR3_SPI_RD_CMD 0x01
402 #define VCPMONITOR3_SPI_WR_CMD 0x00
403 
404 #define VCPMONITOR3_PAGE_0 0x00
405 #define VCPMONITOR3_PAGE_1 0x01
406 
412 #define VCPMONITOR3_I2C_ADR_L_L 0x5C
413 #define VCPMONITOR3_I2C_ADR_L_H 0x5D
414 #define VCPMONITOR3_I2C_ADR_L_R 0x5E
415 #define VCPMONITOR3_I2C_ADR_R_L 0x64
416 #define VCPMONITOR3_I2C_ADR_R_H 0x65
417 #define VCPMONITOR3_I2C_ADR_R_R 0x66
418 
427 #define VCPMONITOR3_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
428 #define VCPMONITOR3_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
429  // vcpmonitor3_set
431 
446 #define VCPMONITOR3_MAP_MIKROBUS( cfg, mikrobus ) \
447  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
448  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
449  cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
450  cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
451  cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
452  cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
453  cfg.io = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
454  cfg.alr = MIKROBUS( mikrobus, MIKROBUS_INT )
455  // vcpmonitor3_map // vcpmonitor3
458 
463 typedef enum
464 {
469 
474 typedef err_t ( *vcpmonitor3_master_io_t )( struct vcpmonitor3_s*, uint8_t, uint8_t*, uint8_t );
480 typedef struct vcpmonitor3_s
481 {
482  digital_out_t io;
483  digital_in_t alr;
485  i2c_master_t i2c;
486  spi_master_t spi;
488  uint8_t slave_address;
489  pin_name_t chip_select;
496 
501 typedef struct
502 {
503  pin_name_t scl;
504  pin_name_t sda;
505  pin_name_t miso;
506  pin_name_t mosi;
507  pin_name_t sck;
508  pin_name_t cs;
509  pin_name_t io;
510  pin_name_t alr;
512  uint32_t i2c_speed;
513  uint8_t i2c_address;
515  uint32_t spi_speed;
516  spi_master_mode_t spi_mode;
517  spi_master_chip_select_polarity_t cs_polarity;
522 
527 typedef enum
528 {
530  VCPMONITOR3_ERROR = -1
531 
533 
550 
566 
582 
597 
613 err_t vcpmonitor3_generic_write ( vcpmonitor3_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len );
614 
630 err_t vcpmonitor3_generic_read ( vcpmonitor3_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len );
631 
643 void vcpmonitor3_wr_page_0 ( vcpmonitor3_t *ctx, uint8_t reg, uint8_t *wr_data, uint8_t n_bytes );
644 
656 void vcpmonitor3_rd_page_0 ( vcpmonitor3_t *ctx, uint8_t reg, uint8_t *rd_data, uint8_t n_bytes );
657 
669 void vcpmonitor3_wr_page_1 ( vcpmonitor3_t *ctx, uint8_t reg, uint8_t *wr_data, uint8_t n_bytes );
670 
682 void vcpmonitor3_rd_page_1 ( vcpmonitor3_t *ctx, uint8_t reg, uint8_t *rd_data, uint8_t n_bytes );
683 
692 void vcpmonitor3_set_op_mode ( vcpmonitor3_t *ctx, uint8_t op_mode );
693 
702 
711 
720 
729 
738 
747 float vcpmonitor3_read_c ( vcpmonitor3_t *ctx, uint8_t accu_set1 );
748 
757 float vcpmonitor3_read_e ( vcpmonitor3_t *ctx, uint8_t accu_set1 );
758 
767 float vcpmonitor3_read_tb ( vcpmonitor3_t *ctx, uint8_t accu_set1 );
768 
777 
778 #ifdef __cplusplus
779 }
780 #endif
781 #endif // VCPMONITOR3_H
782  // vcpmonitor3
784 
785 // ------------------------------------------------------------------------ END
vcpmonitor3_cfg_t::sck
pin_name_t sck
Definition: vcpmonitor3.h:507
vcpmonitor3_cfg_t::cs_polarity
spi_master_chip_select_polarity_t cs_polarity
Definition: vcpmonitor3.h:517
vcpmonitor3_return_value_t
vcpmonitor3_return_value_t
VCP Monitor 3 Click return value data.
Definition: vcpmonitor3.h:528
vcpmonitor3_generic_write
err_t vcpmonitor3_generic_write(vcpmonitor3_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
VCP Monitor 3 data writing function.
vcpmonitor3_s::spi
spi_master_t spi
Definition: vcpmonitor3.h:486
vcpmonitor3_s::drv_sel
vcpmonitor3_drv_t drv_sel
Definition: vcpmonitor3.h:490
vcpmonitor3_cfg_t::sda
pin_name_t sda
Definition: vcpmonitor3.h:504
VCPMONITOR3_OK
@ VCPMONITOR3_OK
Definition: vcpmonitor3.h:529
vcpmonitor3_drv_t
vcpmonitor3_drv_t
VCP Monitor 3 Click driver selector.
Definition: vcpmonitor3.h:464
VCPMONITOR3_DRV_SEL_I2C
@ VCPMONITOR3_DRV_SEL_I2C
Definition: vcpmonitor3.h:466
VCPMONITOR3_DRV_SEL_SPI
@ VCPMONITOR3_DRV_SEL_SPI
Definition: vcpmonitor3.h:465
spi_specifics.h
This file contains SPI specific macros, functions, etc.
vcpmonitor3_init
err_t vcpmonitor3_init(vcpmonitor3_t *ctx, vcpmonitor3_cfg_t *cfg)
VCP Monitor 3 initialization function.
vcpmonitor3_s::write_f
vcpmonitor3_master_io_t write_f
Definition: vcpmonitor3.h:492
vcpmonitor3_read_tb
float vcpmonitor3_read_tb(vcpmonitor3_t *ctx, uint8_t accu_set1)
Read Time in Seconds function.
vcpmonitor3_master_io_t
err_t(* vcpmonitor3_master_io_t)(struct vcpmonitor3_s *, uint8_t, uint8_t *, uint8_t)
VCP Monitor 3 Click driver interface.
Definition: vcpmonitor3.h:474
vcpmonitor3_s::i2c
i2c_master_t i2c
Definition: vcpmonitor3.h:485
vcpmonitor3_set_op_mode
void vcpmonitor3_set_op_mode(vcpmonitor3_t *ctx, uint8_t op_mode)
Set Operation Mode function.
vcpmonitor3_cfg_t::cs
pin_name_t cs
Definition: vcpmonitor3.h:508
vcpmonitor3_cfg_t::scl
pin_name_t scl
Definition: vcpmonitor3.h:503
vcpmonitor3_read_c
float vcpmonitor3_read_c(vcpmonitor3_t *ctx, uint8_t accu_set1)
Read Charge in Coulombs function.
vcpmonitor3_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: vcpmonitor3.h:512
vcpmonitor3_cfg_t::miso
pin_name_t miso
Definition: vcpmonitor3.h:505
vcpmonitor3_s::io
digital_out_t io
Definition: vcpmonitor3.h:482
vcpmonitor3_generic_read
err_t vcpmonitor3_generic_read(vcpmonitor3_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
VCP Monitor 3 data reading function.
vcpmonitor3_default_cfg
err_t vcpmonitor3_default_cfg(vcpmonitor3_t *ctx)
VCP Monitor 3 default configuration function.
vcpmonitor3_cfg_t::spi_mode
spi_master_mode_t spi_mode
Definition: vcpmonitor3.h:516
vcpmonitor3_wr_page_1
void vcpmonitor3_wr_page_1(vcpmonitor3_t *ctx, uint8_t reg, uint8_t *wr_data, uint8_t n_bytes)
Write Data To Page 1 function.
VCPMONITOR3_ERROR
@ VCPMONITOR3_ERROR
Definition: vcpmonitor3.h:530
vcpmonitor3_cfg_t::drv_sel
vcpmonitor3_drv_t drv_sel
Definition: vcpmonitor3.h:519
vcpmonitor3_rd_page_0
void vcpmonitor3_rd_page_0(vcpmonitor3_t *ctx, uint8_t reg, uint8_t *rd_data, uint8_t n_bytes)
Read Data From Page 0 function.
vcpmonitor3_read_e
float vcpmonitor3_read_e(vcpmonitor3_t *ctx, uint8_t accu_set1)
Read Energy in Joules function.
vcpmonitor3_drv_interface_selection
void vcpmonitor3_drv_interface_selection(vcpmonitor3_cfg_t *cfg, vcpmonitor3_drv_t drv_sel)
VCP Monitor 3 driver interface setup function.
vcpmonitor3_read_p
float vcpmonitor3_read_p(vcpmonitor3_t *ctx)
Read Power in Watts function.
vcpmonitor3_read_vcc
float vcpmonitor3_read_vcc(vcpmonitor3_t *ctx)
Read Voltage at DVCC in Volts function.
vcpmonitor3_cfg_t::alr
pin_name_t alr
Definition: vcpmonitor3.h:510
vcpmonitor3_s::slave_address
uint8_t slave_address
Definition: vcpmonitor3.h:488
vcpmonitor3_get_int
uint8_t vcpmonitor3_get_int(vcpmonitor3_t *ctx)
Get Interrupt state function.
vcpmonitor3_s
VCP Monitor 3 Click context object.
Definition: vcpmonitor3.h:481
vcpmonitor3_cfg_t::io
pin_name_t io
Definition: vcpmonitor3.h:509
vcpmonitor3_cfg_setup
void vcpmonitor3_cfg_setup(vcpmonitor3_cfg_t *cfg)
VCP Monitor 3 configuration object setup function.
vcpmonitor3_cfg_t
VCP Monitor 3 Click configuration object.
Definition: vcpmonitor3.h:502
vcpmonitor3_cfg_t::mosi
pin_name_t mosi
Definition: vcpmonitor3.h:506
vcpmonitor3_cfg_t::spi_speed
uint32_t spi_speed
Definition: vcpmonitor3.h:515
vcpmonitor3_rd_page_1
void vcpmonitor3_rd_page_1(vcpmonitor3_t *ctx, uint8_t reg, uint8_t *rd_data, uint8_t n_bytes)
Read Data From Page 1 function.
vcpmonitor3_s::read_f
vcpmonitor3_master_io_t read_f
Definition: vcpmonitor3.h:493
vcpmonitor3_t
struct vcpmonitor3_s vcpmonitor3_t
VCP Monitor 3 Click context object.
vcpmonitor3_s::alr
digital_in_t alr
Definition: vcpmonitor3.h:483
vcpmonitor3_cfg_t::i2c_address
uint8_t i2c_address
Definition: vcpmonitor3.h:513
vcpmonitor3_s::chip_select
pin_name_t chip_select
Definition: vcpmonitor3.h:489
vcpmonitor3_wr_page_0
void vcpmonitor3_wr_page_0(vcpmonitor3_t *ctx, uint8_t reg, uint8_t *wr_data, uint8_t n_bytes)
Write Data To Page 0 function.
vcpmonitor3_read_v
float vcpmonitor3_read_v(vcpmonitor3_t *ctx)
Read Voltage in Volts function.
vcpmonitor3_read_i
float vcpmonitor3_read_i(vcpmonitor3_t *ctx)
Read Current in Amps function.
vcpmonitor3_read_temp
float vcpmonitor3_read_temp(vcpmonitor3_t *ctx)
Read Die Temperature in degrees Centigrade function.