Skip to content

Commit d61320c

Browse files
shileiyuadbridge
shileiyu
authored andcommitted
New target UNO_91H from RDA Microelectronics.
1 parent 72c46f9 commit d61320c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4747
-0
lines changed

platform/mbed_lib.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@
106106
},
107107
"EFR32": {
108108
"stdio-baud-rate": 115200
109+
},
110+
"UNO_91H": {
111+
"stdio-baud-rate": 115200
109112
}
110113
}
111114
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2006-2018 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+
#include "PinNames.h"
21+
22+
#ifdef __cplusplus
23+
extern "C" {
24+
#endif
25+
26+
typedef enum {
27+
UART_0 = (int)RDA_UART0_BASE,
28+
UART_1 = (int)RDA_UART1_BASE
29+
} UARTName;
30+
31+
typedef enum {
32+
// Make sure GPIO_BASE & 0x1F == 0, store GPIO index at this field when mapping pins
33+
GPIO_0 = (int)RDA_GPIO_BASE
34+
} GPIOName;
35+
36+
typedef enum {
37+
I2C_0 = (int)RDA_I2C0_BASE
38+
} I2CName;
39+
40+
typedef enum {
41+
SPI_0 = (int)RDA_SPI0_BASE
42+
} SPIName;
43+
44+
typedef enum {
45+
I2S_0 = (int)RDA_I2S_BASE
46+
} I2SName;
47+
48+
typedef enum {
49+
WDT_0 = (int)RDA_WDT_BASE
50+
} WDTName;
51+
52+
typedef enum {
53+
PWM_0 = 0,
54+
PWM_1,
55+
PWM_2,
56+
PWM_3,
57+
PWM_4,
58+
PWM_5,
59+
PWM_6,
60+
PWM_7
61+
} PWMName;
62+
63+
typedef enum {
64+
ADC0_0 = 0,
65+
ADC0_1,
66+
ADC0_2
67+
} ADCName;
68+
69+
typedef enum {
70+
GPADC0_0 = 0,
71+
GPADC0_1
72+
} GPADCName;
73+
74+
#define STDIO_UART_TX UART0_TX
75+
#define STDIO_UART_RX UART0_RX
76+
#define STDIO_UART UART_0
77+
78+
// Default peripherals
79+
#define MBED_UART0 PA_0, PA_1
80+
#define MBED_UART1 PB_1, PB_2
81+
#define MBED_UARTUSB USBTX, USBRX
82+
83+
#ifdef __cplusplus
84+
}
85+
#endif
86+
87+
#endif
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2006-2018 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_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+
} PinDirection;
29+
30+
#define PORT_SHIFT 8
31+
32+
typedef enum {
33+
PA_0 = (0 << PORT_SHIFT | 0 ),
34+
PA_1 = (0 << PORT_SHIFT | 1 ),
35+
PA_2 = (0 << PORT_SHIFT | 2 ),
36+
PA_3 = (0 << PORT_SHIFT | 3 ),
37+
PA_4 = (0 << PORT_SHIFT | 4 ),
38+
PA_5 = (0 << PORT_SHIFT | 5 ),
39+
PA_6 = (0 << PORT_SHIFT | 6 ),
40+
PA_7 = (0 << PORT_SHIFT | 7 ),
41+
PA_8 = (0 << PORT_SHIFT | 8 ),
42+
PA_9 = (0 << PORT_SHIFT | 9 ),
43+
PB_0 = (1 << PORT_SHIFT | 0 ),
44+
PB_1 = (1 << PORT_SHIFT | 1 ),
45+
PB_2 = (1 << PORT_SHIFT | 2 ),
46+
PB_3 = (1 << PORT_SHIFT | 3 ),
47+
PB_4 = (1 << PORT_SHIFT | 4 ),
48+
PB_5 = (1 << PORT_SHIFT | 5 ),
49+
PB_6 = (1 << PORT_SHIFT | 6 ),
50+
PB_7 = (1 << PORT_SHIFT | 7 ),
51+
PB_8 = (1 << PORT_SHIFT | 8 ),
52+
PB_9 = (1 << PORT_SHIFT | 9 ),
53+
PC_0 = (4 << PORT_SHIFT | 0 ),
54+
PC_1 = (4 << PORT_SHIFT | 1 ),
55+
PC_2 = (4 << PORT_SHIFT | 2 ),
56+
PC_3 = (4 << PORT_SHIFT | 3 ),
57+
PC_4 = (4 << PORT_SHIFT | 4 ),
58+
PC_5 = (4 << PORT_SHIFT | 5 ),
59+
PC_6 = (4 << PORT_SHIFT | 6 ),
60+
PC_7 = (4 << PORT_SHIFT | 7 ),
61+
PC_8 = (4 << PORT_SHIFT | 8 ),
62+
PC_9 = (4 << PORT_SHIFT | 9 ),
63+
PD_0 = (5 << PORT_SHIFT | 0 ),
64+
PD_1 = (5 << PORT_SHIFT | 1 ),
65+
PD_2 = (5 << PORT_SHIFT | 2 ),
66+
PD_3 = (5 << PORT_SHIFT | 3 ),
67+
PD_9 = (5 << PORT_SHIFT | 9 ), // Fake pin for GPADC_VBAT
68+
69+
UART0_RX = PA_0,
70+
UART0_TX = PA_1,
71+
UART1_RX = PB_1,
72+
UART1_TX = PB_2,
73+
74+
USBRX = UART0_RX,
75+
USBTX = UART0_TX,
76+
77+
I2C_SCL = PC_0,
78+
I2C_SDA = PC_1,
79+
80+
I2S_TX_SD = PB_1,
81+
I2S_TX_WS = PB_2,
82+
I2S_TX_BCLK = PB_3,
83+
I2S_RX_SD = PB_4,
84+
I2S_RX_WS = PB_5,
85+
I2S_RX_BCLK = PB_8,
86+
87+
GPIO_PIN0 = PB_0,
88+
GPIO_PIN1 = PB_1,
89+
GPIO_PIN2 = PB_2,
90+
GPIO_PIN3 = PB_3,
91+
GPIO_PIN4 = PB_4,
92+
GPIO_PIN5 = PB_5,
93+
GPIO_PIN6 = PB_6,
94+
GPIO_PIN7 = PB_7,
95+
GPIO_PIN8 = PB_8,
96+
GPIO_PIN9 = PB_9,
97+
GPIO_PIN10 = PA_8,
98+
GPIO_PIN11 = PA_9,
99+
GPIO_PIN12 = PC_0,
100+
GPIO_PIN13 = PC_1,
101+
GPIO_PIN14 = PC_2,
102+
GPIO_PIN15 = PC_3,
103+
GPIO_PIN16 = PC_4,
104+
GPIO_PIN17 = PC_5,
105+
GPIO_PIN18 = PC_6,
106+
GPIO_PIN19 = PC_7,
107+
GPIO_PIN20 = PC_8,
108+
GPIO_PIN21 = PC_9,
109+
GPIO_PIN22 = PD_0,
110+
GPIO_PIN23 = PD_1,
111+
GPIO_PIN24 = PD_2,
112+
GPIO_PIN25 = PD_3,
113+
GPIO_PIN26 = PA_0,
114+
GPIO_PIN27 = PA_1,
115+
116+
// Another pin names for GPIO 14 - 19
117+
GPIO_PIN14A = PA_2,
118+
GPIO_PIN15A = PA_3,
119+
GPIO_PIN16A = PA_4,
120+
GPIO_PIN17A = PA_5,
121+
GPIO_PIN18A = PA_6,
122+
GPIO_PIN19A = PA_7,
123+
124+
ADC_PIN0 = PB_6,
125+
ADC_PIN1 = PB_7,
126+
ADC_PIN1A = PB_8, // Another pin name for ADC 1
127+
ADC_PIN2 = PD_9,
128+
129+
LED1 = GPIO_PIN21,
130+
LED2 = GPIO_PIN1,
131+
132+
// Arduino Pin Names
133+
// Analog Ports (A0-A1)
134+
A0 = PB_6,
135+
A1 = PB_8,
136+
// A2
137+
// A3
138+
// Digital Pins with "An" name
139+
A4 = PB_2,
140+
A5 = PB_3,
141+
// Digital Port (D0-D7)
142+
D0 = PB_1,
143+
D1 = PB_2,
144+
D2 = PB_3,
145+
D3 = PB_4,
146+
D4 = PB_5,
147+
D5 = PB_7,
148+
D6 = PB_9,
149+
D7 = PC_9,
150+
// Digital Port (D8-D13)
151+
D8 = PB_0,
152+
// D9
153+
D10 = PD_1, // CS0
154+
D11 = PD_2, // MOSI
155+
D12 = PD_3, // MISO
156+
D13 = PD_0, // CLK
157+
// GND
158+
// AREF
159+
SDA = PC_1,
160+
D14 = SDA,
161+
SCL = PC_0,
162+
D15 = SCL,
163+
164+
// Not connected
165+
NC = (int)0xFFFFFFFF
166+
} PinName;
167+
168+
typedef enum {
169+
PullNone = 0,
170+
PullDown = 1,
171+
PullUp = 2,
172+
Repeater = 3,
173+
PullDefault = Repeater,
174+
} PinMode;
175+
176+
#ifdef __cplusplus
177+
}
178+
#endif
179+
180+
#endif
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2006-2018 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_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 = 1,
26+
PortC = 4,
27+
PortD = 5
28+
} PortName;
29+
30+
#ifdef __cplusplus
31+
}
32+
#endif
33+
#endif

0 commit comments

Comments
 (0)