[processor-sdk/pdk.git] / packages / ti / drv / gpio / test / led_blink / src / am335x / GPIO_bbbAM335x_board.c
1 /**
2 * \file GPIO_bbbAM335x_board.c
3 *
4 * \brief AM335x BBB EVM board specific GPIO parameters.
5 *
6 */
8 /*
9 * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 *
15 * Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 *
18 * Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the
21 * distribution.
22 *
23 * Neither the name of Texas Instruments Incorporated nor the names of
24 * its contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 *
39 */
40 #include <stdio.h>
41 #include <ti/drv/gpio/GPIO.h>
42 #include <ti/drv/gpio/soc/GPIO_soc.h>
44 #define GPIO_USER0_LED_PIN_NUM (0x17)
45 #define GPIO_USER0_LED_PORT_NUM (0x01)
46 #define GPIO_USER1_LED_PIN_NUM (0x18)
47 #define GPIO_USER1_LED_PORT_NUM (0x01)
50 /* GPIO Driver board specific pin configuration structure */
51 GPIO_PinConfig gpioPinConfigs[] = {
52 /* Input pin with interrupt enabled : User LED */
53 GPIO_DEVICE_CONFIG((GPIO_USER0_LED_PORT_NUM + 1), GPIO_USER0_LED_PIN_NUM) |
54 GPIO_CFG_IN_INT_RISING | GPIO_CFG_INPUT,
56 /* Output pin : User LED */
57 GPIO_DEVICE_CONFIG((GPIO_USER0_LED_PORT_NUM + 1), GPIO_USER0_LED_PIN_NUM) |
58 GPIO_CFG_OUTPUT
59 };
61 /* GPIO Driver call back functions */
62 GPIO_CallbackFxn gpioCallbackFunctions[] = {
63 NULL,
64 NULL
65 };
67 /* GPIO Driver configuration structure */
68 GPIO_v1_Config GPIO_v1_config = {
69 gpioPinConfigs,
70 gpioCallbackFunctions,
71 sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),
72 sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),
73 0x1U,
74 };