Loading...
Searching...
No Matches
bq27220_data_memory.h
1#pragma once
2
3#include <stdint.h>
4#include <stdbool.h>
5
6typedef enum {
7 BQ27220DMTypeEnd,
8 BQ27220DMTypeWait,
9 BQ27220DMTypeU8,
10 BQ27220DMTypeU16,
11 BQ27220DMTypeU32,
12 BQ27220DMTypeI8,
13 BQ27220DMTypeI16,
14 BQ27220DMTypeI32,
15 BQ27220DMTypeF32,
16 BQ27220DMTypePtr8,
17 BQ27220DMTypePtr16,
18 BQ27220DMTypePtr32,
19} BQ27220DMType;
20
21typedef enum {
22 BQ27220DMAddressGasGaugingCEDVProfile1GaugingConfig = 0x929B,
23 BQ27220DMAddressGasGaugingCEDVProfile1FullChargeCapacity = 0x929D,
24 BQ27220DMAddressGasGaugingCEDVProfile1DesignCapacity = 0x929F,
25 BQ27220DMAddressGasGaugingCEDVProfile1EMF = 0x92A3,
26 BQ27220DMAddressGasGaugingCEDVProfile1C0 = 0x92A9,
27 BQ27220DMAddressGasGaugingCEDVProfile1R0 = 0x92AB,
28 BQ27220DMAddressGasGaugingCEDVProfile1T0 = 0x92AD,
29 BQ27220DMAddressGasGaugingCEDVProfile1R1 = 0x92AF,
30 BQ27220DMAddressGasGaugingCEDVProfile1TC = 0x92B1,
31 BQ27220DMAddressGasGaugingCEDVProfile1C1 = 0x92B2,
32 BQ27220DMAddressGasGaugingCEDVProfile1EDV0 = 0x92B4,
33 BQ27220DMAddressGasGaugingCEDVProfile1EDV1 = 0x92B7,
34 BQ27220DMAddressGasGaugingCEDVProfile1EDV2 = 0x92BA,
35 BQ27220DMAddressGasGaugingCEDVProfile1StartDOD0 = 0x92BD,
36 BQ27220DMAddressGasGaugingCEDVProfile1StartDOD10 = 0x92BF,
37 BQ27220DMAddressGasGaugingCEDVProfile1StartDOD20 = 0x92C1,
38 BQ27220DMAddressGasGaugingCEDVProfile1StartDOD30 = 0x92C3,
39 BQ27220DMAddressGasGaugingCEDVProfile1StartDOD40 = 0x92C5,
40 BQ27220DMAddressGasGaugingCEDVProfile1StartDOD50 = 0x92C7,
41 BQ27220DMAddressGasGaugingCEDVProfile1StartDOD60 = 0x92C9,
42 BQ27220DMAddressGasGaugingCEDVProfile1StartDOD70 = 0x92CB,
43 BQ27220DMAddressGasGaugingCEDVProfile1StartDOD80 = 0x92CD,
44 BQ27220DMAddressGasGaugingCEDVProfile1StartDOD90 = 0x92CF,
45 BQ27220DMAddressGasGaugingCEDVProfile1StartDOD100 = 0x92D1,
46 BQ27220DMAddressCalibrationCurrentDeadband = 0x91DE,
47 BQ27220DMAddressConfigurationPowerSleepCurrent = 0x9217,
48 BQ27220DMAddressConfigurationCurrentThresholdsDischargeDetectionThreshold = 0x9228,
49 BQ27220DMAddressConfigurationDataInitialStandby = 0x923C,
50} BQ27220DMAddress;
51
52typedef struct BQ27220DMData BQ27220DMData;
53
55 uint16_t type;
56 uint16_t address;
57 union {
58 uint8_t u8;
59 uint16_t u16;
60 uint32_t u32;
61 int8_t i8;
62 int16_t i16;
63 int32_t i32;
64 float f32;
65 } value;
66};
67
68typedef struct {
69 // Low byte, Low bit first
70 const bool CCT : 1;
71 const bool CSYNC : 1;
72 const bool RSVD0 : 1;
73 const bool EDV_CMP : 1;
74 const bool SC : 1;
75 const bool FIXED_EDV0 : 1;
76 const uint8_t RSVD1 : 2;
77 // High byte, Low bit first
78 const bool FCC_LIM : 1;
79 const bool RSVD2 : 1;
80 const bool FC_FOR_VDQ : 1;
81 const bool IGNORE_SD : 1;
82 const bool SME0 : 1;
83 const uint8_t RSVD3 : 3;
85
86_Static_assert(sizeof(BQ27220DMGaugingConfig) == 2, "Incorrect structure size");
Definition bq27220_data_memory.h:54
Definition bq27220_data_memory.h:68