diff options
| author | Nick Brassel <nick@tzarc.org> | 2019-11-06 08:04:50 +1100 |
|---|---|---|
| committer | Nick Brassel <nick@tzarc.org> | 2020-01-24 12:45:58 +1100 |
| commit | d13ada11622977bcc0b530212b4405229805016d (patch) | |
| tree | 3f8874ac3c9b5950b1fed6ac4d0081a268d9f487 /tmk_core/common/eeprom.h | |
| parent | 6ff093efbee21d3f64f5b4bfdbc66d4648490523 (diff) | |
| download | qmk_firmware-d13ada11622977bcc0b530212b4405229805016d.tar.gz qmk_firmware-d13ada11622977bcc0b530212b4405229805016d.zip | |
Add customisable EEPROM driver selection (#7274)
- uprintf -> dprintf
- Fix atsam "vendor" eeprom.
- Bump Kinetis K20x to 64 bytes, too.
- Rollback Kinetis to 32 bytes as partitioning can only be done once. Add warning about changing the value.
- Change RAM-backed "fake" EEPROM implementations to match eeconfig's current usage.
- Add 24LC128 by request.
Diffstat (limited to 'tmk_core/common/eeprom.h')
| -rw-r--r-- | tmk_core/common/eeprom.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tmk_core/common/eeprom.h b/tmk_core/common/eeprom.h index fcd1667c0..8a81e7066 100644 --- a/tmk_core/common/eeprom.h +++ b/tmk_core/common/eeprom.h | |||
| @@ -1,23 +1,24 @@ | |||
| 1 | #ifndef TMK_CORE_COMMON_EEPROM_H_ | 1 | #ifndef TMK_CORE_COMMON_EEPROM_H_ |
| 2 | #define TMK_CORE_COMMON_EEPROM_H_ | 2 | #define TMK_CORE_COMMON_EEPROM_H_ |
| 3 | 3 | ||
| 4 | #if defined(__AVR__) | 4 | #if defined(__AVR__) && !defined(EEPROM_DRIVER) |
| 5 | # include <avr/eeprom.h> | 5 | # include <avr/eeprom.h> |
| 6 | #else | 6 | #else |
| 7 | # include <stdint.h> | 7 | # include <stdint.h> |
| 8 | # include <stdlib.h> | ||
| 8 | 9 | ||
| 9 | uint8_t eeprom_read_byte(const uint8_t *__p); | 10 | uint8_t eeprom_read_byte(const uint8_t *__p); |
| 10 | uint16_t eeprom_read_word(const uint16_t *__p); | 11 | uint16_t eeprom_read_word(const uint16_t *__p); |
| 11 | uint32_t eeprom_read_dword(const uint32_t *__p); | 12 | uint32_t eeprom_read_dword(const uint32_t *__p); |
| 12 | void eeprom_read_block(void *__dst, const void *__src, uint32_t __n); | 13 | void eeprom_read_block(void *__dst, const void *__src, size_t __n); |
| 13 | void eeprom_write_byte(uint8_t *__p, uint8_t __value); | 14 | void eeprom_write_byte(uint8_t *__p, uint8_t __value); |
| 14 | void eeprom_write_word(uint16_t *__p, uint16_t __value); | 15 | void eeprom_write_word(uint16_t *__p, uint16_t __value); |
| 15 | void eeprom_write_dword(uint32_t *__p, uint32_t __value); | 16 | void eeprom_write_dword(uint32_t *__p, uint32_t __value); |
| 16 | void eeprom_write_block(const void *__src, void *__dst, uint32_t __n); | 17 | void eeprom_write_block(const void *__src, void *__dst, size_t __n); |
| 17 | void eeprom_update_byte(uint8_t *__p, uint8_t __value); | 18 | void eeprom_update_byte(uint8_t *__p, uint8_t __value); |
| 18 | void eeprom_update_word(uint16_t *__p, uint16_t __value); | 19 | void eeprom_update_word(uint16_t *__p, uint16_t __value); |
| 19 | void eeprom_update_dword(uint32_t *__p, uint32_t __value); | 20 | void eeprom_update_dword(uint32_t *__p, uint32_t __value); |
| 20 | void eeprom_update_block(const void *__src, void *__dst, uint32_t __n); | 21 | void eeprom_update_block(const void *__src, void *__dst, size_t __n); |
| 21 | #endif | 22 | #endif |
| 22 | 23 | ||
| 23 | #endif /* TMK_CORE_COMMON_EEPROM_H_ */ | 24 | #endif /* TMK_CORE_COMMON_EEPROM_H_ */ |
