aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2019-08-15 14:57:43 +0100
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-08-15 06:57:43 -0700
commitee8d9bd40ad4f5b8d23be951d652143582d42938 (patch)
treedd140df4b5336f36edab6405268bda440fe74564
parentd578aaefcd70ce7cfa69049fac57a2a5fb1c3571 (diff)
downloadqmk_firmware-ee8d9bd40ad4f5b8d23be951d652143582d42938.tar.gz
qmk_firmware-ee8d9bd40ad4f5b8d23be951d652143582d42938.zip
Remove duplicate test keyboards (#6539)
* Remove test keyboards now onekey and splittest have been extended * Add f072 for testing
-rw-r--r--keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c49
-rw-r--r--keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h166
-rw-r--r--keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk5
-rw-r--r--keyboards/chibios_test/boards/GENERIC_STM32_F103/mini_stm32_mapping.pngbin162908 -> 0 bytes
-rw-r--r--keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.c111
-rw-r--r--keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.h923
-rw-r--r--keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.mk5
-rw-r--r--keyboards/chibios_test/boards/maple_mini_mapping.pngbin237977 -> 0 bytes
-rw-r--r--keyboards/chibios_test/chibios_test.c1
-rw-r--r--keyboards/chibios_test/chibios_test.h8
-rw-r--r--keyboards/chibios_test/config.h65
-rw-r--r--keyboards/chibios_test/keymaps/default/keymap.c22
-rw-r--r--keyboards/chibios_test/ld/MKL26Z64.ld105
-rw-r--r--keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld88
-rw-r--r--keyboards/chibios_test/readme.md3
-rw-r--r--keyboards/chibios_test/rules.mk10
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/bootloader_defs.h7
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/config.h7
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/led.c34
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/matrix.c163
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/readme.md3
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.c1
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.h7
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/bootloader_defs.h10
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/chconf.h524
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/config.h6
-rwxr-xr-xkeyboards/chibios_test/stm32_f103_onekey/flash.sh2
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/halconf.h353
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/led.c43
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/matrix.c177
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/mcuconf.h209
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/readme.md3
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/rules.mk47
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.c1
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.h7
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/chconf.h524
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/config.h6
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/halconf.h354
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/instructions.md97
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/led.c32
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/matrix.c163
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/mcuconf.h55
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/readme.md3
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/rules.mk45
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.c1
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.h7
-rw-r--r--keyboards/handwired/onekey/stm32f0_disco/chconf.h (renamed from keyboards/chibios_test/stm32_f072_onekey/chconf.h)0
-rw-r--r--keyboards/handwired/onekey/stm32f0_disco/config.h (renamed from keyboards/proton_c/proton_c.h)9
-rw-r--r--keyboards/handwired/onekey/stm32f0_disco/halconf.h (renamed from keyboards/chibios_test/stm32_f072_onekey/halconf.h)2
-rw-r--r--keyboards/handwired/onekey/stm32f0_disco/mcuconf.h (renamed from keyboards/chibios_test/stm32_f072_onekey/mcuconf.h)2
-rw-r--r--keyboards/handwired/onekey/stm32f0_disco/readme.md5
-rw-r--r--keyboards/handwired/onekey/stm32f0_disco/rules.mk (renamed from keyboards/chibios_test/stm32_f072_onekey/rules.mk)10
-rw-r--r--keyboards/proton_c/config.h114
-rw-r--r--keyboards/proton_c/keymaps/default/keymap.c21
-rw-r--r--keyboards/proton_c/proton_c.c25
-rw-r--r--keyboards/proton_c/readme.md16
-rw-r--r--keyboards/proton_c/rules.mk17
57 files changed, 17 insertions, 4656 deletions
diff --git a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c
deleted file mode 100644
index 2809c9d18..000000000
--- a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#include "hal.h"
18
19/**
20 * @brief PAL setup.
21 * @details Digital I/O ports static configuration as defined in @p board.h.
22 * This variable is used by the HAL when initializing the PAL driver.
23 */
24#if HAL_USE_PAL || defined(__DOXYGEN__)
25const PALConfig pal_default_config =
26{
27 {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},
28 {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},
29 {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},
30 {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH},
31 {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH},
32};
33#endif
34
35/*
36 * Early initialization code.
37 * This initialization must be performed just after stack setup and before
38 * any other initialization.
39 */
40void __early_init(void) {
41
42 stm32_clock_init();
43}
44
45/*
46 * Board-specific initialization code.
47 */
48void boardInit(void) {
49}
diff --git a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h
deleted file mode 100644
index b31d74307..000000000
--- a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h
+++ /dev/null
@@ -1,166 +0,0 @@
1/*
2 ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#ifndef _BOARD_H_
18#define _BOARD_H_
19
20/*
21 * Setup for a Generic STM32F103 board.
22 */
23
24/*
25 * Board identifier.
26 */
27#define BOARD_GENERIC_STM32_F103
28#define BOARD_NAME "Generic STM32F103x board"
29
30/*
31 * Board frequencies.
32 */
33#define STM32_LSECLK 32768
34#define STM32_HSECLK 8000000
35
36/*
37 * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.
38 */
39#define STM32F103xB
40
41/*
42 * IO pins assignments
43 */
44
45/* on-board */
46
47#define GPIOC_LED 13
48#define GPIOD_OSC_IN 0
49#define GPIOD_OSC_OUT 1
50
51/* In case your board has a "USB enable" hardware
52 controlled by a pin, define it here. (It could be just
53 a 1.5k resistor connected to D+ line.)
54*/
55/*
56#define GPIOB_USB_DISC 10
57*/
58
59/*
60 * I/O ports initial setup, this configuration is established soon after reset
61 * in the initialization code.
62 *
63 * The digits have the following meaning:
64 * 0 - Analog input.
65 * 1 - Push Pull output 10MHz.
66 * 2 - Push Pull output 2MHz.
67 * 3 - Push Pull output 50MHz.
68 * 4 - Digital input.
69 * 5 - Open Drain output 10MHz.
70 * 6 - Open Drain output 2MHz.
71 * 7 - Open Drain output 50MHz.
72 * 8 - Digital input with PullUp or PullDown resistor depending on ODR.
73 * 9 - Alternate Push Pull output 10MHz.
74 * A - Alternate Push Pull output 2MHz.
75 * B - Alternate Push Pull output 50MHz.
76 * C - Reserved.
77 * D - Alternate Open Drain output 10MHz.
78 * E - Alternate Open Drain output 2MHz.
79 * F - Alternate Open Drain output 50MHz.
80 * Please refer to the STM32 Reference Manual for details.
81 */
82
83/*
84 * Port A setup.
85 * Everything input with pull-up except:
86 * PA2 - Alternate output (USART2 TX).
87 * PA3 - Normal input (USART2 RX).
88 * PA9 - Alternate output (USART1 TX).
89 * PA10 - Normal input (USART1 RX).
90 */
91#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */
92#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */
93#define VAL_GPIOAODR 0xFFFFFFFF
94
95/*
96 * Port B setup.
97 * Everything input with pull-up except:
98 * PB10 - Push Pull output (USB switch).
99 */
100#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */
101#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */
102#define VAL_GPIOBODR 0xFFFFFFFF
103
104/*
105 * Port C setup.
106 * Everything input with pull-up except:
107 * PC13 - Push Pull output (LED).
108 */
109#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */
110#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */
111#define VAL_GPIOCODR 0xFFFFFFFF
112
113/*
114 * Port D setup.
115 * Everything input with pull-up except:
116 * PD0 - Normal input (XTAL).
117 * PD1 - Normal input (XTAL).
118 */
119#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */
120#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */
121#define VAL_GPIODODR 0xFFFFFFFF
122
123/*
124 * Port E setup.
125 * Everything input with pull-up except:
126 */
127#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */
128#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */
129#define VAL_GPIOEODR 0xFFFFFFFF
130
131/*
132 * USB bus activation macro, required by the USB driver.
133 */
134/* The point is that most of the generic STM32F103* boards
135 have a 1.5k resistor connected on one end to the D+ line
136 and on the other end to some pin. Or even a slightly more
137 complicated "USB enable" circuit, controlled by a pin.
138 That should go here.
139
140 However on some boards (e.g. one that I have), there's no
141 such hardware. In which case it's better to not do anything.
142*/
143/*
144#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC)
145*/
146#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT);
147
148/*
149 * USB bus de-activation macro, required by the USB driver.
150 */
151/*
152#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC)
153*/
154#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12);
155
156#if !defined(_FROM_ASM_)
157#ifdef __cplusplus
158extern "C" {
159#endif
160 void boardInit(void);
161#ifdef __cplusplus
162}
163#endif
164#endif /* _FROM_ASM_ */
165
166#endif /* _BOARD_H_ */
diff --git a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk
deleted file mode 100644
index 6b8b312fd..000000000
--- a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk
+++ /dev/null
@@ -1,5 +0,0 @@
1# List of all the board related files.
2BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F103/board.c
3
4# Required include directories
5BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F103
diff --git a/keyboards/chibios_test/boards/GENERIC_STM32_F103/mini_stm32_mapping.png b/keyboards/chibios_test/boards/GENERIC_STM32_F103/mini_stm32_mapping.png
deleted file mode 100644
index c44a7d9eb..000000000
--- a/keyboards/chibios_test/boards/GENERIC_STM32_F103/mini_stm32_mapping.png
+++ /dev/null
Binary files differ
diff --git a/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.c
deleted file mode 100644
index 7e9f90853..000000000
--- a/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.c
+++ /dev/null
@@ -1,111 +0,0 @@
1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/*
18 * This file has been automatically generated using ChibiStudio board
19 * generator plugin. Do not edit manually.
20 */
21
22#include "hal.h"
23
24#if HAL_USE_PAL || defined(__DOXYGEN__)
25/**
26 * @brief PAL setup.
27 * @details Digital I/O ports static configuration as defined in @p board.h.
28 * This variable is used by the HAL when initializing the PAL driver.
29 */
30const PALConfig pal_default_config = {
31#if STM32_HAS_GPIOA
32 {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR,
33 VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
34#endif
35#if STM32_HAS_GPIOB
36 {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR,
37 VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
38#endif
39#if STM32_HAS_GPIOC
40 {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR,
41 VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
42#endif
43#if STM32_HAS_GPIOD
44 {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR,
45 VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
46#endif
47#if STM32_HAS_GPIOE
48 {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR,
49 VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
50#endif
51#if STM32_HAS_GPIOF
52 {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR,
53 VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
54#endif
55#if STM32_HAS_GPIOG
56 {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR,
57 VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
58#endif
59#if STM32_HAS_GPIOH
60 {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR,
61 VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
62#endif
63#if STM32_HAS_GPIOI
64 {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
65 VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}
66#endif
67};
68#endif
69
70void enter_bootloader_mode_if_requested(void);
71
72/**
73 * @brief Early initialization code.
74 * @details This initialization must be performed just after stack setup
75 * and before any other initialization.
76 */
77void __early_init(void) {
78 enter_bootloader_mode_if_requested();
79 stm32_clock_init();
80}
81
82
83
84#if HAL_USE_MMC_SPI || defined(__DOXYGEN__)
85/**
86 * @brief MMC_SPI card detection.
87 */
88bool mmc_lld_is_card_inserted(MMCDriver *mmcp) {
89
90 (void)mmcp;
91 /* TODO: Fill the implementation.*/
92 return true;
93}
94
95/**
96 * @brief MMC_SPI card write protection detection.
97 */
98bool mmc_lld_is_write_protected(MMCDriver *mmcp) {
99
100 (void)mmcp;
101 /* TODO: Fill the implementation.*/
102 return false;
103}
104#endif
105
106/**
107 * @brief Board-specific initialization code.
108 * @todo Add your board-specific code, if any.
109 */
110void boardInit(void) {
111}
diff --git a/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.h
deleted file mode 100644
index 173f7b605..000000000
--- a/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.h
+++ /dev/null
@@ -1,923 +0,0 @@
1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/*
18 * This file has been automatically generated using ChibiStudio board
19 * generator plugin. Do not edit manually.
20 */
21
22#ifndef BOARD_H
23#define BOARD_H
24
25/*
26 * Setup for ST STM32F072B-Discovery board.
27 */
28
29/*
30 * Board identifier.
31 */
32#define BOARD_ST_STM32F072B_DISCOVERY
33#define BOARD_NAME "ST STM32F072B-Discovery"
34
35/*
36 * Board oscillators-related settings.
37 * NOTE: LSE not fitted.
38 * NOTE: HSE not fitted.
39 */
40#if !defined(STM32_LSECLK)
41#define STM32_LSECLK 0U
42#endif
43
44#define STM32_LSEDRV (3U << 3U)
45
46#if !defined(STM32_HSECLK)
47#define STM32_HSECLK 0U
48#endif
49
50#define STM32_HSE_BYPASS
51
52/*
53 * MCU type as defined in the ST header.
54 */
55#define STM32F072xB
56
57/*
58 * IO pins assignments.
59 */
60#define GPIOA_BUTTON 0U
61#define GPIOA_PIN1 1U
62#define GPIOA_PIN2 2U
63#define GPIOA_PIN3 3U
64#define GPIOA_PIN4 4U
65#define GPIOA_PIN5 5U
66#define GPIOA_PIN6 6U
67#define GPIOA_PIN7 7U
68#define GPIOA_PIN8 8U
69#define GPIOA_PIN9 9U
70#define GPIOA_PIN10 10U
71#define GPIOA_USB_DM 11U
72#define GPIOA_USB_DP 12U
73#define GPIOA_SWDIO 13U
74#define GPIOA_SWCLK 14U
75#define GPIOA_PIN15 15U
76
77#define GPIOB_PIN0 0U
78#define GPIOB_PIN1 1U
79#define GPIOB_PIN2 2U
80#define GPIOB_PIN3 3U
81#define GPIOB_PIN4 4U
82#define GPIOB_PIN5 5U
83#define GPIOB_PIN6 6U
84#define GPIOB_PIN7 7U
85#define GPIOB_PIN8 8U
86#define GPIOB_PIN9 9U
87#define GPIOB_PIN10 10U
88#define GPIOB_PIN11 11U
89#define GPIOB_PIN12 12U
90#define GPIOB_SPI2_SCK 13U
91#define GPIOB_SPI2_MISO 14U
92#define GPIOB_SPI2_MOSI 15U
93
94#define GPIOC_MEMS_CS 0U
95#define GPIOC_PIN1 1U
96#define GPIOC_PIN2 2U
97#define GPIOC_PIN3 3U
98#define GPIOC_PIN4 4U
99#define GPIOC_PIN5 5U
100#define GPIOC_LED_RED 6U
101#define GPIOC_LED_BLUE 7U
102#define GPIOC_LED_ORANGE 8U
103#define GPIOC_LED_GREEN 9U
104#define GPIOC_PIN10 10U
105#define GPIOC_PIN11 11U
106#define GPIOC_PIN12 12U
107#define GPIOC_PIN13 13U
108#define GPIOC_OSC32_IN 14U
109#define GPIOC_OSC32_OUT 15U
110
111#define GPIOD_PIN0 0U
112#define GPIOD_PIN1 1U
113#define GPIOD_PIN2 2U
114#define GPIOD_PIN3 3U
115#define GPIOD_PIN4 4U
116#define GPIOD_PIN5 5U
117#define GPIOD_PIN6 6U
118#define GPIOD_PIN7 7U
119#define GPIOD_PIN8 8U
120#define GPIOD_PIN9 9U
121#define GPIOD_PIN10 10U
122#define GPIOD_PIN11 11U
123#define GPIOD_PIN12 12U
124#define GPIOD_PIN13 13U
125#define GPIOD_PIN14 14U
126#define GPIOD_PIN15 15U
127
128#define GPIOE_PIN0 0U
129#define GPIOE_PIN1 1U
130#define GPIOE_PIN2 2U
131#define GPIOE_PIN3 3U
132#define GPIOE_PIN4 4U
133#define GPIOE_PIN5 5U
134#define GPIOE_PIN6 6U
135#define GPIOE_PIN7 7U
136#define GPIOE_PIN8 8U
137#define GPIOE_PIN9 9U
138#define GPIOE_PIN10 10U
139#define GPIOE_PIN11 11U
140#define GPIOE_PIN12 12U
141#define GPIOE_PIN13 13U
142#define GPIOE_PIN14 14U
143#define GPIOE_PIN15 15U
144
145#define GPIOF_OSC_IN 0U
146#define GPIOF_OSC_OUT 1U
147#define GPIOF_PIN2 2U
148#define GPIOF_PIN3 3U
149#define GPIOF_PIN4 4U
150#define GPIOF_PIN5 5U
151#define GPIOF_PIN6 6U
152#define GPIOF_PIN7 7U
153#define GPIOF_PIN8 8U
154#define GPIOF_PIN9 9U
155#define GPIOF_PIN10 10U
156#define GPIOF_PIN11 11U
157#define GPIOF_PIN12 12U
158#define GPIOF_PIN13 13U
159#define GPIOF_PIN14 14U
160#define GPIOF_PIN15 15U
161
162/*
163 * IO lines assignments.
164 */
165#define LINE_BUTTON PAL_LINE(GPIOA, 0U)
166#define LINE_USB_DM PAL_LINE(GPIOA, 11U)
167#define LINE_USB_DP PAL_LINE(GPIOA, 12U)
168#define LINE_SWDIO PAL_LINE(GPIOA, 13U)
169#define LINE_SWCLK PAL_LINE(GPIOA, 14U)
170
171#define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U)
172#define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U)
173#define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U)
174
175#define LINE_MEMS_CS PAL_LINE(GPIOC, 0U)
176#define LINE_LED_RED PAL_LINE(GPIOC, 6U)
177#define LINE_LED_BLUE PAL_LINE(GPIOC, 7U)
178#define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U)
179#define LINE_LED_GREEN PAL_LINE(GPIOC, 9U)
180#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U)
181#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U)
182
183
184
185#define LINE_OSC_IN PAL_LINE(GPIOF, 0U)
186#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U)
187
188/*
189 * I/O ports initial setup, this configuration is established soon after reset
190 * in the initialization code.
191 * Please refer to the STM32 Reference Manual for details.
192 */
193#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
194#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
195#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
196#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
197#define PIN_ODR_LOW(n) (0U << (n))
198#define PIN_ODR_HIGH(n) (1U << (n))
199#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
200#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
201#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
202#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
203#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
204#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
205#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
206#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
207#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
208#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
209
210/*
211 * GPIOA setup:
212 *
213 * PA0 - BUTTON (input floating).
214 * PA1 - PIN1 (input pullup).
215 * PA2 - PIN2 (input pullup).
216 * PA3 - PIN3 (input pullup).
217 * PA4 - PIN4 (input pullup).
218 * PA5 - PIN5 (input pullup).
219 * PA6 - PIN6 (input pullup).
220 * PA7 - PIN7 (input pullup).
221 * PA8 - PIN8 (input pullup).
222 * PA9 - PIN9 (input pullup).
223 * PA10 - PIN10 (input pullup).
224 * PA11 - USB_DM (input floating).
225 * PA12 - USB_DP (input floating).
226 * PA13 - SWDIO (alternate 0).
227 * PA14 - SWCLK (alternate 0).
228 * PA15 - PIN15 (input pullup).
229 */
230#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \
231 PIN_MODE_INPUT(GPIOA_PIN1) | \
232 PIN_MODE_INPUT(GPIOA_PIN2) | \
233 PIN_MODE_INPUT(GPIOA_PIN3) | \
234 PIN_MODE_INPUT(GPIOA_PIN4) | \
235 PIN_MODE_INPUT(GPIOA_PIN5) | \
236 PIN_MODE_INPUT(GPIOA_PIN6) | \
237 PIN_MODE_INPUT(GPIOA_PIN7) | \
238 PIN_MODE_INPUT(GPIOA_PIN8) | \
239 PIN_MODE_INPUT(GPIOA_PIN9) | \
240 PIN_MODE_INPUT(GPIOA_PIN10) | \
241 PIN_MODE_INPUT(GPIOA_USB_DM) | \
242 PIN_MODE_INPUT(GPIOA_USB_DP) | \
243 PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
244 PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
245 PIN_MODE_INPUT(GPIOA_PIN15))
246#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \
247 PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \
248 PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \
249 PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \
250 PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \
251 PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \
252 PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \
253 PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \
254 PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \
255 PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \
256 PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \
257 PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \
258 PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \
259 PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \
260 PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \
261 PIN_OTYPE_PUSHPULL(GPIOA_PIN15))
262#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \
263 PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \
264 PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \
265 PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \
266 PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \
267 PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \
268 PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \
269 PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \
270 PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \
271 PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \
272 PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \
273 PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \
274 PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \
275 PIN_OSPEED_HIGH(GPIOA_SWDIO) | \
276 PIN_OSPEED_HIGH(GPIOA_SWCLK) | \
277 PIN_OSPEED_HIGH(GPIOA_PIN15))
278#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \
279 PIN_PUPDR_PULLUP(GPIOA_PIN1) | \
280 PIN_PUPDR_PULLUP(GPIOA_PIN2) | \
281 PIN_PUPDR_PULLUP(GPIOA_PIN3) | \
282 PIN_PUPDR_PULLUP(GPIOA_PIN4) | \
283 PIN_PUPDR_PULLUP(GPIOA_PIN5) | \
284 PIN_PUPDR_PULLUP(GPIOA_PIN6) | \
285 PIN_PUPDR_PULLUP(GPIOA_PIN7) | \
286 PIN_PUPDR_PULLUP(GPIOA_PIN8) | \
287 PIN_PUPDR_PULLUP(GPIOA_PIN9) | \
288 PIN_PUPDR_PULLUP(GPIOA_PIN10) | \
289 PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \
290 PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \
291 PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \
292 PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \
293 PIN_PUPDR_PULLUP(GPIOA_PIN15))
294#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \
295 PIN_ODR_HIGH(GPIOA_PIN1) | \
296 PIN_ODR_HIGH(GPIOA_PIN2) | \
297 PIN_ODR_HIGH(GPIOA_PIN3) | \
298 PIN_ODR_HIGH(GPIOA_PIN4) | \
299 PIN_ODR_HIGH(GPIOA_PIN5) | \
300 PIN_ODR_HIGH(GPIOA_PIN6) | \
301 PIN_ODR_HIGH(GPIOA_PIN7) | \
302 PIN_ODR_HIGH(GPIOA_PIN8) | \
303 PIN_ODR_HIGH(GPIOA_PIN9) | \
304 PIN_ODR_HIGH(GPIOA_PIN10) | \
305 PIN_ODR_HIGH(GPIOA_USB_DM) | \
306 PIN_ODR_HIGH(GPIOA_USB_DP) | \
307 PIN_ODR_HIGH(GPIOA_SWDIO) | \
308 PIN_ODR_HIGH(GPIOA_SWCLK) | \
309 PIN_ODR_HIGH(GPIOA_PIN15))
310#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \
311 PIN_AFIO_AF(GPIOA_PIN1, 0U) | \
312 PIN_AFIO_AF(GPIOA_PIN2, 0U) | \
313 PIN_AFIO_AF(GPIOA_PIN3, 0U) | \
314 PIN_AFIO_AF(GPIOA_PIN4, 0U) | \
315 PIN_AFIO_AF(GPIOA_PIN5, 0U) | \
316 PIN_AFIO_AF(GPIOA_PIN6, 0U) | \
317 PIN_AFIO_AF(GPIOA_PIN7, 0U))
318#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \
319 PIN_AFIO_AF(GPIOA_PIN9, 0U) | \
320 PIN_AFIO_AF(GPIOA_PIN10, 0U) | \
321 PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \
322 PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \
323 PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \
324 PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \
325 PIN_AFIO_AF(GPIOA_PIN15, 0U))
326
327/*
328 * GPIOB setup:
329 *
330 * PB0 - PIN0 (input pullup).
331 * PB1 - PIN1 (input pullup).
332 * PB2 - PIN2 (input pullup).
333 * PB3 - PIN3 (input pullup).
334 * PB4 - PIN4 (input pullup).
335 * PB5 - PIN5 (input pullup).
336 * PB6 - PIN6 (input pullup).
337 * PB7 - PIN7 (input pullup).
338 * PB8 - PIN8 (input pullup).
339 * PB9 - PIN9 (input pullup).
340 * PB10 - PIN10 (input pullup).
341 * PB11 - PIN11 (input pullup).
342 * PB12 - PIN12 (input pullup).
343 * PB13 - SPI2_SCK (alternate 0).
344 * PB14 - SPI2_MISO (alternate 0).
345 * PB15 - SPI2_MOSI (alternate 0).
346 */
347#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \
348 PIN_MODE_INPUT(GPIOB_PIN1) | \
349 PIN_MODE_INPUT(GPIOB_PIN2) | \
350 PIN_MODE_INPUT(GPIOB_PIN3) | \
351 PIN_MODE_INPUT(GPIOB_PIN4) | \
352 PIN_MODE_INPUT(GPIOB_PIN5) | \
353 PIN_MODE_INPUT(GPIOB_PIN6) | \
354 PIN_MODE_INPUT(GPIOB_PIN7) | \
355 PIN_MODE_INPUT(GPIOB_PIN8) | \
356 PIN_MODE_INPUT(GPIOB_PIN9) | \
357 PIN_MODE_INPUT(GPIOB_PIN10) | \
358 PIN_MODE_INPUT(GPIOB_PIN11) | \
359 PIN_MODE_INPUT(GPIOB_PIN12) | \
360 PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \
361 PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \
362 PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI))
363#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \
364 PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \
365 PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \
366 PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \
367 PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \
368 PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \
369 PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \
370 PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \
371 PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \
372 PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \
373 PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \
374 PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
375 PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \
376 PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \
377 PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \
378 PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI))
379#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \
380 PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \
381 PIN_OSPEED_HIGH(GPIOB_PIN2) | \
382 PIN_OSPEED_HIGH(GPIOB_PIN3) | \
383 PIN_OSPEED_HIGH(GPIOB_PIN4) | \
384 PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \
385 PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \
386 PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \
387 PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \
388 PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \
389 PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \
390 PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \
391 PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \
392 PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \
393 PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \
394 PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI))
395#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \
396 PIN_PUPDR_PULLUP(GPIOB_PIN1) | \
397 PIN_PUPDR_PULLUP(GPIOB_PIN2) | \
398 PIN_PUPDR_PULLUP(GPIOB_PIN3) | \
399 PIN_PUPDR_PULLUP(GPIOB_PIN4) | \
400 PIN_PUPDR_PULLUP(GPIOB_PIN5) | \
401 PIN_PUPDR_PULLUP(GPIOB_PIN6) | \
402 PIN_PUPDR_PULLUP(GPIOB_PIN7) | \
403 PIN_PUPDR_PULLUP(GPIOB_PIN8) | \
404 PIN_PUPDR_PULLUP(GPIOB_PIN9) | \
405 PIN_PUPDR_PULLUP(GPIOB_PIN10) | \
406 PIN_PUPDR_PULLUP(GPIOB_PIN11) | \
407 PIN_PUPDR_PULLUP(GPIOB_PIN12) | \
408 PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \
409 PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \
410 PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI))
411#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \
412 PIN_ODR_HIGH(GPIOB_PIN1) | \
413 PIN_ODR_HIGH(GPIOB_PIN2) | \
414 PIN_ODR_HIGH(GPIOB_PIN3) | \
415 PIN_ODR_HIGH(GPIOB_PIN4) | \
416 PIN_ODR_HIGH(GPIOB_PIN5) | \
417 PIN_ODR_HIGH(GPIOB_PIN6) | \
418 PIN_ODR_HIGH(GPIOB_PIN7) | \
419 PIN_ODR_HIGH(GPIOB_PIN8) | \
420 PIN_ODR_HIGH(GPIOB_PIN9) | \
421 PIN_ODR_HIGH(GPIOB_PIN10) | \
422 PIN_ODR_HIGH(GPIOB_PIN11) | \
423 PIN_ODR_HIGH(GPIOB_PIN12) | \
424 PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \
425 PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \
426 PIN_ODR_HIGH(GPIOB_SPI2_MOSI))
427#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \
428 PIN_AFIO_AF(GPIOB_PIN1, 0U) | \
429 PIN_AFIO_AF(GPIOB_PIN2, 0U) | \
430 PIN_AFIO_AF(GPIOB_PIN3, 0U) | \
431 PIN_AFIO_AF(GPIOB_PIN4, 0U) | \
432 PIN_AFIO_AF(GPIOB_PIN5, 0U) | \
433 PIN_AFIO_AF(GPIOB_PIN6, 0U) | \
434 PIN_AFIO_AF(GPIOB_PIN7, 0U))
435#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \
436 PIN_AFIO_AF(GPIOB_PIN9, 0U) | \
437 PIN_AFIO_AF(GPIOB_PIN10, 0U) | \
438 PIN_AFIO_AF(GPIOB_PIN11, 0U) | \
439 PIN_AFIO_AF(GPIOB_PIN12, 0U) | \
440 PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \
441 PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \
442 PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U))
443
444/*
445 * GPIOC setup:
446 *
447 * PC0 - MEMS_CS (output pushpull maximum).
448 * PC1 - PIN1 (input pullup).
449 * PC2 - PIN2 (input pullup).
450 * PC3 - PIN3 (input pullup).
451 * PC4 - PIN4 (input pullup).
452 * PC5 - PIN5 (input pullup).
453 * PC6 - LED_RED (output pushpull maximum).
454 * PC7 - LED_BLUE (output pushpull maximum).
455 * PC8 - LED_ORANGE (output pushpull maximum).
456 * PC9 - LED_GREEN (output pushpull maximum).
457 * PC10 - PIN10 (input pullup).
458 * PC11 - PIN11 (input pullup).
459 * PC12 - PIN12 (input pullup).
460 * PC13 - PIN13 (input pullup).
461 * PC14 - OSC32_IN (input floating).
462 * PC15 - OSC32_OUT (input floating).
463 */
464#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \
465 PIN_MODE_INPUT(GPIOC_PIN1) | \
466 PIN_MODE_INPUT(GPIOC_PIN2) | \
467 PIN_MODE_INPUT(GPIOC_PIN3) | \
468 PIN_MODE_INPUT(GPIOC_PIN4) | \
469 PIN_MODE_INPUT(GPIOC_PIN5) | \
470 PIN_MODE_OUTPUT(GPIOC_LED_RED) | \
471 PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \
472 PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \
473 PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \
474 PIN_MODE_INPUT(GPIOC_PIN10) | \
475 PIN_MODE_INPUT(GPIOC_PIN11) | \
476 PIN_MODE_INPUT(GPIOC_PIN12) | \
477 PIN_MODE_INPUT(GPIOC_PIN13) | \
478 PIN_MODE_INPUT(GPIOC_OSC32_IN) | \
479 PIN_MODE_INPUT(GPIOC_OSC32_OUT))
480#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \
481 PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \
482 PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \
483 PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \
484 PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \
485 PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \
486 PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \
487 PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \
488 PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \
489 PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \
490 PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \
491 PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \
492 PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \
493 PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \
494 PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \
495 PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT))
496#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \
497 PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \
498 PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \
499 PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \
500 PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \
501 PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \
502 PIN_OSPEED_HIGH(GPIOC_LED_RED) | \
503 PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \
504 PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \
505 PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \
506 PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \
507 PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \
508 PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \
509 PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \
510 PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \
511 PIN_OSPEED_HIGH(GPIOC_OSC32_OUT))
512#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \
513 PIN_PUPDR_PULLUP(GPIOC_PIN1) | \
514 PIN_PUPDR_PULLUP(GPIOC_PIN2) | \
515 PIN_PUPDR_PULLUP(GPIOC_PIN3) | \
516 PIN_PUPDR_PULLUP(GPIOC_PIN4) | \
517 PIN_PUPDR_PULLUP(GPIOC_PIN5) | \
518 PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \
519 PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \
520 PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \
521 PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \
522 PIN_PUPDR_PULLUP(GPIOC_PIN10) | \
523 PIN_PUPDR_PULLUP(GPIOC_PIN11) | \
524 PIN_PUPDR_PULLUP(GPIOC_PIN12) | \
525 PIN_PUPDR_PULLUP(GPIOC_PIN13) | \
526 PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \
527 PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT))
528#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \
529 PIN_ODR_HIGH(GPIOC_PIN1) | \
530 PIN_ODR_HIGH(GPIOC_PIN2) | \
531 PIN_ODR_HIGH(GPIOC_PIN3) | \
532 PIN_ODR_HIGH(GPIOC_PIN4) | \
533 PIN_ODR_HIGH(GPIOC_PIN5) | \
534 PIN_ODR_LOW(GPIOC_LED_RED) | \
535 PIN_ODR_LOW(GPIOC_LED_BLUE) | \
536 PIN_ODR_LOW(GPIOC_LED_ORANGE) | \
537 PIN_ODR_LOW(GPIOC_LED_GREEN) | \
538 PIN_ODR_HIGH(GPIOC_PIN10) | \
539 PIN_ODR_HIGH(GPIOC_PIN11) | \
540 PIN_ODR_HIGH(GPIOC_PIN12) | \
541 PIN_ODR_HIGH(GPIOC_PIN13) | \
542 PIN_ODR_HIGH(GPIOC_OSC32_IN) | \
543 PIN_ODR_HIGH(GPIOC_OSC32_OUT))
544#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \
545 PIN_AFIO_AF(GPIOC_PIN1, 0U) | \
546 PIN_AFIO_AF(GPIOC_PIN2, 0U) | \
547 PIN_AFIO_AF(GPIOC_PIN3, 0U) | \
548 PIN_AFIO_AF(GPIOC_PIN4, 0U) | \
549 PIN_AFIO_AF(GPIOC_PIN5, 0U) | \
550 PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \
551 PIN_AFIO_AF(GPIOC_LED_BLUE, 0U))
552#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \
553 PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \
554 PIN_AFIO_AF(GPIOC_PIN10, 0U) | \
555 PIN_AFIO_AF(GPIOC_PIN11, 0U) | \
556 PIN_AFIO_AF(GPIOC_PIN12, 0U) | \
557 PIN_AFIO_AF(GPIOC_PIN13, 0U) | \
558 PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \
559 PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U))
560
561/*
562 * GPIOD setup:
563 *
564 * PD0 - PIN0 (input pullup).
565 * PD1 - PIN1 (input pullup).
566 * PD2 - PIN2 (input pullup).
567 * PD3 - PIN3 (input pullup).
568 * PD4 - PIN4 (input pullup).
569 * PD5 - PIN5 (input pullup).
570 * PD6 - PIN6 (input pullup).
571 * PD7 - PIN7 (input pullup).
572 * PD8 - PIN8 (input pullup).
573 * PD9 - PIN9 (input pullup).
574 * PD10 - PIN10 (input pullup).
575 * PD11 - PIN11 (input pullup).
576 * PD12 - PIN12 (input pullup).
577 * PD13 - PIN13 (input pullup).
578 * PD14 - PIN14 (input pullup).
579 * PD15 - PIN15 (input pullup).
580 */
581#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \
582 PIN_MODE_INPUT(GPIOD_PIN1) | \
583 PIN_MODE_INPUT(GPIOD_PIN2) | \
584 PIN_MODE_INPUT(GPIOD_PIN3) | \
585 PIN_MODE_INPUT(GPIOD_PIN4) | \
586 PIN_MODE_INPUT(GPIOD_PIN5) | \
587 PIN_MODE_INPUT(GPIOD_PIN6) | \
588 PIN_MODE_INPUT(GPIOD_PIN7) | \
589 PIN_MODE_INPUT(GPIOD_PIN8) | \
590 PIN_MODE_INPUT(GPIOD_PIN9) | \
591 PIN_MODE_INPUT(GPIOD_PIN10) | \
592 PIN_MODE_INPUT(GPIOD_PIN11) | \
593 PIN_MODE_INPUT(GPIOD_PIN12) | \
594 PIN_MODE_INPUT(GPIOD_PIN13) | \
595 PIN_MODE_INPUT(GPIOD_PIN14) | \
596 PIN_MODE_INPUT(GPIOD_PIN15))
597#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
598 PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
599 PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \
600 PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
601 PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
602 PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
603 PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
604 PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
605 PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
606 PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
607 PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
608 PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
609 PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
610 PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
611 PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
612 PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
613#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \
614 PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \
615 PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \
616 PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \
617 PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \
618 PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \
619 PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \
620 PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \
621 PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \
622 PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \
623 PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \
624 PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \
625 PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \
626 PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \
627 PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \
628 PIN_OSPEED_VERYLOW(GPIOD_PIN15))
629#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \
630 PIN_PUPDR_PULLUP(GPIOD_PIN1) | \
631 PIN_PUPDR_PULLUP(GPIOD_PIN2) | \
632 PIN_PUPDR_PULLUP(GPIOD_PIN3) | \
633 PIN_PUPDR_PULLUP(GPIOD_PIN4) | \
634 PIN_PUPDR_PULLUP(GPIOD_PIN5) | \
635 PIN_PUPDR_PULLUP(GPIOD_PIN6) | \
636 PIN_PUPDR_PULLUP(GPIOD_PIN7) | \
637 PIN_PUPDR_PULLUP(GPIOD_PIN8) | \
638 PIN_PUPDR_PULLUP(GPIOD_PIN9) | \
639 PIN_PUPDR_PULLUP(GPIOD_PIN10) | \
640 PIN_PUPDR_PULLUP(GPIOD_PIN11) | \
641 PIN_PUPDR_PULLUP(GPIOD_PIN12) | \
642 PIN_PUPDR_PULLUP(GPIOD_PIN13) | \
643 PIN_PUPDR_PULLUP(GPIOD_PIN14) | \
644 PIN_PUPDR_PULLUP(GPIOD_PIN15))
645#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \
646 PIN_ODR_HIGH(GPIOD_PIN1) | \
647 PIN_ODR_HIGH(GPIOD_PIN2) | \
648 PIN_ODR_HIGH(GPIOD_PIN3) | \
649 PIN_ODR_HIGH(GPIOD_PIN4) | \
650 PIN_ODR_HIGH(GPIOD_PIN5) | \
651 PIN_ODR_HIGH(GPIOD_PIN6) | \
652 PIN_ODR_HIGH(GPIOD_PIN7) | \
653 PIN_ODR_HIGH(GPIOD_PIN8) | \
654 PIN_ODR_HIGH(GPIOD_PIN9) | \
655 PIN_ODR_HIGH(GPIOD_PIN10) | \
656 PIN_ODR_HIGH(GPIOD_PIN11) | \
657 PIN_ODR_HIGH(GPIOD_PIN12) | \
658 PIN_ODR_HIGH(GPIOD_PIN13) | \
659 PIN_ODR_HIGH(GPIOD_PIN14) | \
660 PIN_ODR_HIGH(GPIOD_PIN15))
661#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \
662 PIN_AFIO_AF(GPIOD_PIN1, 0U) | \
663 PIN_AFIO_AF(GPIOD_PIN2, 0U) | \
664 PIN_AFIO_AF(GPIOD_PIN3, 0U) | \
665 PIN_AFIO_AF(GPIOD_PIN4, 0U) | \
666 PIN_AFIO_AF(GPIOD_PIN5, 0U) | \
667 PIN_AFIO_AF(GPIOD_PIN6, 0U) | \
668 PIN_AFIO_AF(GPIOD_PIN7, 0U))
669#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \
670 PIN_AFIO_AF(GPIOD_PIN9, 0U) | \
671 PIN_AFIO_AF(GPIOD_PIN10, 0U) | \
672 PIN_AFIO_AF(GPIOD_PIN11, 0U) | \
673 PIN_AFIO_AF(GPIOD_PIN12, 0U) | \
674 PIN_AFIO_AF(GPIOD_PIN13, 0U) | \
675 PIN_AFIO_AF(GPIOD_PIN14, 0U) | \
676 PIN_AFIO_AF(GPIOD_PIN15, 0U))
677
678/*
679 * GPIOE setup:
680 *
681 * PE0 - PIN0 (input pullup).
682 * PE1 - PIN1 (input pullup).
683 * PE2 - PIN2 (input pullup).
684 * PE3 - PIN3 (input pullup).
685 * PE4 - PIN4 (input pullup).
686 * PE5 - PIN5 (input pullup).
687 * PE6 - PIN6 (input pullup).
688 * PE7 - PIN7 (input pullup).
689 * PE8 - PIN8 (input pullup).
690 * PE9 - PIN9 (input pullup).
691 * PE10 - PIN10 (input pullup).
692 * PE11 - PIN11 (input pullup).
693 * PE12 - PIN12 (input pullup).
694 * PE13 - PIN13 (input pullup).
695 * PE14 - PIN14 (input pullup).
696 * PE15 - PIN15 (input pullup).
697 */
698#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \
699 PIN_MODE_INPUT(GPIOE_PIN1) | \
700 PIN_MODE_INPUT(GPIOE_PIN2) | \
701 PIN_MODE_INPUT(GPIOE_PIN3) | \
702 PIN_MODE_INPUT(GPIOE_PIN4) | \
703 PIN_MODE_INPUT(GPIOE_PIN5) | \
704 PIN_MODE_INPUT(GPIOE_PIN6) | \
705 PIN_MODE_INPUT(GPIOE_PIN7) | \
706 PIN_MODE_INPUT(GPIOE_PIN8) | \
707 PIN_MODE_INPUT(GPIOE_PIN9) | \
708 PIN_MODE_INPUT(GPIOE_PIN10) | \
709 PIN_MODE_INPUT(GPIOE_PIN11) | \
710 PIN_MODE_INPUT(GPIOE_PIN12) | \
711 PIN_MODE_INPUT(GPIOE_PIN13) | \
712 PIN_MODE_INPUT(GPIOE_PIN14) | \
713 PIN_MODE_INPUT(GPIOE_PIN15))
714#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \
715 PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \
716 PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \
717 PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \
718 PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \
719 PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \
720 PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \
721 PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \
722 PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \
723 PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \
724 PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \
725 PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \
726 PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \
727 PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \
728 PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \
729 PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
730#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \
731 PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \
732 PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \
733 PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \
734 PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \
735 PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \
736 PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \
737 PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \
738 PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \
739 PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \
740 PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \
741 PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \
742 PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \
743 PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \
744 PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \
745 PIN_OSPEED_VERYLOW(GPIOE_PIN15))
746#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \
747 PIN_PUPDR_PULLUP(GPIOE_PIN1) | \
748 PIN_PUPDR_PULLUP(GPIOE_PIN2) | \
749 PIN_PUPDR_PULLUP(GPIOE_PIN3) | \
750 PIN_PUPDR_PULLUP(GPIOE_PIN4) | \
751 PIN_PUPDR_PULLUP(GPIOE_PIN5) | \
752 PIN_PUPDR_PULLUP(GPIOE_PIN6) | \
753 PIN_PUPDR_PULLUP(GPIOE_PIN7) | \
754 PIN_PUPDR_PULLUP(GPIOE_PIN8) | \
755 PIN_PUPDR_PULLUP(GPIOE_PIN9) | \
756 PIN_PUPDR_PULLUP(GPIOE_PIN10) | \
757 PIN_PUPDR_PULLUP(GPIOE_PIN11) | \
758 PIN_PUPDR_PULLUP(GPIOE_PIN12) | \
759 PIN_PUPDR_PULLUP(GPIOE_PIN13) | \
760 PIN_PUPDR_PULLUP(GPIOE_PIN14) | \
761 PIN_PUPDR_PULLUP(GPIOE_PIN15))
762#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \
763 PIN_ODR_HIGH(GPIOE_PIN1) | \
764 PIN_ODR_HIGH(GPIOE_PIN2) | \
765 PIN_ODR_HIGH(GPIOE_PIN3) | \
766 PIN_ODR_HIGH(GPIOE_PIN4) | \
767 PIN_ODR_HIGH(GPIOE_PIN5) | \
768 PIN_ODR_HIGH(GPIOE_PIN6) | \
769 PIN_ODR_HIGH(GPIOE_PIN7) | \
770 PIN_ODR_HIGH(GPIOE_PIN8) | \
771 PIN_ODR_HIGH(GPIOE_PIN9) | \
772 PIN_ODR_HIGH(GPIOE_PIN10) | \
773 PIN_ODR_HIGH(GPIOE_PIN11) | \
774 PIN_ODR_HIGH(GPIOE_PIN12) | \
775 PIN_ODR_HIGH(GPIOE_PIN13) | \
776 PIN_ODR_HIGH(GPIOE_PIN14) | \
777 PIN_ODR_HIGH(GPIOE_PIN15))
778#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \
779 PIN_AFIO_AF(GPIOE_PIN1, 0U) | \
780 PIN_AFIO_AF(GPIOE_PIN2, 0U) | \
781 PIN_AFIO_AF(GPIOE_PIN3, 0U) | \
782 PIN_AFIO_AF(GPIOE_PIN4, 0U) | \
783 PIN_AFIO_AF(GPIOE_PIN5, 0U) | \
784 PIN_AFIO_AF(GPIOE_PIN6, 0U) | \
785 PIN_AFIO_AF(GPIOE_PIN7, 0U))
786#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \
787 PIN_AFIO_AF(GPIOE_PIN9, 0U) | \
788 PIN_AFIO_AF(GPIOE_PIN10, 0U) | \
789 PIN_AFIO_AF(GPIOE_PIN11, 0U) | \
790 PIN_AFIO_AF(GPIOE_PIN12, 0U) | \
791 PIN_AFIO_AF(GPIOE_PIN13, 0U) | \
792 PIN_AFIO_AF(GPIOE_PIN14, 0U) | \
793 PIN_AFIO_AF(GPIOE_PIN15, 0U))
794
795/*
796 * GPIOF setup:
797 *
798 * PF0 - OSC_IN (input floating).
799 * PF1 - OSC_OUT (input floating).
800 * PF2 - PIN2 (input pullup).
801 * PF3 - PIN3 (input pullup).
802 * PF4 - PIN4 (input pullup).
803 * PF5 - PIN5 (input pullup).
804 * PF6 - PIN6 (input pullup).
805 * PF7 - PIN7 (input pullup).
806 * PF8 - PIN8 (input pullup).
807 * PF9 - PIN9 (input pullup).
808 * PF10 - PIN10 (input pullup).
809 * PF11 - PIN11 (input pullup).
810 * PF12 - PIN12 (input pullup).
811 * PF13 - PIN13 (input pullup).
812 * PF14 - PIN14 (input pullup).
813 * PF15 - PIN15 (input pullup).
814 */
815#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \
816 PIN_MODE_INPUT(GPIOF_OSC_OUT) | \
817 PIN_MODE_INPUT(GPIOF_PIN2) | \
818 PIN_MODE_INPUT(GPIOF_PIN3) | \
819 PIN_MODE_INPUT(GPIOF_PIN4) | \
820 PIN_MODE_INPUT(GPIOF_PIN5) | \
821 PIN_MODE_INPUT(GPIOF_PIN6) | \
822 PIN_MODE_INPUT(GPIOF_PIN7) | \
823 PIN_MODE_INPUT(GPIOF_PIN8) | \
824 PIN_MODE_INPUT(GPIOF_PIN9) | \
825 PIN_MODE_INPUT(GPIOF_PIN10) | \
826 PIN_MODE_INPUT(GPIOF_PIN11) | \
827 PIN_MODE_INPUT(GPIOF_PIN12) | \
828 PIN_MODE_INPUT(GPIOF_PIN13) | \
829 PIN_MODE_INPUT(GPIOF_PIN14) | \
830 PIN_MODE_INPUT(GPIOF_PIN15))
831#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \
832 PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \
833 PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \
834 PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \
835 PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \
836 PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \
837 PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \
838 PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \
839 PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \
840 PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \
841 PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \
842 PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \
843 PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \
844 PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \
845 PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \
846 PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
847#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \
848 PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \
849 PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \
850 PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \
851 PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \
852 PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \
853 PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \
854 PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \
855 PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \
856 PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \
857 PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \
858 PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \
859 PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \
860 PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \
861 PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \
862 PIN_OSPEED_VERYLOW(GPIOF_PIN15))
863#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \
864 PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \
865 PIN_PUPDR_PULLUP(GPIOF_PIN2) | \
866 PIN_PUPDR_PULLUP(GPIOF_PIN3) | \
867 PIN_PUPDR_PULLUP(GPIOF_PIN4) | \
868 PIN_PUPDR_PULLUP(GPIOF_PIN5) | \
869 PIN_PUPDR_PULLUP(GPIOF_PIN6) | \
870 PIN_PUPDR_PULLUP(GPIOF_PIN7) | \
871 PIN_PUPDR_PULLUP(GPIOF_PIN8) | \
872 PIN_PUPDR_PULLUP(GPIOF_PIN9) | \
873 PIN_PUPDR_PULLUP(GPIOF_PIN10) | \
874 PIN_PUPDR_PULLUP(GPIOF_PIN11) | \
875 PIN_PUPDR_PULLUP(GPIOF_PIN12) | \
876 PIN_PUPDR_PULLUP(GPIOF_PIN13) | \
877 PIN_PUPDR_PULLUP(GPIOF_PIN14) | \
878 PIN_PUPDR_PULLUP(GPIOF_PIN15))
879#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \
880 PIN_ODR_HIGH(GPIOF_OSC_OUT) | \
881 PIN_ODR_HIGH(GPIOF_PIN2) | \
882 PIN_ODR_HIGH(GPIOF_PIN3) | \
883 PIN_ODR_HIGH(GPIOF_PIN4) | \
884 PIN_ODR_HIGH(GPIOF_PIN5) | \
885 PIN_ODR_HIGH(GPIOF_PIN6) | \
886 PIN_ODR_HIGH(GPIOF_PIN7) | \
887 PIN_ODR_HIGH(GPIOF_PIN8) | \
888 PIN_ODR_HIGH(GPIOF_PIN9) | \
889 PIN_ODR_HIGH(GPIOF_PIN10) | \
890 PIN_ODR_HIGH(GPIOF_PIN11) | \
891 PIN_ODR_HIGH(GPIOF_PIN12) | \
892 PIN_ODR_HIGH(GPIOF_PIN13) | \
893 PIN_ODR_HIGH(GPIOF_PIN14) | \
894 PIN_ODR_HIGH(GPIOF_PIN15))
895#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \
896 PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \
897 PIN_AFIO_AF(GPIOF_PIN2, 0U) | \
898 PIN_AFIO_AF(GPIOF_PIN3, 0U) | \
899 PIN_AFIO_AF(GPIOF_PIN4, 0U) | \
900 PIN_AFIO_AF(GPIOF_PIN5, 0U) | \
901 PIN_AFIO_AF(GPIOF_PIN6, 0U) | \
902 PIN_AFIO_AF(GPIOF_PIN7, 0U))
903#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \
904 PIN_AFIO_AF(GPIOF_PIN9, 0U) | \
905 PIN_AFIO_AF(GPIOF_PIN10, 0U) | \
906 PIN_AFIO_AF(GPIOF_PIN11, 0U) | \
907 PIN_AFIO_AF(GPIOF_PIN12, 0U) | \
908 PIN_AFIO_AF(GPIOF_PIN13, 0U) | \
909 PIN_AFIO_AF(GPIOF_PIN14, 0U) | \
910 PIN_AFIO_AF(GPIOF_PIN15, 0U))
911
912
913#if !defined(_FROM_ASM_)
914#ifdef __cplusplus
915extern "C" {
916#endif
917 void boardInit(void);
918#ifdef __cplusplus
919}
920#endif
921#endif /* _FROM_ASM_ */
922
923#endif /* BOARD_H */
diff --git a/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.mk
deleted file mode 100644
index b98dcdd26..000000000
--- a/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.mk
+++ /dev/null
@@ -1,5 +0,0 @@
1# List of all the board related files.
2BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c
3
4# Required include directories
5BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY
diff --git a/keyboards/chibios_test/boards/maple_mini_mapping.png b/keyboards/chibios_test/boards/maple_mini_mapping.png
deleted file mode 100644
index 12cfa81db..000000000
--- a/keyboards/chibios_test/boards/maple_mini_mapping.png
+++ /dev/null
Binary files differ
diff --git a/keyboards/chibios_test/chibios_test.c b/keyboards/chibios_test/chibios_test.c
deleted file mode 100644
index efe2d4a5d..000000000
--- a/keyboards/chibios_test/chibios_test.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "chibios_test.h"
diff --git a/keyboards/chibios_test/chibios_test.h b/keyboards/chibios_test/chibios_test.h
deleted file mode 100644
index 9fc996ff7..000000000
--- a/keyboards/chibios_test/chibios_test.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef KEYBOARDS_CHIBIOS_TEST_CHIBIOS_TEST_H_
2#define KEYBOARDS_CHIBIOS_TEST_CHIBIOS_TEST_H_
3
4#include "quantum.h"
5
6#define LAYOUT(k00) {{ k00 }}
7
8#endif /* KEYBOARDS_CHIBIOS_TEST_CHIBIOS_TEST_H_ */
diff --git a/keyboards/chibios_test/config.h b/keyboards/chibios_test/config.h
deleted file mode 100644
index 91350c445..000000000
--- a/keyboards/chibios_test/config.h
+++ /dev/null
@@ -1,65 +0,0 @@
1/*
2Copyright 2015 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef CONFIG_H
19#define CONFIG_H
20
21/* USB Device descriptor parameter */
22#define VENDOR_ID 0xFEED
23#define PRODUCT_ID 0x6464
24#define DEVICE_VER 0x0001
25/* in python2: list(u"whatever".encode('utf-16-le')) */
26/* at most 32 characters or the ugly hack in usb_main.c borks */
27#define MANUFACTURER QMK
28#define PRODUCT ChibiOS QMK test
29#define DESCRIPTION QMK keyboard firmware test for ChibiOS
30
31/* key matrix size */
32#define MATRIX_ROWS 1
33#define MATRIX_COLS 1
34#define DIODE_DIRECTION COL2ROW
35
36/* define if matrix has ghost */
37//#define MATRIX_HAS_GHOST
38
39/* Set 0 if debouncing isn't needed */
40#define DEBOUNCE 5
41
42/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
43#define LOCKING_SUPPORT_ENABLE
44/* Locking resynchronize hack */
45#define LOCKING_RESYNC_ENABLE
46
47/*
48 * Feature disable options
49 * These options are also useful to firmware size reduction.
50 */
51
52/* disable debug print */
53//#define NO_DEBUG
54
55/* disable print */
56//#define NO_PRINT
57
58/* disable action features */
59//#define NO_ACTION_LAYER
60//#define NO_ACTION_TAPPING
61//#define NO_ACTION_ONESHOT
62//#define NO_ACTION_MACRO
63//#define NO_ACTION_FUNCTION
64
65#endif
diff --git a/keyboards/chibios_test/keymaps/default/keymap.c b/keyboards/chibios_test/keymaps/default/keymap.c
deleted file mode 100644
index 0edc697bf..000000000
--- a/keyboards/chibios_test/keymaps/default/keymap.c
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#include QMK_KEYBOARD_H
19
20const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
21 {{KC_CAPS}}, // test with KC_CAPS, KC_A, RESET
22};
diff --git a/keyboards/chibios_test/ld/MKL26Z64.ld b/keyboards/chibios_test/ld/MKL26Z64.ld
deleted file mode 100644
index c4ca8b874..000000000
--- a/keyboards/chibios_test/ld/MKL26Z64.ld
+++ /dev/null
@@ -1,105 +0,0 @@
1/*
2 * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com
3 * (C) 2016 flabbergast <s3+flabbergast@sdfeu.org>
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 * SOFTWARE.
22 */
23
24/*
25 * KL26Z64 memory setup.
26 */
27MEMORY
28{
29 flash0 : org = 0x00000000, len = 0x100
30 flash1 : org = 0x00000400, len = 0x10
31 flash2 : org = 0x00000410, len = 62k - 0x410
32 flash3 : org = 0x0000F800, len = 2k
33 flash4 : org = 0x00000000, len = 0
34 flash5 : org = 0x00000000, len = 0
35 flash6 : org = 0x00000000, len = 0
36 flash7 : org = 0x00000000, len = 0
37 ram0 : org = 0x1FFFF800, len = 8k
38 ram1 : org = 0x00000000, len = 0
39 ram2 : org = 0x00000000, len = 0
40 ram3 : org = 0x00000000, len = 0
41 ram4 : org = 0x00000000, len = 0
42 ram5 : org = 0x00000000, len = 0
43 ram6 : org = 0x00000000, len = 0
44 ram7 : org = 0x00000000, len = 0
45}
46
47/* Flash region for the configuration bytes.*/
48SECTIONS
49{
50 .cfmprotect : ALIGN(4) SUBALIGN(4)
51 {
52 KEEP(*(.cfmconfig))
53 } > flash1
54}
55
56/* For each data/text section two region are defined, a virtual region
57 and a load region (_LMA suffix).*/
58
59/* Flash region to be used for exception vectors.*/
60REGION_ALIAS("VECTORS_FLASH", flash0);
61REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
62
63/* Flash region to be used for constructors and destructors.*/
64REGION_ALIAS("XTORS_FLASH", flash2);
65REGION_ALIAS("XTORS_FLASH_LMA", flash2);
66
67/* Flash region to be used for code text.*/
68REGION_ALIAS("TEXT_FLASH", flash2);
69REGION_ALIAS("TEXT_FLASH_LMA", flash2);
70
71/* Flash region to be used for read only data.*/
72REGION_ALIAS("RODATA_FLASH", flash2);
73REGION_ALIAS("RODATA_FLASH_LMA", flash2);
74
75/* Flash region to be used for various.*/
76REGION_ALIAS("VARIOUS_FLASH", flash2);
77REGION_ALIAS("VARIOUS_FLASH_LMA", flash2);
78
79/* Flash region to be used for RAM(n) initialization data.*/
80REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2);
81
82/* RAM region to be used for Main stack. This stack accommodates the processing
83 of all exceptions and interrupts.*/
84REGION_ALIAS("MAIN_STACK_RAM", ram0);
85
86/* RAM region to be used for the process stack. This is the stack used by
87 the main() function.*/
88REGION_ALIAS("PROCESS_STACK_RAM", ram0);
89
90/* RAM region to be used for data segment.*/
91REGION_ALIAS("DATA_RAM", ram0);
92REGION_ALIAS("DATA_RAM_LMA", flash2);
93
94/* RAM region to be used for BSS segment.*/
95REGION_ALIAS("BSS_RAM", ram0);
96
97/* RAM region to be used for the default heap.*/
98REGION_ALIAS("HEAP_RAM", ram0);
99
100__eeprom_workarea_start__ = ORIGIN(flash3);
101__eeprom_workarea_size__ = LENGTH(flash3);
102__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__;
103
104/* Generic rules inclusion.*/
105INCLUDE rules.ld
diff --git a/keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld
deleted file mode 100644
index f9bfe9c00..000000000
--- a/keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld
+++ /dev/null
@@ -1,88 +0,0 @@
1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/*
18 * ST32F103xB memory setup for use with the maplemini bootloader.
19 * You will have to
20 * #define CORTEX_VTOR_INIT 0x5000
21 * in your projects chconf.h
22 */
23MEMORY
24{
25 flash0 : org = 0x08002000, len = 128k - 0x2000
26 flash1 : org = 0x00000000, len = 0
27 flash2 : org = 0x00000000, len = 0
28 flash3 : org = 0x00000000, len = 0
29 flash4 : org = 0x00000000, len = 0
30 flash5 : org = 0x00000000, len = 0
31 flash6 : org = 0x00000000, len = 0
32 flash7 : org = 0x00000000, len = 0
33 ram0 : org = 0x20000000, len = 20k
34 ram1 : org = 0x00000000, len = 0
35 ram2 : org = 0x00000000, len = 0
36 ram3 : org = 0x00000000, len = 0
37 ram4 : org = 0x00000000, len = 0
38 ram5 : org = 0x00000000, len = 0
39 ram6 : org = 0x00000000, len = 0
40 ram7 : org = 0x00000000, len = 0
41}
42
43/* For each data/text section two region are defined, a virtual region
44 and a load region (_LMA suffix).*/
45
46/* Flash region to be used for exception vectors.*/
47REGION_ALIAS("VECTORS_FLASH", flash0);
48REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
49
50/* Flash region to be used for constructors and destructors.*/
51REGION_ALIAS("XTORS_FLASH", flash0);
52REGION_ALIAS("XTORS_FLASH_LMA", flash0);
53
54/* Flash region to be used for code text.*/
55REGION_ALIAS("TEXT_FLASH", flash0);
56REGION_ALIAS("TEXT_FLASH_LMA", flash0);
57
58/* Flash region to be used for read only data.*/
59REGION_ALIAS("RODATA_FLASH", flash0);
60REGION_ALIAS("RODATA_FLASH_LMA", flash0);
61
62/* Flash region to be used for various.*/
63REGION_ALIAS("VARIOUS_FLASH", flash0);
64REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);
65
66/* Flash region to be used for RAM(n) initialization data.*/
67REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);
68
69/* RAM region to be used for Main stack. This stack accommodates the processing
70 of all exceptions and interrupts.*/
71REGION_ALIAS("MAIN_STACK_RAM", ram0);
72
73/* RAM region to be used for the process stack. This is the stack used by
74 the main() function.*/
75REGION_ALIAS("PROCESS_STACK_RAM", ram0);
76
77/* RAM region to be used for data segment.*/
78REGION_ALIAS("DATA_RAM", ram0);
79REGION_ALIAS("DATA_RAM_LMA", flash0);
80
81/* RAM region to be used for BSS segment.*/
82REGION_ALIAS("BSS_RAM", ram0);
83
84/* RAM region to be used for the default heap.*/
85REGION_ALIAS("HEAP_RAM", ram0);
86
87/* Generic rules inclusion.*/
88INCLUDE rules.ld
diff --git a/keyboards/chibios_test/readme.md b/keyboards/chibios_test/readme.md
deleted file mode 100644
index 096ecd6ae..000000000
--- a/keyboards/chibios_test/readme.md
+++ /dev/null
@@ -1,3 +0,0 @@
1# ChibiOS Test Keyboards
2
3Test code for several ARM based ChibiOS boards \ No newline at end of file
diff --git a/keyboards/chibios_test/rules.mk b/keyboards/chibios_test/rules.mk
deleted file mode 100644
index 45f03be02..000000000
--- a/keyboards/chibios_test/rules.mk
+++ /dev/null
@@ -1,10 +0,0 @@
1#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
2MOUSEKEY_ENABLE = yes # Mouse keys
3EXTRAKEY_ENABLE = yes # Audio control and System control
4CONSOLE_ENABLE = yes # Console for debug
5COMMAND_ENABLE = yes # Commands for debug and configuration
6SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
7NKRO_ENABLE = yes # USB Nkey Rollover
8CUSTOM_MATRIX = yes # Custom matrix file
9
10DEFAULT_FOLDER = chibios_test/stm32_f072_onekey \ No newline at end of file
diff --git a/keyboards/chibios_test/stm32_f072_onekey/bootloader_defs.h b/keyboards/chibios_test/stm32_f072_onekey/bootloader_defs.h
deleted file mode 100644
index 02c48c4e6..000000000
--- a/keyboards/chibios_test/stm32_f072_onekey/bootloader_defs.h
+++ /dev/null
@@ -1,7 +0,0 @@
1/* Address for jumping to bootloader on STM32 chips. */
2/* It is chip dependent, the correct number can be looked up here (page 175):
3 * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
4 * This also requires a patch to chibios:
5 * <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
6 */
7#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800
diff --git a/keyboards/chibios_test/stm32_f072_onekey/config.h b/keyboards/chibios_test/stm32_f072_onekey/config.h
deleted file mode 100644
index bbaf0dc4b..000000000
--- a/keyboards/chibios_test/stm32_f072_onekey/config.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef KEYBOARDS_CHIBIOS_TEST_STM32_F072_ONEKEY_CONFIG_H_
2#define KEYBOARDS_CHIBIOS_TEST_STM32_F072_ONEKEY_CONFIG_H_
3
4#include "../config.h"
5
6
7#endif /* KEYBOARDS_CHIBIOS_TEST_STM32_F072_ONEKEY_CONFIG_H_ */
diff --git a/keyboards/chibios_test/stm32_f072_onekey/led.c b/keyboards/chibios_test/stm32_f072_onekey/led.c
deleted file mode 100644
index 18edb8ba8..000000000
--- a/keyboards/chibios_test/stm32_f072_onekey/led.c
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#include "hal.h"
19
20#include "led.h"
21
22
23void led_set(uint8_t usb_led)
24{
25 (void)usb_led;
26 if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
27 // output high
28 palSetPadMode(GPIOC, GPIOC_LED_GREEN, PAL_MODE_OUTPUT_PUSHPULL);
29 palSetPad(GPIOC, GPIOC_LED_GREEN);
30 } else {
31 // Hi-Z
32 palSetPadMode(GPIOC, GPIOC_LED_GREEN, PAL_MODE_INPUT);
33 }
34}
diff --git a/keyboards/chibios_test/stm32_f072_onekey/matrix.c b/keyboards/chibios_test/stm32_f072_onekey/matrix.c
deleted file mode 100644
index a05b38cd4..000000000
--- a/keyboards/chibios_test/stm32_f072_onekey/matrix.c
+++ /dev/null
@@ -1,163 +0,0 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#include "ch.h"
19#include "hal.h"
20
21/*
22 * scan matrix
23 */
24#include "print.h"
25#include "debug.h"
26#include "util.h"
27#include "matrix.h"
28#include "wait.h"
29
30#ifndef DEBOUNCE
31# define DEBOUNCE 5
32#endif
33static uint8_t debouncing = DEBOUNCE;
34
35/* matrix state(1:on, 0:off) */
36static matrix_row_t matrix[MATRIX_ROWS];
37static matrix_row_t matrix_debouncing[MATRIX_ROWS];
38
39static matrix_row_t read_cols(void);
40static void init_cols(void);
41static void unselect_rows(void);
42static void select_row(uint8_t row);
43
44
45inline
46uint8_t matrix_rows(void)
47{
48 return MATRIX_ROWS;
49}
50
51inline
52uint8_t matrix_cols(void)
53{
54 return MATRIX_COLS;
55}
56
57#define LED_ON() do { palSetPad(GPIOC, GPIOC_LED_BLUE) ;} while (0)
58#define LED_OFF() do { palClearPad(GPIOC, GPIOC_LED_BLUE); } while (0)
59#define LED_TGL() do { palTogglePad(GPIOC, GPIOC_LED_BLUE); } while (0)
60
61void matrix_init(void)
62{
63 // initialize row and col
64 unselect_rows();
65 init_cols();
66
67 // initialize matrix state: all keys off
68 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
69 matrix[i] = 0;
70 matrix_debouncing[i] = 0;
71 }
72
73 //debug
74 debug_matrix = true;
75 LED_ON();
76 wait_ms(500);
77 LED_OFF();
78}
79
80uint8_t matrix_scan(void)
81{
82 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
83 select_row(i);
84 wait_us(30); // without this wait read unstable value.
85 matrix_row_t cols = read_cols();
86 if (matrix_debouncing[i] != cols) {
87 matrix_debouncing[i] = cols;
88 if (debouncing) {
89 debug("bounce!: "); debug_hex(debouncing); debug("\n");
90 }
91 debouncing = DEBOUNCE;
92 }
93 unselect_rows();
94 }
95
96 if (debouncing) {
97 if (--debouncing) {
98 wait_ms(1);
99 } else {
100 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
101 matrix[i] = matrix_debouncing[i];
102 }
103 }
104 }
105
106 return 1;
107}
108
109inline
110bool matrix_is_on(uint8_t row, uint8_t col)
111{
112 return (matrix[row] & ((matrix_row_t)1<<col));
113}
114
115inline
116matrix_row_t matrix_get_row(uint8_t row)
117{
118 return matrix[row];
119}
120
121void matrix_print(void)
122{
123 print("\nr/c 0123456789ABCDEF\n");
124 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
125 phex(row); print(": ");
126 pbin_reverse16(matrix_get_row(row));
127 print("\n");
128 }
129}
130
131/* Column pin configuration
132 */
133static void init_cols(void)
134{
135 // don't need pullup/down, since it's pulled down in hardware
136 palSetPadMode(GPIOA, GPIOA_BUTTON, PAL_MODE_INPUT);
137}
138
139/* Returns status of switches(1:on, 0:off) */
140static matrix_row_t read_cols(void)
141{
142 return ((palReadPad(GPIOA, GPIOA_BUTTON)==PAL_LOW) ? 0 : (1<<0));
143 // | ((palReadPad(...)==PAL_HIGH) ? 0 : (1<<1))
144}
145
146/* Row pin configuration
147 */
148static void unselect_rows(void)
149{
150 // palSetPadMode(GPIOA, GPIOA_PIN10, PAL_MODE_INPUT); // hi-Z
151}
152
153static void select_row(uint8_t row)
154{
155 (void)row;
156 // Output low to select
157 // switch (row) {
158 // case 0:
159 // palSetPadMode(GPIOA, GPIOA_PIN10, PAL_MODE_OUTPUT_PUSHPULL);
160 // palSetPad(GPIOA, GPIOA_PIN10, PAL_LOW);
161 // break;
162 // }
163}
diff --git a/keyboards/chibios_test/stm32_f072_onekey/readme.md b/keyboards/chibios_test/stm32_f072_onekey/readme.md
deleted file mode 100644
index c5e504e49..000000000
--- a/keyboards/chibios_test/stm32_f072_onekey/readme.md
+++ /dev/null
@@ -1,3 +0,0 @@
1# ChibiOS Test
2
3Test code for the stm32_f072 one key keyboard \ No newline at end of file
diff --git a/keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.c b/keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.c
deleted file mode 100644
index 820d062ff..000000000
--- a/keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "stm32_f072_onekey.h"
diff --git a/keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.h b/keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.h
deleted file mode 100644
index 345bf3bed..000000000
--- a/keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef STM32_F072_ONEKEY_H
2#define STM32_F072_ONEKEY_H
3#include "chibios_test.h"
4
5#define LAYOUT(k00) {{ k00 }}
6
7#endif
diff --git a/keyboards/chibios_test/stm32_f103_onekey/bootloader_defs.h b/keyboards/chibios_test/stm32_f103_onekey/bootloader_defs.h
deleted file mode 100644
index 0f45203cb..000000000
--- a/keyboards/chibios_test/stm32_f103_onekey/bootloader_defs.h
+++ /dev/null
@@ -1,10 +0,0 @@
1/* Address for jumping to bootloader on STM32 chips. */
2/* It is chip dependent, the correct number can be looked up here (page 175):
3 * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
4 * This also requires a patch to chibios:
5 * <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
6 */
7
8// STM32F103* does NOT have an USB bootloader in ROM (only serial),
9// so setting anything here does not make much sense
10// #define STM32_BOOTLOADER_ADDRESS 0x1FFFC800
diff --git a/keyboards/chibios_test/stm32_f103_onekey/chconf.h b/keyboards/chibios_test/stm32_f103_onekey/chconf.h
deleted file mode 100644
index dfb1f9dfb..000000000
--- a/keyboards/chibios_test/stm32_f103_onekey/chconf.h
+++ /dev/null
@@ -1,524 +0,0 @@
1/*
2 ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/chconf.h
19 * @brief Configuration file template.
20 * @details A copy of this file must be placed in each project directory, it
21 * contains the application specific kernel settings.
22 *
23 * @addtogroup config
24 * @details Kernel related settings and hooks.
25 * @{
26 */
27
28#ifndef CHCONF_H
29#define CHCONF_H
30
31#define _CHIBIOS_RT_CONF_
32
33/*===========================================================================*/
34/**
35 * @name System timers settings
36 * @{
37 */
38/*===========================================================================*/
39
40/**
41 * @brief System time counter resolution.
42 * @note Allowed values are 16 or 32 bits.
43 */
44#define CH_CFG_ST_RESOLUTION 16
45
46/**
47 * @brief System tick frequency.
48 * @details Frequency of the system timer that drives the system ticks. This
49 * setting also defines the system tick time unit.
50 */
51#define CH_CFG_ST_FREQUENCY 2000
52
53/**
54 * @brief Time delta constant for the tick-less mode.
55 * @note If this value is zero then the system uses the classic
56 * periodic tick. This value represents the minimum number
57 * of ticks that is safe to specify in a timeout directive.
58 * The value one is not valid, timeouts are rounded up to
59 * this value.
60 */
61#define CH_CFG_ST_TIMEDELTA 2
62
63/** @} */
64
65/*===========================================================================*/
66/**
67 * @name Kernel parameters and options
68 * @{
69 */
70/*===========================================================================*/
71
72/**
73 * @brief Round robin interval.
74 * @details This constant is the number of system ticks allowed for the
75 * threads before preemption occurs. Setting this value to zero
76 * disables the preemption for threads with equal priority and the
77 * round robin becomes cooperative. Note that higher priority
78 * threads can still preempt, the kernel is always preemptive.
79 * @note Disabling the round robin preemption makes the kernel more compact
80 * and generally faster.
81 * @note The round robin preemption is not supported in tickless mode and
82 * must be set to zero in that case.
83 */
84#define CH_CFG_TIME_QUANTUM 0
85
86/**
87 * @brief Managed RAM size.
88 * @details Size of the RAM area to be managed by the OS. If set to zero
89 * then the whole available RAM is used. The core memory is made
90 * available to the heap allocator and/or can be used directly through
91 * the simplified core memory allocator.
92 *
93 * @note In order to let the OS manage the whole RAM the linker script must
94 * provide the @p __heap_base__ and @p __heap_end__ symbols.
95 * @note Requires @p CH_CFG_USE_MEMCORE.
96 */
97#define CH_CFG_MEMCORE_SIZE 0
98
99/**
100 * @brief Idle thread automatic spawn suppression.
101 * @details When this option is activated the function @p chSysInit()
102 * does not spawn the idle thread. The application @p main()
103 * function becomes the idle thread and must implement an
104 * infinite loop.
105 */
106#define CH_CFG_NO_IDLE_THREAD FALSE
107
108/* Use __WFI in the idle thread for waiting. Does lower the power
109 * consumption. */
110#define CORTEX_ENABLE_WFI_IDLE TRUE
111
112/** @} */
113
114/*===========================================================================*/
115/**
116 * @name Performance options
117 * @{
118 */
119/*===========================================================================*/
120
121/**
122 * @brief OS optimization.
123 * @details If enabled then time efficient rather than space efficient code
124 * is used when two possible implementations exist.
125 *
126 * @note This is not related to the compiler optimization options.
127 * @note The default is @p TRUE.
128 */
129#define CH_CFG_OPTIMIZE_SPEED TRUE
130
131/** @} */
132
133/*===========================================================================*/
134/**
135 * @name Subsystem options
136 * @{
137 */
138/*===========================================================================*/
139
140/**
141 * @brief Time Measurement APIs.
142 * @details If enabled then the time measurement APIs are included in
143 * the kernel.
144 *
145 * @note The default is @p TRUE.
146 */
147#define CH_CFG_USE_TM FALSE
148
149/**
150 * @brief Threads registry APIs.
151 * @details If enabled then the registry APIs are included in the kernel.
152 *
153 * @note The default is @p TRUE.
154 */
155#define CH_CFG_USE_REGISTRY TRUE
156
157/**
158 * @brief Threads synchronization APIs.
159 * @details If enabled then the @p chThdWait() function is included in
160 * the kernel.
161 *
162 * @note The default is @p TRUE.
163 */
164#define CH_CFG_USE_WAITEXIT TRUE
165
166/**
167 * @brief Semaphores APIs.
168 * @details If enabled then the Semaphores APIs are included in the kernel.
169 *
170 * @note The default is @p TRUE.
171 */
172#define CH_CFG_USE_SEMAPHORES TRUE
173
174/**
175 * @brief Semaphores queuing mode.
176 * @details If enabled then the threads are enqueued on semaphores by
177 * priority rather than in FIFO order.
178 *
179 * @note The default is @p FALSE. Enable this if you have special
180 * requirements.
181 * @note Requires @p CH_CFG_USE_SEMAPHORES.
182 */
183#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
184
185/**
186 * @brief Mutexes APIs.
187 * @details If enabled then the mutexes APIs are included in the kernel.
188 *
189 * @note The default is @p TRUE.
190 */
191#define CH_CFG_USE_MUTEXES TRUE
192
193/**
194 * @brief Enables recursive behavior on mutexes.
195 * @note Recursive mutexes are heavier and have an increased
196 * memory footprint.
197 *
198 * @note The default is @p FALSE.
199 * @note Requires @p CH_CFG_USE_MUTEXES.
200 */
201#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
202
203/**
204 * @brief Conditional Variables APIs.
205 * @details If enabled then the conditional variables APIs are included
206 * in the kernel.
207 *
208 * @note The default is @p TRUE.
209 * @note Requires @p CH_CFG_USE_MUTEXES.
210 */
211#define CH_CFG_USE_CONDVARS TRUE
212
213/**
214 * @brief Conditional Variables APIs with timeout.
215 * @details If enabled then the conditional variables APIs with timeout
216 * specification are included in the kernel.
217 *
218 * @note The default is @p TRUE.
219 * @note Requires @p CH_CFG_USE_CONDVARS.
220 */
221#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE
222
223/**
224 * @brief Events Flags APIs.
225 * @details If enabled then the event flags APIs are included in the kernel.
226 *
227 * @note The default is @p TRUE.
228 */
229#define CH_CFG_USE_EVENTS TRUE
230
231/**
232 * @brief Events Flags APIs with timeout.
233 * @details If enabled then the events APIs with timeout specification
234 * are included in the kernel.
235 *
236 * @note The default is @p TRUE.
237 * @note Requires @p CH_CFG_USE_EVENTS.
238 */
239#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
240
241/**
242 * @brief Synchronous Messages APIs.
243 * @details If enabled then the synchronous messages APIs are included
244 * in the kernel.
245 *
246 * @note The default is @p TRUE.
247 */
248#define CH_CFG_USE_MESSAGES TRUE
249
250/**
251 * @brief Synchronous Messages queuing mode.
252 * @details If enabled then messages are served by priority rather than in
253 * FIFO order.
254 *
255 * @note The default is @p FALSE. Enable this if you have special
256 * requirements.
257 * @note Requires @p CH_CFG_USE_MESSAGES.
258 */
259#define CH_CFG_USE_MESSAGES_PRIORITY FALSE
260
261/**
262 * @brief Mailboxes APIs.
263 * @details If enabled then the asynchronous messages (mailboxes) APIs are
264 * included in the kernel.
265 *
266 * @note The default is @p TRUE.
267 * @note Requires @p CH_CFG_USE_SEMAPHORES.
268 */
269#define CH_CFG_USE_MAILBOXES TRUE
270
271/**
272 * @brief Core Memory Manager APIs.
273 * @details If enabled then the core memory manager APIs are included
274 * in the kernel.
275 *
276 * @note The default is @p TRUE.
277 */
278#define CH_CFG_USE_MEMCORE TRUE
279
280/**
281 * @brief Heap Allocator APIs.
282 * @details If enabled then the memory heap allocator APIs are included
283 * in the kernel.
284 *
285 * @note The default is @p TRUE.
286 * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
287 * @p CH_CFG_USE_SEMAPHORES.
288 * @note Mutexes are recommended.
289 */
290#define CH_CFG_USE_HEAP TRUE
291
292/**
293 * @brief Memory Pools Allocator APIs.
294 * @details If enabled then the memory pools allocator APIs are included
295 * in the kernel.
296 *
297 * @note The default is @p TRUE.
298 */
299#define CH_CFG_USE_MEMPOOLS FALSE
300
301/**
302 * @brief Dynamic Threads APIs.
303 * @details If enabled then the dynamic threads creation APIs are included
304 * in the kernel.
305 *
306 * @note The default is @p TRUE.
307 * @note Requires @p CH_CFG_USE_WAITEXIT.
308 * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
309 */
310#define CH_CFG_USE_DYNAMIC FALSE
311
312/** @} */
313
314/*===========================================================================*/
315/**
316 * @name Debug options
317 * @{
318 */
319/*===========================================================================*/
320
321/**
322 * @brief Debug option, kernel statistics.
323 *
324 * @note The default is @p FALSE.
325 */
326#define CH_DBG_STATISTICS FALSE
327
328/**
329 * @brief Debug option, system state check.
330 * @details If enabled the correct call protocol for system APIs is checked
331 * at runtime.
332 *
333 * @note The default is @p FALSE.
334 */
335#define CH_DBG_SYSTEM_STATE_CHECK FALSE
336
337/**
338 * @brief Debug option, parameters checks.
339 * @details If enabled then the checks on the API functions input
340 * parameters are activated.
341 *
342 * @note The default is @p FALSE.
343 */
344#define CH_DBG_ENABLE_CHECKS FALSE
345
346/**
347 * @brief Debug option, consistency checks.
348 * @details If enabled then all the assertions in the kernel code are
349 * activated. This includes consistency checks inside the kernel,
350 * runtime anomalies and port-defined checks.
351 *
352 * @note The default is @p FALSE.
353 */
354#define CH_DBG_ENABLE_ASSERTS FALSE
355
356/**
357 * @brief Debug option, trace buffer.
358 * @details If enabled then the trace buffer is activated.
359 *
360 * @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
361 */
362#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
363
364/**
365 * @brief Trace buffer entries.
366 * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
367 * different from @p CH_DBG_TRACE_MASK_DISABLED.
368 */
369#define CH_DBG_TRACE_BUFFER_SIZE 128
370
371/**
372 * @brief Debug option, stack checks.
373 * @details If enabled then a runtime stack check is performed.
374 *
375 * @note The default is @p FALSE.
376 * @note The stack check is performed in a architecture/port dependent way.
377 * It may not be implemented or some ports.
378 * @note The default failure mode is to halt the system with the global
379 * @p panic_msg variable set to @p NULL.
380 */
381#define CH_DBG_ENABLE_STACK_CHECK FALSE
382
383/**
384 * @brief Debug option, stacks initialization.
385 * @details If enabled then the threads working area is filled with a byte
386 * value when a thread is created. This can be useful for the
387 * runtime measurement of the used stack.
388 *
389 * @note The default is @p FALSE.
390 */
391#define CH_DBG_FILL_THREADS FALSE
392
393/**
394 * @brief Debug option, threads profiling.
395 * @details If enabled then a field is added to the @p thread_t structure that
396 * counts the system ticks occurred while executing the thread.
397 *
398 * @note The default is @p FALSE.
399 * @note This debug option is not currently compatible with the
400 * tickless mode.
401 */
402#define CH_DBG_THREADS_PROFILING FALSE
403
404/** @} */
405
406/*===========================================================================*/
407/**
408 * @name Kernel hooks
409 * @{
410 */
411/*===========================================================================*/
412
413/**
414 * @brief Threads descriptor structure extension.
415 * @details User fields added to the end of the @p thread_t structure.
416 */
417#define CH_CFG_THREAD_EXTRA_FIELDS \
418 /* Add threads custom fields here.*/
419
420/**
421 * @brief Threads initialization hook.
422 * @details User initialization code added to the @p chThdInit() API.
423 *
424 * @note It is invoked from within @p chThdInit() and implicitly from all
425 * the threads creation APIs.
426 */
427#define CH_CFG_THREAD_INIT_HOOK(tp) { \
428 /* Add threads initialization code here.*/ \
429}
430
431/**
432 * @brief Threads finalization hook.
433 * @details User finalization code added to the @p chThdExit() API.
434 */
435#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
436 /* Add threads finalization code here.*/ \
437}
438
439/**
440 * @brief Context switch hook.
441 * @details This hook is invoked just before switching between threads.
442 */
443#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
444 /* Context switch code here.*/ \
445}
446
447/**
448 * @brief ISR enter hook.
449 */
450#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
451 /* IRQ prologue code here.*/ \
452}
453
454/**
455 * @brief ISR exit hook.
456 */
457#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
458 /* IRQ epilogue code here.*/ \
459}
460
461/**
462 * @brief Idle thread enter hook.
463 * @note This hook is invoked within a critical zone, no OS functions
464 * should be invoked from here.
465 * @note This macro can be used to activate a power saving mode.
466 */
467#define CH_CFG_IDLE_ENTER_HOOK() { \
468 /* Idle-enter code here.*/ \
469}
470
471/**
472 * @brief Idle thread leave hook.
473 * @note This hook is invoked within a critical zone, no OS functions
474 * should be invoked from here.
475 * @note This macro can be used to deactivate a power saving mode.
476 */
477#define CH_CFG_IDLE_LEAVE_HOOK() { \
478 /* Idle-leave code here.*/ \
479}
480
481/**
482 * @brief Idle Loop hook.
483 * @details This hook is continuously invoked by the idle thread loop.
484 */
485#define CH_CFG_IDLE_LOOP_HOOK() { \
486 /* Idle loop code here.*/ \
487}
488
489/**
490 * @brief System tick event hook.
491 * @details This hook is invoked in the system tick handler immediately
492 * after processing the virtual timers queue.
493 */
494#define CH_CFG_SYSTEM_TICK_HOOK() { \
495 /* System tick event code here.*/ \
496}
497
498/**
499 * @brief System halt hook.
500 * @details This hook is invoked in case to a system halting error before
501 * the system is halted.
502 */
503#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
504 /* System halt code here.*/ \
505}
506
507/**
508 * @brief Trace hook.
509 * @details This hook is invoked each time a new record is written in the
510 * trace buffer.
511 */
512#define CH_CFG_TRACE_HOOK(tep) { \
513 /* Trace code here.*/ \
514}
515
516/** @} */
517
518/*===========================================================================*/
519/* Port-specific settings (override port settings defaulted in chcore.h). */
520/*===========================================================================*/
521
522#endif /* CHCONF_H */
523
524/** @} */
diff --git a/keyboards/chibios_test/stm32_f103_onekey/config.h b/keyboards/chibios_test/stm32_f103_onekey/config.h
deleted file mode 100644
index de0b906f3..000000000
--- a/keyboards/chibios_test/stm32_f103_onekey/config.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef KEYBOARDS_CHIBIOS_TEST_STM32_F103_ONEKEY_CONFIG_H_
2#define KEYBOARDS_CHIBIOS_TEST_STM32_F103_ONEKEY_CONFIG_H_
3
4#include "../config.h"
5
6#endif /* KEYBOARDS_CHIBIOS_TEST_STM32_F103_ONEKEY_CONFIG_H_ */
diff --git a/keyboards/chibios_test/stm32_f103_onekey/flash.sh b/keyboards/chibios_test/stm32_f103_onekey/flash.sh
deleted file mode 100755
index 15501dfa5..000000000
--- a/keyboards/chibios_test/stm32_f103_onekey/flash.sh
+++ /dev/null
@@ -1,2 +0,0 @@
1#!/bin/bash
2Arduino_STM32_usb_hid/tools/linux/maple_upload ttyACM0 2 1EAF:0003 build/ch.bin
diff --git a/keyboards/chibios_test/stm32_f103_onekey/halconf.h b/keyboards/chibios_test/stm32_f103_onekey/halconf.h
deleted file mode 100644
index 8b9724b1a..000000000
--- a/keyboards/chibios_test/stm32_f103_onekey/halconf.h
+++ /dev/null
@@ -1,353 +0,0 @@
1/*
2 ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/halconf.h
19 * @brief HAL configuration header.
20 * @details HAL configuration file, this file allows to enable or disable the
21 * various device drivers from your application. You may also use
22 * this file in order to override the device drivers default settings.
23 *
24 * @addtogroup HAL_CONF
25 * @{
26 */
27
28#ifndef _HALCONF_H_
29#define _HALCONF_H_
30
31#include "mcuconf.h"
32
33/**
34 * @brief Enables the PAL subsystem.
35 */
36#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
37#define HAL_USE_PAL TRUE
38#endif
39
40/**
41 * @brief Enables the ADC subsystem.
42 */
43#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
44#define HAL_USE_ADC FALSE
45#endif
46
47/**
48 * @brief Enables the CAN subsystem.
49 */
50#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
51#define HAL_USE_CAN FALSE
52#endif
53
54/**
55 * @brief Enables the DAC subsystem.
56 */
57#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
58#define HAL_USE_DAC FALSE
59#endif
60
61/**
62 * @brief Enables the EXT subsystem.
63 */
64#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
65#define HAL_USE_EXT FALSE
66#endif
67
68/**
69 * @brief Enables the GPT subsystem.
70 */
71#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
72#define HAL_USE_GPT FALSE
73#endif
74
75/**
76 * @brief Enables the I2C subsystem.
77 */
78#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
79#define HAL_USE_I2C FALSE
80#endif
81
82/**
83 * @brief Enables the I2S subsystem.
84 */
85#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
86#define HAL_USE_I2S FALSE
87#endif
88
89/**
90 * @brief Enables the ICU subsystem.
91 */
92#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
93#define HAL_USE_ICU FALSE
94#endif
95
96/**
97 * @brief Enables the MAC subsystem.
98 */
99#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
100#define HAL_USE_MAC FALSE
101#endif
102
103/**
104 * @brief Enables the MMC_SPI subsystem.
105 */
106#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
107#define HAL_USE_MMC_SPI FALSE
108#endif
109
110/**
111 * @brief Enables the PWM subsystem.
112 */
113#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
114#define HAL_USE_PWM FALSE
115#endif
116
117/**
118 * @brief Enables the RTC subsystem.
119 */
120#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
121#define HAL_USE_RTC FALSE
122#endif
123
124/**
125 * @brief Enables the SDC subsystem.
126 */
127#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
128#define HAL_USE_SDC FALSE
129#endif
130
131/**
132 * @brief Enables the SERIAL subsystem.
133 */
134#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
135#define HAL_USE_SERIAL FALSE
136#endif
137
138/**
139 * @brief Enables the SERIAL over USB subsystem.
140 */
141#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
142#define HAL_USE_SERIAL_USB FALSE
143#endif
144
145/**
146 * @brief Enables the SPI subsystem.
147 */
148#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
149#define HAL_USE_SPI FALSE
150#endif
151
152/**
153 * @brief Enables the UART subsystem.
154 */
155#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
156#define HAL_USE_UART FALSE
157#endif
158
159/**
160 * @brief Enables the USB subsystem.
161 */
162#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
163#define HAL_USE_USB TRUE
164#endif
165
166/**
167 * @brief Enables the WDG subsystem.
168 */
169#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
170#define HAL_USE_WDG FALSE
171#endif
172
173/*===========================================================================*/
174/* ADC driver related settings. */
175/*===========================================================================*/
176
177/**
178 * @brief Enables synchronous APIs.
179 * @note Disabling this option saves both code and data space.
180 */
181#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
182#define ADC_USE_WAIT TRUE
183#endif
184
185/**
186 * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
187 * @note Disabling this option saves both code and data space.
188 */
189#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
190#define ADC_USE_MUTUAL_EXCLUSION TRUE
191#endif
192
193/*===========================================================================*/
194/* CAN driver related settings. */
195/*===========================================================================*/
196
197/**
198 * @brief Sleep mode related APIs inclusion switch.
199 */
200#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
201#define CAN_USE_SLEEP_MODE TRUE
202#endif
203
204/*===========================================================================*/
205/* I2C driver related settings. */
206/*===========================================================================*/
207
208/**
209 * @brief Enables the mutual exclusion APIs on the I2C bus.
210 */
211#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
212#define I2C_USE_MUTUAL_EXCLUSION TRUE
213#endif
214
215/*===========================================================================*/
216/* MAC driver related settings. */
217/*===========================================================================*/
218
219/**
220 * @brief Enables an event sources for incoming packets.
221 */
222#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
223#define MAC_USE_ZERO_COPY FALSE
224#endif
225
226/**
227 * @brief Enables an event sources for incoming packets.
228 */
229#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
230#define MAC_USE_EVENTS TRUE
231#endif
232
233/*===========================================================================*/
234/* MMC_SPI driver related settings. */
235/*===========================================================================*/
236
237/**
238 * @brief Delays insertions.
239 * @details If enabled this options inserts delays into the MMC waiting
240 * routines releasing some extra CPU time for the threads with
241 * lower priority, this may slow down the driver a bit however.
242 * This option is recommended also if the SPI driver does not
243 * use a DMA channel and heavily loads the CPU.
244 */
245#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
246#define MMC_NICE_WAITING TRUE
247#endif
248
249/*===========================================================================*/
250/* SDC driver related settings. */
251/*===========================================================================*/
252
253/**
254 * @brief Number of initialization attempts before rejecting the card.
255 * @note Attempts are performed at 10mS intervals.
256 */
257#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
258#define SDC_INIT_RETRY 100
259#endif
260
261/**
262 * @brief Include support for MMC cards.
263 * @note MMC support is not yet implemented so this option must be kept
264 * at @p FALSE.
265 */
266#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
267#define SDC_MMC_SUPPORT FALSE
268#endif
269
270/**
271 * @brief Delays insertions.
272 * @details If enabled this options inserts delays into the MMC waiting
273 * routines releasing some extra CPU time for the threads with
274 * lower priority, this may slow down the driver a bit however.
275 */
276#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
277#define SDC_NICE_WAITING TRUE
278#endif
279
280/*===========================================================================*/
281/* SERIAL driver related settings. */
282/*===========================================================================*/
283
284/**
285 * @brief Default bit rate.
286 * @details Configuration parameter, this is the baud rate selected for the
287 * default configuration.
288 */
289#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
290#define SERIAL_DEFAULT_BITRATE 38400
291#endif
292
293/**
294 * @brief Serial buffers size.
295 * @details Configuration parameter, you can change the depth of the queue
296 * buffers depending on the requirements of your application.
297 * @note The default is 64 bytes for both the transmission and receive
298 * buffers.
299 */
300#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
301#define SERIAL_BUFFERS_SIZE 16
302#endif
303
304/*===========================================================================*/
305/* SERIAL_USB driver related setting. */
306/*===========================================================================*/
307
308/**
309 * @brief Serial over USB buffers size.
310 * @details Configuration parameter, the buffer size must be a multiple of
311 * the USB data endpoint maximum packet size.
312 * @note The default is 64 bytes for both the transmission and receive
313 * buffers.
314 */
315#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
316#define SERIAL_USB_BUFFERS_SIZE 1
317#endif
318
319/*===========================================================================*/
320/* SPI driver related settings. */
321/*===========================================================================*/
322
323/**
324 * @brief Enables synchronous APIs.
325 * @note Disabling this option saves both code and data space.
326 */
327#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
328#define SPI_USE_WAIT TRUE
329#endif
330
331/**
332 * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
333 * @note Disabling this option saves both code and data space.
334 */
335#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
336#define SPI_USE_MUTUAL_EXCLUSION TRUE
337#endif
338
339/*===========================================================================*/
340/* USB driver related settings. */
341/*===========================================================================*/
342
343/**
344 * @brief Enables synchronous APIs.
345 * @note Disabling this option saves both code and data space.
346 */
347#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
348#define USB_USE_WAIT TRUE
349#endif
350
351#endif /* _HALCONF_H_ */
352
353/** @} */
diff --git a/keyboards/chibios_test/stm32_f103_onekey/led.c b/keyboards/chibios_test/stm32_f103_onekey/led.c
deleted file mode 100644
index f5c55f7d9..000000000
--- a/keyboards/chibios_test/stm32_f103_onekey/led.c
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#include "hal.h"
19#include "led.h"
20
21
22void led_set(uint8_t usb_led)
23{
24 if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
25 /* generic STM32F103C8T6 board */
26#ifdef BOARD_GENERIC_STM32_F103
27 palClearPad(GPIOC, 13);
28#endif
29 /* Maple Mini */
30#ifdef BOARD_MAPLEMINI_STM32_F103
31 palSetPad(GPIOB, 1);
32#endif
33 } else {
34 /* generic STM32F103C8T6 board */
35#ifdef BOARD_GENERIC_STM32_F103
36 palSetPad(GPIOC, 13);
37#endif
38 /* Maple Mini */
39#ifdef BOARD_MAPLEMINI_STM32_F103
40 palClearPad(GPIOB,1);
41#endif
42 }
43}
diff --git a/keyboards/chibios_test/stm32_f103_onekey/matrix.c b/keyboards/chibios_test/stm32_f103_onekey/matrix.c
deleted file mode 100644
index ea9d8d057..000000000
--- a/keyboards/chibios_test/stm32_f103_onekey/matrix.c
+++ /dev/null
@@ -1,177 +0,0 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#include "ch.h"
19#include "hal.h"
20
21/*
22 * scan matrix
23 */
24#include "print.h"
25#include "debug.h"
26#include "util.h"
27#include "matrix.h"
28#include "wait.h"
29
30#ifndef DEBOUNCE
31# define DEBOUNCE 5
32#endif
33static uint8_t debouncing = DEBOUNCE;
34
35/* matrix state(1:on, 0:off) */
36static matrix_row_t matrix[MATRIX_ROWS];
37static matrix_row_t matrix_debouncing[MATRIX_ROWS];
38
39static matrix_row_t read_cols(void);
40static void init_cols(void);
41static void unselect_rows(void);
42static void select_row(uint8_t row);
43
44
45inline
46uint8_t matrix_rows(void)
47{
48 return MATRIX_ROWS;
49}
50
51inline
52uint8_t matrix_cols(void)
53{
54 return MATRIX_COLS;
55}
56
57/* generic STM32F103C8T6 board */
58#ifdef BOARD_GENERIC_STM32_F103
59#define LED_ON() do { palClearPad(GPIOC, GPIOC_LED) ;} while (0)
60#define LED_OFF() do { palSetPad(GPIOC, GPIOC_LED); } while (0)
61#define LED_TGL() do { palTogglePad(GPIOC, GPIOC_LED); } while (0)
62#endif
63
64/* Maple Mini */
65#ifdef BOARD_MAPLEMINI_STM32_F103
66#define LED_ON() do { palSetPad(GPIOB, 1) ;} while (0)
67#define LED_OFF() do { palClearPad(GPIOB, 1); } while (0)
68#define LED_TGL() do { palTogglePad(GPIOB, 1); } while (0)
69#endif
70
71void matrix_init(void)
72{
73 // initialize row and col
74 unselect_rows();
75 init_cols();
76
77 // initialize matrix state: all keys off
78 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
79 matrix[i] = 0;
80 matrix_debouncing[i] = 0;
81 }
82
83 //debug
84 debug_matrix = true;
85 LED_ON();
86 wait_ms(500);
87 LED_OFF();
88}
89
90uint8_t matrix_scan(void)
91{
92 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
93 select_row(i);
94 wait_us(30); // without this wait read unstable value.
95 matrix_row_t cols = read_cols();
96 if (matrix_debouncing[i] != cols) {
97 matrix_debouncing[i] = cols;
98 if (debouncing) {
99 debug("bounce!: "); debug_hex(debouncing); debug("\n");
100 }
101 debouncing = DEBOUNCE;
102 }
103 unselect_rows();
104 }
105
106 if (debouncing) {
107 if (--debouncing) {
108 wait_ms(1);
109 } else {
110 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
111 matrix[i] = matrix_debouncing[i];
112 }
113 }
114 }
115
116 return 1;
117}
118
119inline
120bool matrix_is_on(uint8_t row, uint8_t col)
121{
122 return (matrix[row] & ((matrix_row_t)1<<col));
123}
124
125inline
126matrix_row_t matrix_get_row(uint8_t row)
127{
128 return matrix[row];
129}
130
131void matrix_print(void)
132{
133 print("\nr/c 0123456789ABCDEF\n");
134 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
135 phex(row); print(": ");
136 pbin_reverse16(matrix_get_row(row));
137 print("\n");
138 }
139}
140
141/* Column pin configuration
142 */
143static void init_cols(void)
144{
145#ifdef BOARD_MAPLEMINI_STM32_F103
146 // don't need pullup/down, since it's pulled down in hardware
147 palSetPadMode(GPIOB, 8, PAL_MODE_INPUT);
148#else
149 palSetPadMode(GPIOB, 8, PAL_MODE_INPUT_PULLDOWN);
150#endif
151}
152
153/* Returns status of switches(1:on, 0:off) */
154static matrix_row_t read_cols(void)
155{
156 return ((palReadPad(GPIOB, 8)==PAL_LOW) ? 0 : (1<<0));
157 // | ((palReadPad(...)==PAL_HIGH) ? 0 : (1<<1))
158}
159
160/* Row pin configuration
161 */
162static void unselect_rows(void)
163{
164 // palSetPadMode(GPIOA, GPIOA_PIN10, PAL_MODE_INPUT); // hi-Z
165}
166
167static void select_row(uint8_t row)
168{
169 (void)row;
170 // Output low to select
171 // switch (row) {
172 // case 0:
173 // palSetPadMode(GPIOA, GPIOA_PIN10, PAL_MODE_OUTPUT_PUSHPULL);
174 // palSetPad(GPIOA, GPIOA_PIN10, PAL_LOW);
175 // break;
176 // }
177}
diff --git a/keyboards/chibios_test/stm32_f103_onekey/mcuconf.h b/keyboards/chibios_test/stm32_f103_onekey/mcuconf.h
deleted file mode 100644
index 276829216..000000000
--- a/keyboards/chibios_test/stm32_f103_onekey/mcuconf.h
+++ /dev/null
@@ -1,209 +0,0 @@
1/*
2 ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#ifndef _MCUCONF_H_
18#define _MCUCONF_H_
19
20#define STM32F103_MCUCONF
21
22/*
23 * STM32F103 drivers configuration.
24 * The following settings override the default settings present in
25 * the various device driver implementation headers.
26 * Note that the settings for each driver only have effect if the whole
27 * driver is enabled in halconf.h.
28 *
29 * IRQ priorities:
30 * 15...0 Lowest...Highest.
31 *
32 * DMA priorities:
33 * 0...3 Lowest...Highest.
34 */
35
36/*
37 * HAL driver system settings.
38 */
39#define STM32_NO_INIT FALSE
40#define STM32_HSI_ENABLED TRUE
41#define STM32_LSI_ENABLED FALSE
42#define STM32_HSE_ENABLED TRUE
43#define STM32_LSE_ENABLED FALSE
44#define STM32_SW STM32_SW_PLL
45#define STM32_PLLSRC STM32_PLLSRC_HSE
46#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1
47#define STM32_PLLMUL_VALUE 9
48#define STM32_HPRE STM32_HPRE_DIV1
49#define STM32_PPRE1 STM32_PPRE1_DIV2
50#define STM32_PPRE2 STM32_PPRE2_DIV2
51#define STM32_ADCPRE STM32_ADCPRE_DIV4
52#define STM32_USB_CLOCK_REQUIRED TRUE
53#define STM32_USBPRE STM32_USBPRE_DIV1P5
54#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
55#define STM32_RTCSEL STM32_RTCSEL_HSEDIV
56#define STM32_PVD_ENABLE FALSE
57#define STM32_PLS STM32_PLS_LEV0
58
59/*
60 * ADC driver system settings.
61 */
62#define STM32_ADC_USE_ADC1 FALSE
63#define STM32_ADC_ADC1_DMA_PRIORITY 2
64#define STM32_ADC_ADC1_IRQ_PRIORITY 6
65
66/*
67 * CAN driver system settings.
68 */
69#define STM32_CAN_USE_CAN1 FALSE
70#define STM32_CAN_CAN1_IRQ_PRIORITY 11
71
72/*
73 * EXT driver system settings.
74 */
75#define STM32_EXT_EXTI0_IRQ_PRIORITY 6
76#define STM32_EXT_EXTI1_IRQ_PRIORITY 6
77#define STM32_EXT_EXTI2_IRQ_PRIORITY 6
78#define STM32_EXT_EXTI3_IRQ_PRIORITY 6
79#define STM32_EXT_EXTI4_IRQ_PRIORITY 6
80#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6
81#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6
82#define STM32_EXT_EXTI16_IRQ_PRIORITY 6
83#define STM32_EXT_EXTI17_IRQ_PRIORITY 6
84#define STM32_EXT_EXTI18_IRQ_PRIORITY 6
85#define STM32_EXT_EXTI19_IRQ_PRIORITY 6
86
87/*
88 * GPT driver system settings.
89 */
90#define STM32_GPT_USE_TIM1 FALSE
91#define STM32_GPT_USE_TIM2 FALSE
92#define STM32_GPT_USE_TIM3 FALSE
93#define STM32_GPT_USE_TIM4 FALSE
94#define STM32_GPT_USE_TIM5 FALSE
95#define STM32_GPT_USE_TIM8 FALSE
96#define STM32_GPT_TIM1_IRQ_PRIORITY 7
97#define STM32_GPT_TIM2_IRQ_PRIORITY 7
98#define STM32_GPT_TIM3_IRQ_PRIORITY 7
99#define STM32_GPT_TIM4_IRQ_PRIORITY 7
100#define STM32_GPT_TIM5_IRQ_PRIORITY 7
101#define STM32_GPT_TIM8_IRQ_PRIORITY 7
102
103/*
104 * I2C driver system settings.
105 */
106#define STM32_I2C_USE_I2C1 FALSE
107#define STM32_I2C_USE_I2C2 FALSE
108#define STM32_I2C_BUSY_TIMEOUT 50
109#define STM32_I2C_I2C1_IRQ_PRIORITY 5
110#define STM32_I2C_I2C2_IRQ_PRIORITY 5
111#define STM32_I2C_I2C1_DMA_PRIORITY 3
112#define STM32_I2C_I2C2_DMA_PRIORITY 3
113#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
114
115/*
116 * ICU driver system settings.
117 */
118#define STM32_ICU_USE_TIM1 FALSE
119#define STM32_ICU_USE_TIM2 FALSE
120#define STM32_ICU_USE_TIM3 FALSE
121#define STM32_ICU_USE_TIM4 FALSE
122#define STM32_ICU_USE_TIM5 FALSE
123#define STM32_ICU_USE_TIM8 FALSE
124#define STM32_ICU_TIM1_IRQ_PRIORITY 7
125#define STM32_ICU_TIM2_IRQ_PRIORITY 7
126#define STM32_ICU_TIM3_IRQ_PRIORITY 7
127#define STM32_ICU_TIM4_IRQ_PRIORITY 7
128#define STM32_ICU_TIM5_IRQ_PRIORITY 7
129#define STM32_ICU_TIM8_IRQ_PRIORITY 7
130
131/*
132 * PWM driver system settings.
133 */
134#define STM32_PWM_USE_ADVANCED FALSE
135#define STM32_PWM_USE_TIM1 FALSE
136#define STM32_PWM_USE_TIM2 FALSE
137#define STM32_PWM_USE_TIM3 FALSE
138#define STM32_PWM_USE_TIM4 FALSE
139#define STM32_PWM_USE_TIM5 FALSE
140#define STM32_PWM_USE_TIM8 FALSE
141#define STM32_PWM_TIM1_IRQ_PRIORITY 7
142#define STM32_PWM_TIM2_IRQ_PRIORITY 7
143#define STM32_PWM_TIM3_IRQ_PRIORITY 7
144#define STM32_PWM_TIM4_IRQ_PRIORITY 7
145#define STM32_PWM_TIM5_IRQ_PRIORITY 7
146#define STM32_PWM_TIM8_IRQ_PRIORITY 7
147
148/*
149 * RTC driver system settings.
150 */
151#define STM32_RTC_IRQ_PRIORITY 15
152
153/*
154 * SERIAL driver system settings.
155 */
156#define STM32_SERIAL_USE_USART1 FALSE
157#define STM32_SERIAL_USE_USART2 FALSE
158#define STM32_SERIAL_USE_USART3 FALSE
159#define STM32_SERIAL_USE_UART4 FALSE
160#define STM32_SERIAL_USE_UART5 FALSE
161#define STM32_SERIAL_USART1_PRIORITY 12
162#define STM32_SERIAL_USART2_PRIORITY 12
163#define STM32_SERIAL_USART3_PRIORITY 12
164#define STM32_SERIAL_UART4_PRIORITY 12
165#define STM32_SERIAL_UART5_PRIORITY 12
166
167/*
168 * SPI driver system settings.
169 */
170#define STM32_SPI_USE_SPI1 FALSE
171#define STM32_SPI_USE_SPI2 FALSE
172#define STM32_SPI_USE_SPI3 FALSE
173#define STM32_SPI_SPI1_DMA_PRIORITY 1
174#define STM32_SPI_SPI2_DMA_PRIORITY 1
175#define STM32_SPI_SPI3_DMA_PRIORITY 1
176#define STM32_SPI_SPI1_IRQ_PRIORITY 10
177#define STM32_SPI_SPI2_IRQ_PRIORITY 10
178#define STM32_SPI_SPI3_IRQ_PRIORITY 10
179#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
180
181/*
182 * ST driver system settings.
183 */
184#define STM32_ST_IRQ_PRIORITY 8
185#define STM32_ST_USE_TIMER 2
186
187/*
188 * UART driver system settings.
189 */
190#define STM32_UART_USE_USART1 FALSE
191#define STM32_UART_USE_USART2 FALSE
192#define STM32_UART_USE_USART3 FALSE
193#define STM32_UART_USART1_IRQ_PRIORITY 12
194#define STM32_UART_USART2_IRQ_PRIORITY 12
195#define STM32_UART_USART3_IRQ_PRIORITY 12
196#define STM32_UART_USART1_DMA_PRIORITY 0
197#define STM32_UART_USART2_DMA_PRIORITY 0
198#define STM32_UART_USART3_DMA_PRIORITY 0
199#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
200
201/*
202 * USB driver system settings.
203 */
204#define STM32_USB_USE_USB1 TRUE
205#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE
206#define STM32_USB_USB1_HP_IRQ_PRIORITY 13
207#define STM32_USB_USB1_LP_IRQ_PRIORITY 14
208
209#endif /* _MCUCONF_H_ */
diff --git a/keyboards/chibios_test/stm32_f103_onekey/readme.md b/keyboards/chibios_test/stm32_f103_onekey/readme.md
deleted file mode 100644
index d375ef7d8..000000000
--- a/keyboards/chibios_test/stm32_f103_onekey/readme.md
+++ /dev/null
@@ -1,3 +0,0 @@
1# ChibiOS Test
2
3Test code for the stm32_f103 one key keyboard \ No newline at end of file
diff --git a/keyboards/chibios_test/stm32_f103_onekey/rules.mk b/keyboards/chibios_test/stm32_f103_onekey/rules.mk
deleted file mode 100644
index c75738338..000000000
--- a/keyboards/chibios_test/stm32_f103_onekey/rules.mk
+++ /dev/null
@@ -1,47 +0,0 @@
1# project specific files
2SRC = matrix.c \
3 led.c
4
5# GENERIC STM32F103C8T6 board - stm32duino bootloader
6OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000
7MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
8BOARD = GENERIC_STM32_F103
9
10# GENERIC STM32F103C8T6 board - no bootloader (programmer over serial or SWD)
11# OPT_DEFS =
12# MCU_LDSCRIPT = STM32F103x8
13# BOARD = GENERIC_STM32_F103
14
15# MAPLE MINI
16# OPT_DEFS = -DCORTEX_VTOR_INIT=0x5000
17# MCU_LDSCRIPT = STM32F103xB_maplemini_bootloader
18# BOARD = MAPLEMINI_STM32_F103
19
20## chip/board settings
21# the next two should match the directories in
22# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
23MCU_FAMILY = STM32
24MCU_SERIES = STM32F1xx
25# linker script to use
26# it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
27# or <this_dir>/ld/
28# startup code to use
29# is should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
30MCU_STARTUP = stm32f1xx
31# it should exist either in <chibios>/os/hal/boards/
32# or <this_dir>/boards
33# Cortex version
34# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
35MCU = cortex-m3
36# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
37ARMV = 7
38# If you want to be able to jump to bootloader from firmware on STM32 MCUs,
39# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in
40# ./bootloader_defs.h or in ./boards/<FOO>/bootloader_defs.h (if you have
41# a custom board definition that you plan to reuse).
42# If you're not setting it here, leave it commented out.
43# It is chip dependent, the correct number can be looked up here (page 175):
44# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
45# This also requires a patch to chibios:
46# <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
47#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 \ No newline at end of file
diff --git a/keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.c b/keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.c
deleted file mode 100644
index 7fa99bb28..000000000
--- a/keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "stm32_f103_onekey.h"
diff --git a/keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.h b/keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.h
deleted file mode 100644
index b9ba65a9e..000000000
--- a/keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef STM32_F103_ONEKEY_H
2#define STM32_F103_ONEKEY_H
3#include "chibios_test.h"
4
5#define LAYOUT(k00) {{ k00 }}
6
7#endif
diff --git a/keyboards/chibios_test/teensy_lc_onekey/chconf.h b/keyboards/chibios_test/teensy_lc_onekey/chconf.h
deleted file mode 100644
index 3294ac7ee..000000000
--- a/keyboards/chibios_test/teensy_lc_onekey/chconf.h
+++ /dev/null
@@ -1,524 +0,0 @@
1/*
2 ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/chconf.h
19 * @brief Configuration file template.
20 * @details A copy of this file must be placed in each project directory, it
21 * contains the application specific kernel settings.
22 *
23 * @addtogroup config
24 * @details Kernel related settings and hooks.
25 * @{
26 */
27
28#ifndef CHCONF_H
29#define CHCONF_H
30
31#define _CHIBIOS_RT_CONF_
32
33/*===========================================================================*/
34/**
35 * @name System timers settings
36 * @{
37 */
38/*===========================================================================*/
39
40/**
41 * @brief System time counter resolution.
42 * @note Allowed values are 16 or 32 bits.
43 */
44#define CH_CFG_ST_RESOLUTION 32
45
46/**
47 * @brief System tick frequency.
48 * @details Frequency of the system timer that drives the system ticks. This
49 * setting also defines the system tick time unit.
50 */
51#define CH_CFG_ST_FREQUENCY 1000
52
53/**
54 * @brief Time delta constant for the tick-less mode.
55 * @note If this value is zero then the system uses the classic
56 * periodic tick. This value represents the minimum number
57 * of ticks that is safe to specify in a timeout directive.
58 * The value one is not valid, timeouts are rounded up to
59 * this value.
60 */
61#define CH_CFG_ST_TIMEDELTA 0
62
63/** @} */
64
65/*===========================================================================*/
66/**
67 * @name Kernel parameters and options
68 * @{
69 */
70/*===========================================================================*/
71
72/**
73 * @brief Round robin interval.
74 * @details This constant is the number of system ticks allowed for the
75 * threads before preemption occurs. Setting this value to zero
76 * disables the preemption for threads with equal priority and the
77 * round robin becomes cooperative. Note that higher priority
78 * threads can still preempt, the kernel is always preemptive.
79 * @note Disabling the round robin preemption makes the kernel more compact
80 * and generally faster.
81 * @note The round robin preemption is not supported in tickless mode and
82 * must be set to zero in that case.
83 */
84#define CH_CFG_TIME_QUANTUM 20
85
86/**
87 * @brief Managed RAM size.
88 * @details Size of the RAM area to be managed by the OS. If set to zero
89 * then the whole available RAM is used. The core memory is made
90 * available to the heap allocator and/or can be used directly through
91 * the simplified core memory allocator.
92 *
93 * @note In order to let the OS manage the whole RAM the linker script must
94 * provide the @p __heap_base__ and @p __heap_end__ symbols.
95 * @note Requires @p CH_CFG_USE_MEMCORE.
96 */
97#define CH_CFG_MEMCORE_SIZE 0
98
99/**
100 * @brief Idle thread automatic spawn suppression.
101 * @details When this option is activated the function @p chSysInit()
102 * does not spawn the idle thread. The application @p main()
103 * function becomes the idle thread and must implement an
104 * infinite loop.
105 */
106#define CH_CFG_NO_IDLE_THREAD FALSE
107
108/* Use __WFI in the idle thread for waiting. Does lower the power
109 * consumption. */
110#define CORTEX_ENABLE_WFI_IDLE TRUE
111
112/** @} */
113
114/*===========================================================================*/
115/**
116 * @name Performance options
117 * @{
118 */
119/*===========================================================================*/
120
121/**
122 * @brief OS optimization.
123 * @details If enabled then time efficient rather than space efficient code
124 * is used when two possible implementations exist.
125 *
126 * @note This is not related to the compiler optimization options.
127 * @note The default is @p TRUE.
128 */
129#define CH_CFG_OPTIMIZE_SPEED TRUE
130
131/** @} */
132
133/*===========================================================================*/
134/**
135 * @name Subsystem options
136 * @{
137 */
138/*===========================================================================*/
139
140/**
141 * @brief Time Measurement APIs.
142 * @details If enabled then the time measurement APIs are included in
143 * the kernel.
144 *
145 * @note The default is @p TRUE.
146 */
147#define CH_CFG_USE_TM FALSE
148
149/**
150 * @brief Threads registry APIs.
151 * @details If enabled then the registry APIs are included in the kernel.
152 *
153 * @note The default is @p TRUE.
154 */
155#define CH_CFG_USE_REGISTRY TRUE
156
157/**
158 * @brief Threads synchronization APIs.
159 * @details If enabled then the @p chThdWait() function is included in
160 * the kernel.
161 *
162 * @note The default is @p TRUE.
163 */
164#define CH_CFG_USE_WAITEXIT TRUE
165
166/**
167 * @brief Semaphores APIs.
168 * @details If enabled then the Semaphores APIs are included in the kernel.
169 *
170 * @note The default is @p TRUE.
171 */
172#define CH_CFG_USE_SEMAPHORES TRUE
173
174/**
175 * @brief Semaphores queuing mode.
176 * @details If enabled then the threads are enqueued on semaphores by
177 * priority rather than in FIFO order.
178 *
179 * @note The default is @p FALSE. Enable this if you have special
180 * requirements.
181 * @note Requires @p CH_CFG_USE_SEMAPHORES.
182 */
183#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
184
185/**
186 * @brief Mutexes APIs.
187 * @details If enabled then the mutexes APIs are included in the kernel.
188 *
189 * @note The default is @p TRUE.
190 */
191#define CH_CFG_USE_MUTEXES TRUE
192
193/**
194 * @brief Enables recursive behavior on mutexes.
195 * @note Recursive mutexes are heavier and have an increased
196 * memory footprint.
197 *
198 * @note The default is @p FALSE.
199 * @note Requires @p CH_CFG_USE_MUTEXES.
200 */
201#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
202
203/**
204 * @brief Conditional Variables APIs.
205 * @details If enabled then the conditional variables APIs are included
206 * in the kernel.
207 *
208 * @note The default is @p TRUE.
209 * @note Requires @p CH_CFG_USE_MUTEXES.
210 */
211#define CH_CFG_USE_CONDVARS TRUE
212
213/**
214 * @brief Conditional Variables APIs with timeout.
215 * @details If enabled then the conditional variables APIs with timeout
216 * specification are included in the kernel.
217 *
218 * @note The default is @p TRUE.
219 * @note Requires @p CH_CFG_USE_CONDVARS.
220 */
221#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
222
223/**
224 * @brief Events Flags APIs.
225 * @details If enabled then the event flags APIs are included in the kernel.
226 *
227 * @note The default is @p TRUE.
228 */
229#define CH_CFG_USE_EVENTS TRUE
230
231/**
232 * @brief Events Flags APIs with timeout.
233 * @details If enabled then the events APIs with timeout specification
234 * are included in the kernel.
235 *
236 * @note The default is @p TRUE.
237 * @note Requires @p CH_CFG_USE_EVENTS.
238 */
239#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
240
241/**
242 * @brief Synchronous Messages APIs.
243 * @details If enabled then the synchronous messages APIs are included
244 * in the kernel.
245 *
246 * @note The default is @p TRUE.
247 */
248#define CH_CFG_USE_MESSAGES TRUE
249
250/**
251 * @brief Synchronous Messages queuing mode.
252 * @details If enabled then messages are served by priority rather than in
253 * FIFO order.
254 *
255 * @note The default is @p FALSE. Enable this if you have special
256 * requirements.
257 * @note Requires @p CH_CFG_USE_MESSAGES.
258 */
259#define CH_CFG_USE_MESSAGES_PRIORITY FALSE
260
261/**
262 * @brief Mailboxes APIs.
263 * @details If enabled then the asynchronous messages (mailboxes) APIs are
264 * included in the kernel.
265 *
266 * @note The default is @p TRUE.
267 * @note Requires @p CH_CFG_USE_SEMAPHORES.
268 */
269#define CH_CFG_USE_MAILBOXES TRUE
270
271/**
272 * @brief Core Memory Manager APIs.
273 * @details If enabled then the core memory manager APIs are included
274 * in the kernel.
275 *
276 * @note The default is @p TRUE.
277 */
278#define CH_CFG_USE_MEMCORE TRUE
279
280/**
281 * @brief Heap Allocator APIs.
282 * @details If enabled then the memory heap allocator APIs are included
283 * in the kernel.
284 *
285 * @note The default is @p TRUE.
286 * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
287 * @p CH_CFG_USE_SEMAPHORES.
288 * @note Mutexes are recommended.
289 */
290#define CH_CFG_USE_HEAP TRUE
291
292/**
293 * @brief Memory Pools Allocator APIs.
294 * @details If enabled then the memory pools allocator APIs are included
295 * in the kernel.
296 *
297 * @note The default is @p TRUE.
298 */
299#define CH_CFG_USE_MEMPOOLS TRUE
300
301/**
302 * @brief Dynamic Threads APIs.
303 * @details If enabled then the dynamic threads creation APIs are included
304 * in the kernel.
305 *
306 * @note The default is @p TRUE.
307 * @note Requires @p CH_CFG_USE_WAITEXIT.
308 * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
309 */
310#define CH_CFG_USE_DYNAMIC TRUE
311
312/** @} */
313
314/*===========================================================================*/
315/**
316 * @name Debug options
317 * @{
318 */
319/*===========================================================================*/
320
321/**
322 * @brief Debug option, kernel statistics.
323 *
324 * @note The default is @p FALSE.
325 */
326#define CH_DBG_STATISTICS FALSE
327
328/**
329 * @brief Debug option, system state check.
330 * @details If enabled the correct call protocol for system APIs is checked
331 * at runtime.
332 *
333 * @note The default is @p FALSE.
334 */
335#define CH_DBG_SYSTEM_STATE_CHECK TRUE
336
337/**
338 * @brief Debug option, parameters checks.
339 * @details If enabled then the checks on the API functions input
340 * parameters are activated.
341 *
342 * @note The default is @p FALSE.
343 */
344#define CH_DBG_ENABLE_CHECKS TRUE
345
346/**
347 * @brief Debug option, consistency checks.
348 * @details If enabled then all the assertions in the kernel code are
349 * activated. This includes consistency checks inside the kernel,
350 * runtime anomalies and port-defined checks.
351 *
352 * @note The default is @p FALSE.
353 */
354#define CH_DBG_ENABLE_ASSERTS TRUE
355
356/**
357 * @brief Debug option, trace buffer.
358 * @details If enabled then the trace buffer is activated.
359 *
360 * @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
361 */
362#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
363
364/**
365 * @brief Trace buffer entries.
366 * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
367 * different from @p CH_DBG_TRACE_MASK_DISABLED.
368 */
369#define CH_DBG_TRACE_BUFFER_SIZE 128
370
371/**
372 * @brief Debug option, stack checks.
373 * @details If enabled then a runtime stack check is performed.
374 *
375 * @note The default is @p FALSE.
376 * @note The stack check is performed in a architecture/port dependent way.
377 * It may not be implemented or some ports.
378 * @note The default failure mode is to halt the system with the global
379 * @p panic_msg variable set to @p NULL.
380 */
381#define CH_DBG_ENABLE_STACK_CHECK TRUE
382
383/**
384 * @brief Debug option, stacks initialization.
385 * @details If enabled then the threads working area is filled with a byte
386 * value when a thread is created. This can be useful for the
387 * runtime measurement of the used stack.
388 *
389 * @note The default is @p FALSE.
390 */
391#define CH_DBG_FILL_THREADS TRUE
392
393/**
394 * @brief Debug option, threads profiling.
395 * @details If enabled then a field is added to the @p thread_t structure that
396 * counts the system ticks occurred while executing the thread.
397 *
398 * @note The default is @p FALSE.
399 * @note This debug option is not currently compatible with the
400 * tickless mode.
401 */
402#define CH_DBG_THREADS_PROFILING FALSE
403
404/** @} */
405
406/*===========================================================================*/
407/**
408 * @name Kernel hooks
409 * @{
410 */
411/*===========================================================================*/
412
413/**
414 * @brief Threads descriptor structure extension.
415 * @details User fields added to the end of the @p thread_t structure.
416 */
417#define CH_CFG_THREAD_EXTRA_FIELDS \
418 /* Add threads custom fields here.*/
419
420/**
421 * @brief Threads initialization hook.
422 * @details User initialization code added to the @p chThdInit() API.
423 *
424 * @note It is invoked from within @p chThdInit() and implicitly from all
425 * the threads creation APIs.
426 */
427#define CH_CFG_THREAD_INIT_HOOK(tp) { \
428 /* Add threads initialization code here.*/ \
429}
430
431/**
432 * @brief Threads finalization hook.
433 * @details User finalization code added to the @p chThdExit() API.
434 */
435#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
436 /* Add threads finalization code here.*/ \
437}
438
439/**
440 * @brief Context switch hook.
441 * @details This hook is invoked just before switching between threads.
442 */
443#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
444 /* Context switch code here.*/ \
445}
446
447/**
448 * @brief ISR enter hook.
449 */
450#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
451 /* IRQ prologue code here.*/ \
452}
453
454/**
455 * @brief ISR exit hook.
456 */
457#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
458 /* IRQ epilogue code here.*/ \
459}
460
461/**
462 * @brief Idle thread enter hook.
463 * @note This hook is invoked within a critical zone, no OS functions
464 * should be invoked from here.
465 * @note This macro can be used to activate a power saving mode.
466 */
467#define CH_CFG_IDLE_ENTER_HOOK() { \
468 /* Idle-enter code here.*/ \
469}
470
471/**
472 * @brief Idle thread leave hook.
473 * @note This hook is invoked within a critical zone, no OS functions
474 * should be invoked from here.
475 * @note This macro can be used to deactivate a power saving mode.
476 */
477#define CH_CFG_IDLE_LEAVE_HOOK() { \
478 /* Idle-leave code here.*/ \
479}
480
481/**
482 * @brief Idle Loop hook.
483 * @details This hook is continuously invoked by the idle thread loop.
484 */
485#define CH_CFG_IDLE_LOOP_HOOK() { \
486 /* Idle loop code here.*/ \
487}
488
489/**
490 * @brief System tick event hook.
491 * @details This hook is invoked in the system tick handler immediately
492 * after processing the virtual timers queue.
493 */
494#define CH_CFG_SYSTEM_TICK_HOOK() { \
495 /* System tick event code here.*/ \
496}
497
498/**
499 * @brief System halt hook.
500 * @details This hook is invoked in case to a system halting error before
501 * the system is halted.
502 */
503#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
504 /* System halt code here.*/ \
505}
506
507/**
508 * @brief Trace hook.
509 * @details This hook is invoked each time a new record is written in the
510 * trace buffer.
511 */
512#define CH_CFG_TRACE_HOOK(tep) { \
513 /* Trace code here.*/ \
514}
515
516/** @} */
517
518/*===========================================================================*/
519/* Port-specific settings (override port settings defaulted in chcore.h). */
520/*===========================================================================*/
521
522#endif /* CHCONF_H */
523
524/** @} */
diff --git a/keyboards/chibios_test/teensy_lc_onekey/config.h b/keyboards/chibios_test/teensy_lc_onekey/config.h
deleted file mode 100644
index d9eb05d2a..000000000
--- a/keyboards/chibios_test/teensy_lc_onekey/config.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef KEYBOARDS_CHIBIOS_TEST_TEENSY_LC_ONEKEY_CONFIG_H_
2#define KEYBOARDS_CHIBIOS_TEST_TEENSY_LC_ONEKEY_CONFIG_H_
3
4#include "../config.h"
5
6#endif /* KEYBOARDS_CHIBIOS_TEST_TEENSY_LC_ONEKEY_CONFIG_H_ */
diff --git a/keyboards/chibios_test/teensy_lc_onekey/halconf.h b/keyboards/chibios_test/teensy_lc_onekey/halconf.h
deleted file mode 100644
index 1b6f2adc2..000000000
--- a/keyboards/chibios_test/teensy_lc_onekey/halconf.h
+++ /dev/null
@@ -1,354 +0,0 @@
1/*
2 ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/halconf.h
19 * @brief HAL configuration header.
20 * @details HAL configuration file, this file allows to enable or disable the
21 * various device drivers from your application. You may also use
22 * this file in order to override the device drivers default settings.
23 *
24 * @addtogroup HAL_CONF
25 * @{
26 */
27
28#ifndef _HALCONF_H_
29#define _HALCONF_H_
30
31#include "mcuconf.h"
32
33/**
34 * @brief Enables the PAL subsystem.
35 */
36#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
37#define HAL_USE_PAL TRUE
38#endif
39
40/**
41 * @brief Enables the ADC subsystem.
42 */
43#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
44#define HAL_USE_ADC FALSE
45#endif
46
47/**
48 * @brief Enables the CAN subsystem.
49 */
50#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
51#define HAL_USE_CAN FALSE
52#endif
53
54/**
55 * @brief Enables the DAC subsystem.
56 */
57#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
58#define HAL_USE_DAC FALSE
59#endif
60
61/**
62 * @brief Enables the EXT subsystem.
63 */
64#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
65#define HAL_USE_EXT FALSE
66#endif
67
68/**
69 * @brief Enables the GPT subsystem.
70 */
71#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
72#define HAL_USE_GPT FALSE
73#endif
74
75/**
76 * @brief Enables the I2C subsystem.
77 */
78#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
79#define HAL_USE_I2C FALSE
80#endif
81
82/**
83 * @brief Enables the I2S subsystem.
84 */
85#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
86#define HAL_USE_I2S FALSE
87#endif
88
89/**
90 * @brief Enables the ICU subsystem.
91 */
92#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
93#define HAL_USE_ICU FALSE
94#endif
95
96/**
97 * @brief Enables the MAC subsystem.
98 */
99#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
100#define HAL_USE_MAC FALSE
101#endif
102
103/**
104 * @brief Enables the MMC_SPI subsystem.
105 */
106#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
107#define HAL_USE_MMC_SPI FALSE
108#endif
109
110/**
111 * @brief Enables the PWM subsystem.
112 */
113#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
114#define HAL_USE_PWM FALSE
115#endif
116
117/**
118 * @brief Enables the RTC subsystem.
119 */
120#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
121#define HAL_USE_RTC FALSE
122#endif
123
124/**
125 * @brief Enables the SDC subsystem.
126 */
127#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
128#define HAL_USE_SDC FALSE
129#endif
130
131/**
132 * @brief Enables the SERIAL subsystem.
133 */
134#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
135#define HAL_USE_SERIAL FALSE
136#endif
137
138/**
139 * @brief Enables the SERIAL over USB subsystem.
140 */
141#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
142#define HAL_USE_SERIAL_USB FALSE
143#endif
144
145/**
146 * @brief Enables the SPI subsystem.
147 */
148#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
149#define HAL_USE_SPI FALSE
150#endif
151
152/**
153 * @brief Enables the UART subsystem.
154 */
155#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
156#define HAL_USE_UART FALSE
157#endif
158
159/**
160 * @brief Enables the USB subsystem.
161 */
162#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
163#define HAL_USE_USB TRUE
164#endif
165
166/**
167 * @brief Enables the WDG subsystem.
168 */
169#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
170#define HAL_USE_WDG FALSE
171#endif
172
173/*===========================================================================*/
174/* ADC driver related settings. */
175/*===========================================================================*/
176
177/**
178 * @brief Enables synchronous APIs.
179 * @note Disabling this option saves both code and data space.
180 */
181#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
182#define ADC_USE_WAIT TRUE
183#endif
184
185/**
186 * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
187 * @note Disabling this option saves both code and data space.
188 */
189#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
190#define ADC_USE_MUTUAL_EXCLUSION TRUE
191#endif
192
193/*===========================================================================*/
194/* CAN driver related settings. */
195/*===========================================================================*/
196
197/**
198 * @brief Sleep mode related APIs inclusion switch.
199 */
200#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
201#define CAN_USE_SLEEP_MODE TRUE
202#endif
203
204/*===========================================================================*/
205/* I2C driver related settings. */
206/*===========================================================================*/
207
208/**
209 * @brief Enables the mutual exclusion APIs on the I2C bus.
210 */
211#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
212#define I2C_USE_MUTUAL_EXCLUSION TRUE
213#endif
214
215/*===========================================================================*/
216/* MAC driver related settings. */
217/*===========================================================================*/
218
219/**
220 * @brief Enables an event sources for incoming packets.
221 */
222#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
223#define MAC_USE_ZERO_COPY FALSE
224#endif
225
226/**
227 * @brief Enables an event sources for incoming packets.
228 */
229#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
230#define MAC_USE_EVENTS TRUE
231#endif
232
233/*===========================================================================*/
234/* MMC_SPI driver related settings. */
235/*===========================================================================*/
236
237/**
238 * @brief Delays insertions.
239 * @details If enabled this options inserts delays into the MMC waiting
240 * routines releasing some extra CPU time for the threads with
241 * lower priority, this may slow down the driver a bit however.
242 * This option is recommended also if the SPI driver does not
243 * use a DMA channel and heavily loads the CPU.
244 */
245#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
246#define MMC_NICE_WAITING TRUE
247#endif
248
249/*===========================================================================*/
250/* SDC driver related settings. */
251/*===========================================================================*/
252
253/**
254 * @brief Number of initialization attempts before rejecting the card.
255 * @note Attempts are performed at 10mS intervals.
256 */
257#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
258#define SDC_INIT_RETRY 100
259#endif
260
261/**
262 * @brief Include support for MMC cards.
263 * @note MMC support is not yet implemented so this option must be kept
264 * at @p FALSE.
265 */
266#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
267#define SDC_MMC_SUPPORT FALSE
268#endif
269
270/**
271 * @brief Delays insertions.
272 * @details If enabled this options inserts delays into the MMC waiting
273 * routines releasing some extra CPU time for the threads with
274 * lower priority, this may slow down the driver a bit however.
275 */
276#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
277#define SDC_NICE_WAITING TRUE
278#endif
279
280/*===========================================================================*/
281/* SERIAL driver related settings. */
282/*===========================================================================*/
283
284/**
285 * @brief Default bit rate.
286 * @details Configuration parameter, this is the baud rate selected for the
287 * default configuration.
288 */
289#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
290#define SERIAL_DEFAULT_BITRATE 38400
291#endif
292
293/**
294 * @brief Serial buffers size.
295 * @details Configuration parameter, you can change the depth of the queue
296 * buffers depending on the requirements of your application.
297 * @note The default is 64 bytes for both the transmission and receive
298 * buffers.
299 */
300#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
301#define SERIAL_BUFFERS_SIZE 16
302#endif
303
304/*===========================================================================*/
305/* SERIAL_USB driver related setting. */
306/*===========================================================================*/
307
308/**
309 * @brief Serial over USB buffers size.
310 * @details Configuration parameter, the buffer size must be a multiple of
311 * the USB data endpoint maximum packet size.
312 * @note The default is 64 bytes for both the transmission and receive
313 * buffers.
314 */
315#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
316#define SERIAL_USB_BUFFERS_SIZE 1
317#endif
318
319/*===========================================================================*/
320/* SPI driver related settings. */
321/*===========================================================================*/
322
323/**
324 * @brief Enables synchronous APIs.
325 * @note Disabling this option saves both code and data space.
326 */
327#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
328#define SPI_USE_WAIT TRUE
329#endif
330
331/**
332 * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
333 * @note Disabling this option saves both code and data space.
334 */
335#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
336#define SPI_USE_MUTUAL_EXCLUSION TRUE
337#endif
338
339/*===========================================================================*/
340/* USB driver related settings. */
341/*===========================================================================*/
342
343/**
344 * @brief Enables synchronous APIs.
345 * @note Disabling this option saves both code and data space.
346 */
347#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
348#define USB_USE_WAIT TRUE
349#endif
350
351#endif /* _HALCONF_H_ */
352
353/** @} */
354
diff --git a/keyboards/chibios_test/teensy_lc_onekey/instructions.md b/keyboards/chibios_test/teensy_lc_onekey/instructions.md
deleted file mode 100644
index 66f73bf14..000000000
--- a/keyboards/chibios_test/teensy_lc_onekey/instructions.md
+++ /dev/null
@@ -1,97 +0,0 @@
1# Teensy LC, 3.0, 3.1, 3.2 support
2
3These ARM Teensies are now supported through [ChibiOS](http://chibios.org).
4
5## Installing the ARM toolchain
6
7You'll need to install an ARM toolchain, there is now a nice documentation about the two AVR/ARM toolchain : https://docs.qmk.fm/getting_started_build_tools.html and you can just run `sudo util/install_dependencies.sh`.
8This toolchain is used instead of `avr-gcc`, which is only for AVR chips. Naturally you'll also need the usual development tools (e.g. `make`), just as in the AVR setting.
9
10You can find others way with the [gcc ARM embedded](https://launchpad.net/gcc-arm-embedded) website, or using your favourite package manager. After installing, you should be able to run `arm-none-eabi-gcc -v` in the command prompt and get sensible output.
11
12## Installing ChibiOS
13
14Next, you'll need ChibiOS. For Teensies, you'll need code from two repositories: [chibios-main](https://github.com/ChibiOS/ChibiOS) and [chibios-contrib](https://github.com/ChibiOS/ChibiOS).
15
16### If you’re using git
17
18Run `git submodule sync --recursive && git submodule update --init --recursive`. This will install ChibiOS and ChibiOS-Contrib in the `/lib/` directory.
19
20### If you’re not using Git
21
22If you're not using git, you can just download a [zip of chibios from here](https://github.com/ChibiOS/ChibiOS/archive/a7df9a891067621e8e1a5c2a2c0ceada82403afe.zip), unpack the zip, and rename/move the unpacked directory (named `ChibiOS-<long_hash_here>`) to `lib/chibios/chibios` (so that the file `lib/chibios/chibios/license.txt` exists). Now the same procedure with a [zip of chibios-contrib from here](https://github.com/ChibiOS/ChibiOS-Contrib/archive/e1311c4db6cd366cf760673f769e925741ac0ad3.zip): unpack and move `ChibiOS-Contrib-<long_hash_here>` to `lib/chibios/chibios-contrib`.
23
24(If you're using git, you can just clone the two repos: [chibios](https://github.com/ChibiOS/ChibiOS) and [chibios-contrib](https://github.com/ChibiOS/ChibiOS-Contrib). However - be warned that things may be somewhat out-of-sync (updates at different rates), so you may need to hunt a bit for the right commits.)
25
26(Why do we need chibios-contrib? Well, the main repo focuses on STM32 chips, and Freescale/NXP Kinetis chips are supported via the Contrib repository.)
27
28This should be it. Running `make` in `keyboard/teensy_lc_onekey` should create a working firmware in `build/`, called `ch.hex`.
29
30For more notes about the ChibiOS backend in TMK, see `tmk_core/protocol/chibios/README.md`.
31
32## About this onekey example
33
34It's set up for Teensy LC. To use 3.x, you'll need to edit the `Makefile` (and comment out one line in `mcuconf.h`). A sample makefile for Teensy 3.0 is provided as `Makefile.3.0`, can be used without renaming with `make -f Makefile.3.0`. Similarly for Teensy 3.2, there's `Makefile.3.2`.
35
36## Credits
37
38TMK itself is written by hasu, original sources [here](https://github.com/tmk/tmk_keyboard).
39
40The USB support for Kinetis MCUs is due to RedoX. His ChibiOS fork is also [on github](https://github.com/RedoXyde/ChibiOS); but it doesn't include Teensy LC definitions.
41
42## Features that are not implemented yet
43
44Currently only the more fancy suspend features are not there (power saving during suspend). The rest should work fine (reports either way are welcome).
45
46# Matrix programming notes
47
48The notes below explain what commands can be used to examine and set the status of Teensy pins.
49
50## ChibiOS pin manipulation basics
51
52### Pins
53
54Each pin sits on a "port", each of which comprises at most 32 individual pins.
55So for instance "PTC5" from Kinetis manual/datasheet refers to port C (or GPIOA), pin 5. Most functions dealing with pins take 2 parameters which specify the pin -- the first being the port, the second being the pin number.
56
57Within ChibiOS, there are definitions which simplify this a bit for the Teensies. `TEENSY_PINn_IOPORT` represents the port of the MCU's pin connected Teensy's PIN `n`, and `TEENSY_PINn` represents its MCU's pin number.
58
59### Mode
60
61A MCU pin can be in several modes. The basic command to set a pin mode is
62
63 palSetPadMode(TEENSY_PINn_IOPORT, TEENSY_PINn, PAL_MODE_INPUT_PULLUP);
64
65The last parameter is the mode. For keyboards, the usual ones that are used are `PAL_MODE_INPUT_PULLUP` (input with a pullup), `PAL_MODE_INPUT_PULLDOWN` (input with a pulldown), `PAL_MODE_INPUT` (input floating, a.k.a. Hi-Z), `PAL_MODE_OUTPUT_PUSHPULL` (output in the Arduino sense -- can be then set HIGH or LOW).
66
67### Setting
68
69Pins are set HIGH (after they've been put into `OUTPUT_PUSHPULL` mode) by
70
71 palSetPad(TEENSY_PINn_IOPORT, TEENSY_PINn);
72
73or set LOW by
74
75 palClearPad(TEENSY_PINn_IOPORT, TEENSY_PINn);
76
77Toggling can be done with
78
79 palTogglePad(TEENSY_PINn_IOPORT, TEENSY_PINn);
80
81Alternatively, you can use
82
83 palWritePad(TEENSY_PINn_IOPORT, TEENSY_PINn, bit);
84
85where `bit` is either `PAL_LOW` or `PAL_HIGH` (i.e. `0` or `1`).
86
87### Reading
88
89Reading pin status is done with
90
91 palReadPad(TEENSY_PINn_IOPORT, TEENSY_PINn);
92
93The function returns either `PAL_HIGH` (actually `1`) or `PAL_LOW` (actually `0`).
94
95### Further docs
96
97All the commands that are available for pin manipulation through ChibiOS HAL are documented in [ChibiOS PAL driver docs](http://chibios.sourceforge.net/docs3/hal/group___p_a_l.html).
diff --git a/keyboards/chibios_test/teensy_lc_onekey/led.c b/keyboards/chibios_test/teensy_lc_onekey/led.c
deleted file mode 100644
index dfa60c107..000000000
--- a/keyboards/chibios_test/teensy_lc_onekey/led.c
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#include "hal.h"
19
20#include "led.h"
21
22
23void led_set(uint8_t usb_led) {
24 if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
25 // output high
26 palSetPadMode(TEENSY_PIN13_IOPORT, TEENSY_PIN13, PAL_MODE_OUTPUT_PUSHPULL);
27 palSetPad(TEENSY_PIN13_IOPORT, TEENSY_PIN13);
28 } else {
29 // Hi-Z
30 palSetPadMode(TEENSY_PIN13_IOPORT, TEENSY_PIN13, PAL_MODE_INPUT);
31 }
32}
diff --git a/keyboards/chibios_test/teensy_lc_onekey/matrix.c b/keyboards/chibios_test/teensy_lc_onekey/matrix.c
deleted file mode 100644
index 7dab04f02..000000000
--- a/keyboards/chibios_test/teensy_lc_onekey/matrix.c
+++ /dev/null
@@ -1,163 +0,0 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#include "ch.h"
19#include "hal.h"
20
21/*
22 * scan matrix
23 */
24#include "print.h"
25#include "debug.h"
26#include "util.h"
27#include "matrix.h"
28#include "wait.h"
29
30#ifndef DEBOUNCE
31# define DEBOUNCE 5
32#endif
33static uint8_t debouncing = DEBOUNCE;
34
35/* matrix state(1:on, 0:off) */
36static matrix_row_t matrix[MATRIX_ROWS];
37static matrix_row_t matrix_debouncing[MATRIX_ROWS];
38
39static matrix_row_t read_cols(void);
40static void init_cols(void);
41static void unselect_rows(void);
42static void select_row(uint8_t row);
43
44
45inline
46uint8_t matrix_rows(void)
47{
48 return MATRIX_ROWS;
49}
50
51inline
52uint8_t matrix_cols(void)
53{
54 return MATRIX_COLS;
55}
56
57#define LED_ON() do { palSetPad(TEENSY_PIN13_IOPORT, TEENSY_PIN13) ;} while (0)
58#define LED_OFF() do { palClearPad(TEENSY_PIN13_IOPORT, TEENSY_PIN13); } while (0)
59#define LED_TGL() do { palTogglePad(TEENSY_PIN13_IOPORT, TEENSY_PIN13); } while (0)
60
61void matrix_init(void)
62{
63 // initialize row and col
64 unselect_rows();
65 init_cols();
66
67 // initialize matrix state: all keys off
68 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
69 matrix[i] = 0;
70 matrix_debouncing[i] = 0;
71 }
72
73 //debug
74 debug_matrix = true;
75 LED_ON();
76 wait_ms(500);
77 LED_OFF();
78}
79
80uint8_t matrix_scan(void)
81{
82 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
83 select_row(i);
84 wait_us(30); // without this wait read unstable value.
85 matrix_row_t cols = read_cols();
86 if (matrix_debouncing[i] != cols) {
87 matrix_debouncing[i] = cols;
88 if (debouncing) {
89 debug("bounce!: "); debug_hex(debouncing); debug("\n");
90 }
91 debouncing = DEBOUNCE;
92 }
93 unselect_rows();
94 }
95
96 if (debouncing) {
97 if (--debouncing) {
98 wait_ms(1);
99 } else {
100 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
101 matrix[i] = matrix_debouncing[i];
102 }
103 }
104 }
105
106 return 1;
107}
108
109inline
110bool matrix_is_on(uint8_t row, uint8_t col)
111{
112 return (matrix[row] & ((matrix_row_t)1<<col));
113}
114
115inline
116matrix_row_t matrix_get_row(uint8_t row)
117{
118 return matrix[row];
119}
120
121void matrix_print(void)
122{
123 print("\nr/c 0123456789ABCDEF\n");
124 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
125 phex(row); print(": ");
126 pbin_reverse16(matrix_get_row(row));
127 print("\n");
128 }
129}
130
131/* Column pin configuration
132 */
133static void init_cols(void)
134{
135 // internal pull-up
136 palSetPadMode(TEENSY_PIN2_IOPORT, TEENSY_PIN2, PAL_MODE_INPUT_PULLUP);
137}
138
139/* Returns status of switches(1:on, 0:off) */
140static matrix_row_t read_cols(void)
141{
142 return ((palReadPad(TEENSY_PIN2_IOPORT, TEENSY_PIN2)==PAL_HIGH) ? 0 : (1<<0));
143 // | ((palReadPad(...)==PAL_HIGH) ? 0 : (1<<1))
144}
145
146/* Row pin configuration
147 */
148static void unselect_rows(void)
149{
150 palSetPadMode(TEENSY_PIN5_IOPORT, TEENSY_PIN5, PAL_MODE_INPUT); // hi-Z
151}
152
153static void select_row(uint8_t row)
154{
155 (void)row;
156 // Output low to select
157 switch (row) {
158 case 0:
159 palSetPadMode(TEENSY_PIN5_IOPORT, TEENSY_PIN5, PAL_MODE_OUTPUT_PUSHPULL);
160 palClearPad(TEENSY_PIN5_IOPORT, TEENSY_PIN5);
161 break;
162 }
163}
diff --git a/keyboards/chibios_test/teensy_lc_onekey/mcuconf.h b/keyboards/chibios_test/teensy_lc_onekey/mcuconf.h
deleted file mode 100644
index 2764e8898..000000000
--- a/keyboards/chibios_test/teensy_lc_onekey/mcuconf.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#ifndef _MCUCONF_H_
18#define _MCUCONF_H_
19
20#define KL2x_MCUCONF
21
22/*
23 * HAL driver system settings.
24 */
25#if 1
26/* PEE mode - 48MHz system clock driven by (16 MHz) external crystal. */
27#define KINETIS_MCG_MODE KINETIS_MCG_MODE_PEE
28#define KINETIS_PLLCLK_FREQUENCY 96000000UL
29#define KINETIS_SYSCLK_FREQUENCY 48000000UL
30#endif
31
32#if 0
33/* crystal-less FEI mode - 48 MHz with internal 32.768 kHz crystal */
34#define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEI
35#define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */
36#define KINETIS_MCG_FLL_DRS 1 /* 1464x FLL factor */
37#define KINETIS_SYSCLK_FREQUENCY 47972352UL /* 32.768 kHz * 1464 (~48 MHz) */
38#define KINETIS_CLKDIV1_OUTDIV1 1 /* do not divide system clock */
39#endif
40
41/*
42 * SERIAL driver system settings.
43 */
44#define KINETIS_SERIAL_USE_UART0 TRUE
45
46/*
47 * USB driver settings
48 */
49#define KINETIS_USB_USE_USB0 TRUE
50/* Need to redefine this, since the default is for K20x */
51/* This is for Teensy LC; you should comment it out (or change to 5)
52 * for Teensy 3.x */
53#define KINETIS_USB_USB0_IRQ_PRIORITY 2
54
55#endif /* _MCUCONF_H_ */
diff --git a/keyboards/chibios_test/teensy_lc_onekey/readme.md b/keyboards/chibios_test/teensy_lc_onekey/readme.md
deleted file mode 100644
index 4f9911387..000000000
--- a/keyboards/chibios_test/teensy_lc_onekey/readme.md
+++ /dev/null
@@ -1,3 +0,0 @@
1# ChibiOS Test
2
3Test code for the teensy lc one key keyboard \ No newline at end of file
diff --git a/keyboards/chibios_test/teensy_lc_onekey/rules.mk b/keyboards/chibios_test/teensy_lc_onekey/rules.mk
deleted file mode 100644
index 4deee1f57..000000000
--- a/keyboards/chibios_test/teensy_lc_onekey/rules.mk
+++ /dev/null
@@ -1,45 +0,0 @@
1# project specific files
2SRC = matrix.c \
3 led.c
4
5## chip/board settings
6# - the next two should match the directories in
7# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
8# - For Teensies, FAMILY = KINETIS and SERIES is either
9# KL2x (LC) or K20x (3.0,3.1,3.2).
10MCU_FAMILY = KINETIS
11MCU_SERIES = KL2x
12
13# Linker script to use
14# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
15# or <this_dir>/ld/
16# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
17# - LDSCRIPT =
18# - MKL26Z64 for Teensy LC
19# - MK20DX128 for Teensy 3.0
20# - MK20DX256 for Teensy 3.1 and 3.2
21MCU_LDSCRIPT = MKL26Z64
22
23# Startup code to use
24# - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
25# - STARTUP =
26# - kl2x for Teensy LC
27# - k20x5 for Teensy 3.0
28# - k20x7 for Teensy 3.1 and 3.2
29MCU_STARTUP = kl2x
30
31# Board: it should exist either in <chibios>/os/hal/boards/
32# or <this_dir>/boards
33# - BOARD =
34# - PJRC_TEENSY_LC for Teensy LC
35# - PJRC_TEENSY_3 for Teensy 3.0
36# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
37BOARD = PJRC_TEENSY_LC
38
39# Cortex version
40# Teensy LC is cortex-m0plus; Teensy 3.x are cortex-m4
41MCU = cortex-m0plus
42
43# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
44# I.e. 6 for Teensy LC; 7 for Teensy 3.x
45ARMV = 6 \ No newline at end of file
diff --git a/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.c b/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.c
deleted file mode 100644
index b6c432793..000000000
--- a/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "teensy_lc_onekey.h"
diff --git a/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.h b/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.h
deleted file mode 100644
index e94c13b66..000000000
--- a/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef TEENSY_LC_ONEKEY_H
2#define TEENSY_LC_ONEKEY_H
3#include "chibios_test.h"
4
5#define LAYOUT(k00) {{ k00 }}
6
7#endif
diff --git a/keyboards/chibios_test/stm32_f072_onekey/chconf.h b/keyboards/handwired/onekey/stm32f0_disco/chconf.h
index 99fa8ce39..99fa8ce39 100644
--- a/keyboards/chibios_test/stm32_f072_onekey/chconf.h
+++ b/keyboards/handwired/onekey/stm32f0_disco/chconf.h
diff --git a/keyboards/proton_c/proton_c.h b/keyboards/handwired/onekey/stm32f0_disco/config.h
index 159f9975a..039a1beff 100644
--- a/keyboards/proton_c/proton_c.h
+++ b/keyboards/handwired/onekey/stm32f0_disco/config.h
@@ -1,4 +1,4 @@
1/* Copyright 2018 Jack Humbert 1/* Copyright 2019
2 * 2 *
3 * This program is free software: you can redistribute it and/or modify 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 4 * it under the terms of the GNU General Public License as published by
@@ -15,4 +15,9 @@
15 */ 15 */
16 16
17#pragma once 17#pragma once
18#include "quantum.h" 18
19#include "config_common.h"
20
21#define MATRIX_COL_PINS { B4 }
22#define MATRIX_ROW_PINS { B5 }
23#define UNUSED_PINS
diff --git a/keyboards/chibios_test/stm32_f072_onekey/halconf.h b/keyboards/handwired/onekey/stm32f0_disco/halconf.h
index 8b9724b1a..53b2f91e3 100644
--- a/keyboards/chibios_test/stm32_f072_onekey/halconf.h
+++ b/keyboards/handwired/onekey/stm32f0_disco/halconf.h
@@ -111,7 +111,7 @@
111 * @brief Enables the PWM subsystem. 111 * @brief Enables the PWM subsystem.
112 */ 112 */
113#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) 113#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
114#define HAL_USE_PWM FALSE 114#define HAL_USE_PWM TRUE
115#endif 115#endif
116 116
117/** 117/**
diff --git a/keyboards/chibios_test/stm32_f072_onekey/mcuconf.h b/keyboards/handwired/onekey/stm32f0_disco/mcuconf.h
index faca3defd..20c48b611 100644
--- a/keyboards/chibios_test/stm32_f072_onekey/mcuconf.h
+++ b/keyboards/handwired/onekey/stm32f0_disco/mcuconf.h
@@ -120,7 +120,7 @@
120#define STM32_PWM_USE_ADVANCED FALSE 120#define STM32_PWM_USE_ADVANCED FALSE
121#define STM32_PWM_USE_TIM1 FALSE 121#define STM32_PWM_USE_TIM1 FALSE
122#define STM32_PWM_USE_TIM2 FALSE 122#define STM32_PWM_USE_TIM2 FALSE
123#define STM32_PWM_USE_TIM3 FALSE 123#define STM32_PWM_USE_TIM3 TRUE
124#define STM32_PWM_TIM1_IRQ_PRIORITY 3 124#define STM32_PWM_TIM1_IRQ_PRIORITY 3
125#define STM32_PWM_TIM2_IRQ_PRIORITY 3 125#define STM32_PWM_TIM2_IRQ_PRIORITY 3
126#define STM32_PWM_TIM3_IRQ_PRIORITY 3 126#define STM32_PWM_TIM3_IRQ_PRIORITY 3
diff --git a/keyboards/handwired/onekey/stm32f0_disco/readme.md b/keyboards/handwired/onekey/stm32f0_disco/readme.md
new file mode 100644
index 000000000..48d999d69
--- /dev/null
+++ b/keyboards/handwired/onekey/stm32f0_disco/readme.md
@@ -0,0 +1,5 @@
1# STM32F072 Discovery kit onekey
2
3Supported Hardware: <https://www.st.com/en/evaluation-tools/32f072bdiscovery.html>
4
5To trigger keypress, short together pins *B4* and *B5*.
diff --git a/keyboards/chibios_test/stm32_f072_onekey/rules.mk b/keyboards/handwired/onekey/stm32f0_disco/rules.mk
index 91c17c024..69639f940 100644
--- a/keyboards/chibios_test/stm32_f072_onekey/rules.mk
+++ b/keyboards/handwired/onekey/stm32f0_disco/rules.mk
@@ -1,7 +1,3 @@
1# project specific files
2SRC = matrix.c \
3 led.c
4
5## chip/board settings 1## chip/board settings
6# the next two should match the directories in 2# the next two should match the directories in
7# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) 3# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
@@ -33,6 +29,6 @@ ARMV = 6
33# <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch 29# <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
34#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 30#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800
35 31
36# Build Options 32# Options to pass to dfu-util when flashing
37# comment out to disable the options. 33DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave
38# \ No newline at end of file 34DFU_SUFFIX_ARGS = -p df11 -v 0483
diff --git a/keyboards/proton_c/config.h b/keyboards/proton_c/config.h
deleted file mode 100644
index 5ebd17f99..000000000
--- a/keyboards/proton_c/config.h
+++ /dev/null
@@ -1,114 +0,0 @@
1/* Copyright 2018 Jack Humbert
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
17#pragma once
18
19#include "config_common.h"
20
21/* USB Device descriptor parameter */
22#define VENDOR_ID 0xFEED
23#define PRODUCT_ID 0x6060
24#define DEVICE_VER 0x0006
25#define MANUFACTURER QMK
26#define PRODUCT Proton C
27#define DESCRIPTION A compact ortholinear keyboard
28
29/* key matrix size */
30#define MATRIX_ROWS 1
31#define MATRIX_COLS 1
32
33#define MATRIX_ROW_PINS { B9 }
34#define MATRIX_COL_PINS { B0 }
35
36/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
37#define DEBOUNCE 6
38
39/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
40//#define LOCKING_SUPPORT_ENABLE
41/* Locking resynchronize hack */
42//#define LOCKING_RESYNC_ENABLE
43
44/*
45 * Force NKRO
46 *
47 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
48 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
49 * makefile for this to work.)
50 *
51 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
52 * until the next keyboard reset.
53 *
54 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
55 * fully operational during normal computer usage.
56 *
57 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
58 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
59 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
60 * power-up.
61 *
62 */
63//#define FORCE_NKRO
64
65/*
66 * Feature disable options
67 * These options are also useful to firmware size reduction.
68 */
69
70/* disable debug print */
71//#define NO_DEBUG
72
73/* disable print */
74//#define NO_PRINT
75
76/* disable action features */
77//#define NO_ACTION_LAYER
78//#define NO_ACTION_TAPPING
79//#define NO_ACTION_ONESHOT
80//#define NO_ACTION_MACRO
81//#define NO_ACTION_FUNCTION
82
83/*
84 * MIDI options
85 */
86
87/* Prevent use of disabled MIDI features in the keymap */
88//#define MIDI_ENABLE_STRICT 1
89
90/* enable basic MIDI features:
91 - MIDI notes can be sent when in Music mode is on
92*/
93//#define MIDI_BASIC
94
95/* enable advanced MIDI features:
96 - MIDI notes can be added to the keymap
97 - Octave shift and transpose
98 - Virtual sustain, portamento, and modulation wheel
99 - etc.
100*/
101//#define MIDI_ADVANCED
102
103/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
104//#define MIDI_TONE_KEYCODE_OCTAVES 1
105
106// #define WS2812_LED_N 2
107// #define RGBLED_NUM WS2812_LED_N
108// #define WS2812_TIM_N 2
109// #define WS2812_TIM_CH 2
110// #define PORT_WS2812 GPIOA
111// #define PIN_WS2812 1
112// #define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection)
113//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP
114//#define WS2812_EXTERNAL_PULLUP
diff --git a/keyboards/proton_c/keymaps/default/keymap.c b/keyboards/proton_c/keymaps/default/keymap.c
deleted file mode 100644
index a3103432f..000000000
--- a/keyboards/proton_c/keymaps/default/keymap.c
+++ /dev/null
@@ -1,21 +0,0 @@
1/* Copyright 2018 Jack Humbert
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
17#include QMK_KEYBOARD_H
18
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20 [0] = {{ KC_A }}
21};
diff --git a/keyboards/proton_c/proton_c.c b/keyboards/proton_c/proton_c.c
deleted file mode 100644
index 525634347..000000000
--- a/keyboards/proton_c/proton_c.c
+++ /dev/null
@@ -1,25 +0,0 @@
1/* Copyright 2018 Jack Humbert
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
17#include "proton_c.h"
18
19void matrix_init_kb(void) {
20 // Turn status LED on
21 setPinOutput(C13);
22 writePinHigh(C13);
23
24 matrix_init_user();
25}
diff --git a/keyboards/proton_c/readme.md b/keyboards/proton_c/readme.md
deleted file mode 100644
index 5f27795ae..000000000
--- a/keyboards/proton_c/readme.md
+++ /dev/null
@@ -1,16 +0,0 @@
1Proton C
2===
3
4![Proton C](https://i.imgur.com/xZrjIqa.jpg)
5
6A Pro Micro drop-in replacement.
7
8Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert)
9Hardware Supported: QMK Proton C
10Hardware Availability: [List of vendors](https://qmk.fm/proton-c)
11
12Make example for this keyboard (after setting up your build environment):
13
14 make proton_c:default
15
16See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/proton_c/rules.mk b/keyboards/proton_c/rules.mk
deleted file mode 100644
index 4edc75929..000000000
--- a/keyboards/proton_c/rules.mk
+++ /dev/null
@@ -1,17 +0,0 @@
1MCU = STM32F303
2
3# Build Options
4# comment out to disable the options.
5#
6BACKLIGHT_ENABLE = no
7BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
8## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
9MOUSEKEY_ENABLE = yes # Mouse keys
10EXTRAKEY_ENABLE = yes # Audio control and System control
11CONSOLE_ENABLE = yes # Console for debug
12COMMAND_ENABLE = yes # Commands for debug and configuration
13#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
14NKRO_ENABLE = yes # USB Nkey Rollover
15AUDIO_ENABLE = yes
16RGBLIGHT_ENABLE = no
17# SERIAL_LINK_ENABLE = yes