--- /dev/null
+/*\r
+ ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+*/\r
+\r
+#include "hal.h"\r
+\r
+/**\r
+ * @brief PAL setup.\r
+ * @details Digital I/O ports static configuration as defined in @p board.h.\r
+ * This variable is used by the HAL when initializing the PAL driver.\r
+ */\r
+#if HAL_USE_PAL || defined(__DOXYGEN__)\r
+const PALConfig pal_default_config =\r
+{\r
+ {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},\r
+ {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},\r
+ {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},\r
+ {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH},\r
+ {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH},\r
+};\r
+#endif\r
+\r
+/*\r
+ * Early initialization code.\r
+ * This initialization must be performed just after stack setup and before\r
+ * any other initialization.\r
+ */\r
+void __early_init(void) {\r
+\r
+ stm32_clock_init();\r
+}\r
+\r
+/*\r
+ * Board-specific initialization code.\r
+ */\r
+void boardInit(void) {\r
+}\r
--- /dev/null
+/*\r
+ ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+*/\r
+\r
+#ifndef _BOARD_H_\r
+#define _BOARD_H_\r
+\r
+/*\r
+ * Setup for a Generic STM32F103 board.\r
+ */\r
+\r
+/*\r
+ * Board identifier.\r
+ */\r
+#define BOARD_GENERIC_STM32_F103\r
+#define BOARD_NAME "Generic STM32F103x board"\r
+\r
+/*\r
+ * Board frequencies.\r
+ */\r
+#define STM32_LSECLK 32768\r
+#define STM32_HSECLK 8000000\r
+\r
+/*\r
+ * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.\r
+ */\r
+#define STM32F103xB\r
+\r
+/*\r
+ * IO pins assignments\r
+ */\r
+\r
+/* on-board */\r
+\r
+#define GPIOC_LED 13\r
+#define GPIOD_OSC_IN 0\r
+#define GPIOD_OSC_OUT 1\r
+\r
+/* In case your board has a "USB enable" hardware\r
+ controlled by a pin, define it here. (It could be just\r
+ a 1.5k resistor connected to D+ line.)\r
+*/\r
+/*\r
+#define GPIOB_USB_DISC 10\r
+*/\r
+\r
+/*\r
+ * I/O ports initial setup, this configuration is established soon after reset\r
+ * in the initialization code.\r
+ *\r
+ * The digits have the following meaning:\r
+ * 0 - Analog input.\r
+ * 1 - Push Pull output 10MHz.\r
+ * 2 - Push Pull output 2MHz.\r
+ * 3 - Push Pull output 50MHz.\r
+ * 4 - Digital input.\r
+ * 5 - Open Drain output 10MHz.\r
+ * 6 - Open Drain output 2MHz.\r
+ * 7 - Open Drain output 50MHz.\r
+ * 8 - Digital input with PullUp or PullDown resistor depending on ODR.\r
+ * 9 - Alternate Push Pull output 10MHz.\r
+ * A - Alternate Push Pull output 2MHz.\r
+ * B - Alternate Push Pull output 50MHz.\r
+ * C - Reserved.\r
+ * D - Alternate Open Drain output 10MHz.\r
+ * E - Alternate Open Drain output 2MHz.\r
+ * F - Alternate Open Drain output 50MHz.\r
+ * Please refer to the STM32 Reference Manual for details.\r
+ */\r
+\r
+/*\r
+ * Port A setup.\r
+ * Everything input with pull-up except:\r
+ * PA2 - Alternate output (USART2 TX).\r
+ * PA3 - Normal input (USART2 RX).\r
+ * PA9 - Alternate output (USART1 TX).\r
+ * PA10 - Normal input (USART1 RX).\r
+ */\r
+#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */\r
+#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */\r
+#define VAL_GPIOAODR 0xFFFFFFFF\r
+\r
+/*\r
+ * Port B setup.\r
+ * Everything input with pull-up except:\r
+ * PB10 - Push Pull output (USB switch).\r
+ */\r
+#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */\r
+#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */\r
+#define VAL_GPIOBODR 0xFFFFFFFF\r
+\r
+/*\r
+ * Port C setup.\r
+ * Everything input with pull-up except:\r
+ * PC13 - Push Pull output (LED).\r
+ */\r
+#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */\r
+#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */\r
+#define VAL_GPIOCODR 0xFFFFFFFF\r
+\r
+/*\r
+ * Port D setup.\r
+ * Everything input with pull-up except:\r
+ * PD0 - Normal input (XTAL).\r
+ * PD1 - Normal input (XTAL).\r
+ */\r
+#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */\r
+#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */\r
+#define VAL_GPIODODR 0xFFFFFFFF\r
+\r
+/*\r
+ * Port E setup.\r
+ * Everything input with pull-up except:\r
+ */\r
+#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */\r
+#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */\r
+#define VAL_GPIOEODR 0xFFFFFFFF\r
+\r
+/*\r
+ * USB bus activation macro, required by the USB driver.\r
+ */\r
+/* The point is that most of the generic STM32F103* boards\r
+ have a 1.5k resistor connected on one end to the D+ line\r
+ and on the other end to some pin. Or even a slightly more\r
+ complicated "USB enable" circuit, controlled by a pin.\r
+ That should go here.\r
+\r
+ However on some boards (e.g. one that I have), there's no\r
+ such hardware. In which case it's better to not do anything.\r
+*/\r
+/*\r
+#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC)\r
+*/\r
+#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT);\r
+\r
+/*\r
+ * USB bus de-activation macro, required by the USB driver.\r
+ */\r
+/*\r
+#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC)\r
+*/\r
+#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12);\r
+\r
+#if !defined(_FROM_ASM_)\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+ void boardInit(void);\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+#endif /* _FROM_ASM_ */\r
+\r
+#endif /* _BOARD_H_ */\r
--- /dev/null
+# List of all the board related files.\r
+BOARDSRC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103/board.c\r
+\r
+# Required include directories\r
+BOARDINC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103\r
--- /dev/null
+/*\r
+ * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com\r
+ * (C) 2016 flabbergast <s3+flabbergast@sdfeu.org>\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining\r
+ * a copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+ * SOFTWARE.\r
+ */\r
+\r
+/*\r
+ * KL26Z64 memory setup.\r
+ */\r
+MEMORY\r
+{\r
+ flash0 : org = 0x00000000, len = 0x100\r
+ flash1 : org = 0x00000400, len = 0x10\r
+ flash2 : org = 0x00000410, len = 62k - 0x410\r
+ flash3 : org = 0x0000F800, len = 2k\r
+ flash4 : org = 0x00000000, len = 0\r
+ flash5 : org = 0x00000000, len = 0\r
+ flash6 : org = 0x00000000, len = 0\r
+ flash7 : org = 0x00000000, len = 0\r
+ ram0 : org = 0x1FFFF800, len = 8k\r
+ ram1 : org = 0x00000000, len = 0\r
+ ram2 : org = 0x00000000, len = 0\r
+ ram3 : org = 0x00000000, len = 0\r
+ ram4 : org = 0x00000000, len = 0\r
+ ram5 : org = 0x00000000, len = 0\r
+ ram6 : org = 0x00000000, len = 0\r
+ ram7 : org = 0x00000000, len = 0\r
+}\r
+\r
+/* Flash region for the configuration bytes.*/\r
+SECTIONS\r
+{\r
+ .cfmprotect : ALIGN(4) SUBALIGN(4)\r
+ {\r
+ KEEP(*(.cfmconfig))\r
+ } > flash1\r
+}\r
+\r
+/* For each data/text section two region are defined, a virtual region\r
+ and a load region (_LMA suffix).*/\r
+\r
+/* Flash region to be used for exception vectors.*/\r
+REGION_ALIAS("VECTORS_FLASH", flash0);\r
+REGION_ALIAS("VECTORS_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for constructors and destructors.*/\r
+REGION_ALIAS("XTORS_FLASH", flash2);\r
+REGION_ALIAS("XTORS_FLASH_LMA", flash2);\r
+\r
+/* Flash region to be used for code text.*/\r
+REGION_ALIAS("TEXT_FLASH", flash2);\r
+REGION_ALIAS("TEXT_FLASH_LMA", flash2);\r
+\r
+/* Flash region to be used for read only data.*/\r
+REGION_ALIAS("RODATA_FLASH", flash2);\r
+REGION_ALIAS("RODATA_FLASH_LMA", flash2);\r
+\r
+/* Flash region to be used for various.*/\r
+REGION_ALIAS("VARIOUS_FLASH", flash2);\r
+REGION_ALIAS("VARIOUS_FLASH_LMA", flash2);\r
+\r
+/* Flash region to be used for RAM(n) initialization data.*/\r
+REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2);\r
+\r
+/* RAM region to be used for Main stack. This stack accommodates the processing\r
+ of all exceptions and interrupts.*/\r
+REGION_ALIAS("MAIN_STACK_RAM", ram0);\r
+\r
+/* RAM region to be used for the process stack. This is the stack used by\r
+ the main() function.*/\r
+REGION_ALIAS("PROCESS_STACK_RAM", ram0);\r
+\r
+/* RAM region to be used for data segment.*/\r
+REGION_ALIAS("DATA_RAM", ram0);\r
+REGION_ALIAS("DATA_RAM_LMA", flash2);\r
+\r
+/* RAM region to be used for BSS segment.*/\r
+REGION_ALIAS("BSS_RAM", ram0);\r
+\r
+/* RAM region to be used for the default heap.*/\r
+REGION_ALIAS("HEAP_RAM", ram0);\r
+\r
+__eeprom_workarea_start__ = ORIGIN(flash3);\r
+__eeprom_workarea_size__ = LENGTH(flash3);\r
+__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__;\r
+\r
+/* Generic rules inclusion.*/\r
+INCLUDE rules.ld\r
--- /dev/null
+/*\r
+ ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+*/\r
+\r
+/*\r
+ * ST32F103xB memory setup for use with the maplemini bootloader.\r
+ * You will have to\r
+ * #define CORTEX_VTOR_INIT 0x5000\r
+ * in your projects chconf.h\r
+ */\r
+MEMORY\r
+{\r
+ flash0 : org = 0x08002000, len = 128k - 0x2000\r
+ flash1 : org = 0x00000000, len = 0\r
+ flash2 : org = 0x00000000, len = 0\r
+ flash3 : org = 0x00000000, len = 0\r
+ flash4 : org = 0x00000000, len = 0\r
+ flash5 : org = 0x00000000, len = 0\r
+ flash6 : org = 0x00000000, len = 0\r
+ flash7 : org = 0x00000000, len = 0\r
+ ram0 : org = 0x20000000, len = 20k\r
+ ram1 : org = 0x00000000, len = 0\r
+ ram2 : org = 0x00000000, len = 0\r
+ ram3 : org = 0x00000000, len = 0\r
+ ram4 : org = 0x00000000, len = 0\r
+ ram5 : org = 0x00000000, len = 0\r
+ ram6 : org = 0x00000000, len = 0\r
+ ram7 : org = 0x00000000, len = 0\r
+}\r
+\r
+/* For each data/text section two region are defined, a virtual region\r
+ and a load region (_LMA suffix).*/\r
+\r
+/* Flash region to be used for exception vectors.*/\r
+REGION_ALIAS("VECTORS_FLASH", flash0);\r
+REGION_ALIAS("VECTORS_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for constructors and destructors.*/\r
+REGION_ALIAS("XTORS_FLASH", flash0);\r
+REGION_ALIAS("XTORS_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for code text.*/\r
+REGION_ALIAS("TEXT_FLASH", flash0);\r
+REGION_ALIAS("TEXT_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for read only data.*/\r
+REGION_ALIAS("RODATA_FLASH", flash0);\r
+REGION_ALIAS("RODATA_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for various.*/\r
+REGION_ALIAS("VARIOUS_FLASH", flash0);\r
+REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for RAM(n) initialization data.*/\r
+REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);\r
+\r
+/* RAM region to be used for Main stack. This stack accommodates the processing\r
+ of all exceptions and interrupts.*/\r
+REGION_ALIAS("MAIN_STACK_RAM", ram0);\r
+\r
+/* RAM region to be used for the process stack. This is the stack used by\r
+ the main() function.*/\r
+REGION_ALIAS("PROCESS_STACK_RAM", ram0);\r
+\r
+/* RAM region to be used for data segment.*/\r
+REGION_ALIAS("DATA_RAM", ram0);\r
+REGION_ALIAS("DATA_RAM_LMA", flash0);\r
+\r
+/* RAM region to be used for BSS segment.*/\r
+REGION_ALIAS("BSS_RAM", ram0);\r
+\r
+/* RAM region to be used for the default heap.*/\r
+REGION_ALIAS("HEAP_RAM", ram0);\r
+\r
+/* Generic rules inclusion.*/\r
+INCLUDE rules.ld\r
+++ /dev/null
-/*\r
- ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-*/\r
-\r
-#include "hal.h"\r
-\r
-/**\r
- * @brief PAL setup.\r
- * @details Digital I/O ports static configuration as defined in @p board.h.\r
- * This variable is used by the HAL when initializing the PAL driver.\r
- */\r
-#if HAL_USE_PAL || defined(__DOXYGEN__)\r
-const PALConfig pal_default_config =\r
-{\r
- {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},\r
- {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},\r
- {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},\r
- {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH},\r
- {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH},\r
-};\r
-#endif\r
-\r
-/*\r
- * Early initialization code.\r
- * This initialization must be performed just after stack setup and before\r
- * any other initialization.\r
- */\r
-void __early_init(void) {\r
-\r
- stm32_clock_init();\r
-}\r
-\r
-/*\r
- * Board-specific initialization code.\r
- */\r
-void boardInit(void) {\r
-}\r
+++ /dev/null
-/*\r
- ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-*/\r
-\r
-#ifndef _BOARD_H_\r
-#define _BOARD_H_\r
-\r
-/*\r
- * Setup for a Generic STM32F103 board.\r
- */\r
-\r
-/*\r
- * Board identifier.\r
- */\r
-#define BOARD_GENERIC_STM32_F103\r
-#define BOARD_NAME "Generic STM32F103x board"\r
-\r
-/*\r
- * Board frequencies.\r
- */\r
-#define STM32_LSECLK 32768\r
-#define STM32_HSECLK 8000000\r
-\r
-/*\r
- * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.\r
- */\r
-#define STM32F103xB\r
-\r
-/*\r
- * IO pins assignments\r
- */\r
-\r
-/* on-board */\r
-\r
-#define GPIOC_LED 13\r
-#define GPIOD_OSC_IN 0\r
-#define GPIOD_OSC_OUT 1\r
-\r
-/* In case your board has a "USB enable" hardware\r
- controlled by a pin, define it here. (It could be just\r
- a 1.5k resistor connected to D+ line.)\r
-*/\r
-/*\r
-#define GPIOB_USB_DISC 10\r
-*/\r
-\r
-/*\r
- * I/O ports initial setup, this configuration is established soon after reset\r
- * in the initialization code.\r
- *\r
- * The digits have the following meaning:\r
- * 0 - Analog input.\r
- * 1 - Push Pull output 10MHz.\r
- * 2 - Push Pull output 2MHz.\r
- * 3 - Push Pull output 50MHz.\r
- * 4 - Digital input.\r
- * 5 - Open Drain output 10MHz.\r
- * 6 - Open Drain output 2MHz.\r
- * 7 - Open Drain output 50MHz.\r
- * 8 - Digital input with PullUp or PullDown resistor depending on ODR.\r
- * 9 - Alternate Push Pull output 10MHz.\r
- * A - Alternate Push Pull output 2MHz.\r
- * B - Alternate Push Pull output 50MHz.\r
- * C - Reserved.\r
- * D - Alternate Open Drain output 10MHz.\r
- * E - Alternate Open Drain output 2MHz.\r
- * F - Alternate Open Drain output 50MHz.\r
- * Please refer to the STM32 Reference Manual for details.\r
- */\r
-\r
-/*\r
- * Port A setup.\r
- * Everything input with pull-up except:\r
- * PA2 - Alternate output (USART2 TX).\r
- * PA3 - Normal input (USART2 RX).\r
- * PA9 - Alternate output (USART1 TX).\r
- * PA10 - Normal input (USART1 RX).\r
- */\r
-#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */\r
-#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */\r
-#define VAL_GPIOAODR 0xFFFFFFFF\r
-\r
-/*\r
- * Port B setup.\r
- * Everything input with pull-up except:\r
- * PB10 - Push Pull output (USB switch).\r
- */\r
-#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */\r
-#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */\r
-#define VAL_GPIOBODR 0xFFFFFFFF\r
-\r
-/*\r
- * Port C setup.\r
- * Everything input with pull-up except:\r
- * PC13 - Push Pull output (LED).\r
- */\r
-#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */\r
-#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */\r
-#define VAL_GPIOCODR 0xFFFFFFFF\r
-\r
-/*\r
- * Port D setup.\r
- * Everything input with pull-up except:\r
- * PD0 - Normal input (XTAL).\r
- * PD1 - Normal input (XTAL).\r
- */\r
-#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */\r
-#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */\r
-#define VAL_GPIODODR 0xFFFFFFFF\r
-\r
-/*\r
- * Port E setup.\r
- * Everything input with pull-up except:\r
- */\r
-#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */\r
-#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */\r
-#define VAL_GPIOEODR 0xFFFFFFFF\r
-\r
-/*\r
- * USB bus activation macro, required by the USB driver.\r
- */\r
-/* The point is that most of the generic STM32F103* boards\r
- have a 1.5k resistor connected on one end to the D+ line\r
- and on the other end to some pin. Or even a slightly more\r
- complicated "USB enable" circuit, controlled by a pin.\r
- That should go here.\r
-\r
- However on some boards (e.g. one that I have), there's no\r
- such hardware. In which case it's better to not do anything.\r
-*/\r
-/*\r
-#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC)\r
-*/\r
-#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT);\r
-\r
-/*\r
- * USB bus de-activation macro, required by the USB driver.\r
- */\r
-/*\r
-#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC)\r
-*/\r
-#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12);\r
-\r
-#if !defined(_FROM_ASM_)\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
- void boardInit(void);\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-#endif /* _FROM_ASM_ */\r
-\r
-#endif /* _BOARD_H_ */\r
+++ /dev/null
-# List of all the board related files.\r
-BOARDSRC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103/board.c\r
-\r
-# Required include directories\r
-BOARDINC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103\r
+++ /dev/null
-/*\r
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-*/\r
-\r
-/*\r
- * ST32F103xB memory setup for use with the maplemini bootloader.\r
- * You will have to\r
- * #define CORTEX_VTOR_INIT 0x5000\r
- * in your projects chconf.h\r
- */\r
-MEMORY\r
-{\r
- flash0 : org = 0x08002000, len = 128k - 0x2000\r
- flash1 : org = 0x00000000, len = 0\r
- flash2 : org = 0x00000000, len = 0\r
- flash3 : org = 0x00000000, len = 0\r
- flash4 : org = 0x00000000, len = 0\r
- flash5 : org = 0x00000000, len = 0\r
- flash6 : org = 0x00000000, len = 0\r
- flash7 : org = 0x00000000, len = 0\r
- ram0 : org = 0x20000000, len = 20k\r
- ram1 : org = 0x00000000, len = 0\r
- ram2 : org = 0x00000000, len = 0\r
- ram3 : org = 0x00000000, len = 0\r
- ram4 : org = 0x00000000, len = 0\r
- ram5 : org = 0x00000000, len = 0\r
- ram6 : org = 0x00000000, len = 0\r
- ram7 : org = 0x00000000, len = 0\r
-}\r
-\r
-/* For each data/text section two region are defined, a virtual region\r
- and a load region (_LMA suffix).*/\r
-\r
-/* Flash region to be used for exception vectors.*/\r
-REGION_ALIAS("VECTORS_FLASH", flash0);\r
-REGION_ALIAS("VECTORS_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for constructors and destructors.*/\r
-REGION_ALIAS("XTORS_FLASH", flash0);\r
-REGION_ALIAS("XTORS_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for code text.*/\r
-REGION_ALIAS("TEXT_FLASH", flash0);\r
-REGION_ALIAS("TEXT_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for read only data.*/\r
-REGION_ALIAS("RODATA_FLASH", flash0);\r
-REGION_ALIAS("RODATA_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for various.*/\r
-REGION_ALIAS("VARIOUS_FLASH", flash0);\r
-REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for RAM(n) initialization data.*/\r
-REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);\r
-\r
-/* RAM region to be used for Main stack. This stack accommodates the processing\r
- of all exceptions and interrupts.*/\r
-REGION_ALIAS("MAIN_STACK_RAM", ram0);\r
-\r
-/* RAM region to be used for the process stack. This is the stack used by\r
- the main() function.*/\r
-REGION_ALIAS("PROCESS_STACK_RAM", ram0);\r
-\r
-/* RAM region to be used for data segment.*/\r
-REGION_ALIAS("DATA_RAM", ram0);\r
-REGION_ALIAS("DATA_RAM_LMA", flash0);\r
-\r
-/* RAM region to be used for BSS segment.*/\r
-REGION_ALIAS("BSS_RAM", ram0);\r
-\r
-/* RAM region to be used for the default heap.*/\r
-REGION_ALIAS("HEAP_RAM", ram0);\r
-\r
-/* Generic rules inclusion.*/\r
-INCLUDE rules.ld\r
+++ /dev/null
-/*\r
- * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com\r
- * (C) 2016 flabbergast <s3+flabbergast@sdfeu.org>\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining\r
- * a copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included in\r
- * all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
- * SOFTWARE.\r
- */\r
-\r
-/*\r
- * KL26Z64 memory setup.\r
- */\r
-MEMORY\r
-{\r
- flash0 : org = 0x00000000, len = 0x100\r
- flash1 : org = 0x00000400, len = 0x10\r
- flash2 : org = 0x00000410, len = 62k - 0x410\r
- flash3 : org = 0x0000F800, len = 2k\r
- flash4 : org = 0x00000000, len = 0\r
- flash5 : org = 0x00000000, len = 0\r
- flash6 : org = 0x00000000, len = 0\r
- flash7 : org = 0x00000000, len = 0\r
- ram0 : org = 0x1FFFF800, len = 8k\r
- ram1 : org = 0x00000000, len = 0\r
- ram2 : org = 0x00000000, len = 0\r
- ram3 : org = 0x00000000, len = 0\r
- ram4 : org = 0x00000000, len = 0\r
- ram5 : org = 0x00000000, len = 0\r
- ram6 : org = 0x00000000, len = 0\r
- ram7 : org = 0x00000000, len = 0\r
-}\r
-\r
-/* Flash region for the configuration bytes.*/\r
-SECTIONS\r
-{\r
- .cfmprotect : ALIGN(4) SUBALIGN(4)\r
- {\r
- KEEP(*(.cfmconfig))\r
- } > flash1\r
-}\r
-\r
-/* For each data/text section two region are defined, a virtual region\r
- and a load region (_LMA suffix).*/\r
-\r
-/* Flash region to be used for exception vectors.*/\r
-REGION_ALIAS("VECTORS_FLASH", flash0);\r
-REGION_ALIAS("VECTORS_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for constructors and destructors.*/\r
-REGION_ALIAS("XTORS_FLASH", flash2);\r
-REGION_ALIAS("XTORS_FLASH_LMA", flash2);\r
-\r
-/* Flash region to be used for code text.*/\r
-REGION_ALIAS("TEXT_FLASH", flash2);\r
-REGION_ALIAS("TEXT_FLASH_LMA", flash2);\r
-\r
-/* Flash region to be used for read only data.*/\r
-REGION_ALIAS("RODATA_FLASH", flash2);\r
-REGION_ALIAS("RODATA_FLASH_LMA", flash2);\r
-\r
-/* Flash region to be used for various.*/\r
-REGION_ALIAS("VARIOUS_FLASH", flash2);\r
-REGION_ALIAS("VARIOUS_FLASH_LMA", flash2);\r
-\r
-/* Flash region to be used for RAM(n) initialization data.*/\r
-REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2);\r
-\r
-/* RAM region to be used for Main stack. This stack accommodates the processing\r
- of all exceptions and interrupts.*/\r
-REGION_ALIAS("MAIN_STACK_RAM", ram0);\r
-\r
-/* RAM region to be used for the process stack. This is the stack used by\r
- the main() function.*/\r
-REGION_ALIAS("PROCESS_STACK_RAM", ram0);\r
-\r
-/* RAM region to be used for data segment.*/\r
-REGION_ALIAS("DATA_RAM", ram0);\r
-REGION_ALIAS("DATA_RAM_LMA", flash2);\r
-\r
-/* RAM region to be used for BSS segment.*/\r
-REGION_ALIAS("BSS_RAM", ram0);\r
-\r
-/* RAM region to be used for the default heap.*/\r
-REGION_ALIAS("HEAP_RAM", ram0);\r
-\r
-__eeprom_workarea_start__ = ORIGIN(flash3);\r
-__eeprom_workarea_size__ = LENGTH(flash3);\r
-__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__;\r
-\r
-/* Generic rules inclusion.*/\r
-INCLUDE rules.ld\r