PER Firmware
Loading...
Searching...
No Matches
commands.h
Go to the documentation of this file.
1
10#ifndef COMMANDS_H
11#define COMMANDS_H
12
13#include <stdint.h>
14
15// Register configuration
16static constexpr uint8_t ADBMS6380_CMD_WRCFGA[2] = {0x00, 0x01};
17static constexpr uint8_t ADBMS6380_CMD_WRCFGB[2] = {0x00, 0x24};
18static constexpr uint8_t ADBMS6380_CMD_RDCFGA[2] = {0x00, 0x02};
19static constexpr uint8_t ADBMS6380_CMD_RDCFGB[2] = {0x00, 0x26};
20
21// Read cell voltage result registers
22static constexpr uint8_t ADBMS6380_CMD_RDCVA[2] = {0x00, 0x04};
23static constexpr uint8_t ADBMS6380_CMD_RDCVB[2] = {0x00, 0x06};
24static constexpr uint8_t ADBMS6380_CMD_RDCVC[2] = {0x00, 0x08};
25static constexpr uint8_t ADBMS6380_CMD_RDCVD[2] = {0x00, 0x0A};
26static constexpr uint8_t ADBMS6380_CMD_RDCVE[2] = {0x00, 0x09};
27static constexpr uint8_t ADBMS6380_CMD_RDCVF[2] = {0x00, 0x0B};
28static constexpr uint8_t ADBMS6380_CMD_RDCVALL[2] = {0x00, 0x0C};
29
30// Read average cell voltage result registers
31static constexpr uint8_t ADBMS6380_CMD_RDACA[2] = {0x00, 0x44};
32static constexpr uint8_t ADBMS6380_CMD_RDACB[2] = {0x00, 0x46};
33static constexpr uint8_t ADBMS6380_CMD_RDACC[2] = {0x00, 0x48};
34static constexpr uint8_t ADBMS6380_CMD_RDACD[2] = {0x00, 0x4A};
35static constexpr uint8_t ADBMS6380_CMD_RDACE[2] = {0x00, 0x49};
36static constexpr uint8_t ADBMS6380_CMD_RDACF[2] = {0x00, 0x4B};
37static constexpr uint8_t ADBMS6380_CMD_RDACALL[2] = {0x00, 0x4C};
38
39// Read S voltage result registers
40static constexpr uint8_t ADBMS6380_CMD_RDSVA[2] = {0x00, 0x03};
41static constexpr uint8_t ADBMS6380_CMD_RDSVB[2] = {0x00, 0x05};
42static constexpr uint8_t ADBMS6380_CMD_RDSVC[2] = {0x00, 0x07};
43static constexpr uint8_t ADBMS6380_CMD_RDSVD[2] = {0x00, 0x0D};
44static constexpr uint8_t ADBMS6380_CMD_RDSVE[2] = {0x00, 0x0E};
45static constexpr uint8_t ADBMS6380_CMD_RDSVF[2] = {0x00, 0x0F};
46static constexpr uint8_t ADBMS6380_CMD_RDSALL[2] = {0x00, 0x10};
47
48// Read C and S results
49static constexpr uint8_t ADBMS6380_CMD_RDCSALL[2] = {0x00, 0x11};
50static constexpr uint8_t ADBMS6380_CMD_RDACSALL[2] = {0x00, 0x51};
51
52// Read all AUX and all status registers
53static constexpr uint8_t ADBMS6380_CMD_RDASALL[2] = {0x00, 0x35};
54
55// Read filtered cell voltage result registers
56static constexpr uint8_t ADBMS6380_CMD_RDFCA[2] = {0x00, 0x12};
57static constexpr uint8_t ADBMS6380_CMD_RDFCB[2] = {0x00, 0x13};
58static constexpr uint8_t ADBMS6380_CMD_RDFCC[2] = {0x00, 0x14};
59static constexpr uint8_t ADBMS6380_CMD_RDFCD[2] = {0x00, 0x15};
60static constexpr uint8_t ADBMS6380_CMD_RDFCE[2] = {0x00, 0x16};
61static constexpr uint8_t ADBMS6380_CMD_RDFCF[2] = {0x00, 0x17};
62static constexpr uint8_t ADBMS6380_CMD_RDFCALL[2] = {0x00, 0x18};
63
64// Read aux results
65static constexpr uint8_t ADBMS6380_CMD_RDAUXA[2] = {0x00, 0x19};
66static constexpr uint8_t ADBMS6380_CMD_RDAUXB[2] = {0x00, 0x1A};
67static constexpr uint8_t ADBMS6380_CMD_RDAUXC[2] = {0x00, 0x1B};
68static constexpr uint8_t ADBMS6380_CMD_RDAUXD[2] = {0x00, 0x1F};
69
70// Read redundant aux results
71static constexpr uint8_t ADBMS6380_CMD_RDRAXA[2] = {0x00, 0x1C};
72static constexpr uint8_t ADBMS6380_CMD_RDRAXB[2] = {0x00, 0x1D};
73static constexpr uint8_t ADBMS6380_CMD_RDRAXC[2] = {0x00, 0x1E};
74static constexpr uint8_t ADBMS6380_CMD_RDRAXD[2] = {0x00, 0x25};
75
76// Read status registers
77static constexpr uint8_t ADBMS6380_CMD_RDSTATA[2] = {0x00, 0x30};
78static constexpr uint8_t ADBMS6380_CMD_RDSTATB[2] = {0x00, 0x31};
79static constexpr uint8_t ADBMS6380_CMD_RDSTATC[2] = {0x00, 0x32};
80static constexpr uint8_t ADBMS6380_CMD_RDSTATCERR[2] = {0x00, 0x72};
81static constexpr uint8_t ADBMS6380_CMD_RDSTATD[2] = {0x00, 0x33};
82static constexpr uint8_t ADBMS6380_CMD_RDSTATE[2] = {0x00, 0x34};
83
84// PWM registers commands
85static constexpr uint8_t ADBMS6380_CMD_WRPWMA[2] = {0x00, 0x20};
86static constexpr uint8_t ADBMS6380_CMD_RDPWMA[2] = {0x00, 0x22};
87
88static constexpr uint8_t ADBMS6380_CMD_WRPWMB[2] = {0x00, 0x21};
89static constexpr uint8_t ADBMS6380_CMD_RDPWMB[2] = {0x00, 0x23};
90
91// Clear commands
92static constexpr uint8_t ADBMS6380_CMD_CLRCELL[2] = {0x07, 0x11};
93static constexpr uint8_t ADBMS6380_CMD_CLRAUX[2] = {0x07, 0x12};
94static constexpr uint8_t ADBMS6380_CMD_CLRSPIN[2] = {0x07, 0x16};
95static constexpr uint8_t ADBMS6380_CMD_CLRFLAG[2] = {0x07, 0x17};
96static constexpr uint8_t ADBMS6380_CMD_CLRFC[2] = {0x07, 0x14};
97static constexpr uint8_t ADBMS6380_CMD_CLOVUV[2] = {0x07, 0x15};
98
99// Poll ADC commands
100static constexpr uint8_t ADBMS6380_CMD_PLADC[2] = {0x07, 0x18};
101static constexpr uint8_t ADBMS6380_CMD_PLAUT[2] = {0x07, 0x19};
102static constexpr uint8_t ADBMS6380_CMD_PLCADC[2] = {0x07, 0x1C};
103static constexpr uint8_t ADBMS6380_CMD_PLSADC[2] = {0x07, 0x1D};
104static constexpr uint8_t ADBMS6380_CMD_PLAUX1[2] = {0x07, 0x1E};
105static constexpr uint8_t ADBMS6380_CMD_PLAUX2[2] = {0x07, 0x1F};
106
107// Diagnostic command
108static constexpr uint8_t ADBMS6380_CMD_DIAGN[2] = {0x07, 0x15};
109
110// GPIOs commands
111static constexpr uint8_t ADBMS6380_CMD_WRCOMM[2] = {0x07, 0x21};
112static constexpr uint8_t ADBMS6380_CMD_RDCOMM[2] = {0x07, 0x22};
113static constexpr uint8_t ADBMS6380_CMD_STCOMM[13] = {
114 0x07, 0x23, 0xB9, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
115};
116
117// Mute and Unmute commands
118static constexpr uint8_t ADBMS6380_CMD_MUTE[2] = {0x00, 0x28};
119static constexpr uint8_t ADBMS6380_CMD_UNMUTE[2] = {0x00, 0x29};
120
121static constexpr uint8_t ADBMS6380_CMD_RSTCC[2] = {0x00, 0x2E};
122static constexpr uint8_t ADBMS6380_CMD_SNAP[2] = {0x00, 0x2D};
123static constexpr uint8_t ADBMS6380_CMD_UNSNAP[2] = {0x00, 0x2F};
124static constexpr uint8_t ADBMS6380_CMD_SRST[2] = {0x00, 0x27};
125
126// Read SID command
127static constexpr uint8_t ADBMS6380_CMD_RDSID[2] = {0x00, 0x2C};
128
129#endif // COMMANDS_H
static constexpr uint8_t ADBMS6380_CMD_MUTE[2]
Definition commands.h:118
static constexpr uint8_t ADBMS6380_CMD_RDSTATE[2]
Definition commands.h:82
static constexpr uint8_t ADBMS6380_CMD_RDFCALL[2]
Definition commands.h:62
static constexpr uint8_t ADBMS6380_CMD_RDCVF[2]
Definition commands.h:27
static constexpr uint8_t ADBMS6380_CMD_CLRCELL[2]
Definition commands.h:92
static constexpr uint8_t ADBMS6380_CMD_RDSTATCERR[2]
Definition commands.h:80
static constexpr uint8_t ADBMS6380_CMD_RDASALL[2]
Definition commands.h:53
static constexpr uint8_t ADBMS6380_CMD_RDPWMA[2]
Definition commands.h:86
static constexpr uint8_t ADBMS6380_CMD_RDSVD[2]
Definition commands.h:43
static constexpr uint8_t ADBMS6380_CMD_RDCOMM[2]
Definition commands.h:112
static constexpr uint8_t ADBMS6380_CMD_RDACF[2]
Definition commands.h:36
static constexpr uint8_t ADBMS6380_CMD_DIAGN[2]
Definition commands.h:108
static constexpr uint8_t ADBMS6380_CMD_RDSVF[2]
Definition commands.h:45
static constexpr uint8_t ADBMS6380_CMD_PLSADC[2]
Definition commands.h:103
static constexpr uint8_t ADBMS6380_CMD_RDFCD[2]
Definition commands.h:59
static constexpr uint8_t ADBMS6380_CMD_RDAUXD[2]
Definition commands.h:68
static constexpr uint8_t ADBMS6380_CMD_RDSTATA[2]
Definition commands.h:77
static constexpr uint8_t ADBMS6380_CMD_RDCVA[2]
Definition commands.h:22
static constexpr uint8_t ADBMS6380_CMD_RDRAXD[2]
Definition commands.h:74
static constexpr uint8_t ADBMS6380_CMD_RDCVB[2]
Definition commands.h:23
static constexpr uint8_t ADBMS6380_CMD_SNAP[2]
Definition commands.h:122
static constexpr uint8_t ADBMS6380_CMD_RDFCC[2]
Definition commands.h:58
static constexpr uint8_t ADBMS6380_CMD_RDSVB[2]
Definition commands.h:41
static constexpr uint8_t ADBMS6380_CMD_CLRAUX[2]
Definition commands.h:93
static constexpr uint8_t ADBMS6380_CMD_RDSVA[2]
Definition commands.h:40
static constexpr uint8_t ADBMS6380_CMD_RDACA[2]
Definition commands.h:31
static constexpr uint8_t ADBMS6380_CMD_RDFCE[2]
Definition commands.h:60
static constexpr uint8_t ADBMS6380_CMD_WRCFGB[2]
Definition commands.h:17
static constexpr uint8_t ADBMS6380_CMD_RDAUXA[2]
Definition commands.h:65
static constexpr uint8_t ADBMS6380_CMD_RDSVE[2]
Definition commands.h:44
static constexpr uint8_t ADBMS6380_CMD_RDCSALL[2]
Definition commands.h:49
static constexpr uint8_t ADBMS6380_CMD_RDACD[2]
Definition commands.h:34
static constexpr uint8_t ADBMS6380_CMD_PLCADC[2]
Definition commands.h:102
static constexpr uint8_t ADBMS6380_CMD_WRPWMA[2]
Definition commands.h:85
static constexpr uint8_t ADBMS6380_CMD_RDACE[2]
Definition commands.h:35
static constexpr uint8_t ADBMS6380_CMD_WRPWMB[2]
Definition commands.h:88
static constexpr uint8_t ADBMS6380_CMD_RSTCC[2]
Definition commands.h:121
static constexpr uint8_t ADBMS6380_CMD_CLRSPIN[2]
Definition commands.h:94
static constexpr uint8_t ADBMS6380_CMD_RDCVD[2]
Definition commands.h:25
static constexpr uint8_t ADBMS6380_CMD_STCOMM[13]
Definition commands.h:113
static constexpr uint8_t ADBMS6380_CMD_CLRFC[2]
Definition commands.h:96
static constexpr uint8_t ADBMS6380_CMD_CLRFLAG[2]
Definition commands.h:95
static constexpr uint8_t ADBMS6380_CMD_RDAUXC[2]
Definition commands.h:67
static constexpr uint8_t ADBMS6380_CMD_PLADC[2]
Definition commands.h:100
static constexpr uint8_t ADBMS6380_CMD_UNMUTE[2]
Definition commands.h:119
static constexpr uint8_t ADBMS6380_CMD_RDFCF[2]
Definition commands.h:61
static constexpr uint8_t ADBMS6380_CMD_RDSVC[2]
Definition commands.h:42
static constexpr uint8_t ADBMS6380_CMD_RDFCA[2]
Definition commands.h:56
static constexpr uint8_t ADBMS6380_CMD_RDRAXC[2]
Definition commands.h:73
static constexpr uint8_t ADBMS6380_CMD_RDCVC[2]
Definition commands.h:24
static constexpr uint8_t ADBMS6380_CMD_RDFCB[2]
Definition commands.h:57
static constexpr uint8_t ADBMS6380_CMD_PLAUX1[2]
Definition commands.h:104
static constexpr uint8_t ADBMS6380_CMD_PLAUT[2]
Definition commands.h:101
static constexpr uint8_t ADBMS6380_CMD_RDACSALL[2]
Definition commands.h:50
static constexpr uint8_t ADBMS6380_CMD_WRCOMM[2]
Definition commands.h:111
static constexpr uint8_t ADBMS6380_CMD_RDRAXB[2]
Definition commands.h:72
static constexpr uint8_t ADBMS6380_CMD_RDACC[2]
Definition commands.h:33
static constexpr uint8_t ADBMS6380_CMD_CLOVUV[2]
Definition commands.h:97
static constexpr uint8_t ADBMS6380_CMD_PLAUX2[2]
Definition commands.h:105
static constexpr uint8_t ADBMS6380_CMD_RDCFGB[2]
Definition commands.h:19
static constexpr uint8_t ADBMS6380_CMD_RDAUXB[2]
Definition commands.h:66
static constexpr uint8_t ADBMS6380_CMD_RDCVALL[2]
Definition commands.h:28
static constexpr uint8_t ADBMS6380_CMD_RDCVE[2]
Definition commands.h:26
static constexpr uint8_t ADBMS6380_CMD_RDACB[2]
Definition commands.h:32
static constexpr uint8_t ADBMS6380_CMD_WRCFGA[2]
Definition commands.h:16
static constexpr uint8_t ADBMS6380_CMD_RDSTATB[2]
Definition commands.h:78
static constexpr uint8_t ADBMS6380_CMD_SRST[2]
Definition commands.h:124
static constexpr uint8_t ADBMS6380_CMD_RDPWMB[2]
Definition commands.h:89
static constexpr uint8_t ADBMS6380_CMD_RDSALL[2]
Definition commands.h:46
static constexpr uint8_t ADBMS6380_CMD_RDCFGA[2]
Definition commands.h:18
static constexpr uint8_t ADBMS6380_CMD_RDSTATD[2]
Definition commands.h:81
static constexpr uint8_t ADBMS6380_CMD_RDSTATC[2]
Definition commands.h:79
static constexpr uint8_t ADBMS6380_CMD_UNSNAP[2]
Definition commands.h:123
static constexpr uint8_t ADBMS6380_CMD_RDACALL[2]
Definition commands.h:37
static constexpr uint8_t ADBMS6380_CMD_RDRAXA[2]
Definition commands.h:71
static constexpr uint8_t ADBMS6380_CMD_RDSID[2]
Definition commands.h:127