Skip to content

Commit 13d43d7

Browse files
Merge pull request #5144 from dave-wu/ev-cog-ad4050lz
Add support for ADI EV-COG-AD4050LZ platform.
2 parents 47bae16 + d5122c5 commit 13d43d7

File tree

127 files changed

+61389
-3
lines changed

Some content is hidden

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

127 files changed

+61389
-3
lines changed
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2010-2017 Analog Devices, Inc.
3+
*
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without modification,
7+
* are permitted provided that the following conditions are met:
8+
* - Redistributions of source code must retain the above copyright notice,
9+
* this list of conditions and the following disclaimer.
10+
* - Redistributions in binary form must reproduce the above copyright notice,
11+
* this list of conditions and the following disclaimer in the documentation
12+
* and/or other materials provided with the distribution.
13+
* - Modified versions of the software must be conspicuously marked as such.
14+
* - This software is licensed solely and exclusively for use with processors
15+
* manufactured by or for Analog Devices, Inc.
16+
* - This software may not be combined or merged with other code in any manner
17+
* that would cause the software to become subject to terms and conditions
18+
* which differ from those listed here.
19+
* - Neither the name of Analog Devices, Inc. nor the names of its
20+
* contributors may be used to endorse or promote products derived
21+
* from this software without specific prior written permission.
22+
* - The use of this software may or may not infringe the patent rights of one
23+
* or more patent holders. This license does not release you from the
24+
* requirement that you obtain separate licenses from these patent holders
25+
* to use this software.
26+
*
27+
* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS"
28+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-
29+
* INFRINGEMENT, TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30+
* DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE
31+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR
32+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF
33+
* CLAIMS OF INTELLECTUAL PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF
34+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38+
* POSSIBILITY OF SUCH DAMAGE.
39+
******************************************************************************/
40+
41+
#ifndef MBED_PERIPHERALNAMES_H
42+
#define MBED_PERIPHERALNAMES_H
43+
44+
#include "cmsis.h"
45+
46+
#ifdef __cplusplus
47+
extern "C" {
48+
#endif
49+
50+
typedef enum {
51+
OSC32KCLK = 0,
52+
} RTCName;
53+
54+
typedef enum {
55+
UART_0 = 0,
56+
UART_1 = 1,
57+
UART_2 = 2,
58+
UART_3 = 3,
59+
UART_4 = 4,
60+
} UARTName;
61+
62+
#define STDIO_UART_TX USBTX
63+
#define STDIO_UART_RX USBRX
64+
#define STDIO_UART UART_0
65+
66+
typedef enum {
67+
I2C_0 = 0,
68+
I2C_1 = 1,
69+
I2C_2 = 2,
70+
} I2CName;
71+
72+
#define TPM_SHIFT 8
73+
typedef enum {
74+
PWM_1 = (0 << TPM_SHIFT) | (0), // FTM0 CH0
75+
PWM_2 = (0 << TPM_SHIFT) | (1), // FTM0 CH1
76+
PWM_3 = (0 << TPM_SHIFT) | (2), // FTM0 CH2
77+
PWM_4 = (0 << TPM_SHIFT) | (3), // FTM0 CH3
78+
PWM_5 = (0 << TPM_SHIFT) | (4), // FTM0 CH4
79+
PWM_6 = (0 << TPM_SHIFT) | (5), // FTM0 CH5
80+
PWM_7 = (0 << TPM_SHIFT) | (6), // FTM0 CH6
81+
PWM_8 = (0 << TPM_SHIFT) | (7), // FTM0 CH7
82+
PWM_9 = (1 << TPM_SHIFT) | (0), // FTM1 CH0
83+
PWM_10 = (1 << TPM_SHIFT) | (1), // FTM1 CH1
84+
PWM_11 = (1 << TPM_SHIFT) | (2), // FTM1 CH2
85+
PWM_12 = (1 << TPM_SHIFT) | (3), // FTM1 CH3
86+
PWM_13 = (1 << TPM_SHIFT) | (4), // FTM1 CH4
87+
PWM_14 = (1 << TPM_SHIFT) | (5), // FTM1 CH5
88+
PWM_15 = (1 << TPM_SHIFT) | (6), // FTM1 CH6
89+
PWM_16 = (1 << TPM_SHIFT) | (7), // FTM1 CH7
90+
PWM_17 = (2 << TPM_SHIFT) | (0), // FTM2 CH0
91+
PWM_18 = (2 << TPM_SHIFT) | (1), // FTM2 CH1
92+
PWM_19 = (2 << TPM_SHIFT) | (2), // FTM2 CH2
93+
PWM_20 = (2 << TPM_SHIFT) | (3), // FTM2 CH3
94+
PWM_21 = (2 << TPM_SHIFT) | (4), // FTM2 CH4
95+
PWM_22 = (2 << TPM_SHIFT) | (5), // FTM2 CH5
96+
PWM_23 = (2 << TPM_SHIFT) | (6), // FTM2 CH6
97+
PWM_24 = (2 << TPM_SHIFT) | (7), // FTM2 CH7
98+
// could be 4 or could be 3... not sure what register
99+
// this is for... too much abstraction
100+
PWM_25 = (3 << TPM_SHIFT) | (0), // FTM3 CH0
101+
PWM_26 = (3 << TPM_SHIFT) | (1), // FTM3 CH1
102+
PWM_27 = (3 << TPM_SHIFT) | (2), // FTM3 CH2
103+
PWM_28 = (3 << TPM_SHIFT) | (3), // FTM3 CH3
104+
PWM_29 = (3 << TPM_SHIFT) | (4), // FTM3 CH4
105+
PWM_30 = (3 << TPM_SHIFT) | (5), // FTM3 CH5
106+
PWM_31 = (3 << TPM_SHIFT) | (6), // FTM3 CH6
107+
PWM_32 = (3 << TPM_SHIFT) | (7), // FTM3 CH7
108+
} PWMName;
109+
110+
typedef enum {
111+
ADC0_VIN0 = 0,
112+
ADC0_VIN1 = 1,
113+
ADC0_VIN2 = 2,
114+
ADC0_VIN3 = 3,
115+
ADC0_VIN4 = 4,
116+
ADC0_VIN5 = 5,
117+
ADC0_VIN6 = 6,
118+
ADC0_VIN7 = 7
119+
} ADCName;
120+
121+
typedef enum {
122+
DAC_0 = 0
123+
} DACName;
124+
125+
126+
typedef enum {
127+
SPI_0 = 0,
128+
SPI_1 = 1,
129+
SPI_2 = 2,
130+
} SPIName;
131+
132+
#ifdef __cplusplus
133+
}
134+
#endif
135+
136+
#endif
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2010-2017 Analog Devices, Inc.
3+
*
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without modification,
7+
* are permitted provided that the following conditions are met:
8+
* - Redistributions of source code must retain the above copyright notice,
9+
* this list of conditions and the following disclaimer.
10+
* - Redistributions in binary form must reproduce the above copyright notice,
11+
* this list of conditions and the following disclaimer in the documentation
12+
* and/or other materials provided with the distribution.
13+
* - Modified versions of the software must be conspicuously marked as such.
14+
* - This software is licensed solely and exclusively for use with processors
15+
* manufactured by or for Analog Devices, Inc.
16+
* - This software may not be combined or merged with other code in any manner
17+
* that would cause the software to become subject to terms and conditions
18+
* which differ from those listed here.
19+
* - Neither the name of Analog Devices, Inc. nor the names of its
20+
* contributors may be used to endorse or promote products derived
21+
* from this software without specific prior written permission.
22+
* - The use of this software may or may not infringe the patent rights of one
23+
* or more patent holders. This license does not release you from the
24+
* requirement that you obtain separate licenses from these patent holders
25+
* to use this software.
26+
*
27+
* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS"
28+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-
29+
* INFRINGEMENT, TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30+
* DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE
31+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR
32+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF
33+
* CLAIMS OF INTELLECTUAL PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF
34+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38+
* POSSIBILITY OF SUCH DAMAGE.
39+
******************************************************************************/
40+
41+
#ifndef MBED_PINNAMES_H
42+
#define MBED_PINNAMES_H
43+
44+
/*
45+
The ADuCM4050 is made in two package variants.
46+
47+
64 lead LFCSP & 72 ball WLCSP
48+
49+
There are some differences for Port 2 between the two variants
50+
WLCSP also has Port 3.
51+
52+
The #define ADUCM4050_LFCSP is used to determine which variant the code
53+
is built for.
54+
55+
For LFCSP leave the #define in, to build for ADUCM4050_WLCSP remove.
56+
*/
57+
#define ADUCM4050_LFCSP
58+
59+
#include "cmsis.h"
60+
61+
#include "adi_gpio.h"
62+
63+
#ifdef __cplusplus
64+
extern "C" {
65+
#endif
66+
67+
typedef enum {
68+
PIN_INPUT,
69+
PIN_OUTPUT
70+
} PinDirection;
71+
72+
//update
73+
74+
#define GPIO_PORT_SHIFT 12
75+
76+
77+
typedef enum {
78+
P0_00 = (0 << GPIO_PORT_SHIFT | 0 ),
79+
P0_01 = (0 << GPIO_PORT_SHIFT | 1 ),
80+
P0_02 = (0 << GPIO_PORT_SHIFT | 2 ),
81+
P0_03 = (0 << GPIO_PORT_SHIFT | 3 ),
82+
P0_04 = (0 << GPIO_PORT_SHIFT | 4 ),
83+
P0_05 = (0 << GPIO_PORT_SHIFT | 5 ),
84+
P0_06 = (0 << GPIO_PORT_SHIFT | 6 ),
85+
P0_07 = (0 << GPIO_PORT_SHIFT | 7 ),
86+
P0_08 = (0 << GPIO_PORT_SHIFT | 8 ),
87+
P0_09 = (0 << GPIO_PORT_SHIFT | 9 ),
88+
P0_10 = (0 << GPIO_PORT_SHIFT | 10),
89+
P0_11 = (0 << GPIO_PORT_SHIFT | 11),
90+
P0_12 = (0 << GPIO_PORT_SHIFT | 12),
91+
P0_13 = (0 << GPIO_PORT_SHIFT | 13),
92+
P0_14 = (0 << GPIO_PORT_SHIFT | 14),
93+
P0_15 = (0 << GPIO_PORT_SHIFT | 15),
94+
P1_00 = (1 << GPIO_PORT_SHIFT | 0 ),
95+
P1_01 = (1 << GPIO_PORT_SHIFT | 1 ),
96+
P1_02 = (1 << GPIO_PORT_SHIFT | 2 ),
97+
P1_03 = (1 << GPIO_PORT_SHIFT | 3 ),
98+
P1_04 = (1 << GPIO_PORT_SHIFT | 4 ),
99+
P1_05 = (1 << GPIO_PORT_SHIFT | 5 ),
100+
P1_06 = (1 << GPIO_PORT_SHIFT | 6 ),
101+
P1_07 = (1 << GPIO_PORT_SHIFT | 7 ),
102+
P1_08 = (1 << GPIO_PORT_SHIFT | 8 ),
103+
P1_09 = (1 << GPIO_PORT_SHIFT | 9 ),
104+
P1_10 = (1 << GPIO_PORT_SHIFT | 10),
105+
P1_11 = (1 << GPIO_PORT_SHIFT | 11),
106+
P1_12 = (1 << GPIO_PORT_SHIFT | 12),
107+
P1_13 = (1 << GPIO_PORT_SHIFT | 13),
108+
P1_14 = (1 << GPIO_PORT_SHIFT | 14),
109+
P1_15 = (1 << GPIO_PORT_SHIFT | 15),
110+
P2_00 = (2 << GPIO_PORT_SHIFT | 0 ),
111+
P2_01 = (2 << GPIO_PORT_SHIFT | 1 ),
112+
P2_02 = (2 << GPIO_PORT_SHIFT | 2 ),
113+
P2_03 = (2 << GPIO_PORT_SHIFT | 3 ),
114+
P2_04 = (2 << GPIO_PORT_SHIFT | 4 ),
115+
P2_05 = (2 << GPIO_PORT_SHIFT | 5 ),
116+
P2_06 = (2 << GPIO_PORT_SHIFT | 6 ),
117+
P2_07 = (2 << GPIO_PORT_SHIFT | 7 ),
118+
P2_08 = (2 << GPIO_PORT_SHIFT | 8 ),
119+
P2_09 = (2 << GPIO_PORT_SHIFT | 9 ),
120+
P2_10 = (2 << GPIO_PORT_SHIFT | 10),
121+
P2_11 = (2 << GPIO_PORT_SHIFT | 11),
122+
123+
// USB Pins
124+
USBTX = P0_10,
125+
USBRX = P0_11,
126+
USBTX1 = P1_15,
127+
USBRX1 = P2_00,
128+
129+
// mbed original LED naming
130+
LED1 = P2_02,
131+
LED2 = P2_10,
132+
LED3 = LED2,
133+
LED4 = LED1,
134+
135+
//Push buttons
136+
PB0 = P1_00, // BTN1
137+
PB1 = P0_09, // BTN2
138+
BOOT = P1_01,
139+
WAKE0 = P0_15, // JP15 to select
140+
WAKE1 = P1_00, // JP8 (BTN1 jumper) to select
141+
WAKE2 = P0_13, // JP4 to select
142+
WAKE3 = P2_01, // JP15 to select
143+
144+
// SPI Pins
145+
SPI0_SCLK = P0_00,
146+
SPI0_MOSI = P0_01,
147+
SPI0_MISO = P0_02,
148+
SPI0_CS0 = P0_03,
149+
SPI0_CS1 = P1_10,
150+
SPI0_CS2 = P2_08,
151+
SPI0_CS3 = P2_09,
152+
153+
SPI1_SCLK = P1_06,
154+
SPI1_MOSI = P1_07,
155+
SPI1_MISO = P1_08,
156+
SPI1_CS0 = P1_09,
157+
SPI1_CS1 = P2_11,
158+
SPI1_CS2 = P2_02,
159+
SPI1_CS3 = P1_10,
160+
161+
SPI2_SCLK = P1_02,
162+
SPI2_MOSI = P1_03,
163+
SPI2_MISO = P1_04,
164+
SPI2_CS0 = P1_05,
165+
SPI2_CS1 = P0_09,
166+
SPI2_CS2 = P2_10,
167+
SPI2_CS3 = P2_07,
168+
169+
// ADC Pins
170+
ADC_VIN0 = P2_03,
171+
ADC_VIN1 = P2_04,
172+
ADC_VIN2 = P2_05,
173+
ADC_VIN3 = P2_06,
174+
ADC_VIN4 = P2_07,
175+
ADC_VIN5 = P2_08,
176+
ADC_VIN6 = P2_09,
177+
ADC_VIN7 = P2_10,
178+
179+
// Arduino Headers
180+
D0 = P0_10, // UART0_TXD
181+
D1 = P0_11, // UART0_RXD
182+
D2 = P0_15, // INT_WAKE0
183+
D3 = P0_13, // EXT_INT_WAKE2
184+
D4 = P0_09, // EXT_SPI2_CS1
185+
D5 = P2_01, // INT_WAKE3 or EXT_RTC1_SS1 via JP8
186+
D6 = P1_11, // GPIO_27
187+
D7 = P0_12, // GPIO_08 or GPIO_12 via JP7
188+
189+
D8 = P1_12, // GPIO_28
190+
D9 = P1_14, // GPIO_30
191+
D10 = SPI0_CS2, // P2_08
192+
D11 = SPI0_MOSI, // P0_01
193+
D12 = SPI0_MISO, // P0_02
194+
D13 = SPI0_SCLK, // P0_00
195+
I2C_SCL = P0_04, // I2C_SCL
196+
I2C_SDA = P0_05, // I2C_SDA
197+
198+
A0 = P2_03, // ADC0
199+
A1 = P2_04, // EXT_ADC1
200+
A2 = P2_05, // EXT_ADC2
201+
A3 = P2_06, // ADC3
202+
A4 = P2_07, // SPI2_CS3
203+
A5 = P2_10, // EXT_GPIO42
204+
205+
// Not connected
206+
NC = (int)0xFFFFFFFF
207+
} PinName;
208+
209+
210+
typedef enum {
211+
PullNone = 0,
212+
PullDown = 1,
213+
PullUp = 2,
214+
PullDefault = PullNone
215+
} PinMode;
216+
217+
#ifdef __cplusplus
218+
}
219+
#endif
220+
221+
#endif

0 commit comments

Comments
 (0)