/* * File: eeprom.h * Author: Helle Augland Grasmo, Sebastian H. Gabrielli * * Created on 06 March 2024, 15:30 */ #ifndef EEPROM_H #define EEPROM_H #ifdef __cplusplus extern "C" { #endif #include #include #include #include #include #include // The code is inspired by "EEPROM handling" form avr-libc // web link: https://www.nongnu.org/avr-libc/user-manual/group__avr__eeprom.html // Struct for information on the controller. typedef struct { uint16_t ms_fanspeed_sample_rate; } config_t; // Check if EEPROM is ready to be written to void check_eeprom_is_ready(); // Writes a config_t struct to the EEPROM void write_struct_from_EEPROM(config_t write_struct); // Read data from EEPROM and return it as a config_t struct config_t read_struct_from_EEPROM(); #ifdef __cplusplus } #endif #endif /* EEPROM_H */