]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blob - pdk_k2g_1_0_1/packages/ti/board/diag/led/build/evmAM437x/GPIO_LED_config.c
Add pdk folder
[processor-sdk/performance-audio-sr.git] / pdk_k2g_1_0_1 / packages / ti / board / diag / led / build / evmAM437x / GPIO_LED_config.c
1 /*
2  * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  */
34 #include <stdio.h>
35 #include <ti/drv/gpio/GPIO.h>
36 #include <ti/csl/soc.h>
37 #include <ti/drv/gpio/soc/GPIO_v1.h>
38 #if 0 //SK EVM
39 /* Port and pin number mask for Green LED.
40    Bits 7-0: Pin number  and Bits 15-8: Port number */
41 #define LED1    (0x0503) //STATUS_LED0 - UART3_TXD/GPIO5_3
42 #define LED2    (0x0502) //STATUS_LED1 - UART3_RXD/GPIO5_2
43 #define LED3    (0x0501) //STATUS_LED2 - UART3_RTSn/GPIO5_1
44 #define LED4    (0x0500) //STATUS_LED3 - UART3_CTSn/GPIO5_0
47 /* GPIO Driver board specific pin configuration structure */
48 GPIO_PinConfig gpioPinConfigs[] = {
49         LED1 | GPIO_CFG_OUTPUT,
50         LED2 | GPIO_CFG_OUTPUT,
51         LED3 | GPIO_CFG_OUTPUT,
52         LED4 | GPIO_CFG_OUTPUT
53 };
55 /* GPIO Driver call back functions */
56 GPIO_CallbackFxn gpioCallbackFunctions[] = {
57     NULL,
58     NULL,
59     NULL,
60     NULL
61 };
63 /* GPIO Driver configuration structure */
64 GPIO_v1_Config GPIO_v1_config = {
65     gpioPinConfigs,
66     gpioCallbackFunctions,
67     sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),
68     sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),
69     0,
70 };
71 #endif
73 /* Port and pin number mask for Green LED.
74    Bits 7-0: Pin number  and Bits 15-8: Port number (0 should be mentioned as 1)*/
75 #define LED1    (0x0412) //STATUS_LED0 - MCASP0_ACLKR/GPIO3_18 - D12
76 #define LED2    (0x0407) //STATUS_LED1 - JTAG_EMU0/GPIO3_7 - D13
77 #define LED3    (0x0408) //STATUS_LED2 - JTAG_EMU1/GPIO3_8 - D14
78 #define LED4    (0x060A) //STATUS_LED3 - GPIO5_10 - D9
79 #define LED5    (0x060B) //STATUS_LED4 - GPIO5_11 - D10
80 #define LED6    (0x060C) //STATUS_LED5 - GPIO5_12 - D11
81 #define LED7    (0x060D) //STATUS_LED6 - GPIO5_13 - D15
82 #define LED8    (0x0604) //STATUS_LED7 - SPI4_SCLK/GPIO5_4 - D16
85 /* GPIO Driver board specific pin configuration structure */
86 GPIO_PinConfig gpioPinConfigs[] = {
87         LED1 | GPIO_CFG_OUTPUT,
88         LED2 | GPIO_CFG_OUTPUT,
89         LED3 | GPIO_CFG_OUTPUT,
90         LED4 | GPIO_CFG_OUTPUT,
91         LED5 | GPIO_CFG_OUTPUT,
92         LED6 | GPIO_CFG_OUTPUT,
93         LED7 | GPIO_CFG_OUTPUT,
94         LED8 | GPIO_CFG_OUTPUT
95 };
97 /* GPIO Driver call back functions */
98 GPIO_CallbackFxn gpioCallbackFunctions[] = {
99     NULL,
100     NULL,
101     NULL,
102     NULL,
103         NULL,
104     NULL,
105     NULL,
106     NULL
107 };
109 /* GPIO Driver configuration structure */
110 GPIO_v1_Config GPIO_v1_config = {
111     gpioPinConfigs,
112     gpioCallbackFunctions,
113     sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),
114     sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),
115     0,
116 };