56 #include "Mockcontactor.h"
57 #include "Mockcontactor_cfg.h"
58 #include "Mockdatabase.h"
63 #include "Mockspi_cfg.h"
64 #include "Mocksps_cfg.h"
65 #include "Mocksps_types.h"
85 .pGioPort = &(spiREG3->PC3),
129 OS_EnterTaskCritical_Ignore();
130 OS_ExitTaskCritical_Ignore();
144 OS_EnterTaskCritical_Ignore();
145 OS_ExitTaskCritical_Ignore();
153 OS_EnterTaskCritical_Ignore();
154 OS_ExitTaskCritical_Ignore();
182 OS_EnterTaskCritical_Ignore();
183 OS_ExitTaskCritical_Ignore();
200 OS_EnterTaskCritical_Ignore();
201 OS_ExitTaskCritical_Ignore();
209 const uint8_t defaultTimer = 5u;
225 IO_PinReset_IgnoreArg_pRegisterAddress();
243 IO_PinSet_IgnoreArg_pRegisterAddress();
254 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_OK);
255 MCU_delay_us_Ignore();
268 MCU_delay_us_Ignore();
270 SPI_TransmitReceiveData_IgnoreArg_pSpiInterface();
271 SPI_TransmitReceiveData_IgnoreArg_pTxBuff();
272 SPI_TransmitReceiveData_IgnoreArg_pRxBuff();
273 SPI_TransmitReceiveData_IgnoreArg_frameLength();
275 SPI_TransmitReceiveData_IgnoreArg_pSpiInterface();
276 SPI_TransmitReceiveData_IgnoreArg_pTxBuff();
277 SPI_TransmitReceiveData_IgnoreArg_pRxBuff();
278 SPI_TransmitReceiveData_IgnoreArg_frameLength();
287 MCU_delay_us_Ignore();
289 SPI_TransmitReceiveData_IgnoreArg_pSpiInterface();
290 SPI_TransmitReceiveData_IgnoreArg_pTxBuff();
291 SPI_TransmitReceiveData_IgnoreArg_pRxBuff();
292 SPI_TransmitReceiveData_IgnoreArg_frameLength();
294 SPI_TransmitReceiveData_IgnoreArg_pSpiInterface();
295 SPI_TransmitReceiveData_IgnoreArg_pTxBuff();
296 SPI_TransmitReceiveData_IgnoreArg_pRxBuff();
297 SPI_TransmitReceiveData_IgnoreArg_frameLength();
306 MCU_delay_us_Ignore();
307 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_NOT_OK);
316 MCU_delay_us_Ignore();
317 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_NOT_OK);
327 MCU_delay_us_Ignore();
328 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_NOT_OK);
338 MCU_delay_us_Ignore();
339 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_NOT_OK);
349 MCU_delay_us_Ignore();
350 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_NOT_OK);
360 MCU_delay_us_Ignore();
361 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_NOT_OK);
371 MCU_delay_us_Ignore();
372 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_NOT_OK);
382 MCU_delay_us_Ignore();
383 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_NOT_OK);
393 MCU_delay_us_Ignore();
394 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_OK);
419 OS_EnterTaskCritical_Ignore();
420 OS_ExitTaskCritical_Ignore();
445 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_OK);
446 MCU_delay_us_Ignore();
478 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_OK);
479 MCU_delay_us_Ignore();
#define NULL_PTR
Null pointer.
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.
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)
CONT_ELECTRICAL_STATE_TYPE_e SPS_GetChannelFeedback(SPS_CHANNEL_INDEX channelIndex)
Get feedback value.
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)
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)