logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

eeprom_custom.c-template (1856B)


  1. /* Copyright 2019 Nick Brassel (tzarc)
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include <stdint.h>
  17. #include <string.h>
  18. #include "eeprom_driver.h"
  19. void eeprom_driver_init(void) {
  20. /* Any initialisation code */
  21. }
  22. void eeprom_driver_format(bool erase) {
  23. /* If erase=false, then only do the absolute minimum initialisation necessary
  24. to make sure that the eeprom driver is usable. It doesn't need to guarantee
  25. that the content of the eeprom is reset to any particular value. For many
  26. eeprom drivers this may be a no-op.
  27. If erase=true, then in addition to making sure the eeprom driver is in a
  28. usable state, also make sure that it is erased.
  29. */
  30. }
  31. void eeprom_driver_erase(void) {
  32. /* Wipe out the EEPROM, setting values to zero */
  33. }
  34. void eeprom_read_block(void *buf, const void *addr, size_t len) {
  35. /*
  36. Read a block of data:
  37. buf: target buffer
  38. addr: 0-based offset within the EEPROM
  39. len: length to read
  40. */
  41. }
  42. void eeprom_write_block(const void *buf, void *addr, size_t len) {
  43. /*
  44. Write a block of data:
  45. buf: target buffer
  46. addr: 0-based offset within the EEPROM
  47. len: length to write
  48. */
  49. }