81 #define ILCK_SAVELASTSTATES() \
82 ilck_state.laststate = ilck_state.state; \
83 ilck_state.lastsubstate = ilck_state.substate
97 .ErrRequestCounter = 0,
166 return stateRequestCheck;
238 #if (BS_IGNORE_INTERLOCK_FEEDBACK == true)
242 return measuredInterlockState;
320 #ifdef UNITY_UNIT_TEST
#define DATA_READ_DATA(...)
#define DATA_WRITE_DATA(...)
@ DATA_BLOCK_ID_INTERLOCK_FEEDBACK
@ DATA_BLOCK_ID_ADC_VOLTAGE
DIAG_RETURNTYPE_e DIAG_Handler(DIAG_ID_e diag_id, DIAG_EVENT_e event, DIAG_IMPACT_LEVEL_e impact, uint32_t data)
DIAG_Handler provides generic error handling, based on diagnosis group.
@ DIAG_ID_INTERLOCK_FEEDBACK
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
#define FAS_TRAP
Define that evaluates to essential boolean false thus tripping an assert.
enum STD_PIN_STATE STD_PIN_STATE_e
static void ILCK_InitializePins(void)
Initializes required pins for interlock evaluation.
void TEST_ILCK_SetStateStruct(ILCK_STATE_s state)
#define ILCK_SAVELASTSTATES()
static ILCK_STATE_s ilck_state
static uint8_t ILCK_CheckReEntrance(void)
re-entrance check of ILCK state machine trigger function
ILCK_RETURN_TYPE_e ILCK_SetStateRequest(ILCK_STATE_REQUEST_e statereq)
sets the current state request of the state variable ilck_state.
void ILCK_Trigger(void)
trigger function for the ILCK driver state machine.
static ILCK_STATE_REQUEST_e ILCK_TransferStateRequest(void)
transfers the current state request to the state machine.
static ILCK_ELECTRICAL_STATE_TYPE_e ILCK_GetInterlockFeedback(void)
Reads the feedback pin of the interlock and returns its current value (ILCK_SWITCH_OFF/ILCK_SWITCH_ON...
static DATA_BLOCK_INTERLOCK_FEEDBACK_s ilck_tableFeedback
ILCK_ELECTRICAL_STATE_TYPE_e TEST_ILCK_GetInterlockFeedback(void)
ILCK_STATEMACH_e ILCK_GetState(void)
gets the current state.
static ILCK_RETURN_TYPE_e ILCK_CheckStateRequest(ILCK_STATE_REQUEST_e statereq)
checks the state requests that are made.
Headers for the driver for the interlock.
@ ILCK_STATEMACHINE_UNINITIALIZED
@ ILCK_STATEMACHINE_INITIALIZED
@ ILCK_ALREADY_INITIALIZED
@ ILCK_STATE_INITIALIZATION_REQUEST
#define ILCK_ADC_INPUT_HIGH_SIDE_VOLTAGE_SENSE
#define ILCK_VOLTAGE_DIVIDER_FACTOR
#define ILCK_ADC_INPUT_LOW_SIDE_VOLTAGE_SENSE
enum ILCK_ELECTRICAL_STATE_TYPE ILCK_ELECTRICAL_STATE_TYPE_e
#define ILCK_STATEMACH_SHORTTIME
ILCK statemachine short time definition in ILCK_Trigger() calls until next state/substate is processe...
#define ILCK_INTERLOCK_CONTROL_PIN_IL_HS_ENABLE
#define ILCK_INTERLOCK_FEEDBACK_PIN_IL_STATE
#define ILCK_FACTOR_IL_LS_CS_1_ohm
#define ILCK_ADC_INPUT_LOW_SIDE_CURRENT_SENSE
#define ILCK_ADC_INPUT_HIGH_SIDE_CURRENT_SENSE
#define ILCK_FACTOR_IL_HS_CS_1_ohm
void IO_SetPinDirectionToOutput(volatile uint32_t *pRegisterAddress, uint32_t pin)
Set pin to output by writing in pin direction register.
void IO_SetPinDirectionToInput(volatile uint32_t *pRegisterAddress, uint32_t pin)
Set pin to input by writing in pin direction register.
void IO_PinReset(volatile uint32_t *pRegisterAddress, uint32_t pin)
Reset pin by writing in pin output register.
STD_PIN_STATE_e IO_PinGet(const volatile uint32_t *pRegisterAddress, uint32_t pin)
Get pin state.
Header for the driver for the IO module.
Declaration of the OS wrapper interface.
void OS_ExitTaskCritical(void)
Exit Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
void OS_EnterTaskCritical(void)
Enter Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
float adc1ConvertedVoltages_mV[ADC_ADC1_MAX_NR_CHANNELS]
DATA_BLOCK_HEADER_s header
float interlockVoltageFeedback_IL_LS_VS_mV
float interlockVoltageFeedback_IL_HS_VS_mV
uint8_t interlockFeedback_IL_STATE
float interlockCurrentFeedback_IL_LS_CS_mA
float interlockCurrentFeedback_IL_HS_CS_mA
DATA_BLOCK_HEADER_s header
uint32_t ErrRequestCounter
ILCK_STATE_REQUEST_e statereq
ILCK_STATEMACH_SUB_e substate