foxBMS  1.0.0
The foxBMS Battery Management System API Documentation
mxm_41b_register_map.h
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2021, Fraunhofer-Gesellschaft zur Foerderung der
4  * angewandten Forschung e.V. All rights reserved.
5  *
6  * BSD 3-Clause License
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  * 1. Redistributions of source code must retain the above copyright notice,
10  * this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  * 3. Neither the name of the copyright holder nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  *
30  * We kindly request you to use one or more of the following phrases to refer
31  * to foxBMS in your hardware, software, documentation or advertising
32  * materials:
33  *
34  * ″This product uses parts of foxBMS®″
35  *
36  * ″This product includes parts of foxBMS®″
37  *
38  * ″This product is derived from foxBMS®″
39  *
40  */
41 
42 /**
43  * @file mxm_41b_register_map.h
44  * @author foxBMS Team
45  * @date 2020-06-25 (date of creation)
46  * @updated 2020-06-25 (date of last update)
47  * @ingroup DRIVERS
48  * @prefix MXM
49  *
50  * @brief Register map of the MAX17841 bridge IC
51  *
52  */
53 
54 #ifndef FOXBMS__MXM_41B_REGISTER_MAP_H_
55 #define FOXBMS__MXM_41B_REGISTER_MAP_H_
56 
57 /*========== Includes =======================================================*/
58 
59 /*========== Macros and Definitions =========================================*/
60 /**
61  * @brief Type for MAX17841B buffer transaction commands
62  *
63  * SPI commands for buffer transactions of the MAX17841B.
64  */
65 typedef uint8_t MXM_41B_BUF_CMD_t;
66 
67 /**
68  * @brief MAX17841B register addresses
69  *
70  * Register addresses for the MAX17841B.
71  * Valid register addresses range from 0x01 to 0x1B
72  * and 0x95 to 0x9B
73  * Odd addresses are read addresses and even addresses are
74  * write addresses. Read-only registers have no write address.
75  */
76 typedef uint8_t MXM_41B_REG_ADD_t;
77 
78 /**
79  * @brief Reset transmit buffer to default state and clear TX_Q and LD_Q
80  */
81 #define MXM_BUF_CLR_TX_BUF ((MXM_41B_BUF_CMD_t)0x20u)
82 
83 /**
84  * @brief Read receive buffer starting at RX_RD_Pointer
85  */
86 #define MXM_BUF_RD_MSG ((MXM_41B_BUF_CMD_t)0x91u)
87 
88 /**
89  * @brief Read receive buffer starting at the oldest unread message
90  */
91 #define MXM_BUF_RD_NXT_MSG ((MXM_41B_BUF_CMD_t)0x93u)
92 
93 /**
94  * @brief Select next load queue and write starting from location 0
95  */
96 #define MXM_BUF_WR_NXT_LD_Q_0 ((MXM_41B_BUF_CMD_t)0xB0u)
97 
98 /**
99  * @brief Select next load queue and write starting from location 1
100  */
101 #define MXM_BUF_WR_NXT_LD_Q_1 ((MXM_41B_BUF_CMD_t)0xB2u)
102 
103 /**
104  * @brief Select next load queue and write starting from location 2
105  */
106 #define MXM_BUF_WR_NXT_LD_Q_2 ((MXM_41B_BUF_CMD_t)0xB4u)
107 
108 /**
109  * @brief Select next load queue and write starting from location 3
110  */
111 #define MXM_BUF_WR_NXT_LD_Q_3 ((MXM_41B_BUF_CMD_t)0xB6u)
112 
113 /**
114  * @brief Select next load queue and write starting from location 4
115  */
116 #define MXM_BUF_WR_NXT_LD_Q_4 ((MXM_41B_BUF_CMD_t)0xB8u)
117 
118 /**
119  * @brief Select next load queue and write starting from location 5
120  */
121 #define MXM_BUF_WR_NXT_LD_Q_5 ((MXM_41B_BUF_CMD_t)0xBAu)
122 
123 /**
124  * @brief Select next load queue and write starting from location 6
125  */
126 #define MXM_BUF_WR_NXT_LD_Q_6 ((MXM_41B_BUF_CMD_t)0xBCu)
127 
128 /**
129  * @brief Write load queue starting from location 0
130  */
131 #define MXM_BUF_WR_LD_Q_0 ((MXM_41B_BUF_CMD_t)0xC0u)
132 
133 /**
134  * @brief Write load queue starting from location 1
135  */
136 #define MXM_BUF_WR_LD_Q_1 ((MXM_41B_BUF_CMD_t)0xC2u)
137 
138 /**
139  * @brief Write load queue starting from location 2
140  */
141 #define MXM_BUF_WR_LD_Q_2 ((MXM_41B_BUF_CMD_t)0xC4u)
142 
143 /**
144  * @brief Write load queue starting from location 3
145  */
146 #define MXM_BUF_WR_LD_Q_3 ((MXM_41B_BUF_CMD_t)0xC6u)
147 
148 /**
149  * @brief Write load queue starting from location 4
150  */
151 #define MXM_BUF_WR_LD_Q_4 ((MXM_41B_BUF_CMD_t)0xC8u)
152 
153 /**
154  * @brief Write load queue starting from location 5
155  */
156 #define MXM_BUF_WR_LD_Q_5 ((MXM_41B_BUF_CMD_t)0xCAu)
157 
158 /**
159  * @brief Write load queue starting from location 6
160  */
161 #define MXM_BUF_WR_LD_Q_6 ((MXM_41B_BUF_CMD_t)0xCCu)
162 
163 /**
164  * @brief Read load queue starting from location 0
165  */
166 #define MXM_BUF_RD_LD_Q_0 ((MXM_41B_BUF_CMD_t)0xC1u)
167 
168 /**
169  * @brief Read load queue starting from location 1
170  */
171 #define MXM_BUF_RD_LD_Q_1 ((MXM_41B_BUF_CMD_t)0xC3u)
172 
173 /**
174  * @brief Read load queue starting from location 2
175  */
176 #define MXM_BUF_RD_LD_Q_2 ((MXM_41B_BUF_CMD_t)0xC5u)
177 
178 /**
179  * @brief Read load queue starting from location 3
180  */
181 #define MXM_BUF_RD_LD_Q_3 ((MXM_41B_BUF_CMD_t)0xC7u)
182 
183 /**
184  * @brief Read load queue starting from location 4
185  */
186 #define MXM_BUF_RD_LD_Q_4 ((MXM_41B_BUF_CMD_t)0xC9u)
187 
188 /**
189  * @brief Read load queue starting from location 5
190  */
191 #define MXM_BUF_RD_LD_Q_5 ((MXM_41B_BUF_CMD_t)0xCBu)
192 
193 /**
194  * @brief Read load queue starting from location 6
195  */
196 #define MXM_BUF_RD_LD_Q_6 ((MXM_41B_BUF_CMD_t)0xCDu)
197 
198 /**
199  * @brief Reset receive buffer and pointers to default state
200  */
201 #define MXM_BUF_CLR_RX_BUF ((MXM_41B_BUF_CMD_t)0xE0u)
202 
203 /**
204  * @brief RX status register read address
205  */
206 #define MXM_REG_RX_STATUS_R ((MXM_41B_REG_ADD_t)0x01u)
207 
208 /**
209  * @brief TX status register read address
210  */
211 #define MXM_REG_TX_STATUS_R ((MXM_41B_REG_ADD_t)0x03u)
212 
213 /**
214  * @brief RX interrupt enable register read address
215  */
216 #define MXM_REG_RX_INTERRUPT_ENABLE_R ((MXM_41B_REG_ADD_t)0x05u)
217 
218 /**
219  * @brief RX interrupt enable register write address
220  */
221 #define MXM_REG_RX_INTERRUPT_ENABLE_W ((MXM_41B_REG_ADD_t)0x04u)
222 
223 /**
224  * @brief TX interrupt enable register read address
225  */
226 #define MXM_REG_TX_INTERRUPT_ENABLE_R ((MXM_41B_REG_ADD_t)0x07u)
227 
228 /**
229  * @brief TX interrupt enable register write address
230  */
231 #define MXM_REG_TX_INTERRUPT_ENABLE_W ((MXM_41B_REG_ADD_t)0x06u)
232 
233 /**
234  * @brief RX interrupt flags register read address
235  */
236 #define MXM_REG_RX_INTERRUPT_FLAGS_R ((MXM_41B_REG_ADD_t)0x09u)
237 
238 /**
239  * @brief RX interrupt flags register write address
240  */
241 #define MXM_REG_RX_INTERRUPT_FLAGS_W ((MXM_41B_REG_ADD_t)0x08u)
242 
243 /**
244  * @brief TX interrupt flags register read address
245  */
246 #define MXM_REG_TX_INTERRUPT_FLAGS_R ((MXM_41B_REG_ADD_t)0x0Bu)
247 
248 /**
249  * @brief TX interrupt flags register write address
250  */
251 #define MXM_REG_TX_INTERRUPT_FLAGS_W ((MXM_41B_REG_ADD_t)0x0Au)
252 
253 /**
254  * @brief Configuration 1 register read address
255  */
256 #define MXM_REG_CONFIGURATION_1_R ((MXM_41B_REG_ADD_t)0x0Du)
257 
258 /**
259  * @brief Configuration 1 register write address
260  */
261 #define MXM_REG_CONFIGURATION_1_W ((MXM_41B_REG_ADD_t)0x0Cu)
262 
263 /**
264  * @brief Configuration 2 register read address
265  */
266 #define MXM_REG_CONFIGURATION_2_R ((MXM_41B_REG_ADD_t)0x0Fu)
267 
268 /**
269  * @brief Configuration 2 register write address
270  */
271 #define MXM_REG_CONFIGURATION_2_W ((MXM_41B_REG_ADD_t)0x0Eu)
272 
273 /**
274  * @brief Configuration 3 register read address
275  */
276 #define MXM_REG_CONFIGURATION_3_R ((MXM_41B_REG_ADD_t)0x11u)
277 
278 /**
279  * @brief Configuration 3 register write address
280  */
281 #define MXM_REG_CONFIGURATION_3_W ((MXM_41B_REG_ADD_t)0x10u)
282 
283 /**
284  * @brief FMEA register read address
285  */
286 #define MXM_REG_FMEA_R ((MXM_41B_REG_ADD_t)0x13u)
287 
288 /**
289  * @brief Model register read address
290  */
291 #define MXM_REG_MODEL_R ((MXM_41B_REG_ADD_t)0x15u)
292 
293 /**
294  * @brief Version register read address
295  */
296 #define MXM_REG_VERSION_R ((MXM_41B_REG_ADD_t)0x17u)
297 
298 /**
299  * @brief RX byte register read address
300  */
301 #define MXM_REG_RX_BYTE_R ((MXM_41B_REG_ADD_t)0x19u)
302 
303 /**
304  * @brief RX space register read address
305  */
306 #define MXM_REG_RX_SPACE_R ((MXM_41B_REG_ADD_t)0x1Bu)
307 
308 /**
309  * @brief TX queue selects register read address
310  */
311 #define MXM_REG_TX_QUEUE_SELECTS_R ((MXM_41B_REG_ADD_t)0x95u)
312 
313 /**
314  * @brief RX read pointer register read address
315  */
316 #define MXM_REG_RX_READ_POINTER_R ((MXM_41B_REG_ADD_t)0x97u)
317 
318 /**
319  * @brief RX write pointer register read address
320  */
321 #define MXM_REG_RX_WRITE_POINTER_R ((MXM_41B_REG_ADD_t)0x99u)
322 
323 /**
324  * @brief RX next message register read address
325  */
326 #define MXM_REG_RX_NEXT_MESSAGE_R ((MXM_41B_REG_ADD_t)0x9Bu)
327 
328 /*========== Extern Constant and Variable Declarations ======================*/
329 
330 /*========== Extern Function Prototypes =====================================*/
331 
332 /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/
333 
334 #endif /* FOXBMS__MXM_41B_REGISTER_MAP_H_ */
MXM_41B_REG_ADD_t
uint8_t MXM_41B_REG_ADD_t
MAX17841B register addresses.
Definition: mxm_41b_register_map.h:76
MXM_41B_BUF_CMD_t
uint8_t MXM_41B_BUF_CMD_t
Type for MAX17841B buffer transaction commands.
Definition: mxm_41b_register_map.h:65