#include "main.h"
#define EEPROM_IM24CM01P_ID               0x00A0
#define EEPROM_ATTEN_CURR_ST_LEN          4

#define EEPROM_ATT_BASE					  0x0000
#define EEPROM_ATT_A_EN_150M			  EEPROM_ATT_BASE
#define EEPROM_ATT_A_EN_WIFI1_2_4Ghz	  EEPROM_ATT_A_EN_150M			  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_WIFI2_2_4Ghz	  EEPROM_ATT_A_EN_WIFI1_2_4Ghz	  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_WIFI3_2_4Ghz	  EEPROM_ATT_A_EN_WIFI2_2_4Ghz	  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_WIFI4_2_4Ghz	  EEPROM_ATT_A_EN_WIFI3_2_4Ghz	  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_WIFI1_5_8Ghz	  EEPROM_ATT_A_EN_WIFI4_2_4Ghz	  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_WIFI2_5_8Ghz	  EEPROM_ATT_A_EN_WIFI1_5_8Ghz	  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_WIFI3_5_8Ghz	  EEPROM_ATT_A_EN_WIFI2_5_8Ghz	  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_WIFI4_5_8Ghz	  EEPROM_ATT_A_EN_WIFI3_5_8Ghz	  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_30G1_28_28_5Ghz   EEPROM_ATT_A_EN_WIFI4_5_8Ghz	  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_30G2_28_28_5Ghz   EEPROM_ATT_A_EN_30G1_28_28_5Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_30G3_28_28_5Ghz   EEPROM_ATT_A_EN_30G2_28_28_5Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_30G1_28_5_29Ghz   EEPROM_ATT_A_EN_30G3_28_28_5Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_30G2_28_5_29Ghz   EEPROM_ATT_A_EN_30G1_28_5_29Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_30G3_28_5_29Ghz   EEPROM_ATT_A_EN_30G2_28_5_29Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_30G1_29_29_5Ghz   EEPROM_ATT_A_EN_30G3_28_5_29Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_30G2_29_29_5Ghz   EEPROM_ATT_A_EN_30G1_29_29_5Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_30G3_29_29_5Ghz   EEPROM_ATT_A_EN_30G2_29_29_5Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_30G1_29_5_30Ghz   EEPROM_ATT_A_EN_30G3_29_29_5Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_30G2_29_5_30Ghz   EEPROM_ATT_A_EN_30G1_29_5_30Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_EN_30G3_29_5_30Ghz   EEPROM_ATT_A_EN_30G2_29_5_30Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_150M			  EEPROM_ATT_A_EN_30G3_29_5_30Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_WIFI1_2_4Ghz	  EEPROM_ATT_B_EN_150M			  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_WIFI2_2_4Ghz	  EEPROM_ATT_B_EN_WIFI1_2_4Ghz	  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_WIFI3_2_4Ghz	  EEPROM_ATT_B_EN_WIFI2_2_4Ghz	  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_WIFI4_2_4Ghz	  EEPROM_ATT_B_EN_WIFI3_2_4Ghz	  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_WIFI1_5_8Ghz	  EEPROM_ATT_B_EN_WIFI4_2_4Ghz	  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_WIFI2_5_8Ghz	  EEPROM_ATT_B_EN_WIFI1_5_8Ghz	  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_WIFI3_5_8Ghz	  EEPROM_ATT_B_EN_WIFI2_5_8Ghz	  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_WIFI4_5_8Ghz	  EEPROM_ATT_B_EN_WIFI3_5_8Ghz	  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_30G1_28_28_5Ghz   EEPROM_ATT_B_EN_WIFI4_5_8Ghz	  + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_30G2_28_28_5Ghz   EEPROM_ATT_B_EN_30G1_28_28_5Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_30G3_28_28_5Ghz   EEPROM_ATT_B_EN_30G2_28_28_5Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_30G1_28_5_29Ghz   EEPROM_ATT_B_EN_30G3_28_28_5Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_30G2_28_5_29Ghz   EEPROM_ATT_B_EN_30G1_28_5_29Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_30G3_28_5_29Ghz   EEPROM_ATT_B_EN_30G2_28_5_29Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_30G1_29_29_5Ghz   EEPROM_ATT_B_EN_30G3_28_5_29Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_30G2_29_29_5Ghz   EEPROM_ATT_B_EN_30G1_29_29_5Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_30G3_29_29_5Ghz   EEPROM_ATT_B_EN_30G2_29_29_5Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_30G1_29_5_30Ghz   EEPROM_ATT_B_EN_30G3_29_29_5Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_30G2_29_5_30Ghz   EEPROM_ATT_B_EN_30G1_29_5_30Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_B_EN_30G3_29_5_30Ghz   EEPROM_ATT_B_EN_30G2_29_5_30Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_CH_150M              EEPROM_ATT_B_EN_30G3_29_5_30Ghz + sizeof(Atten_Table_Value_t)
#define EEPROM_ATT_A_CH_WIFI2_4Ghz        EEPROM_ATT_A_CH_150M            + EEPROM_ATTEN_CURR_ST_LEN
#define EEPROM_ATT_A_CH_WIFI5_8Ghz        EEPROM_ATT_A_CH_WIFI2_4Ghz      + EEPROM_ATTEN_CURR_ST_LEN
#define EEPROM_ATT_A_CH_30G_28_28_5       EEPROM_ATT_A_CH_WIFI5_8Ghz      + EEPROM_ATTEN_CURR_ST_LEN
#define EEPROM_ATT_A_CH_30G_28_5_29       EEPROM_ATT_A_CH_30G_28_28_5     + EEPROM_ATTEN_CURR_ST_LEN
#define EEPROM_ATT_A_CH_30G_29_29_5       EEPROM_ATT_A_CH_30G_28_5_29     + EEPROM_ATTEN_CURR_ST_LEN
#define EEPROM_ATT_A_CH_30G_29_5_30       EEPROM_ATT_A_CH_30G_29_29_5     + EEPROM_ATTEN_CURR_ST_LEN
#define EEPROM_ATT_B_CH_150M              EEPROM_ATT_A_CH_30G_29_5_30     + EEPROM_ATTEN_CURR_ST_LEN
#define EEPROM_ATT_B_CH_WIFI2_4Ghz        EEPROM_ATT_B_CH_150M            + EEPROM_ATTEN_CURR_ST_LEN
#define EEPROM_ATT_B_CH_WIFI5_8Ghz        EEPROM_ATT_B_CH_WIFI2_4Ghz      + EEPROM_ATTEN_CURR_ST_LEN
#define EEPROM_ATT_B_CH_30G_28_28_5       EEPROM_ATT_B_CH_WIFI5_8Ghz      + EEPROM_ATTEN_CURR_ST_LEN
#define EEPROM_ATT_B_CH_30G_28_5_29       EEPROM_ATT_B_CH_30G_28_28_5     + EEPROM_ATTEN_CURR_ST_LEN
#define EEPROM_ATT_B_CH_30G_29_29_5       EEPROM_ATT_B_CH_30G_28_5_29     + EEPROM_ATTEN_CURR_ST_LEN
#define EEPROM_ATT_B_CH_30G_29_5_30       EEPROM_ATT_B_CH_30G_29_29_5     + EEPROM_ATTEN_CURR_ST_LEN


#define EEPROM_ATT_A_CH_CURR_150M         EEPROM_ATT_B_CH_30G_29_5_30	    + EEPROM_ATTEN_CURR_ST_LEN
#define EEPROM_ATT_A_CH_CURR_WIFI         EEPROM_ATT_A_CH_CURR_150M         + 1
#define EEPROM_ATT_A_CH_CURR_30G          EEPROM_ATT_A_CH_CURR_WIFI         + EEPROM_ATTEN_CURR_ST_LEN
#define EEPROM_ATT_B_CH_CURR_150M         EEPROM_ATT_A_CH_CURR_30G          + EEPROM_ATTEN_CURR_ST_LEN - 1
#define EEPROM_ATT_B_CH_CURR_WIFI         EEPROM_ATT_B_CH_CURR_150M         + 1
#define EEPROM_ATT_B_CH_CURR_30G          EEPROM_ATT_B_CH_CURR_WIFI         + EEPROM_ATTEN_CURR_ST_LEN
















HAL_StatusTypeDef EEPROM_IM24CM01P_write(uint16_t devid,uint16_t Address,uint8_t* data,uint8_t size);
HAL_StatusTypeDef EEPROM_IM24CM01P_Read(uint16_t devid,uint16_t Address,uint8_t* data,uint8_t size);
void EEPROM_IM24CM01P_Init(void);


