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