EVE 1.0
port-init-generator.h
Go to the documentation of this file.
1 #ifndef DRIVER_PORT_INIT_GENERATOR_H_INCLUDED
2 #define DRIVER_PORT_INIT_GENERATOR_H_INCLUDED
3 /**********************************************************************/
4 /*
5  * Copyright (c) 2013-2015, Jetro AS
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without modification,
9  * are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice,
12  * this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  * this list of conditions and the following disclaimer in the documentation
15  * and/or other materials provided with the distribution.
16  * 3. The name of the author may not be used to endorse or promote products
17  * derived from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONRIBUTORS ``AS IS'' AND ANY EXPRESS
20  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
22  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
24  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
27  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
28  * OF SUCH DAMAGE.
29  *
30  * This file is part of the EVE platform.
31  */
32 
33 /**
34  * \file
35  * @brief Port init table generator.
36  *
37  * @author DT, Jetro AS
38  */ /******************************************************************/
39 
40 #include <dev/eve-module.h>
41 
42 #ifndef DRIVER_PORT_INIT_TABLE
43  #error DRIVER_PORT_INIT_TABLE must point to a header file with pin init values
44 #endif
45 
46 #define gpioPortA 0
47 
48 #define PORTDEF_BEGIN(port)
49 #define PORTDEF_END(port)
50 #define PINDEF(port, name, pin, mode, value) \
51  enum { name = (pin) }; \
52  enum { name ## _PORT = (gpioPort ## port) };
53 #define ALIAS_TABLE_BEGIN()
54 #define ALIAS_TABLE_END()
55 #define ALIAS(name, alias) \
56  enum { name = (alias) }; \
57  enum { name ## _PORT = (alias ## _PORT) };
58 #include DRIVER_PORT_INIT_TABLE
59 #undef PORTDEF_BEGIN
60 #undef PORTDEF_END
61 #undef PINDEF
62 #undef ALIAS_TABLE_BEGIN
63 #undef ALIAS_TABLE_END
64 #undef ALIAS
65 
66 #endif // DRIVER_PORT_INIT_GENERATOR_H_INCLUDED
EVE module stub.