Skip to content

Commit

Permalink
Added FLASH_DRIVER configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Joy committed Dec 7, 2021
1 parent d8dd74d commit d6f89b7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
12 changes: 12 additions & 0 deletions common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,18 @@ else
endif
endif

VALID_FLASH_DRIVER_TYPES := spi
ifeq ($(filter $(FLASH_DRIVER),$(VALID_FLASH_DRIVER_TYPES)),)
$(error FLASH_DRIVER="$(FLASH_DRIVER)" is not a valid FLASH driver)
else
OPT_DEFS += -DFLASH_ENABLE
ifeq ($(strip $(EEPROM_DRIVER)), spi)
OPT_DEFS += -DFLASH_DRIVER -DFLASH_SPI
COMMON_VPATH += $(DRIVER_PATH)/flash
SRC += flash_spi.c
endif
endif

RGBLIGHT_ENABLE ?= no
VALID_RGBLIGHT_TYPES := WS2812 APA102 custom

Expand Down
11 changes: 10 additions & 1 deletion docs/flash_driver.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# SPI FLASH Driver Configuration :id=spi-flash-driver-configuration
# FLASH Driver Configuration :id=flash-driver-configuration

The FLASH driver can be swapped out depending on the needs of the keyboard, or whether extra hardware is present.

Driver | Description
-----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
`FLASH_DRIVER = spi` | Supports writing to almost all NOR Flash chips. See the driver section below.


## SPI FLASH Driver Configuration :id=spi-flash-driver-configuration

Currently QMK supports almost all NOR Flash chips over SPI. As such, requires a working spi_master driver configuration. You can override the driver configuration via your config.h:

Expand Down

0 comments on commit d6f89b7

Please sign in to comment.