Skip to content

Commit 662b744

Browse files
authored
Merge pull request #8324 from ganesh-ramachandran/m3hq_new_target
Add Support for TOSHIBA TMPM3HQ
2 parents 72253b7 + beaa0da commit 662b744

35 files changed

+14882
-0
lines changed
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
/* mbed Microcontroller Library
2+
* (C)Copyright TOSHIBA ELECTRONIC DEVICES & STORAGE CORPORATION 2018 All rights reserved
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 "PinNames.h"
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
typedef enum {
26+
SERIAL_0 = 0,
27+
SERIAL_1,
28+
SERIAL_2,
29+
SERIAL_3,
30+
SERIAL_4,
31+
SERIAL_5,
32+
INVALID_SERIAL = (int)NC
33+
} UARTName;
34+
35+
typedef enum {
36+
ADC_AINA00 = 0,
37+
ADC_AINA01,
38+
ADC_AINA02,
39+
ADC_AINA03,
40+
ADC_AINA04,
41+
ADC_AINA05,
42+
ADC_AINA06,
43+
ADC_AINA07,
44+
ADC_AINA08,
45+
ADC_AINA09,
46+
ADC_AINA10,
47+
ADC_AINA11,
48+
ADC_AINA12,
49+
ADC_AINA13,
50+
ADC_AINA14,
51+
ADC_AINA15,
52+
ADC_AINA16,
53+
ADC_AINA17,
54+
ADC_AINA18,
55+
ADC_AINA19,
56+
ADC_AINA20,
57+
INVALID_ADC = (int)NC
58+
} ADCName;
59+
60+
typedef enum {
61+
DAC_A0 = 0,
62+
DAC_A1,
63+
INVALID_DAC = (int)NC
64+
} DACName;
65+
66+
typedef enum {
67+
SPI_0 = 0,
68+
SPI_1,
69+
SPI_2,
70+
SPI_3,
71+
SPI_4,
72+
INVALID_SPI = (int)NC
73+
} SPIName;
74+
75+
typedef enum {
76+
I2C_0 = 0,
77+
I2C_1,
78+
I2C_2,
79+
I2C_3,
80+
INVALID_I2C = (int)NC
81+
} I2CName;
82+
83+
typedef enum {
84+
PWM_0 = 0,
85+
PWM_1,
86+
PWM_2,
87+
PWM_3,
88+
PWM_4,
89+
PWM_5,
90+
PWM_6,
91+
PWM_7,
92+
INVALID_PWM = (int)NC
93+
} PWMName;
94+
95+
typedef enum {
96+
GPIO_IRQ_00 = 0,
97+
GPIO_IRQ_01,
98+
GPIO_IRQ_02,
99+
GPIO_IRQ_03,
100+
GPIO_IRQ_04,
101+
GPIO_IRQ_05,
102+
GPIO_IRQ_06,
103+
GPIO_IRQ_07,
104+
GPIO_IRQ_08,
105+
GPIO_IRQ_09,
106+
GPIO_IRQ_10,
107+
GPIO_IRQ_11,
108+
GPIO_IRQ_12,
109+
GPIO_IRQ_13,
110+
GPIO_IRQ_14,
111+
GPIO_IRQ_15,
112+
GPIO_IRQ_16,
113+
GPIO_IRQ_17_18,
114+
GPIO_IRQ_19_22,
115+
GPIO_IRQ_23_26,
116+
GPIO_IRQ_27_28,
117+
GPIO_IRQ_29,
118+
GPIO_IRQ_30_31,
119+
INVALID_GPIO_IRQ = (int)NC
120+
} gpio_irqname;
121+
122+
#define STDIO_UART_TX USBTX
123+
#define STDIO_UART_RX USBRX
124+
#define STDIO_UART SERIAL_1
125+
126+
#ifdef __cplusplus
127+
}
128+
#endif
129+
130+
#endif
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
/* mbed Microcontroller Library
2+
* (C)Copyright TOSHIBA ELECTRONIC DEVICES & STORAGE CORPORATION 2018 All rights reserved
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_PINNAMES_H
17+
#define MBED_PINNAMES_H
18+
19+
#include "cmsis.h"
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
typedef enum {
26+
PIN_INPUT,
27+
PIN_OUTPUT,
28+
PIN_INOUT
29+
} PinDirection;
30+
31+
typedef enum {
32+
// TMPM3HQ Pin Names
33+
PA0 = 0 << 3, PA1, PA2, PA3, PA4, PA5, PA6, PA7,
34+
PB0 = 1 << 3, PB1, PB2, PB3, PB4, PB5, PB6, PB7,
35+
PC0 = 2 << 3, PC1, PC2, PC3, PC4, PC5, PC6,
36+
PD0 = 3 << 3, PD1, PD2, PD3, PD4, PD5,
37+
PE0 = 4 << 3, PE1, PE2, PE3, PE4, PE5, PE6,
38+
PF0 = 5 << 3, PF1, PF2, PF3, PF4, PF5, PF6, PF7,
39+
PG0 = 6 << 3, PG1, PG2, PG3, PG4, PG5, PG6, PG7,
40+
PH0 = 7 << 3, PH1, PH2, PH3, PH4, PH5, PH6, PH7,
41+
PJ0 = 8 << 3, PJ1, PJ2, PJ3, PJ4, PJ5,
42+
PK0 = 9 << 3, PK1, PK2, PK3, PK4, PK5, PK6, PK7,
43+
PL0 = 10 << 3, PL1, PL2, PL3, PL4, PL5, PL6, PL7,
44+
PM0 = 11 << 3, PM1, PM2, PM3, PM4, PM5, PM6, PM7,
45+
PN0 = 12 << 3, PN1, PN2, PN3, PN4, PN5,
46+
PP0 = 13 << 3, PP1, PP2, PP3, PP4, PP5, PP6, PP7,
47+
PR0 = 14 << 3, PR1, PR2, PR3, PR4, PR5, PR6, PR7,
48+
PT0 = 15 << 3, PT1, PT2, PT3, PT4, PT5, PT6, PT7,
49+
PU0 = 16 << 3, PU1, PU2, PU3, PU4, PU5,
50+
PV0 = 17 << 3, PV1, PV2, PV3, PV4, PV5, PV6, PV7,
51+
52+
// LED
53+
LED1 = PK4,
54+
LED2 = PK5,
55+
LED3 = PK6,
56+
LED4 = PK7,
57+
58+
// External data bus Pin Names
59+
D0 = PV7,
60+
D1 = PV6,
61+
D2 = PC4,
62+
D3 = PK2,
63+
D4 = PC3,
64+
D5 = PJ0,
65+
D6 = PN0,
66+
D7 = PM6,
67+
D8 = PT0,
68+
D9 = PG2,
69+
D10 = PT1,
70+
D11 = PT3,
71+
D12 = PT4,
72+
D13 = PT2,
73+
D14 = PC1,
74+
D15 = PC0,
75+
76+
// Analogue out pins
77+
A0 = PF2,
78+
A1 = PF3,
79+
A2 = PF4,
80+
A3 = PF5,
81+
A4 = PF6,
82+
A5 = PF7,
83+
84+
// DAC
85+
DAC0 = PG0,
86+
DAC1 = PG1,
87+
88+
// DAP_UART
89+
USBTX = PJ1,
90+
USBRX = PJ2,
91+
MBEDIF_TXD = USBTX,
92+
MBEDIF_RXD = USBRX,
93+
94+
// Push buttons
95+
SW1 = PV0,
96+
SW2 = PV1,
97+
SW3 = PV2,
98+
SW4 = PV3,
99+
100+
// Standardized button names
101+
BUTTON1 = SW1,
102+
BUTTON2 = SW2,
103+
BUTTON3 = SW3,
104+
BUTTON4 = SW4,
105+
106+
// TSPI2
107+
MOSI = D11,
108+
MISO = D12,
109+
SCLK = D13,
110+
CS = D10,
111+
112+
// SD Shield TSPI2
113+
SD_SEL = CS, // Chip select
114+
SD_CLK = SCLK, // SPI clock
115+
SD_MISO = MISO, // Master in Salve out
116+
SD_MOSI = MOSI, // Master out Salve in
117+
118+
// I2C pins
119+
SDA = D14,
120+
SCL = D15,
121+
I2C_SDA = SDA,
122+
I2C_SCL = SCL,
123+
124+
// Not connected
125+
NC = (int)0xFFFFFFFF,
126+
} PinName;
127+
128+
typedef enum {
129+
PullUp = 0,
130+
PullDown,
131+
PullNone,
132+
OpenDrain,
133+
PullDefault
134+
} PinMode;
135+
136+
typedef enum {
137+
DISABLE = 0,
138+
ENABLE
139+
} FunctionalState;
140+
141+
#ifdef __cplusplus
142+
}
143+
#endif
144+
145+
#endif
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/* mbed Microcontroller Library
2+
* (C)Copyright TOSHIBA ELECTRONIC DEVICES & STORAGE CORPORATION 2018 All rights reserved
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_PORTNAMES_H
17+
#define MBED_PORTNAMES_H
18+
19+
#ifdef __cplusplus
20+
extern "C" {
21+
#endif
22+
23+
typedef enum {
24+
PortA = 0,
25+
PortB,
26+
PortC,
27+
PortD,
28+
PortE,
29+
PortF,
30+
PortG,
31+
PortH,
32+
PortJ,
33+
PortK,
34+
PortL,
35+
PortM,
36+
PortN,
37+
PortP,
38+
PortR,
39+
PortT,
40+
PortU,
41+
PortV
42+
} PortName;
43+
44+
#define IS_GPIO_PORT(param) ((param) <= PortV) // parameter checking for port number
45+
46+
#ifdef __cplusplus
47+
}
48+
#endif
49+
50+
#endif

0 commit comments

Comments
 (0)