#include "24LC02.h"
#include "ADBMS_Abstraction.h"

#include <stdint.h>

uint8_t eeprom_init() {
    uint8_t StartAddr = 0;
    uint8_t data = 0;

    if (amsWriteComm(EEPROM_ADDR, StartAddr, data) != 0){
        return 1;
    }

    return 0;
}

uint8_t eeprom_write(uint8_t addr, uint8_t data) {
    if (amsWriteComm(EEPROM_ADDR, addr, data) != 0){
        return 1;
    }

    return 0;
}

uint8_t eeprom_read(uint8_t addr, uint8_t* data) {
    if (amsReadComm(EEPROM_ADDR, addr, &data) != 0){
        return 1;
    };

    return 0;
}