// // Created by cfif on 10.07.2024. // #ifndef SMART_COMPONENTS_UPDATE_AMPLIFIER_H #define SMART_COMPONENTS_UPDATE_AMPLIFIER_H #include "I2cIO.h" #include "XfcProtProcessorUtilDefines.h" #include "Amplifier.h" typedef enum { AMPLIFIER_LEVEL, AMPLIFIER_VOLTAGE, AMPLIFIER_AMPER, BOOST_VTH1, BOOST_VTH2, LOW_STEP, ADP_MODE, POWER, AGC3_REL_TIME, AGC3_ATT_TIME, AGC1_ATT_TIMEA, PD_AGC1_STATE, EN_BOOST, AGC3_OPR_OUTPUT_POWER_LEVEL, PD_AGC3_OPR_STATE, AGC2_OUTPUT_POWER_LEVEL, AGC2_ATT_TIME_VALUE } tAmplifierType; typedef struct { uint16_t boost_reg; uint16_t boost_step; uint16_t boost_vth1; uint16_t boost_vth2; } tAdptBoostVTH; typedef struct { uint16_t level; uint16_t voltage; uint16_t amper; } tGeinControl; typedef struct { uint16_t level; } tAdpMode; typedef struct { bool state; uint16_t attackTime; } tAGC1; typedef struct { bool state; } tEnBoost; typedef struct { bool state; uint16_t out_power; } tAGC3opr; typedef struct { uint16_t out_power; } tAGC2opr; typedef struct { uint16_t relTime; uint16_t attTime; } tAGC3; typedef struct { uint16_t attTime; } tAGC2; typedef struct { tAmplifier *amplifier; tAdpMode adpMode; tGeinControl geinControl; tAdptBoostVTH adptBoostVTH; tAGC1 agc1; tEnBoost enBoost; tAGC3opr agc3_opr; tAGC3 aAgc3; tAGC2opr agc2opr; tAGC2 aAgc2; bool powerMode; bool *playMode; } tXfcAmplifier; void XfcProtMethodsAdd_Amplifier(tXfcProtTable *protTab, tXfcAmplifier *amplifier); void XfcProtMethodsAdd_AmplifierInit(tXfcAmplifier *env, tAmplifier *Amplifier, bool *playMode); uint8_t XfcProtMethod_AmplifierSet(tXfcArray *request, tXfcArray *response, tXfcAmplifier *amplifier); uint8_t XfcProtMethod_AmplifierGet(tXfcArray *request, tXfcArray *response, tXfcAmplifier *amplifier); uint8_t XfcProtMethod_AmplifierSetChange(tXfcArray *request, tXfcArray *response, tXfcAmplifier *amplifier); uint8_t XfcProtMethod_AmplifierPlay(tXfcArray *request, tXfcArray *response, tXfcAmplifier *env); #endif //SMART_COMPONENTS_UPDATE_AMPLIFIER_H