Skip to content

Commit 885659a

Browse files
committed
Merge pull request #425 from AFritzMulti/master
[MTS_GAMBIT] Modified PinNames.h and device.h for Gambit platform
2 parents ddc5340 + 0b5de22 commit 885659a

File tree

4 files changed

+33
-159
lines changed

4 files changed

+33
-159
lines changed

libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/TARGET_MTS_GAMBIT/PeripheralNames.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ typedef enum {
2828

2929
typedef enum {
3030
UART_0 = 0,
31-
UART_1 = 1,
3231
UART_2 = 2,
3332
UART_3 = 3,
34-
UART_4 = 4,
33+
UART_5 = 5,
3534
} UARTName;
3635

3736
#define STDIO_UART_TX USBTX
@@ -41,9 +40,9 @@ typedef enum {
4140
typedef enum {
4241
I2C_0 = 0,
4342
I2C_1 = 1,
44-
I2C_2 = 2,
4543
} I2CName;
4644

45+
4746
#define TPM_SHIFT 8
4847
typedef enum {
4948
PWM_1 = (0 << TPM_SHIFT) | (0), // FTM0 CH0
@@ -82,6 +81,8 @@ typedef enum {
8281
PWM_32 = (3 << TPM_SHIFT) | (7), // FTM3 CH7
8382
} PWMName;
8483

84+
85+
8586
#define ADC_INSTANCE_SHIFT 8
8687
#define ADC_B_CHANNEL_SHIFT 5
8788
typedef enum {
@@ -113,6 +114,8 @@ typedef enum {
113114
ADC1_SE18 = (1 << ADC_INSTANCE_SHIFT) | 18,
114115
} ADCName;
115116

117+
118+
116119
typedef enum {
117120
DAC_0 = 0
118121
} DACName;
@@ -121,7 +124,6 @@ typedef enum {
121124
typedef enum {
122125
SPI_0 = 0,
123126
SPI_1 = 1,
124-
SPI_2 = 2,
125127
} SPIName;
126128

127129
#ifdef __cplusplus

libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/TARGET_MTS_GAMBIT/PeripheralPins.c

Lines changed: 6 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -21,182 +21,58 @@ const PinMap PinMap_RTC[] = {
2121
{NC, OSC32KCLK, 0},
2222
};
2323

24-
/************ADC***************/
25-
const PinMap PinMap_ADC[] = {
26-
{PTC2, ADC0_SE4b, 0},
27-
{PTC8, ADC1_SE4b, 0},
28-
{PTC9, ADC1_SE5b, 0},
29-
{PTD1, ADC0_SE5b, 0},
30-
{PTC10, ADC1_SE6b, 0},
31-
{PTD5, ADC0_SE6b, 0},
32-
{PTC11, ADC1_SE7b, 0},
33-
{PTD6, ADC0_SE7b, 0},
34-
{PTB0 , ADC0_SE8 , 0},
35-
{PTB1 , ADC0_SE9 , 0},
36-
{PTB2 , ADC0_SE12, 0},
37-
{PTB3 , ADC0_SE13, 0},
38-
{PTC0 , ADC0_SE14, 0},
39-
{PTB10, ADC1_SE14, 0},
40-
{PTB11, ADC1_SE15, 0},
41-
{PTC1 , ADC0_SE15, 0},
42-
{PTA17, ADC1_SE17, 0},
43-
//{PTE24, ADC0_SE17, 0}, //I2C pull up
44-
//{PTE25, ADC0_SE18, 0}, //I2C pull up
45-
{NC , NC , 0}
46-
};
47-
48-
/************DAC***************/
49-
const PinMap PinMap_DAC[] = {
50-
{DAC0_OUT, DAC_0, 0},
51-
{NC , NC , 0}
52-
};
53-
5424
/************I2C***************/
5525
const PinMap PinMap_I2C_SDA[] = {
56-
{PTE25, I2C_0, 5},
57-
{PTB1 , I2C_0, 2},
58-
{PTB3 , I2C_0, 2},
5926
{PTC11, I2C_1, 2},
60-
{PTA13, I2C_2, 5},
61-
{PTD3 , I2C_0, 7},
62-
{PTE0 , I2C_1, 6},
27+
{PTB3 , I2C_0, 7},
6328
{NC , NC , 0}
6429
};
6530

6631
const PinMap PinMap_I2C_SCL[] = {
67-
{PTE24, I2C_0, 5},
68-
{PTB0 , I2C_0, 2},
6932
{PTB2 , I2C_0, 2},
7033
{PTC10, I2C_1, 2},
71-
{PTA12, I2C_2, 5},
72-
{PTA14, I2C_2, 5},
73-
{PTD2 , I2C_0, 7},
74-
{PTE1 , I2C_1, 6},
7534
{NC , NC , 0}
7635
};
7736

7837
/************UART***************/
7938
const PinMap PinMap_UART_TX[] = {
8039
{PTB17, UART_0, 3},
81-
{PTC17, UART_3, 3},
82-
{PTD7 , UART_0, 3},
8340
{PTD3 , UART_2, 3},
84-
{PTC4 , UART_1, 3},
85-
{PTC15, UART_4, 3},
8641
{PTB11, UART_3, 3},
87-
{PTA14, UART_0, 3},
88-
{PTE24, UART_4, 3},
89-
{PTE4 , UART_3, 3},
90-
{PTE0, UART_1, 3},
91-
{NC , NC , 0}
42+
{PTE8, UART_5, 0},
43+
{NC, NC, 0}
9244
};
9345

9446
const PinMap PinMap_UART_RX[] = {
9547
{PTB16, UART_0, 3},
96-
{PTE1 , UART_1, 3},
97-
{PTE5 , UART_3, 3},
98-
{PTE25, UART_4, 3},
99-
{PTA15, UART_0, 3},
100-
{PTC16, UART_3, 3},
10148
{PTB10, UART_3, 3},
102-
{PTC3 , UART_1, 3},
103-
{PTC14, UART_4, 3},
104-
{PTD2 , UART_2, 3},
105-
{PTC6 , UART_0, 3},
106-
{NC , NC , 0}
49+
{PTD2, UART_2, 3},
50+
{PTE9, UART_5, 0},
51+
{NC, NC, 0}
10752
};
10853

10954
/************SPI***************/
11055
const PinMap PinMap_SPI_SCLK[] = {
111-
{PTD1 , SPI_0, 2},
11256
{PTE2 , SPI_1, 2},
113-
{PTA15, SPI_0, 2},
114-
{PTB11, SPI_1, 2},
115-
{PTB21, SPI_2, 2},
11657
{PTC5 , SPI_0, 2},
117-
{PTD5 , SPI_1, 7},
11858
{NC , NC , 0}
11959
};
12060

12161
const PinMap PinMap_SPI_MOSI[] = {
122-
{PTD2 , SPI_0, 2},
123-
{PTE1 , SPI_1, 2},
12462
{PTE3 , SPI_1, 7},
125-
{PTA16, SPI_0, 2},
126-
{PTB16, SPI_1, 2},
127-
{PTB22, SPI_2, 2},
12863
{PTC6 , SPI_0, 2},
129-
{PTD6 , SPI_1, 7},
13064
{NC , NC , 0}
13165
};
13266

13367
const PinMap PinMap_SPI_MISO[] = {
134-
{PTD3 , SPI_0, 2},
13568
{PTE1 , SPI_1, 7},
136-
{PTE3 , SPI_1, 2},
137-
{PTA17, SPI_0, 2},
138-
{PTB17, SPI_1, 2},
139-
{PTB23, SPI_2, 2},
14069
{PTC7 , SPI_0, 2},
141-
{PTD7 , SPI_1, 7},
14270
{NC , NC , 0}
14371
};
14472

14573
const PinMap PinMap_SPI_SSEL[] = {
146-
{PTD0 , SPI_0, 2},
14774
{PTE4 , SPI_1, 2},
148-
{PTA14, SPI_0, 2},
149-
{PTB10, SPI_1, 2},
150-
{PTB20, SPI_2, 2},
15175
{PTC4 , SPI_0, 2},
152-
{PTD4 , SPI_1, 7},
15376
{NC , NC , 0}
15477
};
15578

156-
/************PWM***************/
157-
const PinMap PinMap_PWM[] = {
158-
{PTA0 , PWM_6 , 3},
159-
{PTA1 , PWM_7 , 3},
160-
{PTA2 , PWM_8 , 3},
161-
{PTA3 , PWM_1 , 3},
162-
{PTA4 , PWM_2 , 3},
163-
{PTA5 , PWM_3 , 3},
164-
{PTA6 , PWM_4 , 3},
165-
{PTA7 , PWM_5 , 3},
166-
{PTA8 , PWM_9 , 3},
167-
{PTA9 , PWM_10, 3},
168-
{PTA10, PWM_17, 3},
169-
{PTA11, PWM_18, 3},
170-
{PTA12, PWM_9 , 3},
171-
{PTA13, PWM_10, 3},
172-
173-
{PTB0 , PWM_9 , 3},
174-
{PTB1 , PWM_10, 3},
175-
{PTB18, PWM_17, 3},
176-
{PTB19, PWM_18, 3},
177-
178-
{PTC1 , PWM_1 , 4},
179-
{PTC2 , PWM_2 , 4},
180-
{PTC3 , PWM_3 , 4},
181-
{PTC4 , PWM_4 , 4},
182-
{PTC5 , PWM_3 , 7},
183-
{PTC8 , PWM_29, 3},
184-
{PTC9 , PWM_30, 3},
185-
{PTC10, PWM_31, 3},
186-
{PTC11, PWM_32, 3},
187-
188-
{PTD0 , PWM_25, 4},
189-
{PTD1 , PWM_26, 4},
190-
{PTD2 , PWM_27, 4},
191-
{PTD3 , PWM_28, 4},
192-
{PTD4 , PWM_5 , 4},
193-
{PTD5 , PWM_6 , 4},
194-
{PTD6 , PWM_7 , 4},
195-
{PTD4 , PWM_5 , 4},
196-
{PTD7 , PWM_8 , 4},
197-
198-
{PTE5 , PWM_25, 6},
199-
{PTE6 , PWM_26, 6},
200-
201-
{NC , NC , 0}
202-
};

libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/TARGET_MTS_GAMBIT/PinNames.h

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -191,21 +191,17 @@ typedef enum {
191191
PTE30 = (4 << GPIO_PORT_SHIFT | 30),
192192
PTE31 = (4 << GPIO_PORT_SHIFT | 31),
193193

194-
// #TODO all friendly names per platform
195194
// led color naming
196-
LED_RED = PTA0,
197-
LED_GREEN = PTA1,
198-
LED_BLUE = PTA2,
195+
LED_GREEN = PTC0,
196+
199197
// mbed original LED naming
200-
LED1 = LED_RED,
201-
LED2 = LED_GREEN,
202-
LED3 = LED_BLUE,
203-
LED4 = LED_RED,
198+
LED1 = PTD15,
199+
LED2 = PTD14,
200+
LED3 = PTD13,
201+
LED4 = PTD11,
202+
LED5 = PTD12,
203+
STATUS = LED_GREEN,
204204

205-
//Push buttons
206-
//SW2 = PTC6,
207-
//SW3 = PTA4,
208-
209205
// USB Pins
210206
USBTX = PTB17,
211207
USBRX = PTB16,

libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/TARGET_MTS_GAMBIT/device.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,40 @@
1616
#ifndef MBED_DEVICE_H
1717
#define MBED_DEVICE_H
1818

19-
#define DEVICE_PORTIN 0
20-
#define DEVICE_PORTOUT 0
21-
#define DEVICE_PORTINOUT 0
19+
#define DEVICE_PORTIN 1
20+
#define DEVICE_PORTOUT 1
21+
#define DEVICE_PORTINOUT 1
2222

23-
#define DEVICE_INTERRUPTIN 0
23+
#define DEVICE_INTERRUPTIN 1
2424

2525
#define DEVICE_ANALOGIN 0
2626
#define DEVICE_ANALOGOUT 0
2727

28-
#define DEVICE_SERIAL 0
28+
#define DEVICE_SERIAL 1
2929

30-
#define DEVICE_I2C 0
31-
#define DEVICE_I2CSLAVE 0
30+
#define DEVICE_I2C 1
31+
#define DEVICE_I2CSLAVE 1
3232

33-
#define DEVICE_SPI 0
34-
#define DEVICE_SPISLAVE 0
33+
#define DEVICE_SPI 1
34+
#define DEVICE_SPISLAVE 1
3535

3636
#define DEVICE_CAN 0
3737

38-
#define DEVICE_RTC 0
38+
#define DEVICE_RTC 1
3939

40-
#define DEVICE_ETHERNET 0
40+
#define DEVICE_ETHERNET 1
4141

4242
#define DEVICE_PWMOUT 0
4343

4444
#define DEVICE_SEMIHOST 0
4545
#define DEVICE_LOCALFILESYSTEM 0
4646
#define DEVICE_ID_LENGTH 24
4747

48-
#define DEVICE_SLEEP 0
48+
#define DEVICE_SLEEP 1
4949

5050
#define DEVICE_DEBUG_AWARENESS 0
5151

52-
#define DEVICE_STDIO_MESSAGES 0
52+
#define DEVICE_STDIO_MESSAGES 1
5353

5454
#define DEVICE_ERROR_RED 0
5555

0 commit comments

Comments
 (0)