aboutsummaryrefslogtreecommitdiff
path: root/docs/eeprom_driver.md
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2020-05-19 10:34:00 +1000
committerGitHub <noreply@github.com>2020-05-19 10:34:00 +1000
commit54b04d96651a166088477ccf513fa534b30b2132 (patch)
treebace05e50e18069f269d6826800dd82dc2d8afbb /docs/eeprom_driver.md
parent4604c70c4c1a0cb2cebc010dba34b04e902bd982 (diff)
downloadqmk_firmware-54b04d96651a166088477ccf513fa534b30b2132.tar.gz
qmk_firmware-54b04d96651a166088477ccf513fa534b30b2132.zip
Add SPI 25xx EEPROM support. (#8780)
Diffstat (limited to 'docs/eeprom_driver.md')
-rw-r--r--docs/eeprom_driver.md29
1 files changed, 24 insertions, 5 deletions
diff --git a/docs/eeprom_driver.md b/docs/eeprom_driver.md
index 5a91a7c2d..188b95caa 100644
--- a/docs/eeprom_driver.md
+++ b/docs/eeprom_driver.md
@@ -1,4 +1,4 @@
1# EEPROM Driver Configuration 1# EEPROM Driver Configuration :id=eeprom-driver-configuration
2 2
3The EEPROM driver can be swapped out depending on the needs of the keyboard, or whether extra hardware is present. 3The EEPROM driver can be swapped out depending on the needs of the keyboard, or whether extra hardware is present.
4 4
@@ -6,15 +6,20 @@ Driver | Description
6-----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 6-----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
7`EEPROM_DRIVER = vendor` (default) | Uses the on-chip driver provided by the chip manufacturer. For AVR, this is provided by avr-libc. This is supported on ARM for a subset of chips -- STM32F3xx, STM32F1xx, and STM32F072xB will be emulated by writing to flash. STM32L0xx and STM32L1xx will use the onboard dedicated true EEPROM. Other chips will generally act as "transient" below. 7`EEPROM_DRIVER = vendor` (default) | Uses the on-chip driver provided by the chip manufacturer. For AVR, this is provided by avr-libc. This is supported on ARM for a subset of chips -- STM32F3xx, STM32F1xx, and STM32F072xB will be emulated by writing to flash. STM32L0xx and STM32L1xx will use the onboard dedicated true EEPROM. Other chips will generally act as "transient" below.
8`EEPROM_DRIVER = i2c` | Supports writing to I2C-based 24xx EEPROM chips. See the driver section below. 8`EEPROM_DRIVER = i2c` | Supports writing to I2C-based 24xx EEPROM chips. See the driver section below.
9`EEPROM_DRIVER = spi` | Supports writing to SPI-based 25xx EEPROM chips. See the driver section below.
9`EEPROM_DRIVER = transient` | Fake EEPROM driver -- supports reading/writing to RAM, and will be discarded when power is lost. 10`EEPROM_DRIVER = transient` | Fake EEPROM driver -- supports reading/writing to RAM, and will be discarded when power is lost.
10 11
11## Vendor Driver Configuration 12## Vendor Driver Configuration :id=vendor-eeprom-driver-configuration
13
14#### STM32 L0/L1 Configuration :id=stm32l0l1-eeprom-driver-configuration
12 15
13!> Resetting EEPROM using an STM32L0/L1 device takes up to 1 second for every 1kB of internal EEPROM used. 16!> Resetting EEPROM using an STM32L0/L1 device takes up to 1 second for every 1kB of internal EEPROM used.
14 17
15No configurable options are available. 18`config.h` override | Description | Default Value
19------------------------------------|--------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------
20`#define STM32_ONBOARD_EEPROM_SIZE` | The size of the EEPROM to use, in bytes. Erase times can be high, so it's configurable here, if not using the default value. | Minimum required to cover base _eeconfig_ data, or `1024` if VIA is enabled.
16 21
17## I2C Driver Configuration 22## I2C Driver Configuration :id=i2c-eeprom-driver-configuration
18 23
19Currently QMK supports 24xx-series chips over I2C. As such, requires a working i2c_master driver configuration. You can override the driver configuration via your config.h: 24Currently QMK supports 24xx-series chips over I2C. As such, requires a working i2c_master driver configuration. You can override the driver configuration via your config.h:
20 25
@@ -41,7 +46,21 @@ MB85RC256V FRAM | `#define EEPROM_I2C_MB85RC256V` | <https://www.adafruit.com/p
41 46
42?> If you find that the EEPROM is not cooperating, ensure you've correctly shifted up your EEPROM address by 1. For example, the datasheet might state the address as `0b01010000` -- the correct value of `EXTERNAL_EEPROM_I2C_BASE_ADDRESS` needs to be `0b10100000`. 47?> If you find that the EEPROM is not cooperating, ensure you've correctly shifted up your EEPROM address by 1. For example, the datasheet might state the address as `0b01010000` -- the correct value of `EXTERNAL_EEPROM_I2C_BASE_ADDRESS` needs to be `0b10100000`.
43 48
44## Transient Driver configuration 49## SPI Driver Configuration :id=spi-eeprom-driver-configuration
50
51Currently QMK supports 25xx-series chips over SPI. As such, requires a working spi_master driver configuration. You can override the driver configuration via your config.h:
52
53`config.h` override | Description | Default Value
54-----------------------------------------------|--------------------------------------------------------------------------------------|--------------
55`#define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN` | SPI Slave select pin in order to inform that the EEPROM is currently being addressed | _none_
56`#define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR` | Clock divisor used to divide the peripheral clock to derive the SPI frequency | `64`
57`#define EXTERNAL_EEPROM_BYTE_COUNT` | Total size of the EEPROM in bytes | 8192
58`#define EXTERNAL_EEPROM_PAGE_SIZE` | Page size of the EEPROM in bytes, as specified in the datasheet | 32
59`#define EXTERNAL_EEPROM_ADDRESS_SIZE` | The number of bytes to transmit for the memory location within the EEPROM | 2
60
61!> There's no way to determine if there is an SPI EEPROM actually responding. Generally, this will result in reads of nothing but zero.
62
63## Transient Driver configuration :id=transient-eeprom-driver-configuration
45 64
46The only configurable item for the transient EEPROM driver is its size: 65The only configurable item for the transient EEPROM driver is its size:
47 66