diff options
| author | Mike Tsao <mike@sowbug.com> | 2021-02-09 20:45:42 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-09 20:45:42 -0800 |
| commit | 872f656c3b3d94067315029c3996a1f268ff9cd3 (patch) | |
| tree | 55421755883f6c5adb26523e7ca4d8320b174b5c /keyboards/sowbug | |
| parent | fb9f619d8950812a6c5b5c6826891fcefb8eb677 (diff) | |
| download | qmk_firmware-872f656c3b3d94067315029c3996a1f268ff9cd3.tar.gz qmk_firmware-872f656c3b3d94067315029c3996a1f268ff9cd3.zip | |
[Keyboard] Add sowbug/68keys and sowbug/ansi_tkl (#11589)
Diffstat (limited to 'keyboards/sowbug')
22 files changed, 3591 insertions, 0 deletions
diff --git a/keyboards/sowbug/68keys/68keys.c b/keyboards/sowbug/68keys/68keys.c new file mode 100644 index 000000000..d26a6bab5 --- /dev/null +++ b/keyboards/sowbug/68keys/68keys.c | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | /* Copyright 2021 Mike Tsao | ||
| 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 | // 68keys.c | ||
| 18 | |||
| 19 | #include "68keys.h" | ||
| 20 | |||
| 21 | #ifdef RGB_MATRIX_ENABLE | ||
| 22 | led_config_t g_led_config = { { | ||
| 23 | // Key Matrix to LED Index | ||
| 24 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, | ||
| 25 | { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }, | ||
| 26 | { 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, NO_LED, NO_LED, NO_LED }, | ||
| 27 | { 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, NO_LED, NO_LED, NO_LED }, | ||
| 28 | { 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED } | ||
| 29 | }, { | ||
| 30 | // LED Index to Physical Position | ||
| 31 | {0, 0}, {12, 0}, {25, 0}, {38, 0}, {51, 0}, {64, 0}, {77, 0}, {90, 0}, {103, 0}, {116, 0}, {129, 0}, {142, 0}, {155, 0}, {175, 0}, {198, 0}, {211, 0}, {3, 12}, {19, 12}, {32, 12}, {45, 12}, {58, 12}, {71, 12}, {84, 12}, {97, 12}, {110, 12}, {123, 12}, {136, 12}, {149, 12}, {162, 12}, {178, 12}, {198, 12}, {211, 12}, {4, 25}, {22, 25}, {35, 25}, {48, 25}, {61, 25}, {74, 25}, {87, 25}, {100, 25}, {113, 25}, {126, 25}, {139, 25}, {152, 25}, {173, 25}, {8, 38}, {29, 38}, {42, 38}, {55, 38}, {68, 38}, {81, 38}, {94, 38}, {107, 38}, {120, 38}, {133, 38}, {146, 38}, {170, 38}, {198, 38}, {1, 51}, {17, 51}, {34, 51}, {82, 51}, {131, 51}, {147, 51}, {163, 51}, {185, 51}, {198, 51}, {211, 51} | ||
| 32 | }, { | ||
| 33 | // LED Index to Flag | ||
| 34 | LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT | ||
| 35 | } | ||
| 36 | }; | ||
| 37 | |||
| 38 | void suspend_power_down_kb(void) | ||
| 39 | { | ||
| 40 | rgb_matrix_set_suspend_state(true); | ||
| 41 | } | ||
| 42 | |||
| 43 | void suspend_wakeup_init_kb(void) | ||
| 44 | { | ||
| 45 | rgb_matrix_set_suspend_state(false); | ||
| 46 | } | ||
| 47 | #endif // #ifdef RGB_MATRIX_ENABLE | ||
diff --git a/keyboards/sowbug/68keys/68keys.h b/keyboards/sowbug/68keys/68keys.h new file mode 100644 index 000000000..6f455154f --- /dev/null +++ b/keyboards/sowbug/68keys/68keys.h | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | /* Copyright 2021 Mike Tsao | ||
| 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 | // 68keys.h | ||
| 18 | |||
| 19 | #pragma once | ||
| 20 | |||
| 21 | #include "quantum.h" | ||
| 22 | |||
| 23 | #define LAYOUT_default( A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13, B14, B15, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, E0, E1, E2, E3, E4, E5, E6, E7, E8, E9) \ | ||
| 24 | { \ | ||
| 25 | { A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15 }, \ | ||
| 26 | { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13, B14, B15 }, \ | ||
| 27 | { C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, KC_NO, KC_NO, KC_NO }, \ | ||
| 28 | { D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, KC_NO, KC_NO, KC_NO }, \ | ||
| 29 | { E0, E1, E2, E3, E4, E5, E6, E7, E8, E9, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ | ||
| 30 | } | ||
| 31 | |||
| 32 | #define LAYOUT LAYOUT_default | ||
diff --git a/keyboards/sowbug/68keys/bootloader_defs.h b/keyboards/sowbug/68keys/bootloader_defs.h new file mode 100644 index 000000000..6b8fa9f72 --- /dev/null +++ b/keyboards/sowbug/68keys/bootloader_defs.h | |||
| @@ -0,0 +1,10 @@ | |||
| 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 0x80000000 | ||
diff --git a/keyboards/sowbug/68keys/chconf.h b/keyboards/sowbug/68keys/chconf.h new file mode 100644 index 000000000..f5e471640 --- /dev/null +++ b/keyboards/sowbug/68keys/chconf.h | |||
| @@ -0,0 +1,714 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2018 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 rt/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 | #define _CHIBIOS_RT_CONF_VER_6_0_ | ||
| 33 | |||
| 34 | /*===========================================================================*/ | ||
| 35 | /** | ||
| 36 | * @name System timers settings | ||
| 37 | * @{ | ||
| 38 | */ | ||
| 39 | /*===========================================================================*/ | ||
| 40 | |||
| 41 | /** | ||
| 42 | * @brief System time counter resolution. | ||
| 43 | * @note Allowed values are 16 or 32 bits. | ||
| 44 | */ | ||
| 45 | #if !defined(CH_CFG_ST_RESOLUTION) | ||
| 46 | #define CH_CFG_ST_RESOLUTION 32 | ||
| 47 | #endif | ||
| 48 | |||
| 49 | /** | ||
| 50 | * @brief System tick frequency. | ||
| 51 | * @details Frequency of the system timer that drives the system ticks. This | ||
| 52 | * setting also defines the system tick time unit. | ||
| 53 | */ | ||
| 54 | #if !defined(CH_CFG_ST_FREQUENCY) | ||
| 55 | #define CH_CFG_ST_FREQUENCY 100000 | ||
| 56 | #endif | ||
| 57 | |||
| 58 | /** | ||
| 59 | * @brief Time intervals data size. | ||
| 60 | * @note Allowed values are 16, 32 or 64 bits. | ||
| 61 | */ | ||
| 62 | #if !defined(CH_CFG_INTERVALS_SIZE) | ||
| 63 | #define CH_CFG_INTERVALS_SIZE 32 | ||
| 64 | #endif | ||
| 65 | |||
| 66 | /** | ||
| 67 | * @brief Time types data size. | ||
| 68 | * @note Allowed values are 16 or 32 bits. | ||
| 69 | */ | ||
| 70 | #if !defined(CH_CFG_TIME_TYPES_SIZE) | ||
| 71 | #define CH_CFG_TIME_TYPES_SIZE 32 | ||
| 72 | #endif | ||
| 73 | |||
| 74 | /** | ||
| 75 | * @brief Time delta constant for the tick-less mode. | ||
| 76 | * @note If this value is zero then the system uses the classic | ||
| 77 | * periodic tick. This value represents the minimum number | ||
| 78 | * of ticks that is safe to specify in a timeout directive. | ||
| 79 | * The value one is not valid, timeouts are rounded up to | ||
| 80 | * this value. | ||
| 81 | */ | ||
| 82 | #if !defined(CH_CFG_ST_TIMEDELTA) | ||
| 83 | #define CH_CFG_ST_TIMEDELTA 0 | ||
| 84 | #endif | ||
| 85 | |||
| 86 | /** @} */ | ||
| 87 | |||
| 88 | /*===========================================================================*/ | ||
| 89 | /** | ||
| 90 | * @name Kernel parameters and options | ||
| 91 | * @{ | ||
| 92 | */ | ||
| 93 | /*===========================================================================*/ | ||
| 94 | |||
| 95 | /** | ||
| 96 | * @brief Round robin interval. | ||
| 97 | * @details This constant is the number of system ticks allowed for the | ||
| 98 | * threads before preemption occurs. Setting this value to zero | ||
| 99 | * disables the preemption for threads with equal priority and the | ||
| 100 | * round robin becomes cooperative. Note that higher priority | ||
| 101 | * threads can still preempt, the kernel is always preemptive. | ||
| 102 | * @note Disabling the round robin preemption makes the kernel more compact | ||
| 103 | * and generally faster. | ||
| 104 | * @note The round robin preemption is not supported in tickless mode and | ||
| 105 | * must be set to zero in that case. | ||
| 106 | */ | ||
| 107 | #if !defined(CH_CFG_TIME_QUANTUM) | ||
| 108 | #define CH_CFG_TIME_QUANTUM 0 | ||
| 109 | #endif | ||
| 110 | |||
| 111 | /** | ||
| 112 | * @brief Managed RAM size. | ||
| 113 | * @details Size of the RAM area to be managed by the OS. If set to zero | ||
| 114 | * then the whole available RAM is used. The core memory is made | ||
| 115 | * available to the heap allocator and/or can be used directly through | ||
| 116 | * the simplified core memory allocator. | ||
| 117 | * | ||
| 118 | * @note In order to let the OS manage the whole RAM the linker script must | ||
| 119 | * provide the @p __heap_base__ and @p __heap_end__ symbols. | ||
| 120 | * @note Requires @p CH_CFG_USE_MEMCORE. | ||
| 121 | */ | ||
| 122 | #if !defined(CH_CFG_MEMCORE_SIZE) | ||
| 123 | #define CH_CFG_MEMCORE_SIZE 0 | ||
| 124 | #endif | ||
| 125 | |||
| 126 | /** | ||
| 127 | * @brief Idle thread automatic spawn suppression. | ||
| 128 | * @details When this option is activated the function @p chSysInit() | ||
| 129 | * does not spawn the idle thread. The application @p main() | ||
| 130 | * function becomes the idle thread and must implement an | ||
| 131 | * infinite loop. | ||
| 132 | */ | ||
| 133 | #if !defined(CH_CFG_NO_IDLE_THREAD) | ||
| 134 | #define CH_CFG_NO_IDLE_THREAD FALSE | ||
| 135 | #endif | ||
| 136 | |||
| 137 | /** @} */ | ||
| 138 | |||
| 139 | /*===========================================================================*/ | ||
| 140 | /** | ||
| 141 | * @name Performance options | ||
| 142 | * @{ | ||
| 143 | */ | ||
| 144 | /*===========================================================================*/ | ||
| 145 | |||
| 146 | /** | ||
| 147 | * @brief OS optimization. | ||
| 148 | * @details If enabled then time efficient rather than space efficient code | ||
| 149 | * is used when two possible implementations exist. | ||
| 150 | * | ||
| 151 | * @note This is not related to the compiler optimization options. | ||
| 152 | * @note The default is @p TRUE. | ||
| 153 | */ | ||
| 154 | #if !defined(CH_CFG_OPTIMIZE_SPEED) | ||
| 155 | #define CH_CFG_OPTIMIZE_SPEED TRUE | ||
| 156 | #endif | ||
| 157 | |||
| 158 | /** @} */ | ||
| 159 | |||
| 160 | /*===========================================================================*/ | ||
| 161 | /** | ||
| 162 | * @name Subsystem options | ||
| 163 | * @{ | ||
| 164 | */ | ||
| 165 | /*===========================================================================*/ | ||
| 166 | |||
| 167 | /** | ||
| 168 | * @brief Time Measurement APIs. | ||
| 169 | * @details If enabled then the time measurement APIs are included in | ||
| 170 | * the kernel. | ||
| 171 | * | ||
| 172 | * @note The default is @p TRUE. | ||
| 173 | */ | ||
| 174 | #if !defined(CH_CFG_USE_TM) | ||
| 175 | #define CH_CFG_USE_TM FALSE | ||
| 176 | #endif | ||
| 177 | |||
| 178 | /** | ||
| 179 | * @brief Threads registry APIs. | ||
| 180 | * @details If enabled then the registry APIs are included in the kernel. | ||
| 181 | * | ||
| 182 | * @note The default is @p TRUE. | ||
| 183 | */ | ||
| 184 | #if !defined(CH_CFG_USE_REGISTRY) | ||
| 185 | #define CH_CFG_USE_REGISTRY TRUE | ||
| 186 | #endif | ||
| 187 | |||
| 188 | /** | ||
| 189 | * @brief Threads synchronization APIs. | ||
| 190 | * @details If enabled then the @p chThdWait() function is included in | ||
| 191 | * the kernel. | ||
| 192 | * | ||
| 193 | * @note The default is @p TRUE. | ||
| 194 | */ | ||
| 195 | #if !defined(CH_CFG_USE_WAITEXIT) | ||
| 196 | #define CH_CFG_USE_WAITEXIT TRUE | ||
| 197 | #endif | ||
| 198 | |||
| 199 | /** | ||
| 200 | * @brief Semaphores APIs. | ||
| 201 | * @details If enabled then the Semaphores APIs are included in the kernel. | ||
| 202 | * | ||
| 203 | * @note The default is @p TRUE. | ||
| 204 | */ | ||
| 205 | #if !defined(CH_CFG_USE_SEMAPHORES) | ||
| 206 | #define CH_CFG_USE_SEMAPHORES TRUE | ||
| 207 | #endif | ||
| 208 | |||
| 209 | /** | ||
| 210 | * @brief Semaphores queuing mode. | ||
| 211 | * @details If enabled then the threads are enqueued on semaphores by | ||
| 212 | * priority rather than in FIFO order. | ||
| 213 | * | ||
| 214 | * @note The default is @p FALSE. Enable this if you have special | ||
| 215 | * requirements. | ||
| 216 | * @note Requires @p CH_CFG_USE_SEMAPHORES. | ||
| 217 | */ | ||
| 218 | #if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY) | ||
| 219 | #define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE | ||
| 220 | #endif | ||
| 221 | |||
| 222 | /** | ||
| 223 | * @brief Mutexes APIs. | ||
| 224 | * @details If enabled then the mutexes APIs are included in the kernel. | ||
| 225 | * | ||
| 226 | * @note The default is @p TRUE. | ||
| 227 | */ | ||
| 228 | #if !defined(CH_CFG_USE_MUTEXES) | ||
| 229 | #define CH_CFG_USE_MUTEXES TRUE | ||
| 230 | #endif | ||
| 231 | |||
| 232 | /** | ||
| 233 | * @brief Enables recursive behavior on mutexes. | ||
| 234 | * @note Recursive mutexes are heavier and have an increased | ||
| 235 | * memory footprint. | ||
| 236 | * | ||
| 237 | * @note The default is @p FALSE. | ||
| 238 | * @note Requires @p CH_CFG_USE_MUTEXES. | ||
| 239 | */ | ||
| 240 | #if !defined(CH_CFG_USE_MUTEXES_RECURSIVE) | ||
| 241 | #define CH_CFG_USE_MUTEXES_RECURSIVE FALSE | ||
| 242 | #endif | ||
| 243 | |||
| 244 | /** | ||
| 245 | * @brief Conditional Variables APIs. | ||
| 246 | * @details If enabled then the conditional variables APIs are included | ||
| 247 | * in the kernel. | ||
| 248 | * | ||
| 249 | * @note The default is @p TRUE. | ||
| 250 | * @note Requires @p CH_CFG_USE_MUTEXES. | ||
| 251 | */ | ||
| 252 | #if !defined(CH_CFG_USE_CONDVARS) | ||
| 253 | #define CH_CFG_USE_CONDVARS TRUE | ||
| 254 | #endif | ||
| 255 | |||
| 256 | /** | ||
| 257 | * @brief Conditional Variables APIs with timeout. | ||
| 258 | * @details If enabled then the conditional variables APIs with timeout | ||
| 259 | * specification are included in the kernel. | ||
| 260 | * | ||
| 261 | * @note The default is @p TRUE. | ||
| 262 | * @note Requires @p CH_CFG_USE_CONDVARS. | ||
| 263 | */ | ||
| 264 | #if !defined(CH_CFG_USE_CONDVARS_TIMEOUT) | ||
| 265 | #define CH_CFG_USE_CONDVARS_TIMEOUT FALSE | ||
| 266 | #endif | ||
| 267 | |||
| 268 | /** | ||
| 269 | * @brief Events Flags APIs. | ||
| 270 | * @details If enabled then the event flags APIs are included in the kernel. | ||
| 271 | * | ||
| 272 | * @note The default is @p TRUE. | ||
| 273 | */ | ||
| 274 | #if !defined(CH_CFG_USE_EVENTS) | ||
| 275 | #define CH_CFG_USE_EVENTS TRUE | ||
| 276 | #endif | ||
| 277 | |||
| 278 | /** | ||
| 279 | * @brief Events Flags APIs with timeout. | ||
| 280 | * @details If enabled then the events APIs with timeout specification | ||
| 281 | * are included in the kernel. | ||
| 282 | * | ||
| 283 | * @note The default is @p TRUE. | ||
| 284 | * @note Requires @p CH_CFG_USE_EVENTS. | ||
| 285 | */ | ||
| 286 | #if !defined(CH_CFG_USE_EVENTS_TIMEOUT) | ||
| 287 | #define CH_CFG_USE_EVENTS_TIMEOUT TRUE | ||
| 288 | #endif | ||
| 289 | |||
| 290 | /** | ||
| 291 | * @brief Synchronous Messages APIs. | ||
| 292 | * @details If enabled then the synchronous messages APIs are included | ||
| 293 | * in the kernel. | ||
| 294 | * | ||
| 295 | * @note The default is @p TRUE. | ||
| 296 | */ | ||
| 297 | #if !defined(CH_CFG_USE_MESSAGES) | ||
| 298 | #define CH_CFG_USE_MESSAGES TRUE | ||
| 299 | #endif | ||
| 300 | |||
| 301 | /** | ||
| 302 | * @brief Synchronous Messages queuing mode. | ||
| 303 | * @details If enabled then messages are served by priority rather than in | ||
| 304 | * FIFO order. | ||
| 305 | * | ||
| 306 | * @note The default is @p FALSE. Enable this if you have special | ||
| 307 | * requirements. | ||
| 308 | * @note Requires @p CH_CFG_USE_MESSAGES. | ||
| 309 | */ | ||
| 310 | #if !defined(CH_CFG_USE_MESSAGES_PRIORITY) | ||
| 311 | #define CH_CFG_USE_MESSAGES_PRIORITY FALSE | ||
| 312 | #endif | ||
| 313 | |||
| 314 | /** | ||
| 315 | * @brief Mailboxes APIs. | ||
| 316 | * @details If enabled then the asynchronous messages (mailboxes) APIs are | ||
| 317 | * included in the kernel. | ||
| 318 | * | ||
| 319 | * @note The default is @p TRUE. | ||
| 320 | * @note Requires @p CH_CFG_USE_SEMAPHORES. | ||
| 321 | */ | ||
| 322 | #if !defined(CH_CFG_USE_MAILBOXES) | ||
| 323 | #define CH_CFG_USE_MAILBOXES TRUE | ||
| 324 | #endif | ||
| 325 | |||
| 326 | /** | ||
| 327 | * @brief Core Memory Manager APIs. | ||
| 328 | * @details If enabled then the core memory manager APIs are included | ||
| 329 | * in the kernel. | ||
| 330 | * | ||
| 331 | * @note The default is @p TRUE. | ||
| 332 | */ | ||
| 333 | #if !defined(CH_CFG_USE_MEMCORE) | ||
| 334 | #define CH_CFG_USE_MEMCORE TRUE | ||
| 335 | #endif | ||
| 336 | |||
| 337 | /** | ||
| 338 | * @brief Heap Allocator APIs. | ||
| 339 | * @details If enabled then the memory heap allocator APIs are included | ||
| 340 | * in the kernel. | ||
| 341 | * | ||
| 342 | * @note The default is @p TRUE. | ||
| 343 | * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or | ||
| 344 | * @p CH_CFG_USE_SEMAPHORES. | ||
| 345 | * @note Mutexes are recommended. | ||
| 346 | */ | ||
| 347 | #if !defined(CH_CFG_USE_HEAP) | ||
| 348 | #define CH_CFG_USE_HEAP TRUE | ||
| 349 | #endif | ||
| 350 | |||
| 351 | /** | ||
| 352 | * @brief Memory Pools Allocator APIs. | ||
| 353 | * @details If enabled then the memory pools allocator APIs are included | ||
| 354 | * in the kernel. | ||
| 355 | * | ||
| 356 | * @note The default is @p TRUE. | ||
| 357 | */ | ||
| 358 | #if !defined(CH_CFG_USE_MEMPOOLS) | ||
| 359 | #define CH_CFG_USE_MEMPOOLS FALSE | ||
| 360 | #endif | ||
| 361 | |||
| 362 | /** | ||
| 363 | * @brief Objects FIFOs APIs. | ||
| 364 | * @details If enabled then the objects FIFOs APIs are included | ||
| 365 | * in the kernel. | ||
| 366 | * | ||
| 367 | * @note The default is @p TRUE. | ||
| 368 | */ | ||
| 369 | #if !defined(CH_CFG_USE_OBJ_FIFOS) | ||
| 370 | #define CH_CFG_USE_OBJ_FIFOS FALSE | ||
| 371 | #endif | ||
| 372 | |||
| 373 | /** | ||
| 374 | * @brief Pipes APIs. | ||
| 375 | * @details If enabled then the pipes APIs are included | ||
| 376 | * in the kernel. | ||
| 377 | * | ||
| 378 | * @note The default is @p TRUE. | ||
| 379 | */ | ||
| 380 | #if !defined(CH_CFG_USE_PIPES) | ||
| 381 | #define CH_CFG_USE_PIPES FALSE | ||
| 382 | #endif | ||
| 383 | |||
| 384 | /** | ||
| 385 | * @brief Dynamic Threads APIs. | ||
| 386 | * @details If enabled then the dynamic threads creation APIs are included | ||
| 387 | * in the kernel. | ||
| 388 | * | ||
| 389 | * @note The default is @p TRUE. | ||
| 390 | * @note Requires @p CH_CFG_USE_WAITEXIT. | ||
| 391 | * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. | ||
| 392 | */ | ||
| 393 | #if !defined(CH_CFG_USE_DYNAMIC) | ||
| 394 | #define CH_CFG_USE_DYNAMIC FALSE | ||
| 395 | #endif | ||
| 396 | |||
| 397 | /** @} */ | ||
| 398 | |||
| 399 | /*===========================================================================*/ | ||
| 400 | /** | ||
| 401 | * @name Objects factory options | ||
| 402 | * @{ | ||
| 403 | */ | ||
| 404 | /*===========================================================================*/ | ||
| 405 | |||
| 406 | /** | ||
| 407 | * @brief Objects Factory APIs. | ||
| 408 | * @details If enabled then the objects factory APIs are included in the | ||
| 409 | * kernel. | ||
| 410 | * | ||
| 411 | * @note The default is @p FALSE. | ||
| 412 | */ | ||
| 413 | #if !defined(CH_CFG_USE_FACTORY) | ||
| 414 | #define CH_CFG_USE_FACTORY FALSE | ||
| 415 | #endif | ||
| 416 | |||
| 417 | /** | ||
| 418 | * @brief Maximum length for object names. | ||
| 419 | * @details If the specified length is zero then the name is stored by | ||
| 420 | * pointer but this could have unintended side effects. | ||
| 421 | */ | ||
| 422 | #if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH) | ||
| 423 | #define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8 | ||
| 424 | #endif | ||
| 425 | |||
| 426 | /** | ||
| 427 | * @brief Enables the registry of generic objects. | ||
| 428 | */ | ||
| 429 | #if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY) | ||
| 430 | #define CH_CFG_FACTORY_OBJECTS_REGISTRY FALSE | ||
| 431 | #endif | ||
| 432 | |||
| 433 | /** | ||
| 434 | * @brief Enables factory for generic buffers. | ||
| 435 | */ | ||
| 436 | #if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS) | ||
| 437 | #define CH_CFG_FACTORY_GENERIC_BUFFERS FALSE | ||
| 438 | #endif | ||
| 439 | |||
| 440 | /** | ||
| 441 | * @brief Enables factory for semaphores. | ||
| 442 | */ | ||
| 443 | #if !defined(CH_CFG_FACTORY_SEMAPHORES) | ||
| 444 | #define CH_CFG_FACTORY_SEMAPHORES FALSE | ||
| 445 | #endif | ||
| 446 | |||
| 447 | /** | ||
| 448 | * @brief Enables factory for mailboxes. | ||
| 449 | */ | ||
| 450 | #if !defined(CH_CFG_FACTORY_MAILBOXES) | ||
| 451 | #define CH_CFG_FACTORY_MAILBOXES FALSE | ||
| 452 | #endif | ||
| 453 | |||
| 454 | /** | ||
| 455 | * @brief Enables factory for objects FIFOs. | ||
| 456 | */ | ||
| 457 | #if !defined(CH_CFG_FACTORY_OBJ_FIFOS) | ||
| 458 | #define CH_CFG_FACTORY_OBJ_FIFOS FALSE | ||
| 459 | #endif | ||
| 460 | |||
| 461 | /** | ||
| 462 | * @brief Enables factory for Pipes. | ||
| 463 | */ | ||
| 464 | #if !defined(CH_CFG_FACTORY_PIPES) || defined(__DOXYGEN__) | ||
| 465 | #define CH_CFG_FACTORY_PIPES FALSE | ||
| 466 | #endif | ||
| 467 | |||
| 468 | /** @} */ | ||
| 469 | |||
| 470 | /*===========================================================================*/ | ||
| 471 | /** | ||
| 472 | * @name Debug options | ||
| 473 | * @{ | ||
| 474 | */ | ||
| 475 | /*===========================================================================*/ | ||
| 476 | |||
| 477 | /** | ||
| 478 | * @brief Debug option, kernel statistics. | ||
| 479 | * | ||
| 480 | * @note The default is @p FALSE. | ||
| 481 | */ | ||
| 482 | #if !defined(CH_DBG_STATISTICS) | ||
| 483 | #define CH_DBG_STATISTICS FALSE | ||
| 484 | #endif | ||
| 485 | |||
| 486 | /** | ||
| 487 | * @brief Debug option, system state check. | ||
| 488 | * @details If enabled the correct call protocol for system APIs is checked | ||
| 489 | * at runtime. | ||
| 490 | * | ||
| 491 | * @note The default is @p FALSE. | ||
| 492 | */ | ||
| 493 | #if !defined(CH_DBG_SYSTEM_STATE_CHECK) | ||
| 494 | #define CH_DBG_SYSTEM_STATE_CHECK FALSE | ||
| 495 | #endif | ||
| 496 | |||
| 497 | /** | ||
| 498 | * @brief Debug option, parameters checks. | ||
| 499 | * @details If enabled then the checks on the API functions input | ||
| 500 | * parameters are activated. | ||
| 501 | * | ||
| 502 | * @note The default is @p FALSE. | ||
| 503 | */ | ||
| 504 | #if !defined(CH_DBG_ENABLE_CHECKS) | ||
| 505 | #define CH_DBG_ENABLE_CHECKS FALSE | ||
| 506 | #endif | ||
| 507 | |||
| 508 | /** | ||
| 509 | * @brief Debug option, consistency checks. | ||
| 510 | * @details If enabled then all the assertions in the kernel code are | ||
| 511 | * activated. This includes consistency checks inside the kernel, | ||
| 512 | * runtime anomalies and port-defined checks. | ||
| 513 | * | ||
| 514 | * @note The default is @p FALSE. | ||
| 515 | */ | ||
| 516 | #if !defined(CH_DBG_ENABLE_ASSERTS) | ||
| 517 | #define CH_DBG_ENABLE_ASSERTS FALSE | ||
| 518 | #endif | ||
| 519 | |||
| 520 | /** | ||
| 521 | * @brief Debug option, trace buffer. | ||
| 522 | * @details If enabled then the trace buffer is activated. | ||
| 523 | * | ||
| 524 | * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. | ||
| 525 | */ | ||
| 526 | #if !defined(CH_DBG_TRACE_MASK) | ||
| 527 | #define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED | ||
| 528 | #endif | ||
| 529 | |||
| 530 | /** | ||
| 531 | * @brief Trace buffer entries. | ||
| 532 | * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is | ||
| 533 | * different from @p CH_DBG_TRACE_MASK_DISABLED. | ||
| 534 | */ | ||
| 535 | #if !defined(CH_DBG_TRACE_BUFFER_SIZE) | ||
| 536 | #define CH_DBG_TRACE_BUFFER_SIZE 128 | ||
| 537 | #endif | ||
| 538 | |||
| 539 | /** | ||
| 540 | * @brief Debug option, stack checks. | ||
| 541 | * @details If enabled then a runtime stack check is performed. | ||
| 542 | * | ||
| 543 | * @note The default is @p FALSE. | ||
| 544 | * @note The stack check is performed in a architecture/port dependent way. | ||
| 545 | * It may not be implemented or some ports. | ||
| 546 | * @note The default failure mode is to halt the system with the global | ||
| 547 | * @p panic_msg variable set to @p NULL. | ||
| 548 | */ | ||
| 549 | #if !defined(CH_DBG_ENABLE_STACK_CHECK) | ||
| 550 | #define CH_DBG_ENABLE_STACK_CHECK FALSE | ||
| 551 | #endif | ||
| 552 | |||
| 553 | /** | ||
| 554 | * @brief Debug option, stacks initialization. | ||
| 555 | * @details If enabled then the threads working area is filled with a byte | ||
| 556 | * value when a thread is created. This can be useful for the | ||
| 557 | * runtime measurement of the used stack. | ||
| 558 | * | ||
| 559 | * @note The default is @p FALSE. | ||
| 560 | */ | ||
| 561 | #if !defined(CH_DBG_FILL_THREADS) | ||
| 562 | #define CH_DBG_FILL_THREADS FALSE | ||
| 563 | #endif | ||
| 564 | |||
| 565 | /** | ||
| 566 | * @brief Debug option, threads profiling. | ||
| 567 | * @details If enabled then a field is added to the @p thread_t structure that | ||
| 568 | * counts the system ticks occurred while executing the thread. | ||
| 569 | * | ||
| 570 | * @note The default is @p FALSE. | ||
| 571 | * @note This debug option is not currently compatible with the | ||
| 572 | * tickless mode. | ||
| 573 | */ | ||
| 574 | #if !defined(CH_DBG_THREADS_PROFILING) | ||
| 575 | #define CH_DBG_THREADS_PROFILING FALSE | ||
| 576 | #endif | ||
| 577 | |||
| 578 | /** @} */ | ||
| 579 | |||
| 580 | /*===========================================================================*/ | ||
| 581 | /** | ||
| 582 | * @name Kernel hooks | ||
| 583 | * @{ | ||
| 584 | */ | ||
| 585 | /*===========================================================================*/ | ||
| 586 | |||
| 587 | /** | ||
| 588 | * @brief System structure extension. | ||
| 589 | * @details User fields added to the end of the @p ch_system_t structure. | ||
| 590 | */ | ||
| 591 | #define CH_CFG_SYSTEM_EXTRA_FIELDS \ | ||
| 592 | /* Add threads custom fields here.*/ | ||
| 593 | |||
| 594 | /** | ||
| 595 | * @brief System initialization hook. | ||
| 596 | * @details User initialization code added to the @p chSysInit() function | ||
| 597 | * just before interrupts are enabled globally. | ||
| 598 | */ | ||
| 599 | #define CH_CFG_SYSTEM_INIT_HOOK() { \ | ||
| 600 | /* Add threads initialization code here.*/ \ | ||
| 601 | } | ||
| 602 | |||
| 603 | /** | ||
| 604 | * @brief Threads descriptor structure extension. | ||
| 605 | * @details User fields added to the end of the @p thread_t structure. | ||
| 606 | */ | ||
| 607 | #define CH_CFG_THREAD_EXTRA_FIELDS \ | ||
| 608 | /* Add threads custom fields here.*/ | ||
| 609 | |||
| 610 | /** | ||
| 611 | * @brief Threads initialization hook. | ||
| 612 | * @details User initialization code added to the @p _thread_init() function. | ||
| 613 | * | ||
| 614 | * @note It is invoked from within @p _thread_init() and implicitly from all | ||
| 615 | * the threads creation APIs. | ||
| 616 | */ | ||
| 617 | #define CH_CFG_THREAD_INIT_HOOK(tp) { \ | ||
| 618 | /* Add threads initialization code here.*/ \ | ||
| 619 | } | ||
| 620 | |||
| 621 | /** | ||
| 622 | * @brief Threads finalization hook. | ||
| 623 | * @details User finalization code added to the @p chThdExit() API. | ||
| 624 | */ | ||
| 625 | #define CH_CFG_THREAD_EXIT_HOOK(tp) { \ | ||
| 626 | /* Add threads finalization code here.*/ \ | ||
| 627 | } | ||
| 628 | |||
| 629 | /** | ||
| 630 | * @brief Context switch hook. | ||
| 631 | * @details This hook is invoked just before switching between threads. | ||
| 632 | */ | ||
| 633 | #define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ | ||
| 634 | /* Context switch code here.*/ \ | ||
| 635 | } | ||
| 636 | |||
| 637 | /** | ||
| 638 | * @brief ISR enter hook. | ||
| 639 | */ | ||
| 640 | #define CH_CFG_IRQ_PROLOGUE_HOOK() { \ | ||
| 641 | /* IRQ prologue code here.*/ \ | ||
| 642 | } | ||
| 643 | |||
| 644 | /** | ||
| 645 | * @brief ISR exit hook. | ||
| 646 | */ | ||
| 647 | #define CH_CFG_IRQ_EPILOGUE_HOOK() { \ | ||
| 648 | /* IRQ epilogue code here.*/ \ | ||
| 649 | } | ||
| 650 | |||
| 651 | /** | ||
| 652 | * @brief Idle thread enter hook. | ||
| 653 | * @note This hook is invoked within a critical zone, no OS functions | ||
| 654 | * should be invoked from here. | ||
| 655 | * @note This macro can be used to activate a power saving mode. | ||
| 656 | */ | ||
| 657 | #define CH_CFG_IDLE_ENTER_HOOK() { \ | ||
| 658 | /* Idle-enter code here.*/ \ | ||
| 659 | } | ||
| 660 | |||
| 661 | /** | ||
| 662 | * @brief Idle thread leave hook. | ||
| 663 | * @note This hook is invoked within a critical zone, no OS functions | ||
| 664 | * should be invoked from here. | ||
| 665 | * @note This macro can be used to deactivate a power saving mode. | ||
| 666 | */ | ||
| 667 | #define CH_CFG_IDLE_LEAVE_HOOK() { \ | ||
| 668 | /* Idle-leave code here.*/ \ | ||
| 669 | } | ||
| 670 | |||
| 671 | /** | ||
| 672 | * @brief Idle Loop hook. | ||
| 673 | * @details This hook is continuously invoked by the idle thread loop. | ||
| 674 | */ | ||
| 675 | #define CH_CFG_IDLE_LOOP_HOOK() { \ | ||
| 676 | /* Idle loop code here.*/ \ | ||
| 677 | } | ||
| 678 | |||
| 679 | /** | ||
| 680 | * @brief System tick event hook. | ||
| 681 | * @details This hook is invoked in the system tick handler immediately | ||
| 682 | * after processing the virtual timers queue. | ||
| 683 | */ | ||
| 684 | #define CH_CFG_SYSTEM_TICK_HOOK() { \ | ||
| 685 | /* System tick event code here.*/ \ | ||
| 686 | } | ||
| 687 | |||
| 688 | /** | ||
| 689 | * @brief System halt hook. | ||
| 690 | * @details This hook is invoked in case to a system halting error before | ||
| 691 | * the system is halted. | ||
| 692 | */ | ||
| 693 | #define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ | ||
| 694 | /* System halt code here.*/ \ | ||
| 695 | } | ||
| 696 | |||
| 697 | /** | ||
| 698 | * @brief Trace hook. | ||
| 699 | * @details This hook is invoked each time a new record is written in the | ||
| 700 | * trace buffer. | ||
| 701 | */ | ||
| 702 | #define CH_CFG_TRACE_HOOK(tep) { \ | ||
| 703 | /* Trace code here.*/ \ | ||
| 704 | } | ||
| 705 | |||
| 706 | /** @} */ | ||
| 707 | |||
| 708 | /*===========================================================================*/ | ||
| 709 | /* Port-specific settings (override port settings defaulted in chcore.h). */ | ||
| 710 | /*===========================================================================*/ | ||
| 711 | |||
| 712 | #endif /* CHCONF_H */ | ||
| 713 | |||
| 714 | /** @} */ | ||
diff --git a/keyboards/sowbug/68keys/config.h b/keyboards/sowbug/68keys/config.h new file mode 100644 index 000000000..92d839728 --- /dev/null +++ b/keyboards/sowbug/68keys/config.h | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | /* Copyright 2021 Mike Tsao | ||
| 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 | // config.h | ||
| 18 | |||
| 19 | #pragma once | ||
| 20 | |||
| 21 | #include "config_common.h" | ||
| 22 | |||
| 23 | // USB Device descriptor parameter | ||
| 24 | #define VENDOR_ID 0xFEED | ||
| 25 | #define PRODUCT_ID 0x8888 | ||
| 26 | #define DEVICE_VER 0x0001 | ||
| 27 | #define MANUFACTURER github.com/sowbug | ||
| 28 | #define PRODUCT 68-key keyboard | ||
| 29 | #define DESCRIPTION A 68-key keyboard based on 68keys.io | ||
| 30 | |||
| 31 | // key matrix size | ||
| 32 | #define MATRIX_ROWS 5 | ||
| 33 | #define MATRIX_COLS 16 | ||
| 34 | |||
| 35 | // key matrix pins | ||
| 36 | #define MATRIX_ROW_PINS { C14, C15, A0, A1, A2 } | ||
| 37 | #define MATRIX_COL_PINS { A3, A4, A5, A6, A7, B0, B1, B10, B11, B12, B13, B14, B15, A8, A9, A10 } | ||
| 38 | #define UNUSED_PINS | ||
| 39 | |||
| 40 | // COL2ROW or ROW2COL | ||
| 41 | #define DIODE_DIRECTION COL2ROW | ||
| 42 | |||
| 43 | #define RGB_DI_PIN B9 | ||
| 44 | |||
| 45 | // Want backlighting and RGB Matrix patterns? See the note in the readme, | ||
| 46 | // apply the patches, and then uncomment the line below as well as the ones | ||
| 47 | // in rules.mk. | ||
| 48 | // | ||
| 49 | // #define BACKLIGHT_PIN rgb_matrix | ||
| 50 | #define RGB_MATRIX_KEYPRESSES | ||
| 51 | #define DRIVER_LED_TOTAL 68 | ||
| 52 | #define RGBLED_NUM DRIVER_LED_TOTAL | ||
| 53 | #define RGB_MATRIX_FRAMEBUFFER_EFFECTS | ||
| 54 | #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 128 | ||
diff --git a/keyboards/sowbug/68keys/halconf.h b/keyboards/sowbug/68keys/halconf.h new file mode 100644 index 000000000..921803762 --- /dev/null +++ b/keyboards/sowbug/68keys/halconf.h | |||
| @@ -0,0 +1,525 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2018 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 | #define _CHIBIOS_HAL_CONF_ | ||
| 32 | #define _CHIBIOS_HAL_CONF_VER_7_0_ | ||
| 33 | |||
| 34 | #include "mcuconf.h" | ||
| 35 | |||
| 36 | /** | ||
| 37 | * @brief Enables the PAL subsystem. | ||
| 38 | */ | ||
| 39 | #if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) | ||
| 40 | #define HAL_USE_PAL TRUE | ||
| 41 | #endif | ||
| 42 | |||
| 43 | /** | ||
| 44 | * @brief Enables the ADC subsystem. | ||
| 45 | */ | ||
| 46 | #if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) | ||
| 47 | #define HAL_USE_ADC FALSE | ||
| 48 | #endif | ||
| 49 | |||
| 50 | /** | ||
| 51 | * @brief Enables the CAN subsystem. | ||
| 52 | */ | ||
| 53 | #if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) | ||
| 54 | #define HAL_USE_CAN FALSE | ||
| 55 | #endif | ||
| 56 | |||
| 57 | /** | ||
| 58 | * @brief Enables the cryptographic subsystem. | ||
| 59 | */ | ||
| 60 | #if !defined(HAL_USE_CRY) || defined(__DOXYGEN__) | ||
| 61 | #define HAL_USE_CRY FALSE | ||
| 62 | #endif | ||
| 63 | |||
| 64 | /** | ||
| 65 | * @brief Enables the DAC subsystem. | ||
| 66 | */ | ||
| 67 | #if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) | ||
| 68 | #define HAL_USE_DAC FALSE | ||
| 69 | #endif | ||
| 70 | |||
| 71 | /** | ||
| 72 | * @brief Enables the GPT subsystem. | ||
| 73 | */ | ||
| 74 | #if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) | ||
| 75 | #define HAL_USE_GPT FALSE | ||
| 76 | #endif | ||
| 77 | |||
| 78 | /** | ||
| 79 | * @brief Enables the I2C subsystem. | ||
| 80 | */ | ||
| 81 | #if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) | ||
| 82 | #define HAL_USE_I2C FALSE | ||
| 83 | #endif | ||
| 84 | |||
| 85 | /** | ||
| 86 | * @brief Enables the I2S subsystem. | ||
| 87 | */ | ||
| 88 | #if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) | ||
| 89 | #define HAL_USE_I2S FALSE | ||
| 90 | #endif | ||
| 91 | |||
| 92 | /** | ||
| 93 | * @brief Enables the ICU subsystem. | ||
| 94 | */ | ||
| 95 | #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) | ||
| 96 | #define HAL_USE_ICU FALSE | ||
| 97 | #endif | ||
| 98 | |||
| 99 | /** | ||
| 100 | * @brief Enables the MAC subsystem. | ||
| 101 | */ | ||
| 102 | #if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) | ||
| 103 | #define HAL_USE_MAC FALSE | ||
| 104 | #endif | ||
| 105 | |||
| 106 | /** | ||
| 107 | * @brief Enables the MMC_SPI subsystem. | ||
| 108 | */ | ||
| 109 | #if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) | ||
| 110 | #define HAL_USE_MMC_SPI FALSE | ||
| 111 | #endif | ||
| 112 | |||
| 113 | /** | ||
| 114 | * @brief Enables the PWM subsystem. | ||
| 115 | */ | ||
| 116 | #if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) | ||
| 117 | #define HAL_USE_PWM TRUE | ||
| 118 | #endif | ||
| 119 | |||
| 120 | /** | ||
| 121 | * @brief Enables the RTC subsystem. | ||
| 122 | */ | ||
| 123 | #if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) | ||
| 124 | #define HAL_USE_RTC FALSE | ||
| 125 | #endif | ||
| 126 | |||
| 127 | /** | ||
| 128 | * @brief Enables the SDC subsystem. | ||
| 129 | */ | ||
| 130 | #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) | ||
| 131 | #define HAL_USE_SDC FALSE | ||
| 132 | #endif | ||
| 133 | |||
| 134 | /** | ||
| 135 | * @brief Enables the SERIAL subsystem. | ||
| 136 | */ | ||
| 137 | #if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) | ||
| 138 | #define HAL_USE_SERIAL FALSE | ||
| 139 | #endif | ||
| 140 | |||
| 141 | /** | ||
| 142 | * @brief Enables the SERIAL over USB subsystem. | ||
| 143 | */ | ||
| 144 | #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) | ||
| 145 | #define HAL_USE_SERIAL_USB FALSE | ||
| 146 | #endif | ||
| 147 | |||
| 148 | /** | ||
| 149 | * @brief Enables the SIO subsystem. | ||
| 150 | */ | ||
| 151 | #if !defined(HAL_USE_SIO) || defined(__DOXYGEN__) | ||
| 152 | #define HAL_USE_SIO FALSE | ||
| 153 | #endif | ||
| 154 | |||
| 155 | /** | ||
| 156 | * @brief Enables the SPI subsystem. | ||
| 157 | */ | ||
| 158 | #if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) | ||
| 159 | #define HAL_USE_SPI TRUE | ||
| 160 | #endif | ||
| 161 | |||
| 162 | /** | ||
| 163 | * @brief Enables the TRNG subsystem. | ||
| 164 | */ | ||
| 165 | #if !defined(HAL_USE_TRNG) || defined(__DOXYGEN__) | ||
| 166 | #define HAL_USE_TRNG FALSE | ||
| 167 | #endif | ||
| 168 | |||
| 169 | /** | ||
| 170 | * @brief Enables the UART subsystem. | ||
| 171 | */ | ||
| 172 | #if !defined(HAL_USE_UART) || defined(__DOXYGEN__) | ||
| 173 | #define HAL_USE_UART FALSE | ||
| 174 | #endif | ||
| 175 | |||
| 176 | /** | ||
| 177 | * @brief Enables the USB subsystem. | ||
| 178 | */ | ||
| 179 | #if !defined(HAL_USE_USB) || defined(__DOXYGEN__) | ||
| 180 | #define HAL_USE_USB TRUE | ||
| 181 | #endif | ||
| 182 | |||
| 183 | /** | ||
| 184 | * @brief Enables the WDG subsystem. | ||
| 185 | */ | ||
| 186 | #if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) | ||
| 187 | #define HAL_USE_WDG FALSE | ||
| 188 | #endif | ||
| 189 | |||
| 190 | /** | ||
| 191 | * @brief Enables the WSPI subsystem. | ||
| 192 | */ | ||
| 193 | #if !defined(HAL_USE_WSPI) || defined(__DOXYGEN__) | ||
| 194 | #define HAL_USE_WSPI FALSE | ||
| 195 | #endif | ||
| 196 | |||
| 197 | /*===========================================================================*/ | ||
| 198 | /* PAL driver related settings. */ | ||
| 199 | /*===========================================================================*/ | ||
| 200 | |||
| 201 | /** | ||
| 202 | * @brief Enables synchronous APIs. | ||
| 203 | * @note Disabling this option saves both code and data space. | ||
| 204 | */ | ||
| 205 | #if !defined(PAL_USE_CALLBACKS) || defined(__DOXYGEN__) | ||
| 206 | #define PAL_USE_CALLBACKS FALSE | ||
| 207 | #endif | ||
| 208 | |||
| 209 | /** | ||
| 210 | * @brief Enables synchronous APIs. | ||
| 211 | * @note Disabling this option saves both code and data space. | ||
| 212 | */ | ||
| 213 | #if !defined(PAL_USE_WAIT) || defined(__DOXYGEN__) | ||
| 214 | #define PAL_USE_WAIT FALSE | ||
| 215 | #endif | ||
| 216 | |||
| 217 | /*===========================================================================*/ | ||
| 218 | /* ADC driver related settings. */ | ||
| 219 | /*===========================================================================*/ | ||
| 220 | |||
| 221 | /** | ||
| 222 | * @brief Enables synchronous APIs. | ||
| 223 | * @note Disabling this option saves both code and data space. | ||
| 224 | */ | ||
| 225 | #if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) | ||
| 226 | #define ADC_USE_WAIT TRUE | ||
| 227 | #endif | ||
| 228 | |||
| 229 | /** | ||
| 230 | * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. | ||
| 231 | * @note Disabling this option saves both code and data space. | ||
| 232 | */ | ||
| 233 | #if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
| 234 | #define ADC_USE_MUTUAL_EXCLUSION TRUE | ||
| 235 | #endif | ||
| 236 | |||
| 237 | /*===========================================================================*/ | ||
| 238 | /* CAN driver related settings. */ | ||
| 239 | /*===========================================================================*/ | ||
| 240 | |||
| 241 | /** | ||
| 242 | * @brief Sleep mode related APIs inclusion switch. | ||
| 243 | */ | ||
| 244 | #if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) | ||
| 245 | #define CAN_USE_SLEEP_MODE TRUE | ||
| 246 | #endif | ||
| 247 | |||
| 248 | /** | ||
| 249 | * @brief Enforces the driver to use direct callbacks rather than OSAL events. | ||
| 250 | */ | ||
| 251 | #if !defined(CAN_ENFORCE_USE_CALLBACKS) || defined(__DOXYGEN__) | ||
| 252 | #define CAN_ENFORCE_USE_CALLBACKS FALSE | ||
| 253 | #endif | ||
| 254 | |||
| 255 | /*===========================================================================*/ | ||
| 256 | /* CRY driver related settings. */ | ||
| 257 | /*===========================================================================*/ | ||
| 258 | |||
| 259 | /** | ||
| 260 | * @brief Enables the SW fall-back of the cryptographic driver. | ||
| 261 | * @details When enabled, this option, activates a fall-back software | ||
| 262 | * implementation for algorithms not supported by the underlying | ||
| 263 | * hardware. | ||
| 264 | * @note Fall-back implementations may not be present for all algorithms. | ||
| 265 | */ | ||
| 266 | #if !defined(HAL_CRY_USE_FALLBACK) || defined(__DOXYGEN__) | ||
| 267 | #define HAL_CRY_USE_FALLBACK FALSE | ||
| 268 | #endif | ||
| 269 | |||
| 270 | /** | ||
| 271 | * @brief Makes the driver forcibly use the fall-back implementations. | ||
| 272 | */ | ||
| 273 | #if !defined(HAL_CRY_ENFORCE_FALLBACK) || defined(__DOXYGEN__) | ||
| 274 | #define HAL_CRY_ENFORCE_FALLBACK FALSE | ||
| 275 | #endif | ||
| 276 | |||
| 277 | /*===========================================================================*/ | ||
| 278 | /* DAC driver related settings. */ | ||
| 279 | /*===========================================================================*/ | ||
| 280 | |||
| 281 | /** | ||
| 282 | * @brief Enables synchronous APIs. | ||
| 283 | * @note Disabling this option saves both code and data space. | ||
| 284 | */ | ||
| 285 | #if !defined(DAC_USE_WAIT) || defined(__DOXYGEN__) | ||
| 286 | #define DAC_USE_WAIT TRUE | ||
| 287 | #endif | ||
| 288 | |||
| 289 | /** | ||
| 290 | * @brief Enables the @p dacAcquireBus() and @p dacReleaseBus() APIs. | ||
| 291 | * @note Disabling this option saves both code and data space. | ||
| 292 | */ | ||
| 293 | #if !defined(DAC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
| 294 | #define DAC_USE_MUTUAL_EXCLUSION TRUE | ||
| 295 | #endif | ||
| 296 | |||
| 297 | /*===========================================================================*/ | ||
| 298 | /* I2C driver related settings. */ | ||
| 299 | /*===========================================================================*/ | ||
| 300 | |||
| 301 | /** | ||
| 302 | * @brief Enables the mutual exclusion APIs on the I2C bus. | ||
| 303 | */ | ||
| 304 | #if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
| 305 | #define I2C_USE_MUTUAL_EXCLUSION TRUE | ||
| 306 | #endif | ||
| 307 | |||
| 308 | /*===========================================================================*/ | ||
| 309 | /* MAC driver related settings. */ | ||
| 310 | /*===========================================================================*/ | ||
| 311 | |||
| 312 | /** | ||
| 313 | * @brief Enables the zero-copy API. | ||
| 314 | */ | ||
| 315 | #if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) | ||
| 316 | #define MAC_USE_ZERO_COPY FALSE | ||
| 317 | #endif | ||
| 318 | |||
| 319 | /** | ||
| 320 | * @brief Enables an event sources for incoming packets. | ||
| 321 | */ | ||
| 322 | #if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) | ||
| 323 | #define MAC_USE_EVENTS TRUE | ||
| 324 | #endif | ||
| 325 | |||
| 326 | /*===========================================================================*/ | ||
| 327 | /* MMC_SPI driver related settings. */ | ||
| 328 | /*===========================================================================*/ | ||
| 329 | |||
| 330 | /** | ||
| 331 | * @brief Delays insertions. | ||
| 332 | * @details If enabled this options inserts delays into the MMC waiting | ||
| 333 | * routines releasing some extra CPU time for the threads with | ||
| 334 | * lower priority, this may slow down the driver a bit however. | ||
| 335 | * This option is recommended also if the SPI driver does not | ||
| 336 | * use a DMA channel and heavily loads the CPU. | ||
| 337 | */ | ||
| 338 | #if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) | ||
| 339 | #define MMC_NICE_WAITING TRUE | ||
| 340 | #endif | ||
| 341 | |||
| 342 | /*===========================================================================*/ | ||
| 343 | /* SDC driver related settings. */ | ||
| 344 | /*===========================================================================*/ | ||
| 345 | |||
| 346 | /** | ||
| 347 | * @brief Number of initialization attempts before rejecting the card. | ||
| 348 | * @note Attempts are performed at 10mS intervals. | ||
| 349 | */ | ||
| 350 | #if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) | ||
| 351 | #define SDC_INIT_RETRY 100 | ||
| 352 | #endif | ||
| 353 | |||
| 354 | /** | ||
| 355 | * @brief Include support for MMC cards. | ||
| 356 | * @note MMC support is not yet implemented so this option must be kept | ||
| 357 | * at @p FALSE. | ||
| 358 | */ | ||
| 359 | #if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) | ||
| 360 | #define SDC_MMC_SUPPORT FALSE | ||
| 361 | #endif | ||
| 362 | |||
| 363 | /** | ||
| 364 | * @brief Delays insertions. | ||
| 365 | * @details If enabled this options inserts delays into the MMC waiting | ||
| 366 | * routines releasing some extra CPU time for the threads with | ||
| 367 | * lower priority, this may slow down the driver a bit however. | ||
| 368 | */ | ||
| 369 | #if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) | ||
| 370 | #define SDC_NICE_WAITING TRUE | ||
| 371 | #endif | ||
| 372 | |||
| 373 | /** | ||
| 374 | * @brief OCR initialization constant for V20 cards. | ||
| 375 | */ | ||
| 376 | #if !defined(SDC_INIT_OCR_V20) || defined(__DOXYGEN__) | ||
| 377 | #define SDC_INIT_OCR_V20 0x50FF8000U | ||
| 378 | #endif | ||
| 379 | |||
| 380 | /** | ||
| 381 | * @brief OCR initialization constant for non-V20 cards. | ||
| 382 | */ | ||
| 383 | #if !defined(SDC_INIT_OCR) || defined(__DOXYGEN__) | ||
| 384 | #define SDC_INIT_OCR 0x80100000U | ||
| 385 | #endif | ||
| 386 | |||
| 387 | /*===========================================================================*/ | ||
| 388 | /* SERIAL driver related settings. */ | ||
| 389 | /*===========================================================================*/ | ||
| 390 | |||
| 391 | /** | ||
| 392 | * @brief Default bit rate. | ||
| 393 | * @details Configuration parameter, this is the baud rate selected for the | ||
| 394 | * default configuration. | ||
| 395 | */ | ||
| 396 | #if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) | ||
| 397 | #define SERIAL_DEFAULT_BITRATE 38400 | ||
| 398 | #endif | ||
| 399 | |||
| 400 | /** | ||
| 401 | * @brief Serial buffers size. | ||
| 402 | * @details Configuration parameter, you can change the depth of the queue | ||
| 403 | * buffers depending on the requirements of your application. | ||
| 404 | * @note The default is 16 bytes for both the transmission and receive | ||
| 405 | * buffers. | ||
| 406 | */ | ||
| 407 | #if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) | ||
| 408 | #define SERIAL_BUFFERS_SIZE 16 | ||
| 409 | #endif | ||
| 410 | |||
| 411 | /*===========================================================================*/ | ||
| 412 | /* SERIAL_USB driver related setting. */ | ||
| 413 | /*===========================================================================*/ | ||
| 414 | |||
| 415 | /** | ||
| 416 | * @brief Serial over USB buffers size. | ||
| 417 | * @details Configuration parameter, the buffer size must be a multiple of | ||
| 418 | * the USB data endpoint maximum packet size. | ||
| 419 | * @note The default is 256 bytes for both the transmission and receive | ||
| 420 | * buffers. | ||
| 421 | */ | ||
| 422 | #if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) | ||
| 423 | #define SERIAL_USB_BUFFERS_SIZE 1 | ||
| 424 | #endif | ||
| 425 | |||
| 426 | /** | ||
| 427 | * @brief Serial over USB number of buffers. | ||
| 428 | * @note The default is 2 buffers. | ||
| 429 | */ | ||
| 430 | #if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) | ||
| 431 | #define SERIAL_USB_BUFFERS_NUMBER 2 | ||
| 432 | #endif | ||
| 433 | |||
| 434 | /*===========================================================================*/ | ||
| 435 | /* SPI driver related settings. */ | ||
| 436 | /*===========================================================================*/ | ||
| 437 | |||
| 438 | /** | ||
| 439 | * @brief Enables synchronous APIs. | ||
| 440 | * @note Disabling this option saves both code and data space. | ||
| 441 | */ | ||
| 442 | #if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) | ||
| 443 | #define SPI_USE_WAIT TRUE | ||
| 444 | #endif | ||
| 445 | |||
| 446 | /** | ||
| 447 | * @brief Enables circular transfers APIs. | ||
| 448 | * @note Disabling this option saves both code and data space. | ||
| 449 | */ | ||
| 450 | #if !defined(SPI_USE_CIRCULAR) || defined(__DOXYGEN__) | ||
| 451 | #define SPI_USE_CIRCULAR FALSE | ||
| 452 | #endif | ||
| 453 | |||
| 454 | |||
| 455 | /** | ||
| 456 | * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. | ||
| 457 | * @note Disabling this option saves both code and data space. | ||
| 458 | */ | ||
| 459 | #if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
| 460 | #define SPI_USE_MUTUAL_EXCLUSION TRUE | ||
| 461 | #endif | ||
| 462 | |||
| 463 | /** | ||
| 464 | * @brief Handling method for SPI CS line. | ||
| 465 | * @note Disabling this option saves both code and data space. | ||
| 466 | */ | ||
| 467 | #if !defined(SPI_SELECT_MODE) || defined(__DOXYGEN__) | ||
| 468 | #define SPI_SELECT_MODE SPI_SELECT_MODE_PAD | ||
| 469 | #endif | ||
| 470 | |||
| 471 | /*===========================================================================*/ | ||
| 472 | /* UART driver related settings. */ | ||
| 473 | /*===========================================================================*/ | ||
| 474 | |||
| 475 | /** | ||
| 476 | * @brief Enables synchronous APIs. | ||
| 477 | * @note Disabling this option saves both code and data space. | ||
| 478 | */ | ||
| 479 | #if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) | ||
| 480 | #define UART_USE_WAIT FALSE | ||
| 481 | #endif | ||
| 482 | |||
| 483 | /** | ||
| 484 | * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. | ||
| 485 | * @note Disabling this option saves both code and data space. | ||
| 486 | */ | ||
| 487 | #if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
| 488 | #define UART_USE_MUTUAL_EXCLUSION FALSE | ||
| 489 | #endif | ||
| 490 | |||
| 491 | /*===========================================================================*/ | ||
| 492 | /* USB driver related settings. */ | ||
| 493 | /*===========================================================================*/ | ||
| 494 | |||
| 495 | /** | ||
| 496 | * @brief Enables synchronous APIs. | ||
| 497 | * @note Disabling this option saves both code and data space. | ||
| 498 | */ | ||
| 499 | #if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) | ||
| 500 | #define USB_USE_WAIT TRUE | ||
| 501 | #endif | ||
| 502 | |||
| 503 | /*===========================================================================*/ | ||
| 504 | /* WSPI driver related settings. */ | ||
| 505 | /*===========================================================================*/ | ||
| 506 | |||
| 507 | /** | ||
| 508 | * @brief Enables synchronous APIs. | ||
| 509 | * @note Disabling this option saves both code and data space. | ||
| 510 | */ | ||
| 511 | #if !defined(WSPI_USE_WAIT) || defined(__DOXYGEN__) | ||
| 512 | #define WSPI_USE_WAIT TRUE | ||
| 513 | #endif | ||
| 514 | |||
| 515 | /** | ||
| 516 | * @brief Enables the @p wspiAcquireBus() and @p wspiReleaseBus() APIs. | ||
| 517 | * @note Disabling this option saves both code and data space. | ||
| 518 | */ | ||
| 519 | #if !defined(WSPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
| 520 | #define WSPI_USE_MUTUAL_EXCLUSION TRUE | ||
| 521 | #endif | ||
| 522 | |||
| 523 | #endif /* HALCONF_H */ | ||
| 524 | |||
| 525 | /** @} */ | ||
diff --git a/keyboards/sowbug/68keys/info.json b/keyboards/sowbug/68keys/info.json new file mode 100644 index 000000000..f2435e3e4 --- /dev/null +++ b/keyboards/sowbug/68keys/info.json | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "68keys", | ||
| 3 | "url": "github.com/sowbug", | ||
| 4 | "maintainer": "sowbug", | ||
| 5 | "width": 17.25, | ||
| 6 | "height": 5, | ||
| 7 | "layouts": { | ||
| 8 | "LAYOUT": { | ||
| 9 | "layout": [ | ||
| 10 | {"label":"K00", "x":0, "y":0}, | ||
| 11 | {"label":"K01", "x":1, "y":0}, | ||
| 12 | {"label":"K02", "x":2, "y":0}, | ||
| 13 | {"label":"K03", "x":3, "y":0}, | ||
| 14 | {"label":"K04", "x":4, "y":0}, | ||
| 15 | {"label":"K05", "x":5, "y":0}, | ||
| 16 | {"label":"K06", "x":6, "y":0}, | ||
| 17 | {"label":"K07", "x":7, "y":0}, | ||
| 18 | {"label":"K08", "x":8, "y":0}, | ||
| 19 | {"label":"K09", "x":9, "y":0}, | ||
| 20 | {"label":"K0A", "x":10, "y":0}, | ||
| 21 | {"label":"K0B", "x":11, "y":0}, | ||
| 22 | {"label":"K0C", "x":12, "y":0}, | ||
| 23 | {"label":"K0E", "x":13, "y":0, "w":2}, | ||
| 24 | {"label":"K0F", "x":15.25, "y":0}, | ||
| 25 | {"label":"K0G", "x":16.25, "y":0}, | ||
| 26 | {"label":"K10", "x":0, "y":1, "w":1.5}, | ||
| 27 | {"label":"K12", "x":1.5, "y":1}, | ||
| 28 | {"label":"K13", "x":2.5, "y":1}, | ||
| 29 | {"label":"K14", "x":3.5, "y":1}, | ||
| 30 | {"label":"K15", "x":4.5, "y":1}, | ||
| 31 | {"label":"K16", "x":5.5, "y":1}, | ||
| 32 | {"label":"K17", "x":6.5, "y":1}, | ||
| 33 | {"label":"K18", "x":7.5, "y":1}, | ||
| 34 | {"label":"K19", "x":8.5, "y":1}, | ||
| 35 | {"label":"K1A", "x":9.5, "y":1}, | ||
| 36 | {"label":"K1B", "x":10.5, "y":1}, | ||
| 37 | {"label":"K1C", "x":11.5, "y":1}, | ||
| 38 | {"label":"K1D", "x":12.5, "y":1}, | ||
| 39 | {"label":"K1E", "x":13.5, "y":1, "w":1.5}, | ||
| 40 | {"label":"K1F", "x":15.25, "y":1}, | ||
| 41 | {"label":"K1G", "x":16.25, "y":1}, | ||
| 42 | {"label":"K20", "x":0, "y":2, "w":1.75}, | ||
| 43 | {"label":"K22", "x":1.75, "y":2}, | ||
| 44 | {"label":"K23", "x":2.75, "y":2}, | ||
| 45 | {"label":"K24", "x":3.75, "y":2}, | ||
| 46 | {"label":"K25", "x":4.75, "y":2}, | ||
| 47 | {"label":"K26", "x":5.75, "y":2}, | ||
| 48 | {"label":"K27", "x":6.75, "y":2}, | ||
| 49 | {"label":"K28", "x":7.75, "y":2}, | ||
| 50 | {"label":"K29", "x":8.75, "y":2}, | ||
| 51 | {"label":"K2A", "x":9.75, "y":2}, | ||
| 52 | {"label":"K2B", "x":10.75, "y":2}, | ||
| 53 | {"label":"K2C", "x":11.75, "y":2}, | ||
| 54 | {"label":"K2D", "x":12.75, "y":2, "w":2.25}, | ||
| 55 | {"label":"K31", "x":0, "y":3, "w":2.25}, | ||
| 56 | {"label":"K32", "x":2.25, "y":3}, | ||
| 57 | {"label":"K33", "x":3.25, "y":3}, | ||
| 58 | {"label":"K34", "x":4.25, "y":3}, | ||
| 59 | {"label":"K35", "x":5.25, "y":3}, | ||
| 60 | {"label":"K36", "x":6.25, "y":3}, | ||
| 61 | {"label":"K37", "x":7.25, "y":3}, | ||
| 62 | {"label":"K38", "x":8.25, "y":3}, | ||
| 63 | {"label":"K39", "x":9.25, "y":3}, | ||
| 64 | {"label":"K3A", "x":10.25, "y":3}, | ||
| 65 | {"label":"K3B", "x":11.25, "y":3}, | ||
| 66 | {"label":"K3D", "x":12.25, "y":3, "w":2.75}, | ||
| 67 | {"label":"K3F", "x":15.25, "y":3}, | ||
| 68 | {"label":"K40", "x":0, "y":4, "w":1.25}, | ||
| 69 | {"label":"K41", "x":1.25, "y":4, "w":1.25}, | ||
| 70 | {"label":"K43", "x":2.5, "y":4, "w":1.25}, | ||
| 71 | {"label":"K46", "x":3.75, "y":4, "w":6.25}, | ||
| 72 | {"label":"K4A", "x":10, "y":4, "w":1.25}, | ||
| 73 | {"label":"K4B", "x":11.25, "y":4, "w":1.25}, | ||
| 74 | {"label":"K4D", "x":12.5, "y":4, "w":1.25}, | ||
| 75 | {"label":"K4E", "x":14.25, "y":4}, | ||
| 76 | {"label":"K4F", "x":15.25, "y":4}, | ||
| 77 | {"label":"K4G", "x":16.25, "y":4} | ||
| 78 | ] | ||
| 79 | } | ||
| 80 | } | ||
| 81 | ,"meta": "https://noroadsleft.github.io/kbf_qmk_converter/" | ||
| 82 | } | ||
diff --git a/keyboards/sowbug/68keys/keymaps/default/keymap.c b/keyboards/sowbug/68keys/keymaps/default/keymap.c new file mode 100644 index 000000000..73ec6c38e --- /dev/null +++ b/keyboards/sowbug/68keys/keymaps/default/keymap.c | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | /* Copyright 2021 Mike Tsao | ||
| 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 | // keymaps/default/keymap.c | ||
| 18 | |||
| 19 | #include QMK_KEYBOARD_H | ||
| 20 | |||
| 21 | #define _QWERTY 0 | ||
| 22 | #define _FN1 1 | ||
| 23 | |||
| 24 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 25 | [_QWERTY] = LAYOUT( | ||
| 26 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_ESC, KC_PGUP, | ||
| 27 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_PGDN, | ||
| 28 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, | ||
| 29 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
| 30 | KC_LCTRL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN1), KC_RALT, KC_RCTRL, KC_LEFT, KC_DOWN, KC_RGHT | ||
| 31 | ), | ||
| 32 | |||
| 33 | [_FN1] = LAYOUT( | ||
| 34 | //┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────────────┐ ┌────────┬────────┐ | ||
| 35 | _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_HOME, | ||
| 36 | //├────────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────────────┤ ├────────┼────────┤ | ||
| 37 | BL_TOGG, BL_STEP, KC_UP, _______, _______, _______, _______, _______, RGB_SPI, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_BSLS, _______, KC_END, | ||
| 38 | //├────────────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴────────────┤ └────────┴────────┘ | ||
| 39 | _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_HOME, KC_QUOT, KC_ENTER, | ||
| 40 | //├──────────────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───────────────────┤ ┌────────┐ | ||
| 41 | _______, _______, KC_MPLY, KC_MSTP, KC_MPRV, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, _______, KC_END, _______, RGB_MOD, | ||
| 42 | //├──────────┬───────┴──┬─────┴────┬───┴────────┴────────┴────────┴────────┴────────┴──────┬─┴────────┼────────┴─┬──────────┬────┬──────┴─┬────────┼────────┐ | ||
| 43 | _______, _______, _______, _______, _______, _______, KC_MENU, RGB_VAI, RGB_TOG, RGB_HUI | ||
| 44 | //└──────────┴──────────┴──────────┴───────────────────────────────────────────────────────┴──────────┴──────────┴──────────┘ └────────┴────────┴────────┘ | ||
| 45 | ) | ||
| 46 | |||
| 47 | }; | ||
diff --git a/keyboards/sowbug/68keys/mcuconf.h b/keyboards/sowbug/68keys/mcuconf.h new file mode 100644 index 000000000..fced27289 --- /dev/null +++ b/keyboards/sowbug/68keys/mcuconf.h | |||
| @@ -0,0 +1,209 @@ | |||
| 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 TRUE | ||
| 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 TRUE | ||
| 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/sowbug/68keys/readme.md b/keyboards/sowbug/68keys/readme.md new file mode 100644 index 000000000..2ac5e73c4 --- /dev/null +++ b/keyboards/sowbug/68keys/readme.md | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | # 68keys | ||
| 2 | |||
| 3 | A 68-key keyboard with per-key RGB, Kailh hotswap sockets, and USB-C. Uses Blue Pill. | ||
| 4 | |||
| 5 | ## History | ||
| 6 | |||
| 7 | This keyboard was inspired by the [68keys.io](https://68keys.io/) keyboard. The | ||
| 8 | 68keys keyboard has a similar layout to the | ||
| 9 | [MagicForce 68](https://www.amazon.com/Qisan-Mechanical-Keyboard-68-Keys-Magicforce/dp/B01E8KO2B0). | ||
| 10 | [di0ib](https://github.com/di0ib) did a | ||
| 11 | [replacement PCB](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68) | ||
| 12 | for the Magicforce 68. | ||
| 13 | |||
| 14 | I love the Magicforce 68, but wanted a few changes. As a colossally | ||
| 15 | disproportionate response to this challenge, I created | ||
| 16 | [a utility](https://github.com/sowbug/keycad/) that generates PCBs from | ||
| 17 | arbitrary KLE JSON files, and used it to create this keyboard. | ||
| 18 | |||
| 19 | ## A note about backlighting | ||
| 20 | |||
| 21 | I wanted my per-key RGB keyboard to have a dim backlight on all keys, but didn't | ||
| 22 | want to sacrifice cool RGB matrix effects to have it. So I wrote up | ||
| 23 | [a QMK patch](https://github.com/sowbug/qmk_firmware/commit/f7f859ceeefde40e639cfc75044af477504d30f8) | ||
| 24 | that treats RGB(0, 0, 0) as eligible for backlighting. Unfortunately the QMK | ||
| 25 | maintainers weren't interested (actually, now that I look back, I didn't submit | ||
| 26 | a pull request, but rather discussed it in a chat room), so it's not upstreamed. | ||
| 27 | Thus you'll have to add that patch (and | ||
| 28 | [this](https://github.com/sowbug/qmk_firmware/commit/ff17800ef4a9cba59d754c72720d6877edb8fbb9)) | ||
| 29 | to your copy of QMK and then enable it in config.h and rules.mk. | ||
| 30 | |||
| 31 | ## Building and flashing | ||
| 32 | |||
| 33 | `qmk flash -kb sowbug/68keys -km default` | ||
diff --git a/keyboards/sowbug/68keys/rules.mk b/keyboards/sowbug/68keys/rules.mk new file mode 100644 index 000000000..414140c5e --- /dev/null +++ b/keyboards/sowbug/68keys/rules.mk | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = STM32F103 | ||
| 3 | |||
| 4 | # GENERIC STM32F103C8T6 board - stm32duino bootloader | ||
| 5 | OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000 | ||
| 6 | MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader | ||
| 7 | BOARD = STM32_F103_STM32DUINO | ||
| 8 | |||
| 9 | DFU_ARGS = -d 1eaf:0003 -a2 -R | ||
| 10 | DFU_SUFFIX_ARGS = -v 1eaf -p 0003 | ||
| 11 | |||
| 12 | # Build Options | ||
| 13 | # comment out to disable the options. | ||
| 14 | # | ||
| 15 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration | ||
| 16 | MOUSEKEY_ENABLE = yes # Mouse keys | ||
| 17 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
| 18 | CONSOLE_ENABLE = no | ||
| 19 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 20 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 21 | NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 22 | AUDIO_ENABLE = no | ||
| 23 | RGB_MATRIX_ENABLE = yes | ||
| 24 | RGB_MATRIX_DRIVER = WS2812 | ||
| 25 | |||
| 26 | # Want backlighting and RGB Matrix patterns? See the note in the readme, | ||
| 27 | # apply the patches, and then uncomment the lines below as well as the one in | ||
| 28 | # config.h. | ||
| 29 | # | ||
| 30 | # BACKLIGHT_ENABLE = yes | ||
| 31 | # BACKLIGHT_DRIVER = rgb_matrix | ||
| 32 | |||
| 33 | # Enter lower-power sleep mode when on the ChibiOS idle thread | ||
| 34 | OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE | ||
diff --git a/keyboards/sowbug/ansi_tkl/ansi_tkl.c b/keyboards/sowbug/ansi_tkl/ansi_tkl.c new file mode 100644 index 000000000..dc24631a8 --- /dev/null +++ b/keyboards/sowbug/ansi_tkl/ansi_tkl.c | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | /* Copyright 2021 Mike Tsao | ||
| 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 | // ansi_tkl.c | ||
| 18 | |||
| 19 | #include "ansi_tkl.h" | ||
| 20 | |||
| 21 | #ifdef RGB_MATRIX_ENABLE | ||
| 22 | led_config_t g_led_config = {{ | ||
| 23 | // Key Matrix to LED Index | ||
| 24 | {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, NO_LED}, | ||
| 25 | {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}, | ||
| 26 | {33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49}, | ||
| 27 | {50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, NO_LED, NO_LED, NO_LED, NO_LED}, | ||
| 28 | {63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, NO_LED, NO_LED, NO_LED, NO_LED}, | ||
| 29 | {76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED} | ||
| 30 | }, | ||
| 31 | {// LED Index to Physical Position | ||
| 32 | {0, 0}, {24, 0}, {36, 0}, {49, 0}, {61, 0}, {79, 0}, {92, 0}, {104, 0}, {116, 0}, {135, 0}, {147, 0}, {159, 0}, {171, 0}, {187, 0}, {199, 0}, {211, 0}, | ||
| 33 | {0, 14}, {12, 14}, {24, 14}, {36, 14}, {49, 14}, {61, 14}, {73, 14}, {85, 14}, {98, 14}, {110, 14}, {122, 14}, {135, 14}, {147, 14}, {165, 14}, {187, 14}, {199, 14}, {211, 14}, | ||
| 34 | {3, 24}, {18, 24}, {30, 24}, {42, 24}, {55, 24}, {67, 24}, {79, 24}, {92, 24}, {104, 24}, {116, 24}, {128, 24}, {141, 24}, {153, 24}, {168, 24}, {187, 24}, {199, 24}, {211, 24}, | ||
| 35 | {4, 34}, {21, 34}, {33, 34}, {46, 34}, {58, 34}, {70, 34}, {82, 34}, {95, 34}, {107, 34}, {119, 34}, {131, 34}, {144, 34}, {164, 34}, | ||
| 36 | {7, 44}, {27, 44}, {39, 44}, {52, 44}, {64, 44}, {76, 44}, {88, 44}, {101, 44}, {113, 44}, {125, 44}, {138, 44}, {161, 44}, {199, 44}, | ||
| 37 | {1, 54}, {16, 54}, {32, 54}, {78, 54}, {124, 54}, {139, 54}, {154, 54}, {170, 54}, {187, 54}, {199, 54}, {211, 54}}, | ||
| 38 | {// LED Index to Flag | ||
| 39 | LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, | ||
| 40 | LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, | ||
| 41 | LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, | ||
| 42 | LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, | ||
| 43 | LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, | ||
| 44 | LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, | ||
| 45 | LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, | ||
| 46 | LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, | ||
| 47 | LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, | ||
| 48 | LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT | ||
| 49 | } | ||
| 50 | }; | ||
| 51 | |||
| 52 | void suspend_power_down_kb(void) | ||
| 53 | { | ||
| 54 | rgb_matrix_set_suspend_state(true); | ||
| 55 | } | ||
| 56 | |||
| 57 | void suspend_wakeup_init_kb(void) | ||
| 58 | { | ||
| 59 | rgb_matrix_set_suspend_state(false); | ||
| 60 | } | ||
| 61 | #endif // #ifdef RGB_MATRIX_ENABLE | ||
diff --git a/keyboards/sowbug/ansi_tkl/ansi_tkl.h b/keyboards/sowbug/ansi_tkl/ansi_tkl.h new file mode 100644 index 000000000..bf32fc18c --- /dev/null +++ b/keyboards/sowbug/ansi_tkl/ansi_tkl.h | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | /* Copyright 2021 Mike Tsao | ||
| 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 | // ansi_tkl.h | ||
| 18 | |||
| 19 | #pragma once | ||
| 20 | |||
| 21 | #include "quantum.h" | ||
| 22 | |||
| 23 | #define LAYOUT_default( A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13, B14, B15, B16, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, E0, E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11, E12, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10) \ | ||
| 24 | { \ | ||
| 25 | { A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, KC_NO }, \ | ||
| 26 | { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13, B14, B15, B16 }, \ | ||
| 27 | { C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16 }, \ | ||
| 28 | { D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, KC_NO, KC_NO, KC_NO, KC_NO }, \ | ||
| 29 | { E0, E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11, E12, KC_NO, KC_NO, KC_NO, KC_NO }, \ | ||
| 30 | { F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ | ||
| 31 | } | ||
| 32 | |||
| 33 | #define LAYOUT LAYOUT_default | ||
diff --git a/keyboards/sowbug/ansi_tkl/bootloader_defs.h b/keyboards/sowbug/ansi_tkl/bootloader_defs.h new file mode 100644 index 000000000..6b8fa9f72 --- /dev/null +++ b/keyboards/sowbug/ansi_tkl/bootloader_defs.h | |||
| @@ -0,0 +1,10 @@ | |||
| 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 0x80000000 | ||
diff --git a/keyboards/sowbug/ansi_tkl/chconf.h b/keyboards/sowbug/ansi_tkl/chconf.h new file mode 100644 index 000000000..f5e471640 --- /dev/null +++ b/keyboards/sowbug/ansi_tkl/chconf.h | |||
| @@ -0,0 +1,714 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2018 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 rt/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 | #define _CHIBIOS_RT_CONF_VER_6_0_ | ||
| 33 | |||
| 34 | /*===========================================================================*/ | ||
| 35 | /** | ||
| 36 | * @name System timers settings | ||
| 37 | * @{ | ||
| 38 | */ | ||
| 39 | /*===========================================================================*/ | ||
| 40 | |||
| 41 | /** | ||
| 42 | * @brief System time counter resolution. | ||
| 43 | * @note Allowed values are 16 or 32 bits. | ||
| 44 | */ | ||
| 45 | #if !defined(CH_CFG_ST_RESOLUTION) | ||
| 46 | #define CH_CFG_ST_RESOLUTION 32 | ||
| 47 | #endif | ||
| 48 | |||
| 49 | /** | ||
| 50 | * @brief System tick frequency. | ||
| 51 | * @details Frequency of the system timer that drives the system ticks. This | ||
| 52 | * setting also defines the system tick time unit. | ||
| 53 | */ | ||
| 54 | #if !defined(CH_CFG_ST_FREQUENCY) | ||
| 55 | #define CH_CFG_ST_FREQUENCY 100000 | ||
| 56 | #endif | ||
| 57 | |||
| 58 | /** | ||
| 59 | * @brief Time intervals data size. | ||
| 60 | * @note Allowed values are 16, 32 or 64 bits. | ||
| 61 | */ | ||
| 62 | #if !defined(CH_CFG_INTERVALS_SIZE) | ||
| 63 | #define CH_CFG_INTERVALS_SIZE 32 | ||
| 64 | #endif | ||
| 65 | |||
| 66 | /** | ||
| 67 | * @brief Time types data size. | ||
| 68 | * @note Allowed values are 16 or 32 bits. | ||
| 69 | */ | ||
| 70 | #if !defined(CH_CFG_TIME_TYPES_SIZE) | ||
| 71 | #define CH_CFG_TIME_TYPES_SIZE 32 | ||
| 72 | #endif | ||
| 73 | |||
| 74 | /** | ||
| 75 | * @brief Time delta constant for the tick-less mode. | ||
| 76 | * @note If this value is zero then the system uses the classic | ||
| 77 | * periodic tick. This value represents the minimum number | ||
| 78 | * of ticks that is safe to specify in a timeout directive. | ||
| 79 | * The value one is not valid, timeouts are rounded up to | ||
| 80 | * this value. | ||
| 81 | */ | ||
| 82 | #if !defined(CH_CFG_ST_TIMEDELTA) | ||
| 83 | #define CH_CFG_ST_TIMEDELTA 0 | ||
| 84 | #endif | ||
| 85 | |||
| 86 | /** @} */ | ||
| 87 | |||
| 88 | /*===========================================================================*/ | ||
| 89 | /** | ||
| 90 | * @name Kernel parameters and options | ||
| 91 | * @{ | ||
| 92 | */ | ||
| 93 | /*===========================================================================*/ | ||
| 94 | |||
| 95 | /** | ||
| 96 | * @brief Round robin interval. | ||
| 97 | * @details This constant is the number of system ticks allowed for the | ||
| 98 | * threads before preemption occurs. Setting this value to zero | ||
| 99 | * disables the preemption for threads with equal priority and the | ||
| 100 | * round robin becomes cooperative. Note that higher priority | ||
| 101 | * threads can still preempt, the kernel is always preemptive. | ||
| 102 | * @note Disabling the round robin preemption makes the kernel more compact | ||
| 103 | * and generally faster. | ||
| 104 | * @note The round robin preemption is not supported in tickless mode and | ||
| 105 | * must be set to zero in that case. | ||
| 106 | */ | ||
| 107 | #if !defined(CH_CFG_TIME_QUANTUM) | ||
| 108 | #define CH_CFG_TIME_QUANTUM 0 | ||
| 109 | #endif | ||
| 110 | |||
| 111 | /** | ||
| 112 | * @brief Managed RAM size. | ||
| 113 | * @details Size of the RAM area to be managed by the OS. If set to zero | ||
| 114 | * then the whole available RAM is used. The core memory is made | ||
| 115 | * available to the heap allocator and/or can be used directly through | ||
| 116 | * the simplified core memory allocator. | ||
| 117 | * | ||
| 118 | * @note In order to let the OS manage the whole RAM the linker script must | ||
| 119 | * provide the @p __heap_base__ and @p __heap_end__ symbols. | ||
| 120 | * @note Requires @p CH_CFG_USE_MEMCORE. | ||
| 121 | */ | ||
| 122 | #if !defined(CH_CFG_MEMCORE_SIZE) | ||
| 123 | #define CH_CFG_MEMCORE_SIZE 0 | ||
| 124 | #endif | ||
| 125 | |||
| 126 | /** | ||
| 127 | * @brief Idle thread automatic spawn suppression. | ||
| 128 | * @details When this option is activated the function @p chSysInit() | ||
| 129 | * does not spawn the idle thread. The application @p main() | ||
| 130 | * function becomes the idle thread and must implement an | ||
| 131 | * infinite loop. | ||
| 132 | */ | ||
| 133 | #if !defined(CH_CFG_NO_IDLE_THREAD) | ||
| 134 | #define CH_CFG_NO_IDLE_THREAD FALSE | ||
| 135 | #endif | ||
| 136 | |||
| 137 | /** @} */ | ||
| 138 | |||
| 139 | /*===========================================================================*/ | ||
| 140 | /** | ||
| 141 | * @name Performance options | ||
| 142 | * @{ | ||
| 143 | */ | ||
| 144 | /*===========================================================================*/ | ||
| 145 | |||
| 146 | /** | ||
| 147 | * @brief OS optimization. | ||
| 148 | * @details If enabled then time efficient rather than space efficient code | ||
| 149 | * is used when two possible implementations exist. | ||
| 150 | * | ||
| 151 | * @note This is not related to the compiler optimization options. | ||
| 152 | * @note The default is @p TRUE. | ||
| 153 | */ | ||
| 154 | #if !defined(CH_CFG_OPTIMIZE_SPEED) | ||
| 155 | #define CH_CFG_OPTIMIZE_SPEED TRUE | ||
| 156 | #endif | ||
| 157 | |||
| 158 | /** @} */ | ||
| 159 | |||
| 160 | /*===========================================================================*/ | ||
| 161 | /** | ||
| 162 | * @name Subsystem options | ||
| 163 | * @{ | ||
| 164 | */ | ||
| 165 | /*===========================================================================*/ | ||
| 166 | |||
| 167 | /** | ||
| 168 | * @brief Time Measurement APIs. | ||
| 169 | * @details If enabled then the time measurement APIs are included in | ||
| 170 | * the kernel. | ||
| 171 | * | ||
| 172 | * @note The default is @p TRUE. | ||
| 173 | */ | ||
| 174 | #if !defined(CH_CFG_USE_TM) | ||
| 175 | #define CH_CFG_USE_TM FALSE | ||
| 176 | #endif | ||
| 177 | |||
| 178 | /** | ||
| 179 | * @brief Threads registry APIs. | ||
| 180 | * @details If enabled then the registry APIs are included in the kernel. | ||
| 181 | * | ||
| 182 | * @note The default is @p TRUE. | ||
| 183 | */ | ||
| 184 | #if !defined(CH_CFG_USE_REGISTRY) | ||
| 185 | #define CH_CFG_USE_REGISTRY TRUE | ||
| 186 | #endif | ||
| 187 | |||
| 188 | /** | ||
| 189 | * @brief Threads synchronization APIs. | ||
| 190 | * @details If enabled then the @p chThdWait() function is included in | ||
| 191 | * the kernel. | ||
| 192 | * | ||
| 193 | * @note The default is @p TRUE. | ||
| 194 | */ | ||
| 195 | #if !defined(CH_CFG_USE_WAITEXIT) | ||
| 196 | #define CH_CFG_USE_WAITEXIT TRUE | ||
| 197 | #endif | ||
| 198 | |||
| 199 | /** | ||
| 200 | * @brief Semaphores APIs. | ||
| 201 | * @details If enabled then the Semaphores APIs are included in the kernel. | ||
| 202 | * | ||
| 203 | * @note The default is @p TRUE. | ||
| 204 | */ | ||
| 205 | #if !defined(CH_CFG_USE_SEMAPHORES) | ||
| 206 | #define CH_CFG_USE_SEMAPHORES TRUE | ||
| 207 | #endif | ||
| 208 | |||
| 209 | /** | ||
| 210 | * @brief Semaphores queuing mode. | ||
| 211 | * @details If enabled then the threads are enqueued on semaphores by | ||
| 212 | * priority rather than in FIFO order. | ||
| 213 | * | ||
| 214 | * @note The default is @p FALSE. Enable this if you have special | ||
| 215 | * requirements. | ||
| 216 | * @note Requires @p CH_CFG_USE_SEMAPHORES. | ||
| 217 | */ | ||
| 218 | #if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY) | ||
| 219 | #define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE | ||
| 220 | #endif | ||
| 221 | |||
| 222 | /** | ||
| 223 | * @brief Mutexes APIs. | ||
| 224 | * @details If enabled then the mutexes APIs are included in the kernel. | ||
| 225 | * | ||
| 226 | * @note The default is @p TRUE. | ||
| 227 | */ | ||
| 228 | #if !defined(CH_CFG_USE_MUTEXES) | ||
| 229 | #define CH_CFG_USE_MUTEXES TRUE | ||
| 230 | #endif | ||
| 231 | |||
| 232 | /** | ||
| 233 | * @brief Enables recursive behavior on mutexes. | ||
| 234 | * @note Recursive mutexes are heavier and have an increased | ||
| 235 | * memory footprint. | ||
| 236 | * | ||
| 237 | * @note The default is @p FALSE. | ||
| 238 | * @note Requires @p CH_CFG_USE_MUTEXES. | ||
| 239 | */ | ||
| 240 | #if !defined(CH_CFG_USE_MUTEXES_RECURSIVE) | ||
| 241 | #define CH_CFG_USE_MUTEXES_RECURSIVE FALSE | ||
| 242 | #endif | ||
| 243 | |||
| 244 | /** | ||
| 245 | * @brief Conditional Variables APIs. | ||
| 246 | * @details If enabled then the conditional variables APIs are included | ||
| 247 | * in the kernel. | ||
| 248 | * | ||
| 249 | * @note The default is @p TRUE. | ||
| 250 | * @note Requires @p CH_CFG_USE_MUTEXES. | ||
| 251 | */ | ||
| 252 | #if !defined(CH_CFG_USE_CONDVARS) | ||
| 253 | #define CH_CFG_USE_CONDVARS TRUE | ||
| 254 | #endif | ||
| 255 | |||
| 256 | /** | ||
| 257 | * @brief Conditional Variables APIs with timeout. | ||
| 258 | * @details If enabled then the conditional variables APIs with timeout | ||
| 259 | * specification are included in the kernel. | ||
| 260 | * | ||
| 261 | * @note The default is @p TRUE. | ||
| 262 | * @note Requires @p CH_CFG_USE_CONDVARS. | ||
| 263 | */ | ||
| 264 | #if !defined(CH_CFG_USE_CONDVARS_TIMEOUT) | ||
| 265 | #define CH_CFG_USE_CONDVARS_TIMEOUT FALSE | ||
| 266 | #endif | ||
| 267 | |||
| 268 | /** | ||
| 269 | * @brief Events Flags APIs. | ||
| 270 | * @details If enabled then the event flags APIs are included in the kernel. | ||
| 271 | * | ||
| 272 | * @note The default is @p TRUE. | ||
| 273 | */ | ||
| 274 | #if !defined(CH_CFG_USE_EVENTS) | ||
| 275 | #define CH_CFG_USE_EVENTS TRUE | ||
| 276 | #endif | ||
| 277 | |||
| 278 | /** | ||
| 279 | * @brief Events Flags APIs with timeout. | ||
| 280 | * @details If enabled then the events APIs with timeout specification | ||
| 281 | * are included in the kernel. | ||
| 282 | * | ||
| 283 | * @note The default is @p TRUE. | ||
| 284 | * @note Requires @p CH_CFG_USE_EVENTS. | ||
| 285 | */ | ||
| 286 | #if !defined(CH_CFG_USE_EVENTS_TIMEOUT) | ||
| 287 | #define CH_CFG_USE_EVENTS_TIMEOUT TRUE | ||
| 288 | #endif | ||
| 289 | |||
| 290 | /** | ||
| 291 | * @brief Synchronous Messages APIs. | ||
| 292 | * @details If enabled then the synchronous messages APIs are included | ||
| 293 | * in the kernel. | ||
| 294 | * | ||
| 295 | * @note The default is @p TRUE. | ||
| 296 | */ | ||
| 297 | #if !defined(CH_CFG_USE_MESSAGES) | ||
| 298 | #define CH_CFG_USE_MESSAGES TRUE | ||
| 299 | #endif | ||
| 300 | |||
| 301 | /** | ||
| 302 | * @brief Synchronous Messages queuing mode. | ||
| 303 | * @details If enabled then messages are served by priority rather than in | ||
| 304 | * FIFO order. | ||
| 305 | * | ||
| 306 | * @note The default is @p FALSE. Enable this if you have special | ||
| 307 | * requirements. | ||
| 308 | * @note Requires @p CH_CFG_USE_MESSAGES. | ||
| 309 | */ | ||
| 310 | #if !defined(CH_CFG_USE_MESSAGES_PRIORITY) | ||
| 311 | #define CH_CFG_USE_MESSAGES_PRIORITY FALSE | ||
| 312 | #endif | ||
| 313 | |||
| 314 | /** | ||
| 315 | * @brief Mailboxes APIs. | ||
| 316 | * @details If enabled then the asynchronous messages (mailboxes) APIs are | ||
| 317 | * included in the kernel. | ||
| 318 | * | ||
| 319 | * @note The default is @p TRUE. | ||
| 320 | * @note Requires @p CH_CFG_USE_SEMAPHORES. | ||
| 321 | */ | ||
| 322 | #if !defined(CH_CFG_USE_MAILBOXES) | ||
| 323 | #define CH_CFG_USE_MAILBOXES TRUE | ||
| 324 | #endif | ||
| 325 | |||
| 326 | /** | ||
| 327 | * @brief Core Memory Manager APIs. | ||
| 328 | * @details If enabled then the core memory manager APIs are included | ||
| 329 | * in the kernel. | ||
| 330 | * | ||
| 331 | * @note The default is @p TRUE. | ||
| 332 | */ | ||
| 333 | #if !defined(CH_CFG_USE_MEMCORE) | ||
| 334 | #define CH_CFG_USE_MEMCORE TRUE | ||
| 335 | #endif | ||
| 336 | |||
| 337 | /** | ||
| 338 | * @brief Heap Allocator APIs. | ||
| 339 | * @details If enabled then the memory heap allocator APIs are included | ||
| 340 | * in the kernel. | ||
| 341 | * | ||
| 342 | * @note The default is @p TRUE. | ||
| 343 | * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or | ||
| 344 | * @p CH_CFG_USE_SEMAPHORES. | ||
| 345 | * @note Mutexes are recommended. | ||
| 346 | */ | ||
| 347 | #if !defined(CH_CFG_USE_HEAP) | ||
| 348 | #define CH_CFG_USE_HEAP TRUE | ||
| 349 | #endif | ||
| 350 | |||
| 351 | /** | ||
| 352 | * @brief Memory Pools Allocator APIs. | ||
| 353 | * @details If enabled then the memory pools allocator APIs are included | ||
| 354 | * in the kernel. | ||
| 355 | * | ||
| 356 | * @note The default is @p TRUE. | ||
| 357 | */ | ||
| 358 | #if !defined(CH_CFG_USE_MEMPOOLS) | ||
| 359 | #define CH_CFG_USE_MEMPOOLS FALSE | ||
| 360 | #endif | ||
| 361 | |||
| 362 | /** | ||
| 363 | * @brief Objects FIFOs APIs. | ||
| 364 | * @details If enabled then the objects FIFOs APIs are included | ||
| 365 | * in the kernel. | ||
| 366 | * | ||
| 367 | * @note The default is @p TRUE. | ||
| 368 | */ | ||
| 369 | #if !defined(CH_CFG_USE_OBJ_FIFOS) | ||
| 370 | #define CH_CFG_USE_OBJ_FIFOS FALSE | ||
| 371 | #endif | ||
| 372 | |||
| 373 | /** | ||
| 374 | * @brief Pipes APIs. | ||
| 375 | * @details If enabled then the pipes APIs are included | ||
| 376 | * in the kernel. | ||
| 377 | * | ||
| 378 | * @note The default is @p TRUE. | ||
| 379 | */ | ||
| 380 | #if !defined(CH_CFG_USE_PIPES) | ||
| 381 | #define CH_CFG_USE_PIPES FALSE | ||
| 382 | #endif | ||
| 383 | |||
| 384 | /** | ||
| 385 | * @brief Dynamic Threads APIs. | ||
| 386 | * @details If enabled then the dynamic threads creation APIs are included | ||
| 387 | * in the kernel. | ||
| 388 | * | ||
| 389 | * @note The default is @p TRUE. | ||
| 390 | * @note Requires @p CH_CFG_USE_WAITEXIT. | ||
| 391 | * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. | ||
| 392 | */ | ||
| 393 | #if !defined(CH_CFG_USE_DYNAMIC) | ||
| 394 | #define CH_CFG_USE_DYNAMIC FALSE | ||
| 395 | #endif | ||
| 396 | |||
| 397 | /** @} */ | ||
| 398 | |||
| 399 | /*===========================================================================*/ | ||
| 400 | /** | ||
| 401 | * @name Objects factory options | ||
| 402 | * @{ | ||
| 403 | */ | ||
| 404 | /*===========================================================================*/ | ||
| 405 | |||
| 406 | /** | ||
| 407 | * @brief Objects Factory APIs. | ||
| 408 | * @details If enabled then the objects factory APIs are included in the | ||
| 409 | * kernel. | ||
| 410 | * | ||
| 411 | * @note The default is @p FALSE. | ||
| 412 | */ | ||
| 413 | #if !defined(CH_CFG_USE_FACTORY) | ||
| 414 | #define CH_CFG_USE_FACTORY FALSE | ||
| 415 | #endif | ||
| 416 | |||
| 417 | /** | ||
| 418 | * @brief Maximum length for object names. | ||
| 419 | * @details If the specified length is zero then the name is stored by | ||
| 420 | * pointer but this could have unintended side effects. | ||
| 421 | */ | ||
| 422 | #if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH) | ||
| 423 | #define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8 | ||
| 424 | #endif | ||
| 425 | |||
| 426 | /** | ||
| 427 | * @brief Enables the registry of generic objects. | ||
| 428 | */ | ||
| 429 | #if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY) | ||
| 430 | #define CH_CFG_FACTORY_OBJECTS_REGISTRY FALSE | ||
| 431 | #endif | ||
| 432 | |||
| 433 | /** | ||
| 434 | * @brief Enables factory for generic buffers. | ||
| 435 | */ | ||
| 436 | #if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS) | ||
| 437 | #define CH_CFG_FACTORY_GENERIC_BUFFERS FALSE | ||
| 438 | #endif | ||
| 439 | |||
| 440 | /** | ||
| 441 | * @brief Enables factory for semaphores. | ||
| 442 | */ | ||
| 443 | #if !defined(CH_CFG_FACTORY_SEMAPHORES) | ||
| 444 | #define CH_CFG_FACTORY_SEMAPHORES FALSE | ||
| 445 | #endif | ||
| 446 | |||
| 447 | /** | ||
| 448 | * @brief Enables factory for mailboxes. | ||
| 449 | */ | ||
| 450 | #if !defined(CH_CFG_FACTORY_MAILBOXES) | ||
| 451 | #define CH_CFG_FACTORY_MAILBOXES FALSE | ||
| 452 | #endif | ||
| 453 | |||
| 454 | /** | ||
| 455 | * @brief Enables factory for objects FIFOs. | ||
| 456 | */ | ||
| 457 | #if !defined(CH_CFG_FACTORY_OBJ_FIFOS) | ||
| 458 | #define CH_CFG_FACTORY_OBJ_FIFOS FALSE | ||
| 459 | #endif | ||
| 460 | |||
| 461 | /** | ||
| 462 | * @brief Enables factory for Pipes. | ||
| 463 | */ | ||
| 464 | #if !defined(CH_CFG_FACTORY_PIPES) || defined(__DOXYGEN__) | ||
| 465 | #define CH_CFG_FACTORY_PIPES FALSE | ||
| 466 | #endif | ||
| 467 | |||
| 468 | /** @} */ | ||
| 469 | |||
| 470 | /*===========================================================================*/ | ||
| 471 | /** | ||
| 472 | * @name Debug options | ||
| 473 | * @{ | ||
| 474 | */ | ||
| 475 | /*===========================================================================*/ | ||
| 476 | |||
| 477 | /** | ||
| 478 | * @brief Debug option, kernel statistics. | ||
| 479 | * | ||
| 480 | * @note The default is @p FALSE. | ||
| 481 | */ | ||
| 482 | #if !defined(CH_DBG_STATISTICS) | ||
| 483 | #define CH_DBG_STATISTICS FALSE | ||
| 484 | #endif | ||
| 485 | |||
| 486 | /** | ||
| 487 | * @brief Debug option, system state check. | ||
| 488 | * @details If enabled the correct call protocol for system APIs is checked | ||
| 489 | * at runtime. | ||
| 490 | * | ||
| 491 | * @note The default is @p FALSE. | ||
| 492 | */ | ||
| 493 | #if !defined(CH_DBG_SYSTEM_STATE_CHECK) | ||
| 494 | #define CH_DBG_SYSTEM_STATE_CHECK FALSE | ||
| 495 | #endif | ||
| 496 | |||
| 497 | /** | ||
| 498 | * @brief Debug option, parameters checks. | ||
| 499 | * @details If enabled then the checks on the API functions input | ||
| 500 | * parameters are activated. | ||
| 501 | * | ||
| 502 | * @note The default is @p FALSE. | ||
| 503 | */ | ||
| 504 | #if !defined(CH_DBG_ENABLE_CHECKS) | ||
| 505 | #define CH_DBG_ENABLE_CHECKS FALSE | ||
| 506 | #endif | ||
| 507 | |||
| 508 | /** | ||
| 509 | * @brief Debug option, consistency checks. | ||
| 510 | * @details If enabled then all the assertions in the kernel code are | ||
| 511 | * activated. This includes consistency checks inside the kernel, | ||
| 512 | * runtime anomalies and port-defined checks. | ||
| 513 | * | ||
| 514 | * @note The default is @p FALSE. | ||
| 515 | */ | ||
| 516 | #if !defined(CH_DBG_ENABLE_ASSERTS) | ||
| 517 | #define CH_DBG_ENABLE_ASSERTS FALSE | ||
| 518 | #endif | ||
| 519 | |||
| 520 | /** | ||
| 521 | * @brief Debug option, trace buffer. | ||
| 522 | * @details If enabled then the trace buffer is activated. | ||
| 523 | * | ||
| 524 | * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. | ||
| 525 | */ | ||
| 526 | #if !defined(CH_DBG_TRACE_MASK) | ||
| 527 | #define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED | ||
| 528 | #endif | ||
| 529 | |||
| 530 | /** | ||
| 531 | * @brief Trace buffer entries. | ||
| 532 | * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is | ||
| 533 | * different from @p CH_DBG_TRACE_MASK_DISABLED. | ||
| 534 | */ | ||
| 535 | #if !defined(CH_DBG_TRACE_BUFFER_SIZE) | ||
| 536 | #define CH_DBG_TRACE_BUFFER_SIZE 128 | ||
| 537 | #endif | ||
| 538 | |||
| 539 | /** | ||
| 540 | * @brief Debug option, stack checks. | ||
| 541 | * @details If enabled then a runtime stack check is performed. | ||
| 542 | * | ||
| 543 | * @note The default is @p FALSE. | ||
| 544 | * @note The stack check is performed in a architecture/port dependent way. | ||
| 545 | * It may not be implemented or some ports. | ||
| 546 | * @note The default failure mode is to halt the system with the global | ||
| 547 | * @p panic_msg variable set to @p NULL. | ||
| 548 | */ | ||
| 549 | #if !defined(CH_DBG_ENABLE_STACK_CHECK) | ||
| 550 | #define CH_DBG_ENABLE_STACK_CHECK FALSE | ||
| 551 | #endif | ||
| 552 | |||
| 553 | /** | ||
| 554 | * @brief Debug option, stacks initialization. | ||
| 555 | * @details If enabled then the threads working area is filled with a byte | ||
| 556 | * value when a thread is created. This can be useful for the | ||
| 557 | * runtime measurement of the used stack. | ||
| 558 | * | ||
| 559 | * @note The default is @p FALSE. | ||
| 560 | */ | ||
| 561 | #if !defined(CH_DBG_FILL_THREADS) | ||
| 562 | #define CH_DBG_FILL_THREADS FALSE | ||
| 563 | #endif | ||
| 564 | |||
| 565 | /** | ||
| 566 | * @brief Debug option, threads profiling. | ||
| 567 | * @details If enabled then a field is added to the @p thread_t structure that | ||
| 568 | * counts the system ticks occurred while executing the thread. | ||
| 569 | * | ||
| 570 | * @note The default is @p FALSE. | ||
| 571 | * @note This debug option is not currently compatible with the | ||
| 572 | * tickless mode. | ||
| 573 | */ | ||
| 574 | #if !defined(CH_DBG_THREADS_PROFILING) | ||
| 575 | #define CH_DBG_THREADS_PROFILING FALSE | ||
| 576 | #endif | ||
| 577 | |||
| 578 | /** @} */ | ||
| 579 | |||
| 580 | /*===========================================================================*/ | ||
| 581 | /** | ||
| 582 | * @name Kernel hooks | ||
| 583 | * @{ | ||
| 584 | */ | ||
| 585 | /*===========================================================================*/ | ||
| 586 | |||
| 587 | /** | ||
| 588 | * @brief System structure extension. | ||
| 589 | * @details User fields added to the end of the @p ch_system_t structure. | ||
| 590 | */ | ||
| 591 | #define CH_CFG_SYSTEM_EXTRA_FIELDS \ | ||
| 592 | /* Add threads custom fields here.*/ | ||
| 593 | |||
| 594 | /** | ||
| 595 | * @brief System initialization hook. | ||
| 596 | * @details User initialization code added to the @p chSysInit() function | ||
| 597 | * just before interrupts are enabled globally. | ||
| 598 | */ | ||
| 599 | #define CH_CFG_SYSTEM_INIT_HOOK() { \ | ||
| 600 | /* Add threads initialization code here.*/ \ | ||
| 601 | } | ||
| 602 | |||
| 603 | /** | ||
| 604 | * @brief Threads descriptor structure extension. | ||
| 605 | * @details User fields added to the end of the @p thread_t structure. | ||
| 606 | */ | ||
| 607 | #define CH_CFG_THREAD_EXTRA_FIELDS \ | ||
| 608 | /* Add threads custom fields here.*/ | ||
| 609 | |||
| 610 | /** | ||
| 611 | * @brief Threads initialization hook. | ||
| 612 | * @details User initialization code added to the @p _thread_init() function. | ||
| 613 | * | ||
| 614 | * @note It is invoked from within @p _thread_init() and implicitly from all | ||
| 615 | * the threads creation APIs. | ||
| 616 | */ | ||
| 617 | #define CH_CFG_THREAD_INIT_HOOK(tp) { \ | ||
| 618 | /* Add threads initialization code here.*/ \ | ||
| 619 | } | ||
| 620 | |||
| 621 | /** | ||
| 622 | * @brief Threads finalization hook. | ||
| 623 | * @details User finalization code added to the @p chThdExit() API. | ||
| 624 | */ | ||
| 625 | #define CH_CFG_THREAD_EXIT_HOOK(tp) { \ | ||
| 626 | /* Add threads finalization code here.*/ \ | ||
| 627 | } | ||
| 628 | |||
| 629 | /** | ||
| 630 | * @brief Context switch hook. | ||
| 631 | * @details This hook is invoked just before switching between threads. | ||
| 632 | */ | ||
| 633 | #define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ | ||
| 634 | /* Context switch code here.*/ \ | ||
| 635 | } | ||
| 636 | |||
| 637 | /** | ||
| 638 | * @brief ISR enter hook. | ||
| 639 | */ | ||
| 640 | #define CH_CFG_IRQ_PROLOGUE_HOOK() { \ | ||
| 641 | /* IRQ prologue code here.*/ \ | ||
| 642 | } | ||
| 643 | |||
| 644 | /** | ||
| 645 | * @brief ISR exit hook. | ||
| 646 | */ | ||
| 647 | #define CH_CFG_IRQ_EPILOGUE_HOOK() { \ | ||
| 648 | /* IRQ epilogue code here.*/ \ | ||
| 649 | } | ||
| 650 | |||
| 651 | /** | ||
| 652 | * @brief Idle thread enter hook. | ||
| 653 | * @note This hook is invoked within a critical zone, no OS functions | ||
| 654 | * should be invoked from here. | ||
| 655 | * @note This macro can be used to activate a power saving mode. | ||
| 656 | */ | ||
| 657 | #define CH_CFG_IDLE_ENTER_HOOK() { \ | ||
| 658 | /* Idle-enter code here.*/ \ | ||
| 659 | } | ||
| 660 | |||
| 661 | /** | ||
| 662 | * @brief Idle thread leave hook. | ||
| 663 | * @note This hook is invoked within a critical zone, no OS functions | ||
| 664 | * should be invoked from here. | ||
| 665 | * @note This macro can be used to deactivate a power saving mode. | ||
| 666 | */ | ||
| 667 | #define CH_CFG_IDLE_LEAVE_HOOK() { \ | ||
| 668 | /* Idle-leave code here.*/ \ | ||
| 669 | } | ||
| 670 | |||
| 671 | /** | ||
| 672 | * @brief Idle Loop hook. | ||
| 673 | * @details This hook is continuously invoked by the idle thread loop. | ||
| 674 | */ | ||
| 675 | #define CH_CFG_IDLE_LOOP_HOOK() { \ | ||
| 676 | /* Idle loop code here.*/ \ | ||
| 677 | } | ||
| 678 | |||
| 679 | /** | ||
| 680 | * @brief System tick event hook. | ||
| 681 | * @details This hook is invoked in the system tick handler immediately | ||
| 682 | * after processing the virtual timers queue. | ||
| 683 | */ | ||
| 684 | #define CH_CFG_SYSTEM_TICK_HOOK() { \ | ||
| 685 | /* System tick event code here.*/ \ | ||
| 686 | } | ||
| 687 | |||
| 688 | /** | ||
| 689 | * @brief System halt hook. | ||
| 690 | * @details This hook is invoked in case to a system halting error before | ||
| 691 | * the system is halted. | ||
| 692 | */ | ||
| 693 | #define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ | ||
| 694 | /* System halt code here.*/ \ | ||
| 695 | } | ||
| 696 | |||
| 697 | /** | ||
| 698 | * @brief Trace hook. | ||
| 699 | * @details This hook is invoked each time a new record is written in the | ||
| 700 | * trace buffer. | ||
| 701 | */ | ||
| 702 | #define CH_CFG_TRACE_HOOK(tep) { \ | ||
| 703 | /* Trace code here.*/ \ | ||
| 704 | } | ||
| 705 | |||
| 706 | /** @} */ | ||
| 707 | |||
| 708 | /*===========================================================================*/ | ||
| 709 | /* Port-specific settings (override port settings defaulted in chcore.h). */ | ||
| 710 | /*===========================================================================*/ | ||
| 711 | |||
| 712 | #endif /* CHCONF_H */ | ||
| 713 | |||
| 714 | /** @} */ | ||
diff --git a/keyboards/sowbug/ansi_tkl/config.h b/keyboards/sowbug/ansi_tkl/config.h new file mode 100644 index 000000000..e2ed0edd8 --- /dev/null +++ b/keyboards/sowbug/ansi_tkl/config.h | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | /* Copyright 2021 Mike Tsao | ||
| 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 | // config.h | ||
| 18 | |||
| 19 | #pragma once | ||
| 20 | |||
| 21 | #include "config_common.h" | ||
| 22 | |||
| 23 | // USB Device descriptor parameters | ||
| 24 | #define VENDOR_ID 0xFEED | ||
| 25 | #define PRODUCT_ID 0x8889 | ||
| 26 | #define DEVICE_VER 0x0001 | ||
| 27 | #define MANUFACTURER github.com/sowbug | ||
| 28 | #define PRODUCT ANSI TKL | ||
| 29 | #define DESCRIPTION A tenkeyless ANSI-layout keyboard | ||
| 30 | |||
| 31 | // key matrix size | ||
| 32 | #define MATRIX_ROWS 6 | ||
| 33 | #define MATRIX_COLS 17 | ||
| 34 | |||
| 35 | // key matrix pins | ||
| 36 | #define MATRIX_ROW_PINS \ | ||
| 37 | { C14, C15, A0, A1, A2, A3 } | ||
| 38 | #define MATRIX_COL_PINS \ | ||
| 39 | { A4, A5, A6, A7, B0, B1, B10, B11, B12, B13, B14, B15, A8, A9, A10, A15, B3 } | ||
| 40 | #define UNUSED_PINS | ||
| 41 | |||
| 42 | // COL2ROW or ROW2COL | ||
| 43 | #define DIODE_DIRECTION COL2ROW | ||
| 44 | |||
| 45 | #define RGB_DI_PIN B9 | ||
| 46 | #define RGB_MATRIX_KEYPRESSES | ||
| 47 | #define DRIVER_LED_TOTAL (87) | ||
| 48 | #define RGBLED_NUM (DRIVER_LED_TOTAL) | ||
| 49 | #define RGB_MATRIX_FRAMEBUFFER_EFFECTS | ||
| 50 | #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 128 | ||
| 51 | |||
| 52 | // Want backlighting and RGB Matrix patterns? See the note in the readme, | ||
| 53 | // apply the patches, and then uncomment the line below as well as the ones | ||
| 54 | // in rules.mk. | ||
| 55 | // | ||
| 56 | // #define BACKLIGHT_PIN rgb_matrix | ||
diff --git a/keyboards/sowbug/ansi_tkl/halconf.h b/keyboards/sowbug/ansi_tkl/halconf.h new file mode 100644 index 000000000..921803762 --- /dev/null +++ b/keyboards/sowbug/ansi_tkl/halconf.h | |||
| @@ -0,0 +1,525 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2018 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 | #define _CHIBIOS_HAL_CONF_ | ||
| 32 | #define _CHIBIOS_HAL_CONF_VER_7_0_ | ||
| 33 | |||
| 34 | #include "mcuconf.h" | ||
| 35 | |||
| 36 | /** | ||
| 37 | * @brief Enables the PAL subsystem. | ||
| 38 | */ | ||
| 39 | #if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) | ||
| 40 | #define HAL_USE_PAL TRUE | ||
| 41 | #endif | ||
| 42 | |||
| 43 | /** | ||
| 44 | * @brief Enables the ADC subsystem. | ||
| 45 | */ | ||
| 46 | #if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) | ||
| 47 | #define HAL_USE_ADC FALSE | ||
| 48 | #endif | ||
| 49 | |||
| 50 | /** | ||
| 51 | * @brief Enables the CAN subsystem. | ||
| 52 | */ | ||
| 53 | #if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) | ||
| 54 | #define HAL_USE_CAN FALSE | ||
| 55 | #endif | ||
| 56 | |||
| 57 | /** | ||
| 58 | * @brief Enables the cryptographic subsystem. | ||
| 59 | */ | ||
| 60 | #if !defined(HAL_USE_CRY) || defined(__DOXYGEN__) | ||
| 61 | #define HAL_USE_CRY FALSE | ||
| 62 | #endif | ||
| 63 | |||
| 64 | /** | ||
| 65 | * @brief Enables the DAC subsystem. | ||
| 66 | */ | ||
| 67 | #if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) | ||
| 68 | #define HAL_USE_DAC FALSE | ||
| 69 | #endif | ||
| 70 | |||
| 71 | /** | ||
| 72 | * @brief Enables the GPT subsystem. | ||
| 73 | */ | ||
| 74 | #if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) | ||
| 75 | #define HAL_USE_GPT FALSE | ||
| 76 | #endif | ||
| 77 | |||
| 78 | /** | ||
| 79 | * @brief Enables the I2C subsystem. | ||
| 80 | */ | ||
| 81 | #if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) | ||
| 82 | #define HAL_USE_I2C FALSE | ||
| 83 | #endif | ||
| 84 | |||
| 85 | /** | ||
| 86 | * @brief Enables the I2S subsystem. | ||
| 87 | */ | ||
| 88 | #if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) | ||
| 89 | #define HAL_USE_I2S FALSE | ||
| 90 | #endif | ||
| 91 | |||
| 92 | /** | ||
| 93 | * @brief Enables the ICU subsystem. | ||
| 94 | */ | ||
| 95 | #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) | ||
| 96 | #define HAL_USE_ICU FALSE | ||
| 97 | #endif | ||
| 98 | |||
| 99 | /** | ||
| 100 | * @brief Enables the MAC subsystem. | ||
| 101 | */ | ||
| 102 | #if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) | ||
| 103 | #define HAL_USE_MAC FALSE | ||
| 104 | #endif | ||
| 105 | |||
| 106 | /** | ||
| 107 | * @brief Enables the MMC_SPI subsystem. | ||
| 108 | */ | ||
| 109 | #if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) | ||
| 110 | #define HAL_USE_MMC_SPI FALSE | ||
| 111 | #endif | ||
| 112 | |||
| 113 | /** | ||
| 114 | * @brief Enables the PWM subsystem. | ||
| 115 | */ | ||
| 116 | #if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) | ||
| 117 | #define HAL_USE_PWM TRUE | ||
| 118 | #endif | ||
| 119 | |||
| 120 | /** | ||
| 121 | * @brief Enables the RTC subsystem. | ||
| 122 | */ | ||
| 123 | #if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) | ||
| 124 | #define HAL_USE_RTC FALSE | ||
| 125 | #endif | ||
| 126 | |||
| 127 | /** | ||
| 128 | * @brief Enables the SDC subsystem. | ||
| 129 | */ | ||
| 130 | #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) | ||
| 131 | #define HAL_USE_SDC FALSE | ||
| 132 | #endif | ||
| 133 | |||
| 134 | /** | ||
| 135 | * @brief Enables the SERIAL subsystem. | ||
| 136 | */ | ||
| 137 | #if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) | ||
| 138 | #define HAL_USE_SERIAL FALSE | ||
| 139 | #endif | ||
| 140 | |||
| 141 | /** | ||
| 142 | * @brief Enables the SERIAL over USB subsystem. | ||
| 143 | */ | ||
| 144 | #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) | ||
| 145 | #define HAL_USE_SERIAL_USB FALSE | ||
| 146 | #endif | ||
| 147 | |||
| 148 | /** | ||
| 149 | * @brief Enables the SIO subsystem. | ||
| 150 | */ | ||
| 151 | #if !defined(HAL_USE_SIO) || defined(__DOXYGEN__) | ||
| 152 | #define HAL_USE_SIO FALSE | ||
| 153 | #endif | ||
| 154 | |||
| 155 | /** | ||
| 156 | * @brief Enables the SPI subsystem. | ||
| 157 | */ | ||
| 158 | #if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) | ||
| 159 | #define HAL_USE_SPI TRUE | ||
| 160 | #endif | ||
| 161 | |||
| 162 | /** | ||
| 163 | * @brief Enables the TRNG subsystem. | ||
| 164 | */ | ||
| 165 | #if !defined(HAL_USE_TRNG) || defined(__DOXYGEN__) | ||
| 166 | #define HAL_USE_TRNG FALSE | ||
| 167 | #endif | ||
| 168 | |||
| 169 | /** | ||
| 170 | * @brief Enables the UART subsystem. | ||
| 171 | */ | ||
| 172 | #if !defined(HAL_USE_UART) || defined(__DOXYGEN__) | ||
| 173 | #define HAL_USE_UART FALSE | ||
| 174 | #endif | ||
| 175 | |||
| 176 | /** | ||
| 177 | * @brief Enables the USB subsystem. | ||
| 178 | */ | ||
| 179 | #if !defined(HAL_USE_USB) || defined(__DOXYGEN__) | ||
| 180 | #define HAL_USE_USB TRUE | ||
| 181 | #endif | ||
| 182 | |||
| 183 | /** | ||
| 184 | * @brief Enables the WDG subsystem. | ||
| 185 | */ | ||
| 186 | #if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) | ||
| 187 | #define HAL_USE_WDG FALSE | ||
| 188 | #endif | ||
| 189 | |||
| 190 | /** | ||
| 191 | * @brief Enables the WSPI subsystem. | ||
| 192 | */ | ||
| 193 | #if !defined(HAL_USE_WSPI) || defined(__DOXYGEN__) | ||
| 194 | #define HAL_USE_WSPI FALSE | ||
| 195 | #endif | ||
| 196 | |||
| 197 | /*===========================================================================*/ | ||
| 198 | /* PAL driver related settings. */ | ||
| 199 | /*===========================================================================*/ | ||
| 200 | |||
| 201 | /** | ||
| 202 | * @brief Enables synchronous APIs. | ||
| 203 | * @note Disabling this option saves both code and data space. | ||
| 204 | */ | ||
| 205 | #if !defined(PAL_USE_CALLBACKS) || defined(__DOXYGEN__) | ||
| 206 | #define PAL_USE_CALLBACKS FALSE | ||
| 207 | #endif | ||
| 208 | |||
| 209 | /** | ||
| 210 | * @brief Enables synchronous APIs. | ||
| 211 | * @note Disabling this option saves both code and data space. | ||
| 212 | */ | ||
| 213 | #if !defined(PAL_USE_WAIT) || defined(__DOXYGEN__) | ||
| 214 | #define PAL_USE_WAIT FALSE | ||
| 215 | #endif | ||
| 216 | |||
| 217 | /*===========================================================================*/ | ||
| 218 | /* ADC driver related settings. */ | ||
| 219 | /*===========================================================================*/ | ||
| 220 | |||
| 221 | /** | ||
| 222 | * @brief Enables synchronous APIs. | ||
| 223 | * @note Disabling this option saves both code and data space. | ||
| 224 | */ | ||
| 225 | #if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) | ||
| 226 | #define ADC_USE_WAIT TRUE | ||
| 227 | #endif | ||
| 228 | |||
| 229 | /** | ||
| 230 | * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. | ||
| 231 | * @note Disabling this option saves both code and data space. | ||
| 232 | */ | ||
| 233 | #if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
| 234 | #define ADC_USE_MUTUAL_EXCLUSION TRUE | ||
| 235 | #endif | ||
| 236 | |||
| 237 | /*===========================================================================*/ | ||
| 238 | /* CAN driver related settings. */ | ||
| 239 | /*===========================================================================*/ | ||
| 240 | |||
| 241 | /** | ||
| 242 | * @brief Sleep mode related APIs inclusion switch. | ||
| 243 | */ | ||
| 244 | #if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) | ||
| 245 | #define CAN_USE_SLEEP_MODE TRUE | ||
| 246 | #endif | ||
| 247 | |||
| 248 | /** | ||
| 249 | * @brief Enforces the driver to use direct callbacks rather than OSAL events. | ||
| 250 | */ | ||
| 251 | #if !defined(CAN_ENFORCE_USE_CALLBACKS) || defined(__DOXYGEN__) | ||
| 252 | #define CAN_ENFORCE_USE_CALLBACKS FALSE | ||
| 253 | #endif | ||
| 254 | |||
| 255 | /*===========================================================================*/ | ||
| 256 | /* CRY driver related settings. */ | ||
| 257 | /*===========================================================================*/ | ||
| 258 | |||
| 259 | /** | ||
| 260 | * @brief Enables the SW fall-back of the cryptographic driver. | ||
| 261 | * @details When enabled, this option, activates a fall-back software | ||
| 262 | * implementation for algorithms not supported by the underlying | ||
| 263 | * hardware. | ||
| 264 | * @note Fall-back implementations may not be present for all algorithms. | ||
| 265 | */ | ||
| 266 | #if !defined(HAL_CRY_USE_FALLBACK) || defined(__DOXYGEN__) | ||
| 267 | #define HAL_CRY_USE_FALLBACK FALSE | ||
| 268 | #endif | ||
| 269 | |||
| 270 | /** | ||
| 271 | * @brief Makes the driver forcibly use the fall-back implementations. | ||
| 272 | */ | ||
| 273 | #if !defined(HAL_CRY_ENFORCE_FALLBACK) || defined(__DOXYGEN__) | ||
| 274 | #define HAL_CRY_ENFORCE_FALLBACK FALSE | ||
| 275 | #endif | ||
| 276 | |||
| 277 | /*===========================================================================*/ | ||
| 278 | /* DAC driver related settings. */ | ||
| 279 | /*===========================================================================*/ | ||
| 280 | |||
| 281 | /** | ||
| 282 | * @brief Enables synchronous APIs. | ||
| 283 | * @note Disabling this option saves both code and data space. | ||
| 284 | */ | ||
| 285 | #if !defined(DAC_USE_WAIT) || defined(__DOXYGEN__) | ||
| 286 | #define DAC_USE_WAIT TRUE | ||
| 287 | #endif | ||
| 288 | |||
| 289 | /** | ||
| 290 | * @brief Enables the @p dacAcquireBus() and @p dacReleaseBus() APIs. | ||
| 291 | * @note Disabling this option saves both code and data space. | ||
| 292 | */ | ||
| 293 | #if !defined(DAC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
| 294 | #define DAC_USE_MUTUAL_EXCLUSION TRUE | ||
| 295 | #endif | ||
| 296 | |||
| 297 | /*===========================================================================*/ | ||
| 298 | /* I2C driver related settings. */ | ||
| 299 | /*===========================================================================*/ | ||
| 300 | |||
| 301 | /** | ||
| 302 | * @brief Enables the mutual exclusion APIs on the I2C bus. | ||
| 303 | */ | ||
| 304 | #if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
| 305 | #define I2C_USE_MUTUAL_EXCLUSION TRUE | ||
| 306 | #endif | ||
| 307 | |||
| 308 | /*===========================================================================*/ | ||
| 309 | /* MAC driver related settings. */ | ||
| 310 | /*===========================================================================*/ | ||
| 311 | |||
| 312 | /** | ||
| 313 | * @brief Enables the zero-copy API. | ||
| 314 | */ | ||
| 315 | #if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) | ||
| 316 | #define MAC_USE_ZERO_COPY FALSE | ||
| 317 | #endif | ||
| 318 | |||
| 319 | /** | ||
| 320 | * @brief Enables an event sources for incoming packets. | ||
| 321 | */ | ||
| 322 | #if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) | ||
| 323 | #define MAC_USE_EVENTS TRUE | ||
| 324 | #endif | ||
| 325 | |||
| 326 | /*===========================================================================*/ | ||
| 327 | /* MMC_SPI driver related settings. */ | ||
| 328 | /*===========================================================================*/ | ||
| 329 | |||
| 330 | /** | ||
| 331 | * @brief Delays insertions. | ||
| 332 | * @details If enabled this options inserts delays into the MMC waiting | ||
| 333 | * routines releasing some extra CPU time for the threads with | ||
| 334 | * lower priority, this may slow down the driver a bit however. | ||
| 335 | * This option is recommended also if the SPI driver does not | ||
| 336 | * use a DMA channel and heavily loads the CPU. | ||
| 337 | */ | ||
| 338 | #if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) | ||
| 339 | #define MMC_NICE_WAITING TRUE | ||
| 340 | #endif | ||
| 341 | |||
| 342 | /*===========================================================================*/ | ||
| 343 | /* SDC driver related settings. */ | ||
| 344 | /*===========================================================================*/ | ||
| 345 | |||
| 346 | /** | ||
| 347 | * @brief Number of initialization attempts before rejecting the card. | ||
| 348 | * @note Attempts are performed at 10mS intervals. | ||
| 349 | */ | ||
| 350 | #if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) | ||
| 351 | #define SDC_INIT_RETRY 100 | ||
| 352 | #endif | ||
| 353 | |||
| 354 | /** | ||
| 355 | * @brief Include support for MMC cards. | ||
| 356 | * @note MMC support is not yet implemented so this option must be kept | ||
| 357 | * at @p FALSE. | ||
| 358 | */ | ||
| 359 | #if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) | ||
| 360 | #define SDC_MMC_SUPPORT FALSE | ||
| 361 | #endif | ||
| 362 | |||
| 363 | /** | ||
| 364 | * @brief Delays insertions. | ||
| 365 | * @details If enabled this options inserts delays into the MMC waiting | ||
| 366 | * routines releasing some extra CPU time for the threads with | ||
| 367 | * lower priority, this may slow down the driver a bit however. | ||
| 368 | */ | ||
| 369 | #if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) | ||
| 370 | #define SDC_NICE_WAITING TRUE | ||
| 371 | #endif | ||
| 372 | |||
| 373 | /** | ||
| 374 | * @brief OCR initialization constant for V20 cards. | ||
| 375 | */ | ||
| 376 | #if !defined(SDC_INIT_OCR_V20) || defined(__DOXYGEN__) | ||
| 377 | #define SDC_INIT_OCR_V20 0x50FF8000U | ||
| 378 | #endif | ||
| 379 | |||
| 380 | /** | ||
| 381 | * @brief OCR initialization constant for non-V20 cards. | ||
| 382 | */ | ||
| 383 | #if !defined(SDC_INIT_OCR) || defined(__DOXYGEN__) | ||
| 384 | #define SDC_INIT_OCR 0x80100000U | ||
| 385 | #endif | ||
| 386 | |||
| 387 | /*===========================================================================*/ | ||
| 388 | /* SERIAL driver related settings. */ | ||
| 389 | /*===========================================================================*/ | ||
| 390 | |||
| 391 | /** | ||
| 392 | * @brief Default bit rate. | ||
| 393 | * @details Configuration parameter, this is the baud rate selected for the | ||
| 394 | * default configuration. | ||
| 395 | */ | ||
| 396 | #if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) | ||
| 397 | #define SERIAL_DEFAULT_BITRATE 38400 | ||
| 398 | #endif | ||
| 399 | |||
| 400 | /** | ||
| 401 | * @brief Serial buffers size. | ||
| 402 | * @details Configuration parameter, you can change the depth of the queue | ||
| 403 | * buffers depending on the requirements of your application. | ||
| 404 | * @note The default is 16 bytes for both the transmission and receive | ||
| 405 | * buffers. | ||
| 406 | */ | ||
| 407 | #if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) | ||
| 408 | #define SERIAL_BUFFERS_SIZE 16 | ||
| 409 | #endif | ||
| 410 | |||
| 411 | /*===========================================================================*/ | ||
| 412 | /* SERIAL_USB driver related setting. */ | ||
| 413 | /*===========================================================================*/ | ||
| 414 | |||
| 415 | /** | ||
| 416 | * @brief Serial over USB buffers size. | ||
| 417 | * @details Configuration parameter, the buffer size must be a multiple of | ||
| 418 | * the USB data endpoint maximum packet size. | ||
| 419 | * @note The default is 256 bytes for both the transmission and receive | ||
| 420 | * buffers. | ||
| 421 | */ | ||
| 422 | #if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) | ||
| 423 | #define SERIAL_USB_BUFFERS_SIZE 1 | ||
| 424 | #endif | ||
| 425 | |||
| 426 | /** | ||
| 427 | * @brief Serial over USB number of buffers. | ||
| 428 | * @note The default is 2 buffers. | ||
| 429 | */ | ||
| 430 | #if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) | ||
| 431 | #define SERIAL_USB_BUFFERS_NUMBER 2 | ||
| 432 | #endif | ||
| 433 | |||
| 434 | /*===========================================================================*/ | ||
| 435 | /* SPI driver related settings. */ | ||
| 436 | /*===========================================================================*/ | ||
| 437 | |||
| 438 | /** | ||
| 439 | * @brief Enables synchronous APIs. | ||
| 440 | * @note Disabling this option saves both code and data space. | ||
| 441 | */ | ||
| 442 | #if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) | ||
| 443 | #define SPI_USE_WAIT TRUE | ||
| 444 | #endif | ||
| 445 | |||
| 446 | /** | ||
| 447 | * @brief Enables circular transfers APIs. | ||
| 448 | * @note Disabling this option saves both code and data space. | ||
| 449 | */ | ||
| 450 | #if !defined(SPI_USE_CIRCULAR) || defined(__DOXYGEN__) | ||
| 451 | #define SPI_USE_CIRCULAR FALSE | ||
| 452 | #endif | ||
| 453 | |||
| 454 | |||
| 455 | /** | ||
| 456 | * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. | ||
| 457 | * @note Disabling this option saves both code and data space. | ||
| 458 | */ | ||
| 459 | #if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
| 460 | #define SPI_USE_MUTUAL_EXCLUSION TRUE | ||
| 461 | #endif | ||
| 462 | |||
| 463 | /** | ||
| 464 | * @brief Handling method for SPI CS line. | ||
| 465 | * @note Disabling this option saves both code and data space. | ||
| 466 | */ | ||
| 467 | #if !defined(SPI_SELECT_MODE) || defined(__DOXYGEN__) | ||
| 468 | #define SPI_SELECT_MODE SPI_SELECT_MODE_PAD | ||
| 469 | #endif | ||
| 470 | |||
| 471 | /*===========================================================================*/ | ||
| 472 | /* UART driver related settings. */ | ||
| 473 | /*===========================================================================*/ | ||
| 474 | |||
| 475 | /** | ||
| 476 | * @brief Enables synchronous APIs. | ||
| 477 | * @note Disabling this option saves both code and data space. | ||
| 478 | */ | ||
| 479 | #if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) | ||
| 480 | #define UART_USE_WAIT FALSE | ||
| 481 | #endif | ||
| 482 | |||
| 483 | /** | ||
| 484 | * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. | ||
| 485 | * @note Disabling this option saves both code and data space. | ||
| 486 | */ | ||
| 487 | #if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
| 488 | #define UART_USE_MUTUAL_EXCLUSION FALSE | ||
| 489 | #endif | ||
| 490 | |||
| 491 | /*===========================================================================*/ | ||
| 492 | /* USB driver related settings. */ | ||
| 493 | /*===========================================================================*/ | ||
| 494 | |||
| 495 | /** | ||
| 496 | * @brief Enables synchronous APIs. | ||
| 497 | * @note Disabling this option saves both code and data space. | ||
| 498 | */ | ||
| 499 | #if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) | ||
| 500 | #define USB_USE_WAIT TRUE | ||
| 501 | #endif | ||
| 502 | |||
| 503 | /*===========================================================================*/ | ||
| 504 | /* WSPI driver related settings. */ | ||
| 505 | /*===========================================================================*/ | ||
| 506 | |||
| 507 | /** | ||
| 508 | * @brief Enables synchronous APIs. | ||
| 509 | * @note Disabling this option saves both code and data space. | ||
| 510 | */ | ||
| 511 | #if !defined(WSPI_USE_WAIT) || defined(__DOXYGEN__) | ||
| 512 | #define WSPI_USE_WAIT TRUE | ||
| 513 | #endif | ||
| 514 | |||
| 515 | /** | ||
| 516 | * @brief Enables the @p wspiAcquireBus() and @p wspiReleaseBus() APIs. | ||
| 517 | * @note Disabling this option saves both code and data space. | ||
| 518 | */ | ||
| 519 | #if !defined(WSPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
| 520 | #define WSPI_USE_MUTUAL_EXCLUSION TRUE | ||
| 521 | #endif | ||
| 522 | |||
| 523 | #endif /* HALCONF_H */ | ||
| 524 | |||
| 525 | /** @} */ | ||
diff --git a/keyboards/sowbug/ansi_tkl/info.json b/keyboards/sowbug/ansi_tkl/info.json new file mode 100644 index 000000000..301040c25 --- /dev/null +++ b/keyboards/sowbug/ansi_tkl/info.json | |||
| @@ -0,0 +1,101 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "ansi_tkl", | ||
| 3 | "url": "github.com/sowbug", | ||
| 4 | "maintainer": "sowbug", | ||
| 5 | "width": 18.25, | ||
| 6 | "height": 6.5, | ||
| 7 | "layouts": { | ||
| 8 | "LAYOUT": { | ||
| 9 | "layout": [ | ||
| 10 | {"label":"K00", "x":0, "y":0}, | ||
| 11 | {"label":"K02", "x":2, "y":0}, | ||
| 12 | {"label":"K03", "x":3, "y":0}, | ||
| 13 | {"label":"K04", "x":4, "y":0}, | ||
| 14 | {"label":"K05", "x":5, "y":0}, | ||
| 15 | {"label":"K07", "x":6.5, "y":0}, | ||
| 16 | {"label":"K08", "x":7.5, "y":0}, | ||
| 17 | {"label":"K09", "x":8.5, "y":0}, | ||
| 18 | {"label":"K0A", "x":9.5, "y":0}, | ||
| 19 | {"label":"K0B", "x":11, "y":0}, | ||
| 20 | {"label":"K0C", "x":12, "y":0}, | ||
| 21 | {"label":"K0D", "x":13, "y":0}, | ||
| 22 | {"label":"K0E", "x":14, "y":0}, | ||
| 23 | {"label":"K0F", "x":15.25, "y":0}, | ||
| 24 | {"label":"K0G", "x":16.25, "y":0}, | ||
| 25 | {"label":"K0H", "x":17.25, "y":0}, | ||
| 26 | {"label":"K20", "x":0, "y":1.5}, | ||
| 27 | {"label":"K21", "x":1, "y":1.5}, | ||
| 28 | {"label":"K22", "x":2, "y":1.5}, | ||
| 29 | {"label":"K23", "x":3, "y":1.5}, | ||
| 30 | {"label":"K24", "x":4, "y":1.5}, | ||
| 31 | {"label":"K25", "x":5, "y":1.5}, | ||
| 32 | {"label":"K26", "x":6, "y":1.5}, | ||
| 33 | {"label":"K27", "x":7, "y":1.5}, | ||
| 34 | {"label":"K28", "x":8, "y":1.5}, | ||
| 35 | {"label":"K29", "x":9, "y":1.5}, | ||
| 36 | {"label":"K2A", "x":10, "y":1.5}, | ||
| 37 | {"label":"K2B", "x":11, "y":1.5}, | ||
| 38 | {"label":"K2C", "x":12, "y":1.5}, | ||
| 39 | {"label":"K2E", "x":13, "y":1.5, "w":2}, | ||
| 40 | {"label":"K2F", "x":15.25, "y":1.5}, | ||
| 41 | {"label":"K2G", "x":16.25, "y":1.5}, | ||
| 42 | {"label":"K2H", "x":17.25, "y":1.5}, | ||
| 43 | {"label":"K30", "x":0, "y":2.5, "w":1.5}, | ||
| 44 | {"label":"K32", "x":1.5, "y":2.5}, | ||
| 45 | {"label":"K33", "x":2.5, "y":2.5}, | ||
| 46 | {"label":"K34", "x":3.5, "y":2.5}, | ||
| 47 | {"label":"K35", "x":4.5, "y":2.5}, | ||
| 48 | {"label":"K36", "x":5.5, "y":2.5}, | ||
| 49 | {"label":"K37", "x":6.5, "y":2.5}, | ||
| 50 | {"label":"K38", "x":7.5, "y":2.5}, | ||
| 51 | {"label":"K39", "x":8.5, "y":2.5}, | ||
| 52 | {"label":"K3A", "x":9.5, "y":2.5}, | ||
| 53 | {"label":"K3B", "x":10.5, "y":2.5}, | ||
| 54 | {"label":"K3C", "x":11.5, "y":2.5}, | ||
| 55 | {"label":"K3D", "x":12.5, "y":2.5}, | ||
| 56 | {"label":"K3E", "x":13.5, "y":2.5, "w":1.5}, | ||
| 57 | {"label":"K3F", "x":15.25, "y":2.5}, | ||
| 58 | {"label":"K3G", "x":16.25, "y":2.5}, | ||
| 59 | {"label":"K3H", "x":17.25, "y":2.5}, | ||
| 60 | {"label":"K40", "x":0, "y":3.5, "w":1.75}, | ||
| 61 | {"label":"K42", "x":1.75, "y":3.5}, | ||
| 62 | {"label":"K43", "x":2.75, "y":3.5}, | ||
| 63 | {"label":"K44", "x":3.75, "y":3.5}, | ||
| 64 | {"label":"K45", "x":4.75, "y":3.5}, | ||
| 65 | {"label":"K46", "x":5.75, "y":3.5}, | ||
| 66 | {"label":"K47", "x":6.75, "y":3.5}, | ||
| 67 | {"label":"K48", "x":7.75, "y":3.5}, | ||
| 68 | {"label":"K49", "x":8.75, "y":3.5}, | ||
| 69 | {"label":"K4A", "x":9.75, "y":3.5}, | ||
| 70 | {"label":"K4B", "x":10.75, "y":3.5}, | ||
| 71 | {"label":"K4C", "x":11.75, "y":3.5}, | ||
| 72 | {"label":"K4D", "x":12.75, "y":3.5, "w":2.25}, | ||
| 73 | {"label":"K51", "x":0, "y":4.5, "w":2.25}, | ||
| 74 | {"label":"K52", "x":2.25, "y":4.5}, | ||
| 75 | {"label":"K53", "x":3.25, "y":4.5}, | ||
| 76 | {"label":"K54", "x":4.25, "y":4.5}, | ||
| 77 | {"label":"K55", "x":5.25, "y":4.5}, | ||
| 78 | {"label":"K56", "x":6.25, "y":4.5}, | ||
| 79 | {"label":"K57", "x":7.25, "y":4.5}, | ||
| 80 | {"label":"K58", "x":8.25, "y":4.5}, | ||
| 81 | {"label":"K59", "x":9.25, "y":4.5}, | ||
| 82 | {"label":"K5A", "x":10.25, "y":4.5}, | ||
| 83 | {"label":"K5B", "x":11.25, "y":4.5}, | ||
| 84 | {"label":"K5D", "x":12.25, "y":4.5, "w":2.75}, | ||
| 85 | {"label":"K5G", "x":16.25, "y":4.5}, | ||
| 86 | {"label":"K60", "x":0, "y":5.5, "w":1.25}, | ||
| 87 | {"label":"K61", "x":1.25, "y":5.5, "w":1.25}, | ||
| 88 | {"label":"K63", "x":2.5, "y":5.5, "w":1.25}, | ||
| 89 | {"label":"K66", "x":3.75, "y":5.5, "w":6.25}, | ||
| 90 | {"label":"K6A", "x":10, "y":5.5, "w":1.25}, | ||
| 91 | {"label":"K6B", "x":11.25, "y":5.5, "w":1.25}, | ||
| 92 | {"label":"K6D", "x":12.5, "y":5.5, "w":1.25}, | ||
| 93 | {"label":"K6E", "x":13.75, "y":5.5, "w":1.25}, | ||
| 94 | {"label":"K6F", "x":15.25, "y":5.5}, | ||
| 95 | {"label":"K6G", "x":16.25, "y":5.5}, | ||
| 96 | {"label":"K6H", "x":17.25, "y":5.5} | ||
| 97 | ] | ||
| 98 | } | ||
| 99 | } | ||
| 100 | ,"meta": "https://noroadsleft.github.io/kbf_qmk_converter/" | ||
| 101 | } | ||
diff --git a/keyboards/sowbug/ansi_tkl/keymaps/default/keymap.c b/keyboards/sowbug/ansi_tkl/keymaps/default/keymap.c new file mode 100644 index 000000000..b7344b5b4 --- /dev/null +++ b/keyboards/sowbug/ansi_tkl/keymaps/default/keymap.c | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | /* Copyright 2021 Mike Tsao | ||
| 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 | // keymaps/default/keymap.c | ||
| 18 | |||
| 19 | #include QMK_KEYBOARD_H | ||
| 20 | |||
| 21 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 22 | [0] = LAYOUT( | ||
| 23 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ | ||
| 24 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ | ||
| 25 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ | ||
| 26 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ | ||
| 27 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ | ||
| 28 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RCTL, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ | ||
| 29 | ), | ||
| 30 | [1] = LAYOUT( | ||
| 31 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, RESET , \ | ||
| 32 | _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \ | ||
| 33 | _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ | ||
| 34 | _______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 35 | _______, RGB_TOG, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, \ | ||
| 36 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ | ||
| 37 | ), | ||
| 38 | /* | ||
| 39 | [X] = LAYOUT( | ||
| 40 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 41 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 42 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 43 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 44 | _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, \ | ||
| 45 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ | ||
| 46 | ), | ||
| 47 | */ | ||
| 48 | }; | ||
diff --git a/keyboards/sowbug/ansi_tkl/mcuconf.h b/keyboards/sowbug/ansi_tkl/mcuconf.h new file mode 100644 index 000000000..fced27289 --- /dev/null +++ b/keyboards/sowbug/ansi_tkl/mcuconf.h | |||
| @@ -0,0 +1,209 @@ | |||
| 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 TRUE | ||
| 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 TRUE | ||
| 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/sowbug/ansi_tkl/readme.md b/keyboards/sowbug/ansi_tkl/readme.md new file mode 100644 index 000000000..50238aa7c --- /dev/null +++ b/keyboards/sowbug/ansi_tkl/readme.md | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | # ansi-tkl | ||
| 2 | |||
| 3 | A tenkeyless ANSI-layout keyboard with per-key RGB, Kailh hotswap sockets, and | ||
| 4 | USB-C. Uses Blue Pill. Generated by | ||
| 5 | [Keycad](https://github.com/sowbug/keycad/). | ||
| 6 | |||
| 7 | ## A note about backlighting | ||
| 8 | |||
| 9 | See the note about backlighting for sowbug/68keys. | ||
| 10 | |||
| 11 | ## Building and flashing | ||
| 12 | |||
| 13 | `qmk flash -kb sowbug/ansi_tkl -km default` | ||
diff --git a/keyboards/sowbug/ansi_tkl/rules.mk b/keyboards/sowbug/ansi_tkl/rules.mk new file mode 100644 index 000000000..414140c5e --- /dev/null +++ b/keyboards/sowbug/ansi_tkl/rules.mk | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = STM32F103 | ||
| 3 | |||
| 4 | # GENERIC STM32F103C8T6 board - stm32duino bootloader | ||
| 5 | OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000 | ||
| 6 | MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader | ||
| 7 | BOARD = STM32_F103_STM32DUINO | ||
| 8 | |||
| 9 | DFU_ARGS = -d 1eaf:0003 -a2 -R | ||
| 10 | DFU_SUFFIX_ARGS = -v 1eaf -p 0003 | ||
| 11 | |||
| 12 | # Build Options | ||
| 13 | # comment out to disable the options. | ||
| 14 | # | ||
| 15 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration | ||
| 16 | MOUSEKEY_ENABLE = yes # Mouse keys | ||
| 17 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
| 18 | CONSOLE_ENABLE = no | ||
| 19 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 20 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 21 | NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 22 | AUDIO_ENABLE = no | ||
| 23 | RGB_MATRIX_ENABLE = yes | ||
| 24 | RGB_MATRIX_DRIVER = WS2812 | ||
| 25 | |||
| 26 | # Want backlighting and RGB Matrix patterns? See the note in the readme, | ||
| 27 | # apply the patches, and then uncomment the lines below as well as the one in | ||
| 28 | # config.h. | ||
| 29 | # | ||
| 30 | # BACKLIGHT_ENABLE = yes | ||
| 31 | # BACKLIGHT_DRIVER = rgb_matrix | ||
| 32 | |||
| 33 | # Enter lower-power sleep mode when on the ChibiOS idle thread | ||
| 34 | OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE | ||
