57 #include "Mockcontactor.h"
58 #include "Mockcontactor_cfg.h"
59 #include "Mockdatabase.h"
64 #include "Mockpex_cfg.h"
66 #include "Mockspi_cfg.h"
67 #include "Mocksps_cfg.h"
68 #include "Mocksps_types.h"
89 .pGioPort = &(spiREG3->PC3),
140 OS_EnterTaskCritical_Ignore();
141 OS_ExitTaskCritical_Ignore();
155 OS_EnterTaskCritical_Ignore();
156 OS_ExitTaskCritical_Ignore();
164 OS_EnterTaskCritical_Ignore();
165 OS_ExitTaskCritical_Ignore();
193 OS_EnterTaskCritical_Ignore();
194 OS_ExitTaskCritical_Ignore();
211 OS_EnterTaskCritical_Ignore();
212 OS_ExitTaskCritical_Ignore();
220 const uint8_t defaultTimer = 5u;
236 IO_PinReset_IgnoreArg_pRegisterAddress();
254 IO_PinSet_IgnoreArg_pRegisterAddress();
265 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_OK);
266 MCU_Delay_us_Ignore();
279 MCU_Delay_us_Ignore();
281 SPI_TransmitReceiveData_IgnoreArg_pSpiInterface();
282 SPI_TransmitReceiveData_IgnoreArg_pTxBuff();
283 SPI_TransmitReceiveData_IgnoreArg_pRxBuff();
284 SPI_TransmitReceiveData_IgnoreArg_frameLength();
286 SPI_TransmitReceiveData_IgnoreArg_pSpiInterface();
287 SPI_TransmitReceiveData_IgnoreArg_pTxBuff();
288 SPI_TransmitReceiveData_IgnoreArg_pRxBuff();
289 SPI_TransmitReceiveData_IgnoreArg_frameLength();
298 MCU_Delay_us_Ignore();
300 SPI_TransmitReceiveData_IgnoreArg_pSpiInterface();
301 SPI_TransmitReceiveData_IgnoreArg_pTxBuff();
302 SPI_TransmitReceiveData_IgnoreArg_pRxBuff();
303 SPI_TransmitReceiveData_IgnoreArg_frameLength();
305 SPI_TransmitReceiveData_IgnoreArg_pSpiInterface();
306 SPI_TransmitReceiveData_IgnoreArg_pTxBuff();
307 SPI_TransmitReceiveData_IgnoreArg_pRxBuff();
308 SPI_TransmitReceiveData_IgnoreArg_frameLength();
317 MCU_Delay_us_Ignore();
318 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_NOT_OK);
404 MCU_Delay_us_Ignore();
405 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_OK);
430 OS_EnterTaskCritical_Ignore();
431 OS_ExitTaskCritical_Ignore();
456 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_OK);
457 MCU_Delay_us_Ignore();
489 SPI_TransmitReceiveData_IgnoreAndReturn(
STD_OK);
490 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)
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)
void SPS_RequestGeneralIoState(SPS_CHANNEL_INDEX channelIndex, SPS_CHANNEL_FUNCTION_e channelFunction)
Request state of a general IO.
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)