diff --git a/keyboards/yandrstudio/whiteMouse28T/f401/config.h b/keyboards/yandrstudio/whiteMouse28T/f401/config.h index 4657f08d1db3..d4a4a9d63228 100644 --- a/keyboards/yandrstudio/whiteMouse28T/f401/config.h +++ b/keyboards/yandrstudio/whiteMouse28T/f401/config.h @@ -84,4 +84,13 @@ #endif +#define SERIAL_DRIVER SD1 +#define SD1_TX_PIN A9 +#define SD1_TX_PAL_MODE 7 +#define SD1_RX_PIN A10 +#define SD1_RX_PAL_MODE 7 + + +#define ADC_RESOLUTION ADC_CFGR1_RES_12BIT + diff --git a/keyboards/yandrstudio/whiteMouse28T/f401/halconf.h b/keyboards/yandrstudio/whiteMouse28T/f401/halconf.h index 6dfee8652349..1887845f4a8f 100644 --- a/keyboards/yandrstudio/whiteMouse28T/f401/halconf.h +++ b/keyboards/yandrstudio/whiteMouse28T/f401/halconf.h @@ -25,12 +25,18 @@ #define HAL_USE_SERIAL TRUE #undef HAL_USE_SPI -#define HAL_USE_SPI TRUE +#define HAL_USE_SPI FALSE +#undef HAL_USE_ADC +#define HAL_USE_ADC TRUE -#undef SERIAL_USB_BUFFERS_SIZE + +#undef SERIAL_USB_BUFFERS_SIZE #define SERIAL_USB_BUFFERS_SIZE 256 +#undef SERIAL_BUFFERS_SIZE +#define SERIAL_BUFFERS_SIZE 128 + #undef SPI_USE_WAIT #define SPI_USE_WAIT TRUE diff --git a/keyboards/yandrstudio/whiteMouse28T/f401/mcuconf.h b/keyboards/yandrstudio/whiteMouse28T/f401/mcuconf.h index 3e8d9acc921e..a12c489dd75c 100644 --- a/keyboards/yandrstudio/whiteMouse28T/f401/mcuconf.h +++ b/keyboards/yandrstudio/whiteMouse28T/f401/mcuconf.h @@ -22,11 +22,15 @@ #define STM32_PWM_USE_TIM3 TRUE #undef STM32_SPI_USE_SPI1 -#define STM32_SPI_USE_SPI1 TRUE +#define STM32_SPI_USE_SPI1 FALSE #undef STM32_SERIAL_USE_USART1 #define STM32_SERIAL_USE_USART1 TRUE + +#undef STM32_ADC_USE_ADC1 +#define STM32_ADC_USE_ADC1 TRUE + #undef STM32_NO_INIT #undef STM32_HSI_ENABLED #undef STM32_LSI_ENABLED diff --git a/keyboards/yandrstudio/whiteMouse28T/f401/rules.mk b/keyboards/yandrstudio/whiteMouse28T/f401/rules.mk index a5a7c16b1bbe..fa028e805a42 100644 --- a/keyboards/yandrstudio/whiteMouse28T/f401/rules.mk +++ b/keyboards/yandrstudio/whiteMouse28T/f401/rules.mk @@ -17,9 +17,11 @@ RGB_MATRIX_DRIVER = WS2812 # RGBLIGHT_DRIVER = WS2812 WS2812_DRIVER = pwm -EEPROM_DRIVER = spi -# EEPROM_DRIVER = custom -# SRC += eep/eeprom_stm32.c -# SRC += eep/flash_stm32.c -# OPT_DEFS += -DEEPROM_EMU_STM32F401xC -# COMMON_VPATH += keyboards/yandrstudio/whiteMouse28T/f401/eep +# EEPROM_DRIVER = spi +EEPROM_DRIVER = custom +SRC += eep/eeprom_stm32.c +SRC += eep/flash_stm32.c +OPT_DEFS += -DEEPROM_EMU_STM32F401xC +COMMON_VPATH += keyboards/yandrstudio/whiteMouse28T/f401/eep + +SRC += analog.c diff --git a/keyboards/yandrstudio/whiteMouse28T/keymaps/uart/keymap.c b/keyboards/yandrstudio/whiteMouse28T/keymaps/uartAdc/keymap.c similarity index 96% rename from keyboards/yandrstudio/whiteMouse28T/keymaps/uart/keymap.c rename to keyboards/yandrstudio/whiteMouse28T/keymaps/uartAdc/keymap.c index e562c6dd92f4..fab81beb6a9c 100644 --- a/keyboards/yandrstudio/whiteMouse28T/keymaps/uart/keymap.c +++ b/keyboards/yandrstudio/whiteMouse28T/keymaps/uartAdc/keymap.c @@ -16,6 +16,7 @@ #include QMK_KEYBOARD_H #include "uart.h" #include "print.h" +#include "analog.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -49,6 +50,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { uart_putchar(keycode >> 8); uart_putchar(keycode & 0xff); uart_putchar(0xfe); + uprintf("Adc read: %d\n", analogReadPinAdc(A4,0)); uprintf("KL: kc: 0x%04X, col: %u, row: %u, pressed: %b, time: %u, interrupt: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count); } return true; diff --git a/keyboards/yandrstudio/whiteMouse28T/keymaps/uart/rules.mk b/keyboards/yandrstudio/whiteMouse28T/keymaps/uartAdc/rules.mk similarity index 97% rename from keyboards/yandrstudio/whiteMouse28T/keymaps/uart/rules.mk rename to keyboards/yandrstudio/whiteMouse28T/keymaps/uartAdc/rules.mk index d643d5f76138..94cba27f75f6 100644 --- a/keyboards/yandrstudio/whiteMouse28T/keymaps/uart/rules.mk +++ b/keyboards/yandrstudio/whiteMouse28T/keymaps/uartAdc/rules.mk @@ -1,2 +1,3 @@ VIA_ENABLE = yes + QUANTUM_LIB_SRC += uart.c