v2.0.0
cyw43_config.h
1/*
2 * This file is part of the cyw43-driver
3 *
4 * Copyright (C) 2019-2022 George Robotics Pty Ltd
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright notice,
10 * this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 * 3. Any redistribution, use, or modification in source or binary form is done
15 * solely for personal benefit and not for any commercial purpose or for
16 * monetary gain.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE LICENSOR AND COPYRIGHT OWNER "AS IS" AND ANY
19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 * DISCLAIMED. IN NO EVENT SHALL THE LICENSOR OR COPYRIGHT OWNER BE LIABLE FOR
22 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 * This software is also available for use with certain devices under different
30 * terms, as set out in the top level LICENSE file. For commercial licensing
31 * options please email contact@georgerobotics.com.au.
32 */
33
39// Import port-specific configuration file.
40#ifdef CYW43_CONFIG_FILE
41#include CYW43_CONFIG_FILE
42#else
43#include <cyw43_configport.h>
44#endif
45
46// Bus configuration.
47
48#ifndef CYW43_USE_SPI
49#define CYW43_USE_SPI (0)
50#endif
51
52#ifndef CYW43_CLEAR_SDIO_INT
53#define CYW43_CLEAR_SDIO_INT (0)
54#endif
55
56// Firmware configuration.
57
58// Whether Bluetooth support is enabled.
59#ifndef CYW43_ENABLE_BLUETOOTH
60#define CYW43_ENABLE_BLUETOOTH (0)
61#endif
62
63// This include should define:
64// - CYW43_WIFI_FW_LEN
65// - CYW43_CLM_LEN
66// - const uintptr_t fw_data
67#ifndef CYW43_CHIPSET_FIRMWARE_INCLUDE_FILE
68#if CYW43_ENABLE_BLUETOOTH
69#define CYW43_CHIPSET_FIRMWARE_INCLUDE_FILE "firmware/wb43439A0_7_95_49_00_combined.h"
70#else
71#define CYW43_CHIPSET_FIRMWARE_INCLUDE_FILE "firmware/w43439A0_7_95_49_00_combined.h"
72#endif
73#endif
74
75// This include should define a wifi_nvram_4343[] variable.
76#ifndef CYW43_WIFI_NVRAM_INCLUDE_FILE
77#define CYW43_WIFI_NVRAM_INCLUDE_FILE "firmware/wifi_nvram_43439.h"
78#endif
79
80// This should be defined by the port if needed, to override the default
81// alignment, or add more attributes, for the firmware and NVRAM resources.
82#ifndef CYW43_RESOURCE_ATTRIBUTE
83#define CYW43_RESOURCE_ATTRIBUTE __attribute__((aligned(4)))
84#endif
85
86// Whether the download of resources should be verified.
87#ifndef CYW43_RESOURCE_VERIFY_DOWNLOAD
88#define CYW43_RESOURCE_VERIFY_DOWNLOAD (0)
89#endif
90
91// Timing and timeout configuration.
92
93#ifndef CYW43_IOCTL_TIMEOUT_US
94#define CYW43_IOCTL_TIMEOUT_US (500000)
95#endif
96
97#ifndef CYW43_SLEEP_MAX
98#define CYW43_SLEEP_MAX (50)
99#endif
100
101// Miscellaneous configuration.
102
103// No other options right now for TCP/IP stack.
104#ifndef CYW43_LWIP
105#define CYW43_LWIP (1)
106#endif
107
108#ifndef CYW43_NETUTILS
109#define CYW43_NETUTILS (0)
110#endif
111
112#ifndef CYW43_USE_OTP_MAC
113#define CYW43_USE_OTP_MAC (0)
114#endif
115
116#ifndef CYW43_GPIO
117#define CYW43_GPIO (0)
118#endif
119
120#ifndef CYW43_PRINTF
121#include <stdio.h>
122#define CYW43_PRINTF(...) printf(__VA_ARGS__)
123#endif
124
125#ifndef CYW43_VDEBUG
126#define CYW43_VDEBUG(...) (void)0
127#define CYW43_VERBOSE_DEBUG 0
128#endif
129
130#ifndef CYW43_DEBUG
131#ifdef NDEBUG
132#define CYW43_DEBUG(...) (void)0
133#else
134#define CYW43_DEBUG(...) CYW43_PRINTF(__VA_ARGS__)
135#endif
136#endif
137
138#ifndef CYW43_INFO
139#define CYW43_INFO(...) CYW43_PRINTF(__VA_ARGS__)
140#endif
141
142#ifndef CYW43_WARN
143#define CYW43_WARN(...) CYW43_PRINTF("[CYW43] " __VA_ARGS__)
144#endif
145
146#ifndef CYW43_FAIL_FAST_CHECK
147#define CYW43_FAIL_FAST_CHECK(res) (res)
148#endif
149
150// This should be defined by the port if needed, to let background processes
151// run during long blocking operations such as WiFi initialisation.
152#ifndef CYW43_EVENT_POLL_HOOK
153#define CYW43_EVENT_POLL_HOOK
154#endif
155
156#ifndef CYW43_DEFAULT_IP_STA_ADDRESS
157#define CYW43_DEFAULT_IP_STA_ADDRESS LWIP_MAKEU32(0, 0, 0, 0)
158#endif
159
160#ifndef CYW43_DEFAULT_IP_AP_ADDRESS
161#define CYW43_DEFAULT_IP_AP_ADDRESS LWIP_MAKEU32(192, 168, 4, 1)
162#endif
163
164#ifndef CYW43_DEFAULT_IP_MASK
165#define CYW43_DEFAULT_IP_MASK LWIP_MAKEU32(255, 255, 255, 0)
166#endif
167
168#ifndef CYW43_DEFAULT_IP_STA_GATEWAY
169#define CYW43_DEFAULT_IP_STA_GATEWAY LWIP_MAKEU32(192, 168, 0, 1)
170#endif
171
172#ifndef CYW43_DEFAULT_IP_AP_GATEWAY
173#define CYW43_DEFAULT_IP_AP_GATEWAY LWIP_MAKEU32(192, 168, 4, 1)
174#endif
175
176#ifndef CYW43_DEFAULT_IP_DNS
177#define CYW43_DEFAULT_IP_DNS LWIP_MAKEU32(8, 8, 8, 8)
178#endif
stdio.h