Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / platform / EFR32 / CHIPDevicePlatformConfig.h
1 /*
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *    Copyright (c) 2019 Nest Labs, Inc.
5  *
6  *    Licensed under the Apache License, Version 2.0 (the "License");
7  *    you may not use this file except in compliance with the License.
8  *    You may obtain a copy of the License at
9  *
10  *        http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *    Unless required by applicable law or agreed to in writing, software
13  *    distributed under the License is distributed on an "AS IS" BASIS,
14  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *    See the License for the specific language governing permissions and
16  *    limitations under the License.
17  */
18
19 /**
20  *    @file
21  *          Platform-specific configuration overrides for the Chip Device Layer
22  *          on EFR32 platforms using the Silicon Labs SDK.
23  */
24
25 #pragma once
26
27 // ==================== Platform Adaptations ====================
28
29 #define CHIP_DEVICE_CONFIG_EFR32_NVM3_ERROR_MIN 12000000
30 #define CHIP_DEVICE_CONFIG_EFR32_BLE_ERROR_MIN 13000000
31
32 #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 0
33 #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0
34
35 #if CHIP_ENABLE_OPENTHREAD
36 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD 1
37 #endif
38
39 #define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1
40
41 #define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 0
42
43 #define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_CRIT_EIDC_KEY 2
44 #define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_PROD_EIDC_KEY 3
45 #define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_INFO_EIDC_KEY 4
46 #define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_DEBUG_EIDC_KEY 5
47
48 // ========== Platform-specific Configuration =========
49
50 // These are configuration options that are unique to the EFR32 platform.
51 // These can be overridden by the application as needed.
52
53 // -------------- EFR32 NVM3 Storage Configuration -------------
54
55 /**
56  *  @def CHIP_DEVICE_CONFIG_NVM3_MAX_NUM_OBJECTS
57  *
58  *  @brief
59  *    Configures the size of the nvm3 cache and should be set >= the
60  *    maximum number of Chip Config objects, e.g...
61  *    Factory configs[5], System configs[23], Counter configs[32] + margin[4] = 64.
62  *
63  */
64 #ifndef CHIP_DEVICE_CONFIG_NVM3_MAX_NUM_OBJECTS
65 #define CHIP_DEVICE_CONFIG_NVM3_MAX_NUM_OBJECTS 64
66 #endif // CHIP_DEVICE_CONFIG_NVM3_MAX_NUM_OBJECTS
67
68 /**
69  *  @def CHIP_DEVICE_CONFIG_NVM3_MAX_OBJECT_SIZE
70  *
71  *  @brief
72  *    This determines the max size for any Chip nvm3 object
73  *    (e.g. for Config 'string' or 'binary' types).
74  */
75 #ifndef CHIP_DEVICE_CONFIG_NVM3_MAX_OBJECT_SIZE
76 #define CHIP_DEVICE_CONFIG_NVM3_MAX_OBJECT_SIZE 1000
77 #endif // CHIP_DEVICE_CONFIG_NVM3_MAX_OBJECT_SIZE
78
79 /**
80  *  @def CHIP_DEVICE_CONFIG_NVM3_NUM_FLASH_PAGES_FOR_STORAGE
81  *
82  *  @brief
83  *    This determines the Flash size used for nvm3 data storage:-
84  *    (assuming 2k Flash page size) => Total Flash size for nvm3: 8 * 2k = 16k
85  *    The total size should allow sufficient margin for wear-levelling and
86  *    repacking.
87  */
88 #ifndef CHIP_DEVICE_CONFIG_NVM3_NUM_FLASH_PAGES_FOR_STORAGE
89 #define CHIP_DEVICE_CONFIG_NVM3_NUM_FLASH_PAGES_FOR_STORAGE 8
90 #endif // CHIP_DEVICE_CONFIG_NVM3_NUM_FLASH_PAGES_FOR_STORAGE
91
92 // ========== Platform-specific Configuration Overrides =========
93
94 #ifndef CHIP_DEVICE_CONFIG_BLE_LL_TASK_PRIORITY
95 #define CHIP_DEVICE_CONFIG_BLE_LL_TASK_PRIORITY (configTIMER_TASK_PRIORITY - 1)
96 #endif // CHIP_DEVICE_CONFIG_BLE_LL_TASK_PRIORITY
97
98 #ifndef CHIP_DEVICE_CONFIG_BLE_STACK_TASK_PRIORITY
99 #define CHIP_DEVICE_CONFIG_BLE_STACK_TASK_PRIORITY (CHIP_DEVICE_CONFIG_BLE_LL_TASK_PRIORITY - 1)
100 #endif // CHIP_DEVICE_CONFIG_BLE_STACK_TASK_PRIORITY
101
102 #ifndef CHIP_DEVICE_CONFIG_BLE_APP_TASK_PRIORITY
103 #define CHIP_DEVICE_CONFIG_BLE_APP_TASK_PRIORITY (CHIP_DEVICE_CONFIG_BLE_STACK_TASK_PRIORITY - 1)
104 #endif // CHIP_DEVICE_CONFIG_BLE_STACK_TASK_PRIORITY
105
106 #ifndef CHIP_DEVICE_CONFIG_BLE_APP_TASK_STACK_SIZE
107 #define CHIP_DEVICE_CONFIG_BLE_APP_TASK_STACK_SIZE 1536
108 #endif // CHIP_DEVICE_CONFIG_BLE_APP_TASK_STACK_SIZE
109
110 #ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE
111 #define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE 3584
112 #endif // CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE
113
114 #ifndef CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE
115 #define CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE (3 * 1024)
116 #endif // CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE
117
118 #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY 0
119 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY 0
120 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY_FULL 0
121
122 #ifndef CHIP_DEVICE_CONFIG_BLE_APP_TASK_NAME
123 #define CHIP_DEVICE_CONFIG_BLE_APP_TASK_NAME "BLE_EVENT"
124 #endif // CHIP_DEVICE_CONFIG_BLE_APP_TASK_NAME
125 #define CHIP_DEVICE_CONFIG_LOG_PROVISIONING_HASH 0
126
127 #define CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE 25