#ifndef _EEPROM_
#define _EEPROM_

#include "chip.h"
#include "board.h"
#include <stdio.h>

/** Slave address of chip (Chip address input pins are connected to GND => address = 0x0) */
#define EEPROM_ADDR   0x0

/** 24AA025E48 Control Byte */
#define EEPROM_CONTROL_BYTE 0x50

/** Page size of an 24AA025E48 chip (in bytes)*/
#define PAGE_SIZE       16


/** Definition of parameter address */
#define K_addr  0x02
#define Ti_addr  0x04
#define Td_addr  0x06
#define N_addr  0x08
#define Ts_addr  0x0A
#define w_addr  0x0C

float EEPROM_Read_Param(uint8_t address);
void EEPROM_Write_Param(uint8_t address, float value);
void PSD_Param_Init(float *K, float *Ti, float *Td, float *N, uint16_t *Ts, float *w);
void Twi_inst_init(void);

#endif  /*_EEPROM_*/
