Skip to content

Commit 4f12457

Browse files
authored
(develop)AP2: Enable support for WL EEPROM Driver (#17506)
1 parent fb05b49 commit 4f12457

File tree

6 files changed

+56
-0
lines changed

6 files changed

+56
-0
lines changed

keyboards/annepro2/c15/config.h

+18
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,21 @@
4949

5050
// Obins stock firmware has something similar to this already enabled, but disabled by default in QMK
5151
#define PERMISSIVE_HOLD
52+
53+
// SPI configuration
54+
#define SPI_DRIVER SPID1
55+
#define SPI_SCK_PIN A0
56+
#define SPI_MOSI_PIN A1
57+
#define SPI_MISO_PIN A2
58+
59+
// Flash configuration
60+
#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B6
61+
#define EXTERNAL_FLASH_SPI_CLOCK_DIVISOR 16
62+
#define EXTERNAL_FLASH_PAGE_SIZE 256
63+
#define EXTERNAL_FLASH_SECTOR_SIZE 4096
64+
#define EXTERNAL_FLASH_BLOCK_SIZE 4096
65+
#define EXTERNAL_FLASH_SIZE (256 * 1024) // 2M-bit flash size
66+
67+
// Wear-leveling driver configuration
68+
#define WEAR_LEVELING_LOGICAL_SIZE 1024
69+
#define WEAR_LEVELING_BACKING_SIZE (WEAR_LEVELING_LOGICAL_SIZE * 2)

keyboards/annepro2/c15/rules.mk

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
2626
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
2727
AUDIO_ENABLE = no # Audio output
2828

29+
# Wear-levelling driver
30+
EEPROM_DRIVER = wear_leveling
31+
WEAR_LEVELING_DRIVER = spi_flash
32+
2933
# Custom RGB matrix handling
3034
RGB_MATRIX_ENABLE = yes
3135
RGB_MATRIX_DRIVER = custom

keyboards/annepro2/c18/config.h

+18
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,21 @@
4747

4848
// Obins stock firmware has something similar to this already enabled, but disabled by default in QMK
4949
#define PERMISSIVE_HOLD
50+
51+
// SPI configuration
52+
#define SPI_DRIVER SPID1
53+
#define SPI_SCK_PIN A0
54+
#define SPI_MOSI_PIN A1
55+
#define SPI_MISO_PIN A2
56+
57+
// Flash configuration
58+
#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN A3
59+
#define EXTERNAL_FLASH_SPI_CLOCK_DIVISOR 16
60+
#define EXTERNAL_FLASH_PAGE_SIZE 256
61+
#define EXTERNAL_FLASH_SECTOR_SIZE 4096
62+
#define EXTERNAL_FLASH_BLOCK_SIZE 4096
63+
#define EXTERNAL_FLASH_SIZE (256 * 1024) // 2M-bit flash size
64+
65+
// Wear-leveling driver configuration
66+
#define WEAR_LEVELING_LOGICAL_SIZE 1024
67+
#define WEAR_LEVELING_BACKING_SIZE (WEAR_LEVELING_LOGICAL_SIZE * 2)

keyboards/annepro2/c18/rules.mk

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
2626
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
2727
AUDIO_ENABLE = no # Audio output
2828

29+
# Wear-levelling driver
30+
EEPROM_DRIVER = wear_leveling
31+
WEAR_LEVELING_DRIVER = spi_flash
32+
2933
# Custom RGB matrix handling
3034
RGB_MATRIX_ENABLE = yes
3135
RGB_MATRIX_DRIVER = custom

keyboards/annepro2/halconf.h

+4
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@
2525

2626
#define SERIAL_USB_BUFFERS_SIZE 256
2727

28+
#define HAL_USE_SPI TRUE
29+
#define SPI_USE_WAIT TRUE
30+
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
31+
2832
#include_next <halconf.h>

keyboards/annepro2/mcuconf.h

+8
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,11 @@
6060

6161
#define HT32_USB_USE_USB0 TRUE
6262
#define HT32_USB_USB0_IRQ_PRIORITY 5
63+
64+
/*
65+
* SPI driver setting
66+
*/
67+
68+
#define HT32_SPI_USE_SPI1 TRUE
69+
#define HT32_SPI1_IRQ_PRIORITY 9
70+

0 commit comments

Comments
 (0)