86 #pragma SET_DATA_SECTION(".sharedRAM")
89 #pragma SET_DATA_SECTION()
118 .firstMeasurementMade =
false,
119 .firstDiagnosticMade =
false,
121 .redundantAuxiliaryChannel = {0u},
228 return requestReceived;
235 bool measurementStarted =
false;
237 if (requestReceived ==
STD_OK) {
240 measurementStarted =
true;
247 return measurementStarted;
349 requestSubmitted =
STD_OK;
351 return requestSubmitted;
384 if (requestReceived ==
STD_OK) {
392 #ifdef UNITY_UNIT_TEST
399 #ifdef UNITY_UNIT_TEST
400 extern void TEST_ADI_AccessToDatabase(
ADI_STATE_s *adiState) {
403 extern void TEST_ADI_BalanceControl(
ADI_STATE_s *adiState) {
412 extern void TEST_ADI_RunCurrentStringMeasurement(
ADI_STATE_s *adiState) {
415 extern void TEST_ADI_SetFirstMeasurementCycleFinished(
ADI_STATE_s *adiState) {
void ADI_DetermineBalancingRegisterConfiguration(ADI_STATE_s *adiState)
Determines how the balancing registers need to be set.
void ADI_GetGpioVoltages(ADI_STATE_s *adiState, ADI_AUXILIARY_REGISTER_TYPE_e registerType, ADI_AUXILIARY_STORE_LOCATION_e storeLocation)
Stores GPIO voltages.
static void ADI_SetFirstMeasurementCycleFinished(ADI_STATE_s *adiState)
sets the measurement initialization status.
static DATA_BLOCK_OPEN_WIRE_s adi_openWire
static bool ADI_ProcessMeasurementNotStartedState(ADI_STATE_s *adiState, AFE_REQUEST_e *request)
Runs the initialization sequence of the driver.
static DATA_BLOCK_ALL_GPIO_VOLTAGES_s adi_allGpioVoltageOpenWire
static void ADI_RunCurrentStringMeasurement(ADI_STATE_s *adiState)
STD_RETURN_TYPE_e ADI_MakeRequest(AFE_REQUEST_e request)
Makes a request to the ADI driver.
static DATA_BLOCK_CELL_VOLTAGE_s adi_cellVoltageFiltered
static DATA_BLOCK_CELL_VOLTAGE_s adi_cellVoltageRedundant
static DATA_BLOCK_BALANCING_CONTROL_s adi_balancingControl
static DATA_BLOCK_CELL_VOLTAGE_s adi_cellVoltage
static void ADI_BalanceControl(ADI_STATE_s *adiState)
Sets the balancing according to the control values read in the database.
ADI_STATE_s adi_stateBase
static DATA_BLOCK_CELL_VOLTAGE_s adi_cellVoltageAverage
void ADI_MeasurementCycle(ADI_STATE_s *adiState)
Implements the actual measurement sequence for the ADI driver.
static DATA_BLOCK_CELL_VOLTAGE_s adi_cellVoltageAverageOpenWire
static DATA_BLOCK_ALL_GPIO_VOLTAGES_s adi_allGpioVoltage
static DATA_BLOCK_CELL_TEMPERATURE_s adi_cellTemperature
static void ADI_AccessToDatabase(ADI_STATE_s *adiState)
Read local variables from database and write local variables to database.
static STD_RETURN_TYPE_e ADI_GetRequest(AFE_REQUEST_e *request)
Checks the requests made to the ades183x driver.
static DATA_BLOCK_CELL_VOLTAGE_s adi_cellVoltageRedundantOpenWire
static ADI_ERROR_TABLE_s adi_errorTable
bool ADI_IsFirstMeasurementCycleFinished(ADI_STATE_s *adiState)
Gets the measurement initialization status.
static DATA_BLOCK_ALL_GPIO_VOLTAGES_s adi_allGpioVoltageRedundant
static DATA_BLOCK_CELL_VOLTAGE_s adi_cellVoltageOpenWireOdd
void ADI_ActivateInterfaceBoard(void)
Sets the pins to activate the interface board.
static uint16_t adi_bufferRxPec[ADI_N_BYTES_FOR_DATA_TRANSMISSION]
static DATA_BLOCK_CELL_VOLTAGE_s adi_cellVoltageOpenWireEven
static uint16_t adi_bufferTxPec[ADI_N_BYTES_FOR_DATA_TRANSMISSION]
Headers for the driver for the ADI analog front-end.
Headers for the driver for the ADI analog front-end.
uint16_t adi_command[ADI_COMMAND_DEFINITION_LENGTH]
Header for the buffers used by the driver for the ADI analog front-end.
const uint16_t adi_cmdUnmute[ADI_COMMAND_DEFINITION_LENGTH]
const uint16_t adi_cmdMute[ADI_COMMAND_DEFINITION_LENGTH]
const uint16_t adi_cmdClrcell[ADI_COMMAND_DEFINITION_LENGTH]
const uint16_t adi_cmdAdax2[ADI_COMMAND_DEFINITION_LENGTH]
const uint16_t adi_cmdSnap[ADI_COMMAND_DEFINITION_LENGTH]
const uint16_t adi_cmdUnsnap[ADI_COMMAND_DEFINITION_LENGTH]
const uint16_t adi_cmdAdax[ADI_COMMAND_DEFINITION_LENGTH]
Header file of some software.
#define ADI_WAIT_TIME_1_FOR_ADAX_FULL_CYCLE
@ ADI_CELL_VOLTAGE_REGISTER
@ ADI_FILTERED_CELL_VOLTAGE_REGISTER
#define ADI_ADAX_CH03_LEN
#define ADI_BALANCING_TIME_ms
#define ADI_ADAX_CH03_POS
#define ADI_WAIT_TIME_2_FOR_ADAX_FULL_CYCLE
#define ADI_QUEUE_TIMEOUT_MS
#define ADI_N_BYTES_FOR_DATA_TRANSMISSION
#define ADI_ADAX2_CH03_POS
#define ADI_ADAX2_CH03_LEN
@ ADI_FILTERED_CELL_VOLTAGE
Headers for the diagnostic driver for the ADI analog front-end.
void ADI_Diagnostic(ADI_STATE_s *adiState)
Make diagnostics with the built-in AFE functions.
Header file of some software.
void ADI_WriteCommandConfigurationBits(uint16_t *configuredCommand, uint8_t position, uint8_t length, uint16_t configuration)
write configuration bits in commands (e.g., channel in ADAX command).
void ADI_TransmitCommand(uint16_t *command, ADI_STATE_s *adiState)
send command to the ades183x daisy-chain (e.g., start voltage measurement).
void ADI_Wait(uint32_t waitTime)
wait for a certain number of milliseconds
void ADI_CopyCommandBits(const uint16_t *sourceCommand, uint16_t *destinationCommand)
copy command bits in variables.
Headers for the diagnostic driver for the ADI analog front-end.
void ADI_InitializeMeasurement(ADI_STATE_s *adiState)
Implements the initialization for the ades183x driver.
Header file of some software.
Headers for the PEC computations.
void ADI_GetTemperatures(ADI_STATE_s *adiState)
Store temperatures converted from GPIO voltages.
Header file of some software.
void ADI_StopContinuousCellVoltageMeasurements(ADI_STATE_s *adiState)
Stop cell voltage measurement.
void ADI_GetVoltages(ADI_STATE_s *adiState, ADI_VOLTAGE_REGISTER_TYPE_e registerType, ADI_VOLTAGE_STORE_LOCATION_e storeLocation)
Reads and stores cell voltages.
void ADI_RestartContinuousCellVoltageMeasurements(ADI_STATE_s *adiState)
Restart cell voltage measurement.
Header file of some software.
#define DATA_READ_DATA(...)
#define DATA_WRITE_DATA(...)
@ DATA_BLOCK_ID_BALANCING_CONTROL
@ DATA_BLOCK_ID_CELL_TEMPERATURE_BASE
@ DATA_BLOCK_ID_OPEN_WIRE_BASE
@ DATA_BLOCK_ID_CELL_VOLTAGE_BASE
@ DATA_BLOCK_ID_ALL_GPIO_VOLTAGES_BASE
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
#define NULL_PTR
Null pointer.
Header of task driver implementation.
OS_QUEUE ftsk_afeRequestQueue
Macros for implementing testable infinite loops.
Declaration of the OS wrapper interface.
OS_STD_RETURN_e OS_ReceiveFromQueue(OS_QUEUE xQueue, void *const pvBuffer, uint32_t ticksToWait)
Receive an item from a queue.
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.
OS_STD_RETURN_e OS_SendToBackOfQueue(OS_QUEUE xQueue, const void *const pvItemToQueue, uint32_t ticksToWait)
Post an item to the back the provided queue.
void PEX_SetPin(uint8_t portExpander, uint8_t pin)
sets pin to high.
void PEX_SetPinDirectionOutput(uint8_t portExpander, uint8_t pin)
sets pin to input.
Header for the driver for the NXP PCA9539 port expander module.
#define PEX_PORT_EXPANDER3
DATA_BLOCK_CELL_VOLTAGE_s * cellVoltageFiltered
DATA_BLOCK_BALANCING_CONTROL_s * balancingControl
DATA_BLOCK_CELL_TEMPERATURE_s * cellTemperature
DATA_BLOCK_CELL_VOLTAGE_s * cellVoltage
DATA_BLOCK_ALL_GPIO_VOLTAGES_s * allGpioVoltages
bool firstMeasurementMade
uint8_t spiNumberInterfaces
uint8_t redundantAuxiliaryChannel[BS_NR_OF_STRINGS]
DATA_BLOCK_HEADER_s header
DATA_BLOCK_HEADER_s header
uint16_t nrBalancedCells[BS_NR_OF_STRINGS]
DATA_BLOCK_HEADER_s header
DATA_BLOCK_HEADER_s header
DATA_BLOCK_HEADER_s header