58 #include "Mockfassert.h"
59 #include "Mockmxm_cfg.h"
70 .extendMessageBytes = 0,
72 .regRXIntEnable = 0x00u,
73 .regTXIntEnable = 0x00u,
358 uint16_t
rxBuffer[10] = {0x13u, 0x00u};
360 MXM_ReceiveData_ReturnArrayThruPtr_rxBuffer(
rxBuffer, 2);
365 MXM_GetSPIStateReady_ExpectAndReturn(
STD_OK);
379 uint16_t
rxBuffer[10] = {0x13u, 0x01u};
381 MXM_ReceiveData_ReturnArrayThruPtr_rxBuffer(
rxBuffer, 2);
386 MXM_GetSPIStateReady_ExpectAndReturn(
STD_OK);
399 uint16_t
rxBuffer[10] = {0x15u, 0x84u, 0x12u};
401 MXM_ReceiveData_ReturnArrayThruPtr_rxBuffer(
rxBuffer, 3);
406 MXM_GetSPIStateReady_ExpectAndReturn(
STD_OK);
419 uint16_t tx_buffer[10] = {0xE0u};
420 MXM_SendData_ExpectAndReturn(tx_buffer, 1,
STD_OK);
435 uint16_t tx_buffer[10] = {0xE0u};
437 MXM_SendData_ExpectAndReturn(tx_buffer, 1,
STD_NOT_OK);
452 uint16_t tx_buffer[10] = {0x20u};
453 MXM_SendData_ExpectAndReturn(tx_buffer, 1,
STD_OK);
468 uint16_t tx_buffer[10] = {0x20u};
470 MXM_SendData_ExpectAndReturn(tx_buffer, 1,
STD_NOT_OK);
499 MXM_ReceiveData_IgnoreAndReturn(
STD_OK);
#define NULL_PTR
Null pointer.
void MXM_41BStateMachine(MXM_41B_INSTANCE_s *pInstance)
Execute state-machine for the MAX17841B.
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.
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.
STD_RETURN_TYPE_e MXM_41BReadRegisterFunction(const MXM_41B_INSTANCE_s *const kpkInstance, MXM_41B_REG_FUNCTION_e registerFunction, MXM_41B_REG_BIT_VALUE *pValue)
Read the value of a register function.
Headers for the driver for the MAX17841B ASCI and MAX1785x monitoring chip.
enum MXM_41B_STATE_REQUEST_STATUS MXM_41B_STATE_REQUEST_STATUS_e
Request status of MAX17841B states.
@ MXM_41B_STATE_UNPROCESSED
@ MXM_41B_STATE_PROCESSED
@ MXM_41B_REG_FUNCTION_RX_BUSY_STATUS
@ MXM_41B_REG_FUNCTION_RX_EMPTY_STATUS
@ MXM_41B_REG_FUNCTION_TX_PREAMBLES
@ MXM_41B_REG_FUNCTION_RX_ERROR_INT
@ MXM_41B_REG_FUNCTION_KEEP_ALIVE
@ MXM_41B_REG_FUNCTION_RX_OVERFLOW_INT
@ MXM_STATEMACH_41B_MAXSTATE
@ MXM_STATEMACH_41B_GET_VERSION
@ MXM_STATEMACH_41B_CLEAR_RECEIVE_BUFFER
@ MXM_STATEMACH_41B_CLEAR_TRANSMIT_BUFFER
@ MXM_STATEMACH_41B_UNINITIALIZED
@ MXM_STATEMACH_41B_CHECK_FMEA
@ MXM_STATEMACH_41B_UART_TRANSACTION
@ MXM_41B_UART_WAIT_FOR_RX_STATUS_CHANGE_WRITE
@ MXM_41B_UART_READ_BACK_RECEIVE_BUFFER_SAVE
@ MXM_41B_UART_WAIT_FOR_RX_STATUS_CHANGE_READ_AND_READ_BACK_RCV_BUF
Struct for the state-variable of state-machine.
uint16_t spiRXBuffer[100]
MXM_STATEMACH_41B_e state
MXM_41B_SUBSTATES_e substate
uint8_t extendMessageBytes
uint16_t spiTXBuffer[MXM_SPI_TX_BUFFER_LENGTH]
#define TEST_ASSERT_FAIL_ASSERT(_code_under_test)
assert whether assert macro has failed
void testStateGetVersion(void)
void testStateClearTransmitBuffer(void)
void testWriteRegisterFunctionWithLegalValues(void)
void testStateRequestInconsistentInputPayload(void)
void testStateClearTransmitBufferFailedSPIWrite(void)
void testTransitionsOnlyAllowedInIdleAfterInit(void)
uint16_t commandBuffer[10]
void testWriteRegisterFunctionWithIllegalValues(void)
MXM_41B_STATE_REQUEST_STATUS_e status41b
void testStateClearReceiveBufferFailedSPIWrite(void)
void testStateRequestConsistentInput(void)
void testStateStayInIdle(void)
static MXM_41B_INSTANCE_s mxm_41b_state
void testStateUARTWaitForRXStatusChangeFail(void)
void testStateRequestInconsistentInputRXBuffer(void)
void testStateCheckFMEAGNDLAlert(void)
void testStateStayInUninitialized(void)
void testReadRegisterFunctionWithIllegalValues(void)
void testStateClearReceiveBuffer(void)
void testStateCheckFMEA(void)
void testReadRegisterFunctionWithLegalValues(void)
void testOnlyAllowedTransitionFromUnitializedIsInit(void)
void testStateUARTWaitForRXStatusChangeSuccess(void)
void testStateRequestInconsistentInputProcessed(void)