3 #include <avr/eeprom.h>
6 void eeconfig_init(void)
8 eeprom_write_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
9 eeprom_write_byte(EECONFIG_DEBUG, 0);
10 eeprom_write_byte(EECONFIG_DEFAULT_LAYER, 0);
11 eeprom_write_byte(EECONFIG_KEYMAP, 0);
12 eeprom_write_byte(EECONFIG_MOUSEKEY_ACCEL, 0);
15 void eeconfig_enable(void)
17 eeprom_write_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
20 void eeconfig_disable(void)
22 eeprom_write_word(EECONFIG_MAGIC, 0xFFFF);
25 bool eeconfig_is_enabled(void)
27 return (eeprom_read_word(EECONFIG_MAGIC) == EECONFIG_MAGIC_NUMBER);
30 uint8_t eeconfig_read_debug(void) { return eeprom_read_byte(EECONFIG_DEBUG); }
31 void eeconfig_write_debug(uint8_t val) { eeprom_write_byte(EECONFIG_DEBUG, val); }
33 uint8_t eeconfig_read_defalt_layer(void) { return eeprom_read_byte(EECONFIG_DEFAULT_LAYER); }
34 void eeconfig_write_defalt_layer(uint8_t val) { eeprom_write_byte(EECONFIG_DEFAULT_LAYER, val); }
36 uint8_t eeconfig_read_keymap(void) { return eeprom_read_byte(EECONFIG_KEYMAP); }
37 void eeconfig_write_keymap(uint8_t val) { eeprom_write_byte(EECONFIG_KEYMAP, val); }