]> git.donarmstrong.com Git - qmk_firmware.git/blob - tool/mbed/mbed-sdk/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KLXX/TARGET_KL25Z/PeripheralNames.h
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[qmk_firmware.git] / tool / mbed / mbed-sdk / libraries / mbed / targets / hal / TARGET_Freescale / TARGET_KLXX / TARGET_KL25Z / PeripheralNames.h
1 /* mbed Microcontroller Library
2  * Copyright (c) 2006-2013 ARM Limited
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 #ifndef MBED_PERIPHERALNAMES_H
17 #define MBED_PERIPHERALNAMES_H
18
19 #include "cmsis.h"
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 typedef enum {
26     OSC32KCLK = 0,
27     RTC_CLKIN = 2
28 } RTCName;
29
30 typedef enum {
31     UART_0 = (int)UART0_BASE,
32     UART_1 = (int)UART1_BASE,
33     UART_2 = (int)UART2_BASE
34 } UARTName;
35 #define STDIO_UART_TX     USBTX
36 #define STDIO_UART_RX     USBRX
37 #define STDIO_UART        UART_0
38
39 typedef enum {
40     I2C_0 = (int)I2C0_BASE,
41     I2C_1 = (int)I2C1_BASE,
42 } I2CName;
43
44 #define TPM_SHIFT   8
45 typedef enum {
46     PWM_1  = (0 << TPM_SHIFT) | (0),  // TPM0 CH0
47     PWM_2  = (0 << TPM_SHIFT) | (1),  // TPM0 CH1
48     PWM_3  = (0 << TPM_SHIFT) | (2),  // TPM0 CH2
49     PWM_4  = (0 << TPM_SHIFT) | (3),  // TPM0 CH3
50     PWM_5  = (0 << TPM_SHIFT) | (4),  // TPM0 CH4
51     PWM_6  = (0 << TPM_SHIFT) | (5),  // TPM0 CH5
52
53     PWM_7  = (1 << TPM_SHIFT) | (0),  // TPM1 CH0
54     PWM_8  = (1 << TPM_SHIFT) | (1),  // TPM1 CH1
55
56     PWM_9  = (2 << TPM_SHIFT) | (0),  // TPM2 CH0
57     PWM_10 = (2 << TPM_SHIFT) | (1)   // TPM2 CH1
58 } PWMName;
59
60 #define CHANNELS_A_SHIFT    5
61 typedef enum {
62     ADC0_SE0  =  0,
63     ADC0_SE3  =  3,
64     ADC0_SE4a =  (1 << CHANNELS_A_SHIFT) | (4),
65     ADC0_SE4b =  4,
66     ADC0_SE5b =  5,
67     ADC0_SE6b =  6,
68     ADC0_SE7a =  (1 << CHANNELS_A_SHIFT) | (7),
69     ADC0_SE7b =  7,
70     ADC0_SE8  =  8,
71     ADC0_SE9  =  9,
72     ADC0_SE11 = 11,
73     ADC0_SE12 = 12,
74     ADC0_SE13 = 13,
75     ADC0_SE14 = 14,
76     ADC0_SE15 = 15,
77     ADC0_SE23 = 23
78 } ADCName;
79
80 typedef enum {
81     DAC_0 = 0
82 } DACName;
83
84
85 typedef enum {
86     SPI_0 = (int)SPI0_BASE,
87     SPI_1 = (int)SPI1_BASE,
88 } SPIName;
89
90 // Default peripherals
91 #define MBED_SPI0         PTD2, PTD3, PTD1, PTD0
92
93 #define MBED_UART0        PTC4, PTC3
94 #define MBED_UART1        PTD3, PTD2
95 #define MBED_UARTUSB      PTA2, PTA1
96
97 #define MBED_I2C0         PTC9, PTC8
98 #define MBED_I2C1         PTE1, PTE0
99
100 #define MBED_ANALOGOUT0   PTE30
101
102 #define MBED_ANALOGIN0    PTC2
103 #define MBED_ANALOGIN1    PTB3
104 #define MBED_ANALOGIN2    PTB2
105 #define MBED_ANALOGIN3    PTB1
106 #define MBED_ANALOGIN4    PTB0
107
108 #define MBED_PWMOUT0      PTD4
109 #define MBED_PWMOUT1      PTA12
110 #define MBED_PWMOUT2      PTA4
111 #define MBED_PWMOUT3      PTA5
112 #define MBED_PWMOUT4      PTC8
113 #define MBED_PWMOUT5      PTC9
114
115 #ifdef __cplusplus
116 }
117 #endif
118
119 #endif