#include"eeprom.h"
void EEPROM_IM24CM01P_Init(void){
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_150M			 ,&ATT_A_EN_150M_Table.Atten_Table_31_5dB_Value		      ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_WIFI1_2_4Ghz	 ,&ATT_A_EN_WIFI1_2_4Ghz_Table.Atten_Table_31_5dB_Value    ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_WIFI2_2_4Ghz	 ,&ATT_A_EN_WIFI2_2_4Ghz_Table.Atten_Table_31_5dB_Value    ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_WIFI3_2_4Ghz	 ,&ATT_A_EN_WIFI3_2_4Ghz_Table.Atten_Table_31_5dB_Value    ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_WIFI4_2_4Ghz	 ,&ATT_A_EN_WIFI4_2_4Ghz_Table.Atten_Table_31_5dB_Value    ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_WIFI1_5_8Ghz	 ,&ATT_A_EN_WIFI1_5_8Ghz_Table.Atten_Table_31_5dB_Value    ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_WIFI2_5_8Ghz	 ,&ATT_A_EN_WIFI2_5_8Ghz_Table.Atten_Table_31_5dB_Value    ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_WIFI3_5_8Ghz	 ,&ATT_A_EN_WIFI3_5_8Ghz_Table.Atten_Table_31_5dB_Value    ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_WIFI4_5_8Ghz	 ,&ATT_A_EN_WIFI4_5_8Ghz_Table.Atten_Table_31_5dB_Value    ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_30G1_28_28_5Ghz,&ATT_A_EN_30G1_28_28_5Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_30G2_28_28_5Ghz,&ATT_A_EN_30G2_28_28_5Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_30G3_28_28_5Ghz,&ATT_A_EN_30G3_28_28_5Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_30G1_28_5_29Ghz,&ATT_A_EN_30G1_28_5_29Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_30G2_28_5_29Ghz,&ATT_A_EN_30G2_28_5_29Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_30G3_28_5_29Ghz,&ATT_A_EN_30G3_28_5_29Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_30G1_29_29_5Ghz,&ATT_A_EN_30G1_29_29_5Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_30G2_29_29_5Ghz,&ATT_A_EN_30G2_29_29_5Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_30G3_29_29_5Ghz,&ATT_A_EN_30G3_29_29_5Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_30G1_29_5_30Ghz,&ATT_A_EN_30G1_29_5_30Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_30G2_29_5_30Ghz,&ATT_A_EN_30G2_29_5_30Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_A_EN_30G3_29_5_30Ghz,&ATT_A_EN_30G3_29_5_30Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_150M			 ,&ATT_B_EN_150M_Table.Atten_Table_31_5dB_Value            ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_WIFI1_2_4Ghz	 ,&ATT_B_EN_WIFI1_2_4Ghz_Table.Atten_Table_31_5dB_Value    ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_WIFI2_2_4Ghz	 ,&ATT_B_EN_WIFI2_2_4Ghz_Table.Atten_Table_31_5dB_Value    ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_WIFI3_2_4Ghz	 ,&ATT_B_EN_WIFI3_2_4Ghz_Table.Atten_Table_31_5dB_Value    ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_WIFI4_2_4Ghz	 ,&ATT_B_EN_WIFI4_2_4Ghz_Table.Atten_Table_31_5dB_Value    ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_WIFI1_5_8Ghz	 ,&ATT_B_EN_WIFI1_5_8Ghz_Table.Atten_Table_31_5dB_Value    ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_WIFI2_5_8Ghz	 ,&ATT_B_EN_WIFI2_5_8Ghz_Table.Atten_Table_31_5dB_Value    ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_WIFI3_5_8Ghz	 ,&ATT_B_EN_WIFI3_5_8Ghz_Table.Atten_Table_31_5dB_Value    ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_WIFI4_5_8Ghz	 ,&ATT_B_EN_WIFI4_5_8Ghz_Table.Atten_Table_31_5dB_Value    ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_30G1_28_28_5Ghz,&ATT_B_EN_30G1_28_28_5Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_30G2_28_28_5Ghz,&ATT_B_EN_30G2_28_28_5Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_30G3_28_28_5Ghz,&ATT_B_EN_30G3_28_28_5Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_30G1_28_5_29Ghz,&ATT_B_EN_30G1_28_5_29Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_30G2_28_5_29Ghz,&ATT_B_EN_30G2_28_5_29Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_30G3_28_5_29Ghz,&ATT_B_EN_30G3_28_5_29Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_30G1_29_29_5Ghz,&ATT_B_EN_30G1_29_29_5Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_30G2_29_29_5Ghz,&ATT_B_EN_30G2_29_29_5Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_30G3_29_29_5Ghz,&ATT_B_EN_30G3_29_29_5Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_30G1_29_5_30Ghz,&ATT_B_EN_30G1_29_5_30Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_30G2_29_5_30Ghz,&ATT_B_EN_30G2_29_5_30Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
    EEPROM_IM24CM01P_Read(EEPROM_IM24CM01P_ID,EEPROM_ATT_B_EN_30G3_29_5_30Ghz,&ATT_B_EN_30G3_29_5_30Ghz_Table.Atten_Table_31_5dB_Value ,sizeof(Atten_Table_Value_t));
}

HAL_StatusTypeDef EEPROM_IM24CM01P_write(uint16_t devid,uint16_t Address,uint8_t* data,uint8_t size){
    HAL_StatusTypeDef ret = HAL_ERROR;
    ret = HAL_I2C_Mem_Write(&hi2c3, devid, Address,  I2C_MEMADD_SIZE_16BIT, data, size, 10);
    HAL_Delay(5);
    return ret;
}

HAL_StatusTypeDef EEPROM_IM24CM01P_Read(uint16_t devid,uint16_t Address,uint8_t* data,uint8_t size){
   HAL_StatusTypeDef ret = HAL_ERROR;
   ret = HAL_I2C_Mem_Read(&hi2c3, devid, Address, I2C_MEMADD_SIZE_16BIT, data, size, 10);
   HAL_Delay(5);
    return ret;   
}




