#ifndef AD_DEBUG_H
#define AD_DEBUG_H

#include <stdint.h>

#include "ad_board.h"
#include "ad_binary_transport.h"
#include "ad_inverter.h"
#include "ad_modbus.h"
#include "ad_parameter_identification.h"
#include "ad_project.h"
#include "simulink_interface.h"

typedef struct
{
    AD_ProjectState_t project;
    AD_InverterState_t inverter;
    AD_BoardAdcSnapshot_t adc;
    AD_Measurements_t measurements;
    AD_MotorParameters_t motor_parameters;
    AD_Command_t command;
    AD_ModbusState_t modbus;
    AD_ModbusRegisters_t modbus_regs;
    AD_BinaryTransportState_t binary_transport;
    uint32_t param_id_status;
    uint32_t param_id_faults;
    uint8_t param_id_mode;
    uint8_t power_stage_allowed;
    uint8_t test_running;
    uint32_t tick_ms;
} AD_DebugView_t;

extern volatile AD_DebugView_t g_ad_debug;

void AD_Debug_Init(void);
void AD_Debug_Update(void);

#endif
