mikrokontrollersystemer-pro.../prosjekt.X/eeprom.h

51 lines
865 B
C
Raw Normal View History

2024-03-06 14:49:48 +00:00
/*
* File: eeprom.h
* Author: athamantis
*
* Created on 06 March 2024, 15:30
*/
#ifndef EEPROM_H
#define EEPROM_H
#ifdef __cplusplus
extern "C" {
#endif
#include <avr/io.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <avr/eeprom.h>
#include <stdbool.h>
2024-03-06 19:05:52 +00:00
// Struct for information on the controller.
2024-03-06 14:49:48 +00:00
typedef struct {
uint8_t fanSpeed;
} config_t;
2024-03-06 19:05:52 +00:00
// Check if EEPROM is ready to be written in
2024-03-06 14:49:48 +00:00
void checkEEpromIsReady();
2024-03-06 19:05:52 +00:00
// Writes a struct in EEPROM
2024-03-06 14:49:48 +00:00
void WriteStructInEEPROM(config_t writeStruct);
2024-03-06 19:05:52 +00:00
// Read data from EEPROM and return it as a controller struct
2024-03-06 14:49:48 +00:00
config_t ReadStructInEEPROM();
2024-03-06 19:05:52 +00:00
// Writes a datapoint in EEPROM
void WriteDataPointInEEPROM(uint8_t dataPoint, uint8_t data);
// Reads all the dataPoints form EEPROM
void ReadDataPointSpeedInfo(uint8_t data);
2024-03-06 14:49:48 +00:00
#ifdef __cplusplus
}
#endif
#endif /* EEPROM_H */