//
// Created by ilya on 20.06.24.
//

#ifndef AMPLIFIER_AW87579_ENUM_H
#define AMPLIFIER_AW87579_ENUM_H


/*
 *  Battery safe guard deglitch time.
 */
typedef enum {
    BAT_SFGD_DEGLITCH_1ms = 0b00,
    BAT_SFGD_DEGLITCH_500us = 0b01,
    BAT_SFGD_DEGLITCH_200us = 0b10,
    BAT_SFGD_DEGLITCH_Disable = 0b11
}eBAT_SFGD_DEGLITCH;


/*
 * Battery voltage when enter into battery safe_guard
 * mode.
 */
typedef enum {
    BAT_SFGD_VTH_3_3V = 0b00,
    BAT_SFGD_VTH_3_4V = 0b01,
    BAT_SFGD_VTH_3_5V = 0b10,
    BAT_SFGD_VTH_3_6V = 0b11
}eBAT_SFGD_VTH;


/*
 * Maxim output level when enter into battery safe_guard
 * mode
 */
typedef enum {
    BAT_SFGD_LEVEL_5V = 0b00,
    BAT_SFGD_LEVEL_5_5V = 0b01,
    BAT_SFGD_LEVEL_6V = 0b10,
    BAT_SFGD_LEVEL_6_5V = 0b11
}eBAT_SFGD_LEVEL;


/*
 * BOOST OUTPUT VOLTAGE set
 */
typedef enum {
    BST_VOUT_6_5V = 0b00000,
    BST_VOUT_6_75V = 0b00001,
    BST_VOUT_7V = 0b00010,
    BST_VOUT_7_25V = 0b00011,
    BST_VOUT_7_5V = 0b00100,
    BST_VOUT_7_75V = 0b00101,
    BST_VOUT_8V = 0b00110,
    BST_VOUT_8_25V = 0b00111,
    BST_VOUT_8_5V = 0b01000,
    BST_VOUT_8_75V = 0b01001,
    BST_VOUT_9V = 0b01010,
    BST_VOUT_9_25V = 0b01011,
    BST_VOUT_9_5V = 0b01100,
    BST_VOUT_9_75V = 0b01101,
    BST_VOUT_10V = 0b01110,
    BST_VOUT_10_25V = 0b01111,
    BST_VOUT_10_5V = 0b10000,
    BST_VOUT_10_75V = 0b10001,
    BST_VOUT_11V = 0b10010,
    BST_VOUT_11_25V = 0b10011,
    BST_VOUT_11_5V = 0b10100,
    BST_VOUT_11_75V = 0b10101,
    BST_VOUT_12V = 0b10110,
}eBST_VOUT;


/*
 * BOOST peak current limit
 */
typedef enum {
    BST_IPEAK_2A = 0b0010,
    BST_IPEAK_2_25A = 0b0011,
    BST_IPEAK_2_5A = 0b0100,
    BST_IPEAK_2_75A = 0b0101,
    BST_IPEAK_3A = 0b0110,
    BST_IPEAK_3_25A = 0b0111,
    BST_IPEAK_3_5A = 0b1000,
    BST_IPEAK_3_75A = 0b1001,
    BST_IPEAK_4A = 0b1010,
    BST_IPEAK_4_25A = 0b1011,
    BST_IPEAK_4_5A = 0b1100,
}eBST_IPEAK;


/*
 * Speaker Protection output Power Leve
 */
typedef enum {
    AGC3OP_0_5W_8ohm_OR_0_67W_6ohm = 0b0000,
    AGC3OP_0_6W_8ohm_OR_0_8W_6ohm = 0b0001,
    AGC3OP_0_7W_8ohm_OR_0_93W_6ohm = 0b0010,
    AGC3OP_0_8W_8ohm_OR_1_07W_6ohm = 0b0011,
    AGC3OP_0_9W_8ohm_OR_1_2W_6ohm = 0b0100,
    AGC3OP_1W_8ohm_OR_1_33W_6ohm = 0b0101,
    AGC3OP_1_1W_8ohm_OR_1_47W_6ohm = 0b0110,
    AGC3OP_1_2W_8ohm_OR_1_6W_6ohm = 0b0111,
    AGC3OP_1_3W_8ohm_OR_1_73W_6ohm = 0b1000,
    AGC3OP_1_4W_8ohm_OR_1_87W_6ohm = 0b1001,
    AGC3OP_1_5W_8ohm_OR_2W_6ohm = 0b1010,
    AGC3OP_1_6W_8ohm_OR_2_13W_6ohm = 0b1011,
    AGC3OP_1_7W_8ohm_OR_2_27W_6ohm = 0b1100,
    AGC3OP_1_8W_8ohm_OR_2_4W_6ohm = 0b1101,
    AGC3OP_1_9W_8ohm_OR_2_53W_6ohm = 0b1110,
    AGC3OP_2W_8ohm_OR_2_67W_6ohm = 0b1111,
}AGC3_OUTPUT_POWER;

typedef enum {
    PA_GAIN_0dB = 0b00000,
    PA_GAIN_1_5dB = 0b00001,
    PA_GAIN_3dB = 0b00010,
    PA_GAIN_4_5dB = 0b00011,
    PA_GAIN_6dB = 0b00100,
    PA_GAIN_7_5dB = 0b00101,
    PA_GAIN_9dB = 0b00110,
    PA_GAIN_10_5dB = 0b00111,
    PA_GAIN_12dB = 0b01000,
    PA_GAIN_13_5dB = 0b01001,
    PA_GAIN_15dB = 0b01010,
    PA_GAIN_16_5dB = 0b01011,
    PA_GAIN_18dB = 0b01100,
    PA_GAIN_19_5dB = 0b01101,
    PA_GAIN_21dB = 0b01110,
    PA_GAIN_22_5dB = 0b01111,
    PA_GAIN_24dB = 0b10000,
    PA_GAIN_25_5dB = 0b10001,
    PA_GAIN_27dB = 0b10010,
}PA_GAIN;



/*
 * Total 13.5dB release time
 */
typedef enum {
    AGC3_REL_TIME_5_12ms_dB = 0b000,
    AGC3_REL_TIME_10_24ms_dB = 0b001,
    AGC3_REL_TIME_20_48ms_dB = 0b010,
    AGC3_REL_TIME_40_56ms_dB = 0b011,
    AGC3_REL_TIME_81_92ms_dB = 0b100,
    AGC3_REL_TIME_163_84ms_dB = 0b101,
    AGC3_REL_TIME_327_68ms_dB = 0b110,
    AGC3_REL_TIME_655_36ms_dB = 0b111,
}eAGC3_REL_TIME;


/*
 * Total 13.5dB attack time
 */
typedef enum {
    AGC3_ATT_TIME_1_28ms_dB = 0b000,
    AGC3_ATT_TIME_2_56ms_dB = 0b001,
    AGC3_ATT_TIME_10_24ms_dB = 0b010,
    AGC3_ATT_TIME_40_96ms_dB = 0b011,
    AGC3_ATT_TIME_82ms_dB = 0b100,
    AGC3_ATT_TIME_164ms_dB = 0b101,
    AGC3_ATT_TIME_328ms_dB = 0b110,
    AGC3_ATT_TIME_656ms_dB = 0b111,
}eAGC3_ATT_TIME;


/*
 * AGC2 Protection output Power Leve
 */
typedef enum {
    AGC2OP_1W_8ohm_OR_1_33W_6ohm = 0b0000,
    AGC2OP_1_2W_8ohm_OR_1_6W_6ohm = 0b0001,
    AGC2OP_1_4W_8ohm_OR_1_87W_6ohm = 0b0010,
    AGC2OP_1_6W_8ohm_OR_2_13W_6ohm = 0b0011,
    AGC2OP_1_8W_8ohm_OR_2_4W_6ohm = 0b0100,
    AGC2OP_2W_8ohm_OR_2_67W_6ohm = 0b0101,
    AGC2OP_2_2W_8ohm_OR_2_93W_6ohm = 0b0110,
    AGC2OP_2_4W_8ohm_OR_3_2W_6ohm = 0b0111,
    AGC2OP_2_6W_8ohm_OR_3_47W_6ohm = 0b1000,
    AGC2OP_2_8W_8ohm_OR_3_73W_6ohm = 0b1001,
    AGC2OP_3W_8ohm_OR_4W_6ohm = 0b1010,
    AGC2OP_OFF = 0b1011,
}AGC2_OUTPUT_POWER;


/*
 * AGC2 total attack time
 */
typedef enum {
    AGC2_ATT_TIME_0_16ms_dB = 0b000,
    AGC2_ATT_TIME_0_32ms_dB = 0b001,
    AGC2_ATT_TIME_0_64ms_dB = 0b010,
    AGC2_ATT_TIME_2_56ms_dB = 0b011,
    AGC2_ATT_TIME_10_24ms_dB = 0b100,
    AGC2_ATT_TIME_40_96ms_dB = 0b101,
    AGC2_ATT_TIME_82ms_dB = 0b110,
    AGC2_ATT_TIME_164ms_dB = 0b111,
}eAGC2_ATT_TIME;


/*
 *  Fastest Level AGC attack time control
 */
typedef enum {
    AGC1_ATT_TIME_0_04ms_dB = 0b00,
    AGC1_ATT_TIME_0_08ms_dB = 0b01,
    AGC1_ATT_TIME_0_16ms_dB = 0b10,
    AGC1_ATT_TIME_0_32ms_dB = 0b11,
}eAGC1_ATT_TIME;


/*
 * BOOST_MODE
 */
typedef enum {
    ADPBOOST_MODE_PassThrough = 0b000,
    ADPBOOST_MODE_ForceBOOST = 0b001,
    ADPBOOST_MODE_MD1 = 0b010,
    ADPBOOST_MODE_MD2 = 0b011
}eADPBOOST_MODE;


/*
 * Duration time Po less than Po2
 */
typedef enum {
    ADP_BST_TIME_20ms = 0b0101,
    ADP_BST_TIME_30ms = 0b0110,
    ADP_BST_TIME_40ms = 0b0111,
    ADP_BST_TIME_65ms = 0b1000,
    ADP_BST_TIME_80ms = 0b1001,
    ADP_BST_TIME_100ms = 0b1010,
    ADP_BST_TIME_120ms = 0b1011,
    ADP_BST_TIME_140ms = 0b1100,
    ADP_BST_TIME_160ms = 0b1101,
    ADP_BST_TIME_320ms = 0b1110,
    ADP_BST_TIME_480ms = 0b1111,
}eADP_BST_TIME;


/*
 * ADP BOOST mode2 first step set BOOST_OUT<4:0>
 */
typedef enum {
    ADP_LOW_STEP_1st_BST_OUT_6_5V = 0b00,
    ADP_LOW_STEP_1st_BST_OUT_6_75V = 0b01,
    ADP_LOW_STEP_1st_BST_OUT_7V = 0b10,
    ADP_LOW_STEP_1st_BST_OUT_7_25V = 0b11,
}eADP_LOW_STEP;


/*
 * Boost threshold Po2
 */
typedef enum {
    SET_BOOST_VTH2_1_2W = 0b000,
    SET_BOOST_VTH2_1_4W = 0b001,
    SET_BOOST_VTH2_1_6W = 0b010,
    SET_BOOST_VTH2_1_8W = 0b011,
    SET_BOOST_VTH2_2_0W = 0b100,
    SET_BOOST_VTH2_2_2W = 0b101,
}eSET_BOOST_VTH2;


/*
 * Boost threshold Po1
 */
typedef enum {
    SET_BOOST_VTH1_0_1W = 0b000,
    SET_BOOST_VTH1_0_2W = 0b001,
    SET_BOOST_VTH1_0_3W = 0b010,
    SET_BOOST_VTH1_0_4W = 0b011,
}eSET_BOOST_VTH1;
#endif //AMPLIFIER_AW87579_ENUM_H
