Skip to content

Add support for ADI EV-COG-AD4050LZ platform. #5144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
/*******************************************************************************
* Copyright (c) 2010-2017 Analog Devices, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Modified versions of the software must be conspicuously marked as such.
* - This software is licensed solely and exclusively for use with processors
* manufactured by or for Analog Devices, Inc.
* - This software may not be combined or merged with other code in any manner
* that would cause the software to become subject to terms and conditions
* which differ from those listed here.
* - Neither the name of Analog Devices, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* - The use of this software may or may not infringe the patent rights of one
* or more patent holders. This license does not release you from the
* requirement that you obtain separate licenses from these patent holders
* to use this software.
*
* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-
* INFRINGEMENT, TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF
* CLAIMS OF INTELLECTUAL PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/

#ifndef MBED_PERIPHERALNAMES_H
#define MBED_PERIPHERALNAMES_H

#include "cmsis.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
OSC32KCLK = 0,
} RTCName;

typedef enum {
UART_0 = 0,
UART_1 = 1,
UART_2 = 2,
UART_3 = 3,
UART_4 = 4,
} UARTName;

#define STDIO_UART_TX USBTX
#define STDIO_UART_RX USBRX
#define STDIO_UART UART_0

typedef enum {
I2C_0 = 0,
I2C_1 = 1,
I2C_2 = 2,
} I2CName;

#define TPM_SHIFT 8
typedef enum {
PWM_1 = (0 << TPM_SHIFT) | (0), // FTM0 CH0
PWM_2 = (0 << TPM_SHIFT) | (1), // FTM0 CH1
PWM_3 = (0 << TPM_SHIFT) | (2), // FTM0 CH2
PWM_4 = (0 << TPM_SHIFT) | (3), // FTM0 CH3
PWM_5 = (0 << TPM_SHIFT) | (4), // FTM0 CH4
PWM_6 = (0 << TPM_SHIFT) | (5), // FTM0 CH5
PWM_7 = (0 << TPM_SHIFT) | (6), // FTM0 CH6
PWM_8 = (0 << TPM_SHIFT) | (7), // FTM0 CH7
PWM_9 = (1 << TPM_SHIFT) | (0), // FTM1 CH0
PWM_10 = (1 << TPM_SHIFT) | (1), // FTM1 CH1
PWM_11 = (1 << TPM_SHIFT) | (2), // FTM1 CH2
PWM_12 = (1 << TPM_SHIFT) | (3), // FTM1 CH3
PWM_13 = (1 << TPM_SHIFT) | (4), // FTM1 CH4
PWM_14 = (1 << TPM_SHIFT) | (5), // FTM1 CH5
PWM_15 = (1 << TPM_SHIFT) | (6), // FTM1 CH6
PWM_16 = (1 << TPM_SHIFT) | (7), // FTM1 CH7
PWM_17 = (2 << TPM_SHIFT) | (0), // FTM2 CH0
PWM_18 = (2 << TPM_SHIFT) | (1), // FTM2 CH1
PWM_19 = (2 << TPM_SHIFT) | (2), // FTM2 CH2
PWM_20 = (2 << TPM_SHIFT) | (3), // FTM2 CH3
PWM_21 = (2 << TPM_SHIFT) | (4), // FTM2 CH4
PWM_22 = (2 << TPM_SHIFT) | (5), // FTM2 CH5
PWM_23 = (2 << TPM_SHIFT) | (6), // FTM2 CH6
PWM_24 = (2 << TPM_SHIFT) | (7), // FTM2 CH7
// could be 4 or could be 3... not sure what register
// this is for... too much abstraction
PWM_25 = (3 << TPM_SHIFT) | (0), // FTM3 CH0
PWM_26 = (3 << TPM_SHIFT) | (1), // FTM3 CH1
PWM_27 = (3 << TPM_SHIFT) | (2), // FTM3 CH2
PWM_28 = (3 << TPM_SHIFT) | (3), // FTM3 CH3
PWM_29 = (3 << TPM_SHIFT) | (4), // FTM3 CH4
PWM_30 = (3 << TPM_SHIFT) | (5), // FTM3 CH5
PWM_31 = (3 << TPM_SHIFT) | (6), // FTM3 CH6
PWM_32 = (3 << TPM_SHIFT) | (7), // FTM3 CH7
} PWMName;

typedef enum {
ADC0_VIN0 = 0,
ADC0_VIN1 = 1,
ADC0_VIN2 = 2,
ADC0_VIN3 = 3,
ADC0_VIN4 = 4,
ADC0_VIN5 = 5,
ADC0_VIN6 = 6,
ADC0_VIN7 = 7
} ADCName;

typedef enum {
DAC_0 = 0
} DACName;


typedef enum {
SPI_0 = 0,
SPI_1 = 1,
SPI_2 = 2,
} SPIName;

#ifdef __cplusplus
}
#endif

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
/*******************************************************************************
* Copyright (c) 2010-2017 Analog Devices, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Modified versions of the software must be conspicuously marked as such.
* - This software is licensed solely and exclusively for use with processors
* manufactured by or for Analog Devices, Inc.
* - This software may not be combined or merged with other code in any manner
* that would cause the software to become subject to terms and conditions
* which differ from those listed here.
* - Neither the name of Analog Devices, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* - The use of this software may or may not infringe the patent rights of one
* or more patent holders. This license does not release you from the
* requirement that you obtain separate licenses from these patent holders
* to use this software.
*
* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-
* INFRINGEMENT, TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF
* CLAIMS OF INTELLECTUAL PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/

#ifndef MBED_PINNAMES_H
#define MBED_PINNAMES_H

/*
The ADuCM4050 is made in two package variants.

64 lead LFCSP & 72 ball WLCSP

There are some differences for Port 2 between the two variants
WLCSP also has Port 3.

The #define ADUCM4050_LFCSP is used to determine which variant the code
is built for.

For LFCSP leave the #define in, to build for ADUCM4050_WLCSP remove.
*/
#define ADUCM4050_LFCSP

#include "cmsis.h"

#include "adi_gpio.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
PIN_INPUT,
PIN_OUTPUT
} PinDirection;

//update

#define GPIO_PORT_SHIFT 12


typedef enum {
P0_00 = (0 << GPIO_PORT_SHIFT | 0 ),
P0_01 = (0 << GPIO_PORT_SHIFT | 1 ),
P0_02 = (0 << GPIO_PORT_SHIFT | 2 ),
P0_03 = (0 << GPIO_PORT_SHIFT | 3 ),
P0_04 = (0 << GPIO_PORT_SHIFT | 4 ),
P0_05 = (0 << GPIO_PORT_SHIFT | 5 ),
P0_06 = (0 << GPIO_PORT_SHIFT | 6 ),
P0_07 = (0 << GPIO_PORT_SHIFT | 7 ),
P0_08 = (0 << GPIO_PORT_SHIFT | 8 ),
P0_09 = (0 << GPIO_PORT_SHIFT | 9 ),
P0_10 = (0 << GPIO_PORT_SHIFT | 10),
P0_11 = (0 << GPIO_PORT_SHIFT | 11),
P0_12 = (0 << GPIO_PORT_SHIFT | 12),
P0_13 = (0 << GPIO_PORT_SHIFT | 13),
P0_14 = (0 << GPIO_PORT_SHIFT | 14),
P0_15 = (0 << GPIO_PORT_SHIFT | 15),
P1_00 = (1 << GPIO_PORT_SHIFT | 0 ),
P1_01 = (1 << GPIO_PORT_SHIFT | 1 ),
P1_02 = (1 << GPIO_PORT_SHIFT | 2 ),
P1_03 = (1 << GPIO_PORT_SHIFT | 3 ),
P1_04 = (1 << GPIO_PORT_SHIFT | 4 ),
P1_05 = (1 << GPIO_PORT_SHIFT | 5 ),
P1_06 = (1 << GPIO_PORT_SHIFT | 6 ),
P1_07 = (1 << GPIO_PORT_SHIFT | 7 ),
P1_08 = (1 << GPIO_PORT_SHIFT | 8 ),
P1_09 = (1 << GPIO_PORT_SHIFT | 9 ),
P1_10 = (1 << GPIO_PORT_SHIFT | 10),
P1_11 = (1 << GPIO_PORT_SHIFT | 11),
P1_12 = (1 << GPIO_PORT_SHIFT | 12),
P1_13 = (1 << GPIO_PORT_SHIFT | 13),
P1_14 = (1 << GPIO_PORT_SHIFT | 14),
P1_15 = (1 << GPIO_PORT_SHIFT | 15),
P2_00 = (2 << GPIO_PORT_SHIFT | 0 ),
P2_01 = (2 << GPIO_PORT_SHIFT | 1 ),
P2_02 = (2 << GPIO_PORT_SHIFT | 2 ),
P2_03 = (2 << GPIO_PORT_SHIFT | 3 ),
P2_04 = (2 << GPIO_PORT_SHIFT | 4 ),
P2_05 = (2 << GPIO_PORT_SHIFT | 5 ),
P2_06 = (2 << GPIO_PORT_SHIFT | 6 ),
P2_07 = (2 << GPIO_PORT_SHIFT | 7 ),
P2_08 = (2 << GPIO_PORT_SHIFT | 8 ),
P2_09 = (2 << GPIO_PORT_SHIFT | 9 ),
P2_10 = (2 << GPIO_PORT_SHIFT | 10),
P2_11 = (2 << GPIO_PORT_SHIFT | 11),

// USB Pins
USBTX = P0_10,
USBRX = P0_11,
USBTX1 = P1_15,
USBRX1 = P2_00,

// mbed original LED naming
LED1 = P2_02,
LED2 = P2_10,
LED3 = LED2,
LED4 = LED1,

//Push buttons
PB0 = P1_00, // BTN1
PB1 = P0_09, // BTN2
BOOT = P1_01,
WAKE0 = P0_15, // JP15 to select
WAKE1 = P1_00, // JP8 (BTN1 jumper) to select
WAKE2 = P0_13, // JP4 to select
WAKE3 = P2_01, // JP15 to select

// SPI Pins
SPI0_SCLK = P0_00,
SPI0_MOSI = P0_01,
SPI0_MISO = P0_02,
SPI0_CS0 = P0_03,
SPI0_CS1 = P1_10,
SPI0_CS2 = P2_08,
SPI0_CS3 = P2_09,

SPI1_SCLK = P1_06,
SPI1_MOSI = P1_07,
SPI1_MISO = P1_08,
SPI1_CS0 = P1_09,
SPI1_CS1 = P2_11,
SPI1_CS2 = P2_02,
SPI1_CS3 = P1_10,

SPI2_SCLK = P1_02,
SPI2_MOSI = P1_03,
SPI2_MISO = P1_04,
SPI2_CS0 = P1_05,
SPI2_CS1 = P0_09,
SPI2_CS2 = P2_10,
SPI2_CS3 = P2_07,

// ADC Pins
ADC_VIN0 = P2_03,
ADC_VIN1 = P2_04,
ADC_VIN2 = P2_05,
ADC_VIN3 = P2_06,
ADC_VIN4 = P2_07,
ADC_VIN5 = P2_08,
ADC_VIN6 = P2_09,
ADC_VIN7 = P2_10,

// Arduino Headers
D0 = P0_10, // UART0_TXD
D1 = P0_11, // UART0_RXD
D2 = P0_15, // INT_WAKE0
D3 = P0_13, // EXT_INT_WAKE2
D4 = P0_09, // EXT_SPI2_CS1
D5 = P2_01, // INT_WAKE3 or EXT_RTC1_SS1 via JP8
D6 = P1_11, // GPIO_27
D7 = P0_12, // GPIO_08 or GPIO_12 via JP7

D8 = P1_12, // GPIO_28
D9 = P1_14, // GPIO_30
D10 = SPI0_CS2, // P2_08
D11 = SPI0_MOSI, // P0_01
D12 = SPI0_MISO, // P0_02
D13 = SPI0_SCLK, // P0_00
I2C_SCL = P0_04, // I2C_SCL
I2C_SDA = P0_05, // I2C_SDA

A0 = P2_03, // ADC0
A1 = P2_04, // EXT_ADC1
A2 = P2_05, // EXT_ADC2
A3 = P2_06, // ADC3
A4 = P2_07, // SPI2_CS3
A5 = P2_10, // EXT_GPIO42

// Not connected
NC = (int)0xFFFFFFFF
} PinName;


typedef enum {
PullNone = 0,
PullDown = 1,
PullUp = 2,
PullDefault = PullNone
} PinMode;

#ifdef __cplusplus
}
#endif

#endif
Loading