forked from ethersex/ethersex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h
154 lines (126 loc) · 4.72 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*
* (c) by Alexander Neumann <[email protected]>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License (either version 2 or
* version 3) as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* For more information on the GPL, please go to:
* http://www.gnu.org/copyleft/gpl.html
*/
#ifndef _CONFIG_H
#define _CONFIG_H
/* define these menu choices before including autoconf.h */
#define BMP085_OSS_0 0
#define BMP085_OSS_1 1
#define BMP085_OSS_2 2
#define BMP085_OSS_3 3
#include "autoconf.h"
/* network controller hardware bug defines */
#define ENC28J60_REV4_WORKAROUND
#define ENC28J60_REV5_WORKAROUND
#define ENC28J60_REV6_WORKAROUND /* rev is 6; but microchip calls it B7 */
/* configure duplex mode */
#define NET_FULL_DUPLEX 0
/* configure main callback function for uip */
#define UIP_APPCALL if (uip_conn->callback != NULL) uip_conn->callback
#define UIP_UDP_APPCALL if (uip_udp_conn->callback) uip_udp_conn->callback
/* onewire support */
#define ONEWIRE_PARASITE
/* rc5 support */
#define RC5_QUEUE_LENGTH 10
/* rfm12 config */
#define RFM12_FREQ_433920 433920
#define RFM12_FREQ_868300 868300
#define RFM12_FREQ_869775 869775
#define RFM12_FREQ_869800 869800
#define RFM12_FREQ_869825 869825
#define RFM12_FREQ_869850 869850
#define RFM12_FREQ_869875 869875
#define RFM12_FREQ_869900 869900
#define RFM12_FREQ_869925 869925
#define ARCH_AVR 1
#define ARCH_HOST 2
#if ARCH == ARCH_HOST
#include "core/host/host.h"
#endif
/* Include pinning.c as output of m4 scripts in pinning sub-directory.
Have a look there for MCU specific configuration options. */
#include "pinning.c"
/* use watchdog only when not debugging */
#if !defined(DEBUG) || defined(DEBUG_USE_WATCHDOG)
# define USE_WATCHDOG
#endif
/* macros */
#ifdef USE_WATCHDOG
# include <avr/wdt.h>
# define wdt_kick() wdt_reset()
#else
# define wdt_kick()
#endif
/* Map the IP address configuration to use in network.c
(and that is assigned to the primary stack). */
#ifdef ENC28J60_SUPPORT
# define set_CONF_ETHERSEX_MAC(ip) set_CONF_ENC_MAC(ip)
# define set_CONF_ETHERSEX_IP(ip) set_CONF_ENC_IP(ip)
# define set_CONF_ETHERSEX_IP4_NETMASK(ip) set_CONF_ENC_IP4_NETMASK(ip)
# define CONF_ETHERSEX_MAC CONF_ENC_MAC
#elif defined (TAP_SUPPORT)
# define set_CONF_ETHERSEX_MAC(ip) set_CONF_TAP_MAC(ip)
# define set_CONF_ETHERSEX_IP(ip) set_CONF_TAP_IP(ip)
# define set_CONF_ETHERSEX_IP4_NETMASK(ip) set_CONF_TAP_IP4_NETMASK(ip)
# define CONF_ETHERSEX_MAC CONF_TAP_MAC
#elif defined (RFM12_IP_SUPPORT)
# define set_CONF_ETHERSEX_IP(ip) set_CONF_RFM12_IP(ip)
# define set_CONF_ETHERSEX_IP4_NETMASK(ip) set_CONF_RFM12_IP4_NETMASK(ip)
#elif defined (ZBUS_SUPPORT)
# define set_CONF_ETHERSEX_IP(ip) set_CONF_ZBUS_IP(ip)
# define set_CONF_ETHERSEX_IP4_NETMASK(ip) set_CONF_ZBUS_IP4_NETMASK(ip)
#elif defined (USB_NET_SUPPORT)
# define set_CONF_ETHERSEX_IP(ip) set_CONF_USB_NET_IP(ip)
# define set_CONF_ETHERSEX_IP4_NETMASK(ip) set_CONF_USB_NET_IP4_NETMASK(ip)
#endif
/* ADC Reference Flags */
#define ADC_AREF 0
#define ADC_AVCC 0x40
#define ADC_1_1 0x80
#define ADC_2_56 0xC0
/* Figure out whether we need access to EEPROM:
- ECMD without TEENSY (IP address configuration etc.)
- BOOTP with to-EEPROM-feature
- STELLA with eeprom load/write support
- JABBER with configuration in eeprom
- ONEWIRE temperature sensors with names in eeprom */
#if (defined(ECMD_PARSER_SUPPORT) && !defined(TEENSY_SUPPORT)) || \
(defined(BOOTP_SUPPORT) && defined(BOOTP_TO_EEPROM_SUPPORT)) || \
(defined(STELLA_SUPPORT) && !defined(TEENSY_SUPPORT)) || \
defined(JABBER_EEPROM_SUPPORT) || \
(defined(ONEWIRE_NAMING_SUPPORT) && !defined(TEENSY_SUPPORT))
# define EEPROM_SUPPORT 1
#endif
/* Figure out whether we need CRC_SUPPORT: */
#if defined(EEPROM_SUPPORT) || \
defined(ONEWIRE_SUPPORT) || \
defined(VFS_INLINE_SUPPORT) || \
defined(TFTP_SUPPORT)
# define CRC_SUPPORT 1
#endif
#if defined(VFS_SUPPORT) && \
defined(VFS_INLINE_SUPPORT) && \
!defined(VFS_SD_SUPPORT) && \
!defined(VFS_DF_SUPPORT) && \
!defined(VFS_EEPROM_SUPPORT) && \
!defined(VFS_EEPROM_RAW_SUPPORT) && \
!defined(VFS_DC3840_SUPPORT)
# define VFS_TEENSY 1
#endif
#endif /* _CONFIG_H */