Skip to content

Commit 8b7e2ab

Browse files
committed
Commonalize the files in "targets/TARGET_RENESAS/TARGET_RZ_A1XX" directory
I made be available in common whatever the board related to RZ_A1 in the below files. - Since there are the table code of Pinmap differs for each board, I moved the code to "PeripheralPins" file for each board, and changed to include PeripheralPins.h. analogin_api.c, can_api.c, gpio_irq_api.c, i2c_api.c, pinmap.c, port_api.c, pwmout_api.c, serial_api.c, spi_api.c and us_ticker.c - Since there are some board-specific processes, I enclosed the processes with "#ifdef" and rearranged the functions to make be easier to enclose. can_api.c, ethernet_api.c and serial_api.c - Since there are the driver configuration values differs for each board, I added "mbed_drv_cfg.h" file for each board and defined macros for the values, and changed to refer to the macros. can_api.c, gpio_api.c, pwmout_api.c and rtc_api.c
1 parent 6f851a8 commit 8b7e2ab

37 files changed

+1654
-6545
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2006-2015 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+
17+
#ifndef MBED_PERIPHERALPINS_H
18+
#define MBED_PERIPHERALPINS_H
19+
20+
#include "pinmap.h"
21+
#include "PeripheralNames.h"
22+
23+
typedef struct {
24+
PinName pin;
25+
int function;
26+
int pm;
27+
} PinFunc;
28+
29+
/************IRQ***************/
30+
extern const PinMap PinMap_IRQ[];
31+
32+
/************PINMAP***************/
33+
extern const PinFunc PIPC_0_tbl[];
34+
35+
/************ADC***************/
36+
extern const PinMap PinMap_ADC[];
37+
38+
/************DAC***************/
39+
extern const PinMap PinMap_DAC[];
40+
41+
/************I2C***************/
42+
extern const PinMap PinMap_I2C_SDA[];
43+
extern const PinMap PinMap_I2C_SCL[];
44+
45+
/************UART***************/
46+
extern const PinMap PinMap_UART_TX[];
47+
extern const PinMap PinMap_UART_RX[];
48+
extern const PinMap PinMap_UART_CTS[];
49+
extern const PinMap PinMap_UART_RTS[];
50+
51+
/************SPI***************/
52+
extern const PinMap PinMap_SPI_SCLK[];
53+
extern const PinMap PinMap_SPI_MOSI[];
54+
extern const PinMap PinMap_SPI_MISO[];
55+
extern const PinMap PinMap_SPI_SSEL[];
56+
57+
/************PWM***************/
58+
extern const PinMap PinMap_PWM[];
59+
60+
/************CAN***************/
61+
extern const PinMap PinMap_CAN_RD[];
62+
extern const PinMap PinMap_CAN_TD[];
63+
64+
#endif

targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/PeripheralNames.h

Lines changed: 28 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -34,82 +34,31 @@ typedef enum {
3434
UART7,
3535
} UARTName;
3636

37-
// PWMType & 1 == 1 then have to use PWDTR[12] == 1
3837
typedef enum {
39-
PWM1A = 0,
40-
PWM1B,
41-
PWM1C,
42-
PWM1D,
43-
PWM1E,
44-
PWM1F,
45-
PWM1G,
46-
PWM1H,
47-
PWM2A = 0x10,
48-
PWM2B,
49-
PWM2C,
50-
PWM2D,
51-
PWM2E,
52-
PWM2F,
53-
PWM2G,
54-
PWM2H,
55-
} PWMType;
56-
57-
typedef enum {
58-
TIOC0A = 0,
59-
TIOC0B,
60-
TIOC0C,
61-
TIOC0D,
62-
TIOC1A = 0x10,
63-
TIOC1B,
64-
TIOC2A = 0x20,
65-
TIOC2B,
66-
TIOC3A = 0x30,
67-
TIOC3B,
68-
TIOC3C,
69-
TIOC3D,
70-
TIOC4A = 0x40,
71-
TIOC4B,
72-
TIOC4C,
73-
TIOC4D,
74-
} MTU2_PWMType;
75-
76-
typedef enum {
77-
PWM0_PIN = 0,
78-
PWM1_PIN,
79-
PWM2_PIN,
80-
PWM3_PIN,
81-
PWM4_PIN,
82-
PWM5_PIN,
83-
PWM6_PIN,
84-
PWM7_PIN,
85-
PWM8_PIN,
86-
PWM9_PIN,
87-
PWM10_PIN,
88-
PWM11_PIN,
89-
PWM12_PIN,
90-
PWM13_PIN,
91-
MTU2_PWM0_PIN = 0x20,
92-
MTU2_PWM1_PIN,
93-
MTU2_PWM2_PIN,
94-
MTU2_PWM3_PIN,
95-
MTU2_PWM4_PIN,
96-
MTU2_PWM5_PIN,
97-
MTU2_PWM6_PIN,
98-
MTU2_PWM7_PIN,
99-
MTU2_PWM8_PIN,
100-
MTU2_PWM9_PIN,
101-
MTU2_PWM10_PIN,
102-
MTU2_PWM11_PIN,
103-
MTU2_PWM12_PIN,
104-
MTU2_PWM13_PIN,
105-
MTU2_PWM14_PIN,
106-
MTU2_PWM15_PIN,
107-
MTU2_PWM16_PIN,
108-
MTU2_PWM17_PIN,
109-
MTU2_PWM18_PIN,
110-
MTU2_PWM19_PIN,
111-
MTU2_PWM20_PIN,
112-
MTU2_PWM21_PIN,
38+
PWM_PWM1A = 0,
39+
PWM_PWM1B,
40+
PWM_PWM1C,
41+
PWM_PWM1D,
42+
PWM_PWM1E,
43+
PWM_PWM1F,
44+
PWM_PWM1G,
45+
PWM_PWM1H,
46+
PWM_PWM2A,
47+
PWM_PWM2B,
48+
PWM_PWM2C,
49+
PWM_PWM2D,
50+
PWM_PWM2E,
51+
PWM_PWM2F,
52+
PWM_PWM2G,
53+
PWM_PWM2H,
54+
PWM_TIOC0A = 0x20,
55+
PWM_TIOC0C,
56+
PWM_TIOC1A,
57+
PWM_TIOC2A,
58+
PWM_TIOC3A,
59+
PWM_TIOC3C,
60+
PWM_TIOC4A,
61+
PWM_TIOC4C,
11362
} PWMName;
11463

11564
typedef enum {
@@ -128,21 +77,22 @@ typedef enum {
12877
SPI_1,
12978
SPI_2,
13079
SPI_3,
80+
SPI_4,
13181
} SPIName;
13282

13383
typedef enum {
13484
I2C_0 = 0,
13585
I2C_1,
13686
I2C_2,
137-
I2C_3
87+
I2C_3,
13888
} I2CName;
13989

14090
typedef enum {
14191
CAN_0 = 0,
14292
CAN_1,
14393
CAN_2,
144-
CAN_3,
145-
CAN_4
94+
CAN_3,
95+
CAN_4,
14696
} CANName;
14797

14898

0 commit comments

Comments
 (0)