43 lines
756 B
C
43 lines
756 B
C
/*
|
|
* 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 <avr/io.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <stdint.h>
|
|
#include <avr/eeprom.h>
|
|
#include <stdbool.h>
|
|
|
|
// Struct for information on the controller.
|
|
typedef struct {
|
|
uint16_t 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 */
|
|
|