]> git.gir.st - tmk_keyboard.git/blob - keyboard/kl27z_kbd/mcuconf.h
remove experimental return, cleanup slash_question key
[tmk_keyboard.git] / keyboard / kl27z_kbd / mcuconf.h
1 /*
2 ChibiOS - (C) 2015-2016 flabbergast <s3+flabbergast@sdfeu.org>
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 */
16
17 #ifndef _MCUCONF_H_
18 #define _MCUCONF_H_
19
20 #define KL2x_MCUCONF
21
22 /*
23 * HAL driver system settings.
24 */
25 #if 1
26 /* High-frequency internal RC, 48MHz, possible USB clock recovery */
27 #define KINETIS_MCGLITE_MODE KINETIS_MCGLITE_MODE_HIRC
28 #define KINETIS_SYSCLK_FREQUENCY 48000000UL
29 #define KINETIS_CLKDIV1_OUTDIV1 1
30 #endif
31
32 #if 0
33 /* Low-frequency internal RC, 8 MHz mode */
34 #define KINETIS_MCGLITE_MODE KINETIS_MCGLITE_MODE_LIRC8M
35 #define KINETIS_SYSCLK_FREQUENCY 8000000UL
36 #define KINETIS_CLKDIV1_OUTDIV1 1
37 #endif
38
39 /*
40 * SERIAL driver system settings.
41 */
42 #define KINETIS_SERIAL_USE_UART0 TRUE
43
44 /*
45 * USB driver settings
46 */
47 #define KINETIS_USB_USE_USB0 TRUE
48 /* need to redefine this, since the default is for K20x */
49 #define KINETIS_USB_USB0_IRQ_PRIORITY 2
50
51 /*
52 * Kinetis FOPT configuration byte
53 */
54 /* for KL27: */
55 #define KINETIS_NV_FOPT_BYTE 0x39
56 #define KINETIS_NV_FSEC_BYTE 0x7E
57 /* NV_FOPT: bit7-6/BOOTSRC_SEL=0b00 (11=from ROM; 00=from FLASH)
58 bit5/FAST_INIT=1, bit4/LPBOOT1=1,
59 bit3/RESET_PIN_CFG=1, bit2/NMI_DIS=1,
60 bit1/BOOTPIN_OPT=0, bit0/LPBOOT0=1 */
61 /* BOOTPIN_OPT: 1=boot depends on BOOTSRC_SEL
62 0=boot samples BOOTCFG0=NMI pin */
63 /* Boot sequence, page 88 of manual:
64 * - If the NMI/BOOTCFG0 input is high or the NMI function is disabled in FTFA_FOPT, the CPU begins execution at the PC location.
65 * - If the NMI/BOOTCFG0 input is low, the NMI function is enabled in FTFA_FOPT, and FTFA_FOPT[BOOTPIN_OPT] = 1, this results in an NMI interrupt. The processor executes an Exception Entry and reads the NMI interrupt handler address from vector-table offset 8. The CPU begins execution at the NMI interrupt handler.
66 * - When FTFA_FOPT[BOOTPIN_OPT] = 0, it forces boot from ROM if NMI/BOOTCFG0 pin set to 0.
67 *
68 * Observed behaviour:
69 * - when BOOTPIN_OPT=0, BOOTSRC_SEL still matters:
70 * - if 0b11 (from ROM), it still boots from ROM, even if BOOTCFG0 pin
71 * is high/floating, but leaves ROM and runs user app after
72 * 5 seconds delay.
73 * - if 0b00 (from FLASH), reset/powerup jumps to user app unless
74 * BOOTCFG0 pin is asserted.
75 * - in any case, reset when in bootloader induces the 5 second delay
76 * before starting the user app.
77 *
78 */
79
80 #endif /* _MCUCONF_H_ */
Imprint / Impressum