1 /* 2 * Copyright (c) 2019, The OpenThread Authors. 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 are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * 3. Neither the name of the copyright holder nor the 13 * names of its contributors may be used to endorse or promote products 14 * derived from this software without specific prior written permission. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 * POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 /** 30 * @file 31 * This file includes compile-time configurations for platform-specific services. 32 * 33 */ 34 35 #ifndef CONFIG_PLATFORM_H_ 36 #define CONFIG_PLATFORM_H_ 37 38 #include "config/srp_server.h" 39 40 /** 41 * @addtogroup config-platform 42 * 43 * @brief 44 * This module includes configuration variables for platform-specific services. 45 * 46 * @{ 47 * 48 */ 49 50 /** 51 * @def OPENTHREAD_CONFIG_PLATFORM_INFO 52 * 53 * The platform-specific string to insert into the OpenThread version string. 54 * 55 */ 56 #ifndef OPENTHREAD_CONFIG_PLATFORM_INFO 57 #define OPENTHREAD_CONFIG_PLATFORM_INFO "NONE" 58 #endif 59 60 /** 61 * @def OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT 62 * 63 * The message pool is managed by platform defined logic when this flag is set. 64 * This feature would typically be used when operating in a multi-threaded system 65 * and multiple threads need to access the message pool. 66 * 67 */ 68 #ifndef OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT 69 #define OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT 0 70 #endif 71 72 /** 73 * @def OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT 74 * 75 * The assert is managed by platform defined logic when this flag is set. 76 * 77 */ 78 #ifndef OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT 79 #define OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT 0 80 #endif 81 82 /** 83 * @def OPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE 84 * 85 * Define to 1 to enable platform NETIF support. 86 * 87 */ 88 #ifndef OPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE 89 #define OPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE 0 90 #endif 91 92 /** 93 * @def OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 94 * 95 * Define to 1 to enable platform UDP support. 96 * 97 */ 98 #ifndef OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 99 #define OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE 0 100 #endif 101 102 /** 103 * @def OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 104 * 105 * Define to 1 if you want to enable microsecond backoff timer implemented in platform. 106 * 107 */ 108 #ifndef OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 109 #define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 0 110 #endif 111 112 /** 113 * @def OPENTHREAD_CONFIG_PLATFORM_DNSSD_ENABLE 114 * 115 * Define as 1 to enable DNSSD (mDNS) platform module. 116 * 117 */ 118 #ifndef OPENTHREAD_CONFIG_PLATFORM_DNSSD_ENABLE 119 #define OPENTHREAD_CONFIG_PLATFORM_DNSSD_ENABLE OPENTHREAD_CONFIG_SRP_SERVER_ADVERTISING_PROXY_ENABLE 120 #endif 121 122 /** 123 * @def OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE 124 * 125 * Define to 1 if you want to enable radio coexistence implemented in platform. 126 * 127 */ 128 #ifndef OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE 129 #define OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE 0 130 #endif 131 132 /** 133 * @def OPENTHREAD_CONFIG_PLATFORM_RADIO_SPINEL_RX_FRAME_BUFFER_SIZE 134 * 135 * Specifies the rx frame buffer size used by `SpinelInterface` in RCP host (posix) code. This is applicable/used when 136 * `RadioSpinel` platform is used. 137 * 138 */ 139 #ifndef OPENTHREAD_CONFIG_PLATFORM_RADIO_SPINEL_RX_FRAME_BUFFER_SIZE 140 #define OPENTHREAD_CONFIG_PLATFORM_RADIO_SPINEL_RX_FRAME_BUFFER_SIZE 8192 141 #endif 142 143 /** 144 * @def OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_SUPPORT 145 * 146 * Define to 1 if you want to enable proprietary radio support as defined by platform. 147 * 148 */ 149 #ifndef OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_SUPPORT 150 #define OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_SUPPORT 0 151 #endif 152 153 /** 154 * @def OPENTHREAD_CONFIG_PSA_ITS_NVM_OFFSET 155 * 156 * Default NVM offset while using key refs. Platforms can override this definition based on implementation 157 * 158 */ 159 #ifndef OPENTHREAD_CONFIG_PSA_ITS_NVM_OFFSET 160 #define OPENTHREAD_CONFIG_PSA_ITS_NVM_OFFSET 0x20000 161 #endif 162 163 /** 164 * @def OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE 165 * 166 * Define to 1 if you want to enable key ref usage support as defined by platform. 167 * 168 */ 169 #ifndef OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE 170 #define OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE 0 171 #endif 172 173 /** 174 * @def OPENTHREAD_CONFIG_PLATFORM_MAC_KEYS_EXPORTABLE_ENABLE 175 * 176 * Define to 1 if you want to make MAC keys exportable. 177 * 178 */ 179 #ifndef OPENTHREAD_CONFIG_PLATFORM_MAC_KEYS_EXPORTABLE_ENABLE 180 #define OPENTHREAD_CONFIG_PLATFORM_MAC_KEYS_EXPORTABLE_ENABLE 0 181 #endif 182 183 /** 184 * @def OPENTHREAD_CONFIG_PLATFORM_POWER_CALIBRATION_ENABLE 185 * 186 * Define as 1 to enable platform power calibration support. 187 * 188 */ 189 #ifndef OPENTHREAD_CONFIG_PLATFORM_POWER_CALIBRATION_ENABLE 190 #define OPENTHREAD_CONFIG_PLATFORM_POWER_CALIBRATION_ENABLE 0 191 #endif 192 193 #if OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_SUPPORT 194 #if (!defined(OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_CHANNEL_PAGE) || \ 195 !defined(OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_CHANNEL_MIN) || \ 196 !defined(OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_CHANNEL_MAX) || \ 197 !defined(OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_CHANNEL_MASK)) 198 #error "Proprietary radio support requires\ 199 OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_CHANNEL_PAGE,\ 200 OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_CHANNEL_MIN,\ 201 OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_CHANNEL_MAX and\ 202 OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_CHANNEL_MASK\ 203 to be defined by Platform." 204 #endif 205 206 #if OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_CHANNEL_PAGE > 31 207 #error "Maximum Proprietary Channel Page value currently supported is 31." 208 #endif 209 #endif 210 211 /** 212 * @} 213 * 214 */ 215 216 #endif // CONFIG_PLATFORM_H_ 217