[processor-sdk/performance-audio-sr.git] / psdk_cust / pdk_k2g_1_0_1_1_eng / packages / ti / board / diag / mcspi / build / idkAM571x / GPIO_SPI_config.c
1 /**
2 * \file SPI_idkAM572x_board.c
3 *
4 * \brief AM572x IDK Board specific GPIO parameters.
5 *
6 * This file contains the GPIO hardware parameters specific to board.
7 */
9 /*
10 * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 *
16 * Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 *
19 * Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the
22 * distribution.
23 *
24 * Neither the name of Texas Instruments Incorporated nor the names of
25 * its contributors may be used to endorse or promote products derived
26 * from this software without specific prior written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 */
42 #include <stdlib.h>
43 #include <ti/drv/gpio/GPIO.h>
44 #include <ti/csl/soc.h>
45 #include <ti/drv/gpio/soc/GPIO_v1.h>
47 /* control module register definitions */
48 #define CTRL_CORE_PAD_VIN1A_D15 (0xC4U) //(0x130U) //GPIO3_19
49 #define CTRL_CORE_PAD_VIN1A_D15_PILLUP (0x20000 | 0x0E)
51 #define CTRL_CORE_PAD_MCASP4_ACLKX (0x334U) //SPI3_SCLK
52 #define CTRL_CORE_PAD_MCASP4_FSX (0x338U) //SPI3_D1
53 #define CTRL_CORE_PAD_MCASP4_AXR1 (0x340U) //SPI3_CS0
56 #define CTRL_CORE_PAD_MCASP4_ACLKX_PUPDD_RX_MODE 0xc0002 //(0x00040003U)
57 #define CTRL_CORE_PAD_MCASP4_FSX_PUPDD_RX_MODE 0xc0002 //(0x00040003U)
58 #define CTRL_CORE_PAD_MCASP4_AXR1_PUPDD_RX_MODE 0x60002 //(0x00040003U)
60 #define HW_WR_REG32(addr, data) *(unsigned int*)(addr) =(unsigned int)(data)
63 /* Port and pin number mask for GPIO Load pin.
64 Bits 7-0: Pin number and Bits 15-8: Port number */
65 #define AM57X_IDK_GPIO_LD_PIN (0x0217)
68 /* GPIO Driver board specific pin configuration structure */
69 GPIO_PinConfig gpioPinConfigs[] = {
70 /* Output pin : AM57X_IDK_YEL_GRN */
71 AM57X_IDK_GPIO_LD_PIN | GPIO_CFG_OUTPUT
72 };
74 /* GPIO Driver call back functions */
75 GPIO_CallbackFxn gpioCallbackFunctions[] = {
76 NULL
77 };
79 /* GPIO Driver configuration structure */
80 GPIO_v1_Config GPIO_v1_config = {
81 gpioPinConfigs,
82 gpioCallbackFunctions,
83 sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),
84 sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),
85 0,
86 };