|
| 1 | +/***************************************************************************//** |
| 2 | + * @file |
| 3 | + * @brief KEYSCAN driver configuration. |
| 4 | + ******************************************************************************* |
| 5 | + * # License |
| 6 | + * <b>Copyright 2018 Silicon Laboratories Inc. www.silabs.com</b> |
| 7 | + ******************************************************************************* |
| 8 | + * |
| 9 | + * SPDX-License-Identifier: Zlib |
| 10 | + * |
| 11 | + * The licensor of this software is Silicon Laboratories Inc. |
| 12 | + * |
| 13 | + * This software is provided 'as-is', without any express or implied |
| 14 | + * warranty. In no event will the authors be held liable for any damages |
| 15 | + * arising from the use of this software. |
| 16 | + * |
| 17 | + * Permission is granted to anyone to use this software for any purpose, |
| 18 | + * including commercial applications, and to alter it and redistribute it |
| 19 | + * freely, subject to the following restrictions: |
| 20 | + * |
| 21 | + * 1. The origin of this software must not be misrepresented; you must not |
| 22 | + * claim that you wrote the original software. If you use this software |
| 23 | + * in a product, an acknowledgment in the product documentation would be |
| 24 | + * appreciated but is not required. |
| 25 | + * 2. Altered source versions must be plainly marked as such, and must not be |
| 26 | + * misrepresented as being the original software. |
| 27 | + * 3. This notice may not be removed or altered from any source distribution. |
| 28 | + * |
| 29 | + ******************************************************************************/ |
| 30 | + |
| 31 | +// <<< Use Configuration Wizard in Context Menu >>> |
| 32 | +#ifndef KEYSCAN_DRIVER_CONFIG_H |
| 33 | +#define KEYSCAN_DRIVER_CONFIG_H |
| 34 | + |
| 35 | +// <o SL_KEYSCAN_DRIVER_COLUMN_NUMBER> Number of columns in keyscan <1-8> |
| 36 | +// <i> Default: 1 |
| 37 | +#define SL_KEYSCAN_DRIVER_COLUMN_NUMBER 4 |
| 38 | + |
| 39 | +// <o SL_KEYSCAN_DRIVER_ROW_NUMBER> Number of rows in keyscan <3-6> |
| 40 | +// <i> Default: 3 |
| 41 | +#define SL_KEYSCAN_DRIVER_ROW_NUMBER 3 |
| 42 | + |
| 43 | +// <o SL_KEYSCAN_DRIVER_SCAN_DELAY_MS> Scan Delay |
| 44 | +// <SL_HAL_KEYSCAN_DELAY_2MS=> 2ms |
| 45 | +// <SL_HAL_KEYSCAN_DELAY_4MS=> 4ms |
| 46 | +// <SL_HAL_KEYSCAN_DELAY_6MS=> 6ms |
| 47 | +// <SL_HAL_KEYSCAN_DELAY_8MS=> 8ms |
| 48 | +// <SL_HAL_KEYSCAN_DELAY_10MS=> 10ms |
| 49 | +// <SL_HAL_KEYSCAN_DELAY_12MS=> 12ms |
| 50 | +// <SL_HAL_KEYSCAN_DELAY_14MS=> 14ms |
| 51 | +// <SL_HAL_KEYSCAN_DELAY_16MS=> 16ms |
| 52 | +// <SL_HAL_KEYSCAN_DELAY_18MS=> 18ms |
| 53 | +// <SL_HAL_KEYSCAN_DELAY_20MS=> 20ms |
| 54 | +// <SL_HAL_KEYSCAN_DELAY_22MS=> 22ms |
| 55 | +// <SL_HAL_KEYSCAN_DELAY_24MS=> 24ms |
| 56 | +// <SL_HAL_KEYSCAN_DELAY_26MS=> 26ms |
| 57 | +// <SL_HAL_KEYSCAN_DELAY_28MS=> 28ms |
| 58 | +// <SL_HAL_KEYSCAN_DELAY_30MS=> 30ms |
| 59 | +// <SL_HAL_KEYSCAN_DELAY_32MS=> 32ms |
| 60 | +// <i> Duration of the scan period per column |
| 61 | +// <i> Default: SL_HAL_KEYSCAN_DELAY_2MS |
| 62 | +#define SL_KEYSCAN_DRIVER_SCAN_DELAY_MS SL_HAL_KEYSCAN_DELAY_2MS |
| 63 | + |
| 64 | +// <o SL_KEYSCAN_DRIVER_DEBOUNCE_DELAY_MS> Debounce Delay |
| 65 | +// <SL_HAL_KEYSCAN_DELAY_2MS=> 2ms |
| 66 | +// <SL_HAL_KEYSCAN_DELAY_4MS=> 4ms |
| 67 | +// <SL_HAL_KEYSCAN_DELAY_6MS=> 6ms |
| 68 | +// <SL_HAL_KEYSCAN_DELAY_8MS=> 8ms |
| 69 | +// <SL_HAL_KEYSCAN_DELAY_10MS=> 10ms |
| 70 | +// <SL_HAL_KEYSCAN_DELAY_12MS=> 12ms |
| 71 | +// <SL_HAL_KEYSCAN_DELAY_14MS=> 14ms |
| 72 | +// <SL_HAL_KEYSCAN_DELAY_16MS=> 16ms |
| 73 | +// <SL_HAL_KEYSCAN_DELAY_18MS=> 18ms |
| 74 | +// <SL_HAL_KEYSCAN_DELAY_20MS=> 20ms |
| 75 | +// <SL_HAL_KEYSCAN_DELAY_22MS=> 22ms |
| 76 | +// <SL_HAL_KEYSCAN_DELAY_24MS=> 24ms |
| 77 | +// <SL_HAL_KEYSCAN_DELAY_26MS=> 26ms |
| 78 | +// <SL_HAL_KEYSCAN_DELAY_28MS=> 28ms |
| 79 | +// <SL_HAL_KEYSCAN_DELAY_30MS=> 30ms |
| 80 | +// <SL_HAL_KEYSCAN_DELAY_32MS=> 32ms |
| 81 | +// <i> Duration of debounce period once a key press is detected. |
| 82 | +// <i> Default: SL_HAL_KEYSCAN_DELAY_2MS |
| 83 | +#define SL_KEYSCAN_DRIVER_DEBOUNCE_DELAY_MS SL_HAL_KEYSCAN_DELAY_2MS |
| 84 | + |
| 85 | +// <o SL_KEYSCAN_DRIVER_STABLE_DELAY_MS> Stable Delay |
| 86 | +// <SL_HAL_KEYSCAN_DELAY_2MS=> 2ms |
| 87 | +// <SL_HAL_KEYSCAN_DELAY_4MS=> 4ms |
| 88 | +// <SL_HAL_KEYSCAN_DELAY_6MS=> 6ms |
| 89 | +// <SL_HAL_KEYSCAN_DELAY_8MS=> 8ms |
| 90 | +// <SL_HAL_KEYSCAN_DELAY_10MS=> 10ms |
| 91 | +// <SL_HAL_KEYSCAN_DELAY_12MS=> 12ms |
| 92 | +// <SL_HAL_KEYSCAN_DELAY_14MS=> 14ms |
| 93 | +// <SL_HAL_KEYSCAN_DELAY_16MS=> 16ms |
| 94 | +// <SL_HAL_KEYSCAN_DELAY_18MS=> 18ms |
| 95 | +// <SL_HAL_KEYSCAN_DELAY_20MS=> 20ms |
| 96 | +// <SL_HAL_KEYSCAN_DELAY_22MS=> 22ms |
| 97 | +// <SL_HAL_KEYSCAN_DELAY_24MS=> 24ms |
| 98 | +// <SL_HAL_KEYSCAN_DELAY_26MS=> 26ms |
| 99 | +// <SL_HAL_KEYSCAN_DELAY_28MS=> 28ms |
| 100 | +// <SL_HAL_KEYSCAN_DELAY_30MS=> 30ms |
| 101 | +// <SL_HAL_KEYSCAN_DELAY_32MS=> 32ms |
| 102 | +// <i> Duration of the stable period after the debounce stage. |
| 103 | +// <i> Default: SL_HAL_KEYSCAN_DELAY_2MS |
| 104 | +#define SL_KEYSCAN_DRIVER_STABLE_DELAY_MS SL_HAL_KEYSCAN_DELAY_2MS |
| 105 | + |
| 106 | +// <q SL_KEYSCAN_DRIVER_SINGLEPRESS> keyscan single-press functionality |
| 107 | +// <i> Enable or disable single-press functionality. |
| 108 | +// <i> Default: 0 |
| 109 | +#define SL_KEYSCAN_DRIVER_SINGLEPRESS 1 |
| 110 | + |
| 111 | +// <<< end of configuration section >>> |
| 112 | + |
| 113 | +// <<< sl:start pin_tool >>> |
| 114 | +// <keyscan |
| 115 | +// signal=COL_OUT_0,(COL_OUT_1),(COL_OUT_2),(COL_OUT_3),(COL_OUT_4),(COL_OUT_5),(COL_OUT_6),(COL_OUT_7),ROW_SENSE_0,ROW_SENSE_1,ROW_SENSE_2,(ROW_SENSE_3),(ROW_SENSE_4),(ROW_SENSE_5)> |
| 116 | +// SL_KEYSCAN_DRIVER_KEYSCAN |
| 117 | +// $[KEYSCAN_SL_KEYSCAN_DRIVER_KEYSCAN] |
| 118 | +#ifndef SL_KEYSCAN_DRIVER_KEYSCAN_PERIPHERAL |
| 119 | +#define SL_KEYSCAN_DRIVER_KEYSCAN_PERIPHERAL KEYSCAN |
| 120 | +#endif |
| 121 | + |
| 122 | +// KEYSCAN COL_OUT_0 on PA00 |
| 123 | +#ifndef SL_KEYSCAN_DRIVER_KEYSCAN_COL_OUT_0_PORT |
| 124 | +#define SL_KEYSCAN_DRIVER_KEYSCAN_COL_OUT_0_PORT gpioPortA |
| 125 | +#endif |
| 126 | +#ifndef SL_KEYSCAN_DRIVER_KEYSCAN_COL_OUT_0_PIN |
| 127 | +#define SL_KEYSCAN_DRIVER_KEYSCAN_COL_OUT_0_PIN 0 |
| 128 | +#endif |
| 129 | + |
| 130 | +// KEYSCAN COL_OUT_1 on PB05 |
| 131 | +#ifndef SL_KEYSCAN_DRIVER_KEYSCAN_COL_OUT_1_PORT |
| 132 | +#define SL_KEYSCAN_DRIVER_KEYSCAN_COL_OUT_1_PORT gpioPortB |
| 133 | +#endif |
| 134 | +#ifndef SL_KEYSCAN_DRIVER_KEYSCAN_COL_OUT_1_PIN |
| 135 | +#define SL_KEYSCAN_DRIVER_KEYSCAN_COL_OUT_1_PIN 5 |
| 136 | +#endif |
| 137 | + |
| 138 | +// KEYSCAN COL_OUT_2 on PC05 |
| 139 | +#ifndef SL_KEYSCAN_DRIVER_KEYSCAN_COL_OUT_2_PORT |
| 140 | +#define SL_KEYSCAN_DRIVER_KEYSCAN_COL_OUT_2_PORT gpioPortC |
| 141 | +#endif |
| 142 | +#ifndef SL_KEYSCAN_DRIVER_KEYSCAN_COL_OUT_2_PIN |
| 143 | +#define SL_KEYSCAN_DRIVER_KEYSCAN_COL_OUT_2_PIN 5 |
| 144 | +#endif |
| 145 | + |
| 146 | +// KEYSCAN COL_OUT_3 on PC07 |
| 147 | +#ifndef SL_KEYSCAN_DRIVER_KEYSCAN_COL_OUT_3_PORT |
| 148 | +#define SL_KEYSCAN_DRIVER_KEYSCAN_COL_OUT_3_PORT gpioPortC |
| 149 | +#endif |
| 150 | +#ifndef SL_KEYSCAN_DRIVER_KEYSCAN_COL_OUT_3_PIN |
| 151 | +#define SL_KEYSCAN_DRIVER_KEYSCAN_COL_OUT_3_PIN 7 |
| 152 | +#endif |
| 153 | + |
| 154 | +// KEYSCAN ROW_SENSE_0 on PA05 |
| 155 | +#ifndef SL_KEYSCAN_DRIVER_KEYSCAN_ROW_SENSE_0_PORT |
| 156 | +#define SL_KEYSCAN_DRIVER_KEYSCAN_ROW_SENSE_0_PORT gpioPortA |
| 157 | +#endif |
| 158 | +#ifndef SL_KEYSCAN_DRIVER_KEYSCAN_ROW_SENSE_0_PIN |
| 159 | +#define SL_KEYSCAN_DRIVER_KEYSCAN_ROW_SENSE_0_PIN 5 |
| 160 | +#endif |
| 161 | + |
| 162 | +// KEYSCAN ROW_SENSE_1 on PA06 |
| 163 | +#ifndef SL_KEYSCAN_DRIVER_KEYSCAN_ROW_SENSE_1_PORT |
| 164 | +#define SL_KEYSCAN_DRIVER_KEYSCAN_ROW_SENSE_1_PORT gpioPortA |
| 165 | +#endif |
| 166 | +#ifndef SL_KEYSCAN_DRIVER_KEYSCAN_ROW_SENSE_1_PIN |
| 167 | +#define SL_KEYSCAN_DRIVER_KEYSCAN_ROW_SENSE_1_PIN 6 |
| 168 | +#endif |
| 169 | + |
| 170 | +// KEYSCAN ROW_SENSE_2 on PA07 |
| 171 | +#ifndef SL_KEYSCAN_DRIVER_KEYSCAN_ROW_SENSE_2_PORT |
| 172 | +#define SL_KEYSCAN_DRIVER_KEYSCAN_ROW_SENSE_2_PORT gpioPortA |
| 173 | +#endif |
| 174 | +#ifndef SL_KEYSCAN_DRIVER_KEYSCAN_ROW_SENSE_2_PIN |
| 175 | +#define SL_KEYSCAN_DRIVER_KEYSCAN_ROW_SENSE_2_PIN 7 |
| 176 | +#endif |
| 177 | + |
| 178 | +// [KEYSCAN_SL_KEYSCAN_DRIVER_KEYSCAN]$ |
| 179 | +// <<< sl:end pin_tool >>> |
| 180 | + |
| 181 | +#endif /* KEYSCAN_DRIVER_CONFIG_H */ |
0 commit comments