IEC60730_gpio_test.h
Go to the documentation of this file.
1 /* --COPYRIGHT--,BSD
2  * Copyright (c) 2013, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the 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 "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  * --/COPYRIGHT--*/
32 
33 #ifndef _IEC60730_GPIO_TEST_H_
34 #define _IEC60730_GPIO_TEST_H_
35 
36 //*****************************************************************************
37 //
38 //The following include is added to use C99 data types
39 //
40 //*****************************************************************************
41 #include "stdint.h"
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 
48 //*****************************************************************************
49 //
50 //The following defines are used to determine the valid parameter to be passed
51 //as to IEC60730_GPIO_TEST_testGpioOutput
52 //
53 //*****************************************************************************
54 
55 #define PORT_1 0x0001
56 #define PORT_2 0x0002
57 #define PORT_3 0x0004
58 #define PORT_4 0x0008
59 #define PORT_5 0x0010
60 #define PORT_6 0x0020
61 #define PORT_7 0x0040
62 #define PORT_8 0x0080
63 #define PORT_9 0x0100
64 #define PORT_10 0x0200
65 #define PORT_11 0x0400
66 #define PORT_A PORT_1 + PORT_2
67 #define PORT_B PORT_3 + PORT_4
68 #define PORT_C PORT_5 + PORT_6
69 #define PORT_D PORT_7 + PORT_8
70 #define PORT_E PORT_9 + PORT_10
71 #define PORT_F PORT_11
72 #define PORT_J 0x1000
73 
74 
75 //*****************************************************************************
76 //
77 //The following are values that can be passed to GPIO TEST API
78 //as the gpioPin parameter.
79 //
80 //*****************************************************************************
81 
82 #define PIN0 0x0001
83 #define PIN1 0x0002
84 #define PIN2 0x0004
85 #define PIN3 0x0008
86 #define PIN4 0x0010
87 #define PIN5 0x0020
88 #define PIN6 0x0040
89 #define PIN7 0x0080
90 #define PIN8 0x0100
91 #define PIN9 0x0200
92 #define PIN10 0x0400
93 #define PIN11 0x0800
94 #define PIN12 0x1000
95 #define PIN13 0x2000
96 #define PIN14 0x4000
97 #define PIN15 0x8000
98 
99 
100 //*****************************************************************************
101 //
102 //The following are values that can be passed to GPIO TEST API
103 //as the expectedValue parameter.
104 //
105 //*****************************************************************************
106 
107 #define PIN0_HIGH 0x0001
108 #define PIN1_HIGH 0x0002
109 #define PIN2_HIGH 0x0004
110 #define PIN3_HIGH 0x0008
111 #define PIN4_HIGH 0x0010
112 #define PIN5_HIGH 0x0020
113 #define PIN6_HIGH 0x0040
114 #define PIN7_HIGH 0x0080
115 #define PIN8_HIGH 0x0100
116 #define PIN9_HIGH 0x0200
117 #define PIN10_HIGH 0x0400
118 #define PIN11_HIGH 0x0800
119 #define PIN12_HIGH 0x1000
120 #define PIN13_HIGH 0x2000
121 #define PIN14_HIGH 0x4000
122 #define PIN15_HIGH 0x8000
123 #define PIN0_LOW 0x0000
124 #define PIN1_LOW 0x0000
125 #define PIN2_LOW 0x0000
126 #define PIN3_LOW 0x0000
127 #define PIN4_LOW 0x0000
128 #define PIN5_LOW 0x0000
129 #define PIN6_LOW 0x0000
130 #define PIN7_LOW 0x0000
131 #define PIN8_LOW 0x0000
132 #define PIN9_LOW 0x0000
133 #define PIN10_LOW 0x0000
134 #define PIN11_LOW 0x0000
135 #define PIN12_LOW 0x0000
136 #define PIN13_LOW 0x0000
137 #define PIN14_LOW 0x0000
138 #define PIN15_LOW 0x0000
139 
140 
141 //*****************************************************************************
142 //
143 //Prototypes for the APIs.
144 //
145 //*****************************************************************************
146 extern uint8_t IEC60730_GPIO_TEST_testGpioOutput(uint16_t port,
147  uint16_t gpioPin);
148 
149 extern uint8_t IEC60730_GPIO_TEST_testGpioInput(uint16_t port,
150  uint16_t gpioPin,
151  uint16_t expectedValue);
152 
153 
154 #ifdef __cplusplus
155 }
156 #endif // extern "C"
157 
158 
159 
160 
161 #endif

Copyright 2015, Texas Instruments Incorporated