foxBMS-UnitTests  1.0.0
The foxBMS Unit Tests API Documentation
test_mxm_17841b.c
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 test_mxm_17841b.c
44  * @author foxBMS Team
45  * @date 2020-06-22 (date of creation)
46  * @updated 2020-06-24 (date of last update)
47  * @ingroup UNIT_TEST_IMPLEMENTATION
48  * @prefix MXM
49  *
50  * @brief Test for the Maxim MAX17841B driver.
51  *
52  * @details def
53  *
54  */
55 
56 /*========== Includes =======================================================*/
57 #include "unity.h"
58 #include "Mockfassert.h"
59 #include "Mockmxm_cfg.h"
60 
61 #include "mxm_17841b.h"
62 #include "mxm_bitextract.h"
63 
64 /*========== Definitions and Implementations for Unit Test ==================*/
67  .substate = MXM_41B_ENTRY_SUBSTATE,
68  .aliveCounter = 0,
69  .extendMessageBytes = 0,
70  .waitCounter = 0,
71  .regRXIntEnable = 0x00u,
72  .regTXIntEnable = 0x00u,
73  .regRXStatus = 0x00u,
74  .regTXStatus = 0x00u,
75  .regConfig1 = 0x60u,
76  .regConfig2 = 0x10u,
77  .regConfig3 = 0x0Fu,
78  .hwModel = 0,
79  .hwMaskRevision = 0,
80  .spiRXBuffer = {0},
81  .spiTXBuffer = {0},
82 };
83 
84 uint16_t commandBuffer[10] = {0};
85 uint16_t rxBuffer[100] = {0};
86 
88 
89 /*========== Setup and Teardown =============================================*/
90 void setUp(void) {
98  mxm_41b_state.regRXStatus = 0x00u;
99  mxm_41b_state.regTXStatus = 0x00u;
100  mxm_41b_state.regConfig1 = 0x60u;
101  mxm_41b_state.regConfig2 = 0x10u;
102  mxm_41b_state.regConfig3 = 0x0Fu;
105 
106  commandBuffer[0] = 0;
107  commandBuffer[1] = 0;
108  commandBuffer[2] = 0;
109  commandBuffer[3] = 0;
110  commandBuffer[4] = 0;
111  commandBuffer[5] = 0;
112  commandBuffer[6] = 0;
113  commandBuffer[7] = 0;
114  commandBuffer[8] = 0;
115  commandBuffer[9] = 0;
116 
118 }
119 
120 void tearDown(void) {
121 }
122 
123 /*========== Test Cases =====================================================*/
124 /* tests for function MXM_41BSetStateRequest */
125 
127  TEST_ASSERT_EQUAL(
128  STD_NOT_OK,
131  TEST_ASSERT_EQUAL(
132  STD_NOT_OK,
135  TEST_ASSERT_EQUAL(
136  STD_NOT_OK,
139  TEST_ASSERT_EQUAL(
140  STD_OK,
142 }
143 
145  /* start in Idle state */
147 
148  TEST_ASSERT_EQUAL(
149  STD_OK,
152 
153  /* try additional transition (even though not in idle state anymore) */
154  TEST_ASSERT_EQUAL(
155  STD_NOT_OK,
158 }
159 
161  TEST_ASSERT_EQUAL(
162  STD_OK,
164 }
165 
167  TEST_ASSERT_EQUAL(
168  STD_NOT_OK,
170 
171  TEST_ASSERT_EQUAL(
172  STD_NOT_OK,
174 
175  TEST_ASSERT_EQUAL(
176  STD_OK,
178 }
179 
181  TEST_ASSERT_EQUAL(
182  STD_NOT_OK,
184 
185  TEST_ASSERT_EQUAL(
186  STD_NOT_OK,
188 
189  TEST_ASSERT_EQUAL(
190  STD_OK,
192 }
193 
195  TEST_ASSERT_EQUAL(
196  STD_NOT_OK,
198 }
199 
200 /* end of tests for function MXM_41BSetStateRequest */
201 
202 /* tests for function MXM_41BWriteRegisterFunction */
204  TEST_ASSERT_EQUAL(STD_NOT_OK, MXM_41BWriteRegisterFunction(&mxm_41b_state, 0xFF, 0));
205 }
207  /* standard state should be only fourth bit set */
208  TEST_ASSERT_EQUAL(0x10u, mxm_41b_state.regConfig2);
209  TEST_ASSERT_EQUAL(
211  TEST_ASSERT_EQUAL(0x10u, mxm_41b_state.regConfig2);
212 
213  /* after writing register, fifth bit should be set in addition */
214  TEST_ASSERT_EQUAL(
216  TEST_ASSERT_EQUAL((0x10u | (1u << 5u)), mxm_41b_state.regConfig2);
217 
218  /* standard state should be third, second, first and zero bit set */
219  TEST_ASSERT_EQUAL(0xFu, mxm_41b_state.regConfig3);
220 
221  /* 0us --> 0 */
222  TEST_ASSERT_EQUAL(
223  STD_OK,
225  TEST_ASSERT_EQUAL(0x0u, mxm_41b_state.regConfig3);
226 
227  /* 10us --> 1 */
228  TEST_ASSERT_EQUAL(
229  STD_OK,
231  TEST_ASSERT_EQUAL(0x1u, mxm_41b_state.regConfig3);
232 
233  /* 640us --> 0x7 */
234  TEST_ASSERT_EQUAL(
235  STD_OK,
237  TEST_ASSERT_EQUAL(0x7u, mxm_41b_state.regConfig3);
238 
239  /* INF DLY --> 0xF */
240  TEST_ASSERT_EQUAL(
241  STD_OK,
243  TEST_ASSERT_EQUAL(0xFu, mxm_41b_state.regConfig3);
244 
245  /* standard state should be zero */
246  TEST_ASSERT_EQUAL(0x0u, mxm_41b_state.regRXIntEnable);
247 
248  /* rx error int on --> 0x80 */
249  TEST_ASSERT_EQUAL(
251  TEST_ASSERT_EQUAL(0x80u, mxm_41b_state.regRXIntEnable);
252 
253  /* rx error int off --> 0 */
254  TEST_ASSERT_EQUAL(
256  TEST_ASSERT_EQUAL(0x0u, mxm_41b_state.regRXIntEnable);
257 
258  /* standard state should be zero */
259  TEST_ASSERT_EQUAL(0x0u, mxm_41b_state.regRXIntEnable);
260 
261  /* rx overflow int on --> 0x8 */
262  TEST_ASSERT_EQUAL(
264  TEST_ASSERT_EQUAL(0x8u, mxm_41b_state.regRXIntEnable);
265 
266  /* rx overflow int off --> 0 */
267  TEST_ASSERT_EQUAL(
269  TEST_ASSERT_EQUAL(0x0u, mxm_41b_state.regRXIntEnable);
270 }
271 /* end of tests for function MXM_41BWriteRegisterFunction */
272 
273 /* tests for function MXM_41BReadRegisterFunction */
275  TEST_ASSERT_EQUAL(STD_NOT_OK, MXM_41BReadRegisterFunction(&mxm_41b_state, 0xFF, 0));
276 }
278  MXM_41B_REG_BIT_VALUE result = 42;
279  /* set register */
281 
282  /* read all functions in this register */
283  TEST_ASSERT_EQUAL(
285  TEST_ASSERT_EQUAL(MXM_41B_REG_FALSE, result);
286 
287  TEST_ASSERT_EQUAL(
289  TEST_ASSERT_EQUAL(MXM_41B_REG_FALSE, result);
290 
291  /* set register with bit RX_EMPTY */
293 
294  /* read all functions in this register */
295  TEST_ASSERT_EQUAL(
297  TEST_ASSERT_EQUAL(MXM_41B_REG_FALSE, result);
298 
299  TEST_ASSERT_EQUAL(
301  TEST_ASSERT_EQUAL(MXM_41B_REG_TRUE, result);
302 
303  /* set register with bit RX_BUSY */
304  mxm_41b_state.regRXStatus = 0x20u;
305 
306  /* read all functions in this register */
307  TEST_ASSERT_EQUAL(
309  TEST_ASSERT_EQUAL(MXM_41B_REG_TRUE, result);
310 
311  TEST_ASSERT_EQUAL(
313  TEST_ASSERT_EQUAL(MXM_41B_REG_FALSE, result);
314 
315  /* set register to zero */
317 
318  /* read all functions in this register */
320  TEST_ASSERT_EQUAL(MXM_41B_REG_FALSE, result);
321 
322  /* set register with TX_PREAMBLES */
323  mxm_41b_state.regConfig2 = 0x20u;
324 
325  /* read all functions in this register */
327  TEST_ASSERT_EQUAL(MXM_41B_REG_TRUE, result);
328 }
329 /* end of tests for function MXM_41BReadRegisterFunction */
330 
331 /* tests for the state-machine */
336 }
337 
339  /* force state-machine in idle state */
341 
342  TEST_ASSERT_EQUAL(MXM_STATEMACH_41B_IDLE, mxm_41b_state.state);
344  TEST_ASSERT_EQUAL(MXM_STATEMACH_41B_IDLE, mxm_41b_state.state);
345 }
346 
347 void testStateCheckFMEA(void) {
348  /* force state-machine in check_fmea state */
350 
352 
353  /* create a buffer with the assumed output of the ASCI and inject into SPI read */
354  uint16_t rxBuffer[10] = {0x13u, 0x00u};
355  MXM_ReceiveData_ExpectAndReturn(mxm_41b_state.spiTXBuffer, mxm_41b_state.spiRXBuffer, 2, STD_OK);
356  MXM_ReceiveData_ReturnArrayThruPtr_rxBuffer(rxBuffer, 2);
359 
360  /* check if the values are parsed correctly */
361  MXM_GetSPIStateReady_ExpectAndReturn(STD_OK);
363  TEST_ASSERT_EQUAL(MXM_STATEMACH_41B_IDLE, mxm_41b_state.state);
364  TEST_ASSERT_EQUAL(MXM_41B_STATE_PROCESSED, status41b);
365 }
366 
368  /* force state-machine in check_fmea state */
370 
372 
373  /* create a buffer with the assumed output of the ASCI and inject into SPI read */
374  /* simulate an GNDL Alert in FMEA register */
375  uint16_t rxBuffer[10] = {0x13u, 0x01u};
376  MXM_ReceiveData_ExpectAndReturn(mxm_41b_state.spiTXBuffer, mxm_41b_state.spiRXBuffer, 2, STD_OK);
377  MXM_ReceiveData_ReturnArrayThruPtr_rxBuffer(rxBuffer, 2);
380 
381  /* check if the values are parsed correctly */
382  MXM_GetSPIStateReady_ExpectAndReturn(STD_OK);
384  TEST_ASSERT_EQUAL(MXM_STATEMACH_41B_IDLE, mxm_41b_state.state);
385  TEST_ASSERT_EQUAL(MXM_41B_STATE_ERROR, status41b);
386 }
387 
389  /* force state-machine in get_version state */
391 
393 
394  /* create a buffer with the assumed output of the ASCI and inject into SPI read */
395  uint16_t rxBuffer[10] = {0x15u, 0x84u, 0x12u};
396  MXM_ReceiveData_ExpectAndReturn(mxm_41b_state.spiTXBuffer, mxm_41b_state.spiRXBuffer, 3, STD_OK);
397  MXM_ReceiveData_ReturnArrayThruPtr_rxBuffer(rxBuffer, 3);
400 
401  /* check if the values are parsed correctly */
402  MXM_GetSPIStateReady_ExpectAndReturn(STD_OK);
404  TEST_ASSERT_EQUAL(0x841u, mxm_41b_state.hwModel);
405  TEST_ASSERT_EQUAL(0x2u, mxm_41b_state.hwMaskRevision);
406 }
407 
409  /* force state-machine in clear_receive_buffer state */
411 
413 
414  /* create a buffer with the assumed input to the ASCI */
415  uint16_t tx_buffer[10] = {0xE0u};
416  MXM_SendData_ExpectAndReturn(tx_buffer, 1, STD_OK);
418 
419  /* check if the write was successful */
420  TEST_ASSERT_EQUAL(MXM_STATEMACH_41B_IDLE, mxm_41b_state.state);
421  TEST_ASSERT_EQUAL(MXM_41B_STATE_PROCESSED, status41b);
422 }
423 
425  /* force state-machine in clear_receive_buffer state */
427 
429 
430  /* create a buffer with the assumed input to the ASCI */
431  uint16_t tx_buffer[10] = {0xE0u};
432  /* simulate a failure of writing */
433  MXM_SendData_ExpectAndReturn(tx_buffer, 1, STD_NOT_OK);
435 
436  /* check if the write was successful */
438  TEST_ASSERT_EQUAL(MXM_41B_STATE_ERROR, status41b);
439 }
440 
442  /* force state-machine in clear_transmit_buffer state */
444 
446 
447  /* create a buffer with the assumed input to the ASCI */
448  uint16_t tx_buffer[10] = {0x20u};
449  MXM_SendData_ExpectAndReturn(tx_buffer, 1, STD_OK);
451 
452  /* check if the write was successful */
453  TEST_ASSERT_EQUAL(MXM_STATEMACH_41B_IDLE, mxm_41b_state.state);
454  TEST_ASSERT_EQUAL(MXM_41B_STATE_PROCESSED, status41b);
455 }
456 
458  /* force state-machine in clear_transmit_buffer state */
460 
462 
463  /* create a buffer with the assumed input to the ASCI */
464  uint16_t tx_buffer[10] = {0x20u};
465  /* simulate a failure of writing */
466  MXM_SendData_ExpectAndReturn(tx_buffer, 1, STD_NOT_OK);
468 
469  /* check if the write was successful */
471  TEST_ASSERT_EQUAL(MXM_41B_STATE_ERROR, status41b);
472 }
473 
475  /* force state-machine in MXM_41B_UART_WAIT_FOR_RX_STATUS_CHANGE_READ_AND_READ_BACK_RCV_BUF */
478  /* prepare RX buffer with not received RX_Stop_Status bit */
479  mxm_41b_state.spiRXBuffer[1] = 0;
480 
481  /* transition */
483 
485 }
486 
488  /* force state-machine in MXM_41B_UART_WAIT_FOR_RX_STATUS_CHANGE_READ_AND_READ_BACK_RCV_BUF */
491  /* prepare RX buffer with received RX_Stop_Status bit */
492  mxm_41b_state.spiRXBuffer[1] |= (0x01u << 1u);
493 
494  /* transition */
495  MXM_ReceiveData_IgnoreAndReturn(STD_OK);
497 
499 }
500 
501 /* end tests for the state-machine */
testStateRequestInconsistentInputPayload
void testStateRequestInconsistentInputPayload(void)
Definition: test_mxm_17841b.c:166
MXM_STATEMACH_41B_INIT
@ MXM_STATEMACH_41B_INIT
Definition: mxm_17841b.h:82
testStateCheckFMEA
void testStateCheckFMEA(void)
Definition: test_mxm_17841b.c:347
MXM_41B_REG_KEEP_ALIVE_INF_DLY
#define MXM_41B_REG_KEEP_ALIVE_INF_DLY
Definition: mxm_bitextract.h:107
MXM_41B_REG_FUNCTION_RX_ERROR_INT
@ MXM_41B_REG_FUNCTION_RX_ERROR_INT
Definition: mxm_17841b.h:139
testStateRequestInconsistentInputProcessed
void testStateRequestInconsistentInputProcessed(void)
Definition: test_mxm_17841b.c:194
MXM_41B_INSTANCE::regTXIntEnable
uint8_t regTXIntEnable
Definition: mxm_17841b.h:161
MXM_41B_INSTANCE::spiRXBuffer
uint16_t spiRXBuffer[100]
Definition: mxm_17841b.h:169
MXM_41BStateMachine
void MXM_41BStateMachine(MXM_41B_INSTANCE_s *pInstance)
Execute state-machine for the MAX17841B.
Definition: mxm_17841b.c:428
MXM_STATEMACH_41B_CLEAR_TRANSMIT_BUFFER
@ MXM_STATEMACH_41B_CLEAR_TRANSMIT_BUFFER
Definition: mxm_17841b.h:90
commandBuffer
uint16_t commandBuffer[10]
Definition: test_mxm_17841b.c:84
MXM_41BWriteRegisterFunction
STD_RETURN_TYPE_e MXM_41BWriteRegisterFunction(MXM_41B_INSTANCE_s *pInstance, MXM_41B_REG_FUNCTION_e registerFunction, MXM_41B_REG_BIT_VALUE value)
Write a register function.
Definition: mxm_17841b.c:347
mxm_17841b.h
Headers for the driver for the MAX17841B ASCI and MAX1785x monitoring chip.
MXM_STATEMACH_41B_MAXSTATE
@ MXM_STATEMACH_41B_MAXSTATE
Definition: mxm_17841b.h:91
MXM_41B_INSTANCE::substate
MXM_41B_SUBSTATES_e substate
Definition: mxm_17841b.h:151
MXM_41BSetStateRequest
STD_RETURN_TYPE_e MXM_41BSetStateRequest(MXM_41B_INSTANCE_s *pInstance, MXM_STATEMACH_41B_e state, uint16_t *pPayload, uint16_t payloadLength, uint8_t extendMessageBytes, uint16_t *pRxBuffer, uint16_t rxBufferLength, MXM_41B_STATE_REQUEST_STATUS_e *processed)
Set state transition for MAX17841B-state-machine.
Definition: mxm_17841b.c:291
MXM_41B_ENTRY_SUBSTATE
@ MXM_41B_ENTRY_SUBSTATE
Definition: mxm_17841b.h:98
MXM_41B_INSTANCE::spiTXBuffer
uint16_t spiTXBuffer[MXM_SPI_TX_BUFFER_LENGTH]
Definition: mxm_17841b.h:170
MXM_41B_REG_FUNCTION_RX_BUSY_STATUS
@ MXM_41B_REG_FUNCTION_RX_BUSY_STATUS
Definition: mxm_17841b.h:134
MXM_STATEMACH_41B_IDLE
@ MXM_STATEMACH_41B_IDLE
Definition: mxm_17841b.h:83
testStateClearReceiveBuffer
void testStateClearReceiveBuffer(void)
Definition: test_mxm_17841b.c:408
testReadRegisterFunctionWithIllegalValues
void testReadRegisterFunctionWithIllegalValues(void)
Definition: test_mxm_17841b.c:274
MXM_41B_INSTANCE::regRXStatus
uint8_t regRXStatus
Definition: mxm_17841b.h:162
MXM_STATEMACH_41B_UART_TRANSACTION
@ MXM_STATEMACH_41B_UART_TRANSACTION
Definition: mxm_17841b.h:88
MXM_41B_REG_FUNCTION_RX_EMPTY_STATUS
@ MXM_41B_REG_FUNCTION_RX_EMPTY_STATUS
Definition: mxm_17841b.h:136
testOnlyAllowedTransitionFromUnitializedIsInit
void testOnlyAllowedTransitionFromUnitializedIsInit(void)
Definition: test_mxm_17841b.c:126
testStateStayInIdle
void testStateStayInIdle(void)
Definition: test_mxm_17841b.c:338
MXM_41B_INSTANCE::extendMessageBytes
uint8_t extendMessageBytes
Definition: mxm_17841b.h:158
testStateRequestInconsistentInputRXBuffer
void testStateRequestInconsistentInputRXBuffer(void)
Definition: test_mxm_17841b.c:180
MXM_41B_REG_KEEP_ALIVE_0US
#define MXM_41B_REG_KEEP_ALIVE_0US
Definition: mxm_bitextract.h:83
MXM_41B_REG_FUNCTION_KEEP_ALIVE
@ MXM_41B_REG_FUNCTION_KEEP_ALIVE
Definition: mxm_17841b.h:138
MXM_41B_INSTANCE::regTXStatus
uint8_t regTXStatus
Definition: mxm_17841b.h:163
MXM_41B_STATE_REQUEST_STATUS_e
enum MXM_41B_STATE_REQUEST_STATUS MXM_41B_STATE_REQUEST_STATUS_e
Request status of MAX17841B states.
testStateClearReceiveBufferFailedSPIWrite
void testStateClearReceiveBufferFailedSPIWrite(void)
Definition: test_mxm_17841b.c:424
MXM_STATEMACH_41B_UNINITIALIZED
@ MXM_STATEMACH_41B_UNINITIALIZED
Definition: mxm_17841b.h:81
MXM_41B_REG_FUNCTION_RX_OVERFLOW_INT
@ MXM_41B_REG_FUNCTION_RX_OVERFLOW_INT
Definition: mxm_17841b.h:140
testStateCheckFMEAGNDLAlert
void testStateCheckFMEAGNDLAlert(void)
Definition: test_mxm_17841b.c:367
testStateStayInUninitialized
void testStateStayInUninitialized(void)
Definition: test_mxm_17841b.c:332
MXM_41B_INSTANCE::regRXIntEnable
uint8_t regRXIntEnable
Definition: mxm_17841b.h:160
testStateUARTWaitForRXStatusChangeFail
void testStateUARTWaitForRXStatusChangeFail(void)
Definition: test_mxm_17841b.c:474
MXM_41B_UART_READ_BACK_RECEIVE_BUFFER_SAVE
@ MXM_41B_UART_READ_BACK_RECEIVE_BUFFER_SAVE
Definition: mxm_17841b.h:112
STD_OK
@ STD_OK
Definition: fstd_types.h:72
tearDown
void tearDown(void)
Definition: test_mxm_17841b.c:120
MXM_STATEMACH_41B_GET_VERSION
@ MXM_STATEMACH_41B_GET_VERSION
Definition: mxm_17841b.h:85
MXM_41B_INSTANCE::hwMaskRevision
uint8_t hwMaskRevision
Definition: mxm_17841b.h:168
MXM_41B_INSTANCE::regConfig2
uint8_t regConfig2
Definition: mxm_17841b.h:165
STD_NOT_OK
@ STD_NOT_OK
Definition: fstd_types.h:73
MXM_41B_INSTANCE::state
MXM_STATEMACH_41B_e state
Definition: mxm_17841b.h:150
testStateGetVersion
void testStateGetVersion(void)
Definition: test_mxm_17841b.c:388
MXM_41B_INSTANCE
Struct for the state-variable of state-machine.
Definition: mxm_17841b.h:149
MXM_41B_STATE_PROCESSED
@ MXM_41B_STATE_PROCESSED
Definition: mxm_17841b.h:126
status41b
MXM_41B_STATE_REQUEST_STATUS_e status41b
Definition: test_mxm_17841b.c:87
testWriteRegisterFunctionWithLegalValues
void testWriteRegisterFunctionWithLegalValues(void)
Definition: test_mxm_17841b.c:206
testStateRequestConsistentInput
void testStateRequestConsistentInput(void)
Definition: test_mxm_17841b.c:160
setUp
void setUp(void)
Definition: test_mxm_17841b.c:90
MXM_41BReadRegisterFunction
STD_RETURN_TYPE_e MXM_41BReadRegisterFunction(MXM_41B_INSTANCE_s *pInstance, MXM_41B_REG_FUNCTION_e registerFunction, MXM_41B_REG_BIT_VALUE *pValue)
Read the value of a register function.
Definition: mxm_17841b.c:391
testStateClearTransmitBufferFailedSPIWrite
void testStateClearTransmitBufferFailedSPIWrite(void)
Definition: test_mxm_17841b.c:457
testWriteRegisterFunctionWithIllegalValues
void testWriteRegisterFunctionWithIllegalValues(void)
Definition: test_mxm_17841b.c:203
mxm_41b_state
static MXM_41B_INSTANCE_s mxm_41b_state
Definition: test_mxm_17841b.c:65
MXM_41B_REG_KEEP_ALIVE_640US
#define MXM_41B_REG_KEEP_ALIVE_640US
Definition: mxm_bitextract.h:97
MXM_41B_UART_WAIT_FOR_RX_STATUS_CHANGE_WRITE
@ MXM_41B_UART_WAIT_FOR_RX_STATUS_CHANGE_WRITE
Definition: mxm_17841b.h:110
MXM_41B_REG_KEEP_ALIVE_10US
#define MXM_41B_REG_KEEP_ALIVE_10US
Definition: mxm_bitextract.h:85
MXM_41B_REG_FUNCTION_TX_PREAMBLES
@ MXM_41B_REG_FUNCTION_TX_PREAMBLES
Definition: mxm_17841b.h:137
MXM_41B_STATE_UNPROCESSED
@ MXM_41B_STATE_UNPROCESSED
Definition: mxm_17841b.h:125
MXM_41B_INSTANCE::hwModel
uint16_t hwModel
Definition: mxm_17841b.h:167
MXM_41B_REG_BIT_VALUE
uint8_t MXM_41B_REG_BIT_VALUE
Bit-values for registers.
Definition: mxm_bitextract.h:69
NULL_PTR
#define NULL_PTR
Null pointer.
Definition: fstd_types.h:66
MXM_41B_UART_WAIT_FOR_RX_STATUS_CHANGE_READ_AND_READ_BACK_RCV_BUF
@ MXM_41B_UART_WAIT_FOR_RX_STATUS_CHANGE_READ_AND_READ_BACK_RCV_BUF
Definition: mxm_17841b.h:111
MXM_41B_STATE_ERROR
@ MXM_41B_STATE_ERROR
Definition: mxm_17841b.h:127
testStateClearTransmitBuffer
void testStateClearTransmitBuffer(void)
Definition: test_mxm_17841b.c:441
MXM_STATEMACH_41B_CHECK_FMEA
@ MXM_STATEMACH_41B_CHECK_FMEA
Definition: mxm_17841b.h:84
testStateUARTWaitForRXStatusChangeSuccess
void testStateUARTWaitForRXStatusChangeSuccess(void)
Definition: test_mxm_17841b.c:487
MXM_41B_REG_TRUE
#define MXM_41B_REG_TRUE
Definition: mxm_bitextract.h:73
rxBuffer
uint16_t rxBuffer[100]
Definition: test_mxm_17841b.c:85
MXM_41B_INSTANCE::waitCounter
uint8_t waitCounter
Definition: mxm_17841b.h:159
mxm_bitextract.h
Bit extraction function for MXM_17841b.
MXM_41B_INSTANCE::regConfig1
uint8_t regConfig1
Definition: mxm_17841b.h:164
testReadRegisterFunctionWithLegalValues
void testReadRegisterFunctionWithLegalValues(void)
Definition: test_mxm_17841b.c:277
MXM_41B_INSTANCE::aliveCounter
uint16_t aliveCounter
Definition: mxm_17841b.h:157
MXM_41B_INSTANCE::regConfig3
uint8_t regConfig3
Definition: mxm_17841b.h:166
MXM_41B_REG_FALSE
#define MXM_41B_REG_FALSE
Definition: mxm_bitextract.h:71
testTransitionsOnlyAllowedInIdleAfterInit
void testTransitionsOnlyAllowedInIdleAfterInit(void)
Definition: test_mxm_17841b.c:144
MXM_STATEMACH_41B_CLEAR_RECEIVE_BUFFER
@ MXM_STATEMACH_41B_CLEAR_RECEIVE_BUFFER
Definition: mxm_17841b.h:89