| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- /*
- * Eeprom.h
- *
- * Created on: 14 janv. 2019
- * Author: e_rcluze
- *
- *Le fonctionement de l'Eeprom est en Fifo.
- *L'adrresse du pointeur de lecture est stocker dans les 16 premier byte de l'eeprom
- *L'adrresse du pointeur d'ecriture est stocker dans les 16 bit suivant
- *
- *
- *
- *
- */
- #ifndef EEPROM_H_
- #define EEPROM_H_
- #include <stdint.h>
- #include "i2c.h"
- #define EepromADD 0XA0
- typedef struct {
- I2C_HandleTypeDef I2C;
- GPIO_TypeDef WC_PORT;
- uint16_t WC_PIN;
- } EEprom_HandleTypeDef;
- EEprom_HandleTypeDef EEprom;
- /****Private fonction */
- void readEeprom(uint8_t *tab, int len);
- void writeEeprom(uint8_t *tab, int len);
- uint16_t readPointerEcriture();
- void writePointerEcriture(uint16_t p);
- uint16_t readPointerLecture();
- void writePointerLecture(uint16_t p);
- /** Public Fonction*/
- void initEprom(I2C_HandleTypeDef typ, GPIO_TypeDef port, uint16_t pin);
- void writeData(uint16_t add, uint8_t *tab, uint8_t size);
- void readData(uint16_t add, uint8_t *tab, uint8_t size);
- void testEeprom(); //fonction pour tester le hard de l'Eeprom
- #endif /* EEPROM_H_ */
|