56 #include "Mockcontactor.h"
57 #include "Mockcontactor_cfg.h"
58 #include "Mockdatabase.h"
63 #include "Mockpex_cfg.h"
65 #include "Mockspi_cfg.h"
66 #include "Mocksps_cfg.h"
67 #include "Mocksps_types.h"
86 .pGioPort = &(spiREG3->PC3),
137 OS_EnterTaskCritical_Ignore();
138 OS_ExitTaskCritical_Ignore();
152 OS_EnterTaskCritical_Ignore();
153 OS_ExitTaskCritical_Ignore();
161 OS_EnterTaskCritical_Ignore();
162 OS_ExitTaskCritical_Ignore();
190 OS_EnterTaskCritical_Ignore();
191 OS_ExitTaskCritical_Ignore();
208 OS_EnterTaskCritical_Ignore();
209 OS_ExitTaskCritical_Ignore();
217 const uint8_t defaultTimer = 5u;
233 IO_PinReset_IgnoreArg_pRegisterAddress();
251 IO_PinSet_IgnoreArg_pRegisterAddress();
262 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_OK);
263 MCU_delay_us_Ignore();
276 MCU_delay_us_Ignore();
278 SPI_TransmitReceiveData_IgnoreArg_pSpiInterface();
279 SPI_TransmitReceiveData_IgnoreArg_pTxBuff();
280 SPI_TransmitReceiveData_IgnoreArg_pRxBuff();
281 SPI_TransmitReceiveData_IgnoreArg_frameLength();
283 SPI_TransmitReceiveData_IgnoreArg_pSpiInterface();
284 SPI_TransmitReceiveData_IgnoreArg_pTxBuff();
285 SPI_TransmitReceiveData_IgnoreArg_pRxBuff();
286 SPI_TransmitReceiveData_IgnoreArg_frameLength();
295 MCU_delay_us_Ignore();
297 SPI_TransmitReceiveData_IgnoreArg_pSpiInterface();
298 SPI_TransmitReceiveData_IgnoreArg_pTxBuff();
299 SPI_TransmitReceiveData_IgnoreArg_pRxBuff();
300 SPI_TransmitReceiveData_IgnoreArg_frameLength();
302 SPI_TransmitReceiveData_IgnoreArg_pSpiInterface();
303 SPI_TransmitReceiveData_IgnoreArg_pTxBuff();
304 SPI_TransmitReceiveData_IgnoreArg_pRxBuff();
305 SPI_TransmitReceiveData_IgnoreArg_frameLength();
314 MCU_delay_us_Ignore();
315 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_NOT_OK);
324 MCU_delay_us_Ignore();
325 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_NOT_OK);
335 MCU_delay_us_Ignore();
336 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_NOT_OK);
346 MCU_delay_us_Ignore();
347 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_NOT_OK);
357 MCU_delay_us_Ignore();
358 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_NOT_OK);
368 MCU_delay_us_Ignore();
369 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_NOT_OK);
379 MCU_delay_us_Ignore();
380 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_NOT_OK);
390 MCU_delay_us_Ignore();
391 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_NOT_OK);
401 MCU_delay_us_Ignore();
402 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_OK);
427 OS_EnterTaskCritical_Ignore();
428 OS_ExitTaskCritical_Ignore();
453 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_OK);
454 MCU_delay_us_Ignore();
486 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_OK);
487 MCU_delay_us_Ignore();
#define NULL_PTR
Null pointer.
#define PEX_PORT_EXPANDER1
CONT_ELECTRICAL_STATE_TYPE_e SPS_GetChannelPexFeedback(const SPS_CHANNEL_INDEX channelIndex, bool normallyOpen)
Get the feedback state of a channel.
SPS_CHANNEL_AFFILIATION_e SPS_GetChannelAffiliation(SPS_CHANNEL_INDEX channelIndex)
Returns the channel affiliation.
void TEST_SPS_RequestChannelState(SPS_CHANNEL_INDEX channelIndex, SPS_CHANNEL_FUNCTION_e channelFunction)
void SPS_Ctrl(void)
Control function for the CONT driver state machine.
uint8_t TEST_SPS_GetSpsTimer(void)
void TEST_SPS_SetSpsTimer(const uint8_t newTimer)
void SPS_RequestGeneralIOState(SPS_CHANNEL_INDEX channelIndex, SPS_CHANNEL_FUNCTION_e channelFunction)
Request state of a general IO.
CONT_ELECTRICAL_STATE_TYPE_e SPS_GetChannelCurrentFeedback(const SPS_CHANNEL_INDEX channelIndex)
Get feedback value.
void SPS_RequestContactorState(SPS_CHANNEL_INDEX channelIndex, SPS_CHANNEL_FUNCTION_e channelFunction)
Request state of a contactor.
SPS_STATE_e TEST_SPS_GetSpsState(void)
void TEST_SPS_SetSpsState(const SPS_STATE_e newState)
Headers for the driver for the smart power switches.
#define SPS_CHANNEL_ON_DEFAULT_THRESHOLD_mA
#define SPS_NR_OF_AVAILABLE_SPS_CHANNELS
@ SPS_TRIGGER_CURRENT_MEASUREMENT
@ SPS_CONFIGURE_CONTROL_REGISTER
@ SPS_READ_MEASURED_CURRENT2
@ SPS_READ_MEASURED_CURRENT1
@ SPS_READ_MEASURED_CURRENT3
@ SPS_READ_MEASURED_CURRENT4
uint8_t SPS_CHANNEL_INDEX
SPS_CHANNEL_FUNCTION_e channelRequested
SPS_CHANNEL_FUNCTION_e channel
#define TEST_ASSERT_PASS_ASSERT(_code_under_test)
assert whether assert macro has passed
#define TEST_ASSERT_FAIL_ASSERT(_code_under_test)
assert whether assert macro has failed
void testSPS_RequestChannelStateSwitchOn(void)
void testSPS_RequestGeneralIOStateWrongAffiliation(void)
void testContactorSwitchOnAndOff(void)
void testSPS_RequestContactorStateCorrectAffiliation(void)
void testSPS_RequestChannelStateInvalidFunction(void)
void testSPS_CtrlResetFromStateSPS_TRIGGER_CURRENT_MEASUREMENT(void)
SPS_CHANNEL_STATE_s sps_channelStatus[SPS_NR_OF_AVAILABLE_SPS_CHANNELS]
void testSPS_CtrlNormalOperationCycle(void)
void testSPS_GetChannelFeedbackChannelLow(void)
void testSPS_CtrlResetFromStateSPS_READ_MEASURED_CURRENT3(void)
void testSPS_CtrlResetFromStateSPS_READ_MEASURED_CURRENT4(void)
void testSPS_CtrlResetFromStateSPS_READ_EN_IRQ_PIN(void)
void testSPS_RequestGIOStateCorrectAffiliation(void)
void testSPS_CtrlStartupProcedure(void)
void testSPS_GetChannelAffiliationValidIndex(void)
void testSPS_CtrlResetFromStateSPS_READ_MEASURED_CURRENT1(void)
void testSPS_CtrlResetOnFailedSecondTransaction(void)
void testSPS_CtrlAssertOnIllegalState(void)
void testSPS_RequestGeneralIOStateWrongIndex(void)
void testSPS_RequestContactorStateWrongAffiliation(void)
void testSPS_GetChannelAffiliationInvalidIndex(void)
void testSPS_CtrlResetOnFailedBothTransactions(void)
void testSPS_RequestContactorStateWrongIndex(void)
void testSPS_GetChannelPexFeedback(void)
const SPS_CHANNEL_FEEDBACK_MAPPING_s sps_kChannelFeedbackMapping[SPS_NR_OF_AVAILABLE_SPS_CHANNELS]
static const spiDAT1_t spi_kSpsDataConfig
void testSPS_CtrlResetFromStateSPS_READ_MEASURED_CURRENT2(void)
void testSPS_CtrlResetOnFailedFirstTransaction(void)
void testSPS_GetChannelFeedbackChannelHigh(void)
SPI_INTERFACE_CONFIG_s spi_spsInterface
void testSPS_GetChannelFeedbackInvalidChannelIndex(void)
void testSPS_RequestChannelStateInvalidIndex(void)
void testSPS_CtrlResetFromStateSPS_CONFIGURE_CONTROL_REGISTER(void)