15e02e61a13a1fcb6810cc153eedd97b2bdfe617
[processor-sdk/pdk.git] / packages / ti / board / diag / button / build / am64x_evm / GPIO_Button_config.c
1 /*\r
2 * Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com/\r
3 *\r
4 * Redistribution and use in source and binary forms, with or without\r
5 * modification, are permitted provided that the following conditions\r
6 * are met:\r
7 *\r
8 * Redistributions of source code must retain the above copyright\r
9 * notice, this list of conditions and the following disclaimer.\r
10 *\r
11 * Redistributions in binary form must reproduce the above copyright\r
12 * notice, this list of conditions and the following disclaimer in the\r
13 * documentation and/or other materials provided with the\r
14 * distribution.\r
15 *\r
16 * Neither the name of Texas Instruments Incorporated nor the names of\r
17 * its contributors may be used to endorse or promote products derived\r
18 * from this software without specific prior written permission.\r
19 *\r
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
31 *\r
32 */\r
33 \r
34 #include <stdio.h>\r
35 #include <ti/drv/gpio/GPIO.h>\r
36 #include <ti/csl/soc.h>\r
37 #include <ti/drv/gpio/soc/GPIO_soc.h>\r
38 \r
39 #include <ti/board/board.h>\r
40 \r
41 #define BOARD_DIAG_PUSH_BUTTON0 (0x012B) /* Port1 & Pin43 */\r
42 #define BOARD_DIAG_PUSH_BUTTON1 (0x0006) /* Port0 & pin6 */\r
43 \r
44 /* GPIO Driver board specific pin configuration structure */\r
45 GPIO_PinConfig gpioPinConfigs[] = {\r
46 BOARD_DIAG_PUSH_BUTTON0 | GPIO_CFG_INPUT | GPIO_CFG_IN_INT_RISING,\r
47 BOARD_DIAG_PUSH_BUTTON1 | GPIO_CFG_INPUT | GPIO_CFG_IN_INT_RISING\r
48 };\r
49 \r
50 /* GPIO Driver call back functions */\r
51 GPIO_CallbackFxn gpioCallbackFunctions[] = {\r
52 NULL,\r
53 NULL\r
54 };\r
55 \r
56 /* GPIO Driver configuration structure */\r
57 GPIO_v0_Config GPIO_v0_config = {\r
58 gpioPinConfigs,\r
59 gpioCallbackFunctions,\r
60 sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),\r
61 sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),\r
62 0,\r
63 };\r