8 #include "eeprom_stm32.h"
11 /** \brief eeconfig initialization
15 void eeconfig_init(void)
20 eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
21 eeprom_update_byte(EECONFIG_DEBUG, 0);
22 eeprom_update_byte(EECONFIG_DEFAULT_LAYER, 0);
23 eeprom_update_byte(EECONFIG_KEYMAP, 0);
24 eeprom_update_byte(EECONFIG_MOUSEKEY_ACCEL, 0);
25 #ifdef BACKLIGHT_ENABLE
26 eeprom_update_byte(EECONFIG_BACKLIGHT, 0);
29 eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default
31 #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
32 eeprom_update_dword(EECONFIG_RGBLIGHT, 0);
35 eeprom_update_byte(EECONFIG_STENOMODE, 0);
39 /** \brief eeconfig enable
43 void eeconfig_enable(void)
45 eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
48 /** \brief eeconfig disable
52 void eeconfig_disable(void)
57 eeprom_update_word(EECONFIG_MAGIC, 0xFFFF);
60 /** \brief eeconfig is enabled
64 bool eeconfig_is_enabled(void)
66 return (eeprom_read_word(EECONFIG_MAGIC) == EECONFIG_MAGIC_NUMBER);
69 /** \brief eeconfig read debug
73 uint8_t eeconfig_read_debug(void) { return eeprom_read_byte(EECONFIG_DEBUG); }
74 /** \brief eeconfig update debug
78 void eeconfig_update_debug(uint8_t val) { eeprom_update_byte(EECONFIG_DEBUG, val); }
80 /** \brief eeconfig read default layer
84 uint8_t eeconfig_read_default_layer(void) { return eeprom_read_byte(EECONFIG_DEFAULT_LAYER); }
85 /** \brief eeconfig update default layer
89 void eeconfig_update_default_layer(uint8_t val) { eeprom_update_byte(EECONFIG_DEFAULT_LAYER, val); }
91 /** \brief eeconfig read keymap
95 uint8_t eeconfig_read_keymap(void) { return eeprom_read_byte(EECONFIG_KEYMAP); }
96 /** \brief eeconfig update keymap
100 void eeconfig_update_keymap(uint8_t val) { eeprom_update_byte(EECONFIG_KEYMAP, val); }
102 #ifdef BACKLIGHT_ENABLE
103 /** \brief eeconfig read backlight
107 uint8_t eeconfig_read_backlight(void) { return eeprom_read_byte(EECONFIG_BACKLIGHT); }
108 /** \brief eeconfig update backlight
112 void eeconfig_update_backlight(uint8_t val) { eeprom_update_byte(EECONFIG_BACKLIGHT, val); }
116 /** \brief eeconfig read audio
120 uint8_t eeconfig_read_audio(void) { return eeprom_read_byte(EECONFIG_AUDIO); }
121 /** \brief eeconfig update audio
125 void eeconfig_update_audio(uint8_t val) { eeprom_update_byte(EECONFIG_AUDIO, val); }