|
| 1 | +/** |
| 2 | + ****************************************************************************** |
| 3 | + * File Name : app_conf_default.h |
| 4 | + * Description : Default application configuration file for STM32WPAN Middleware. |
| 5 | + ****************************************************************************** |
| 6 | + * @attention |
| 7 | + * |
| 8 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. |
| 9 | + * All rights reserved.</center></h2> |
| 10 | + * |
| 11 | + * This software component is licensed by ST under Ultimate Liberty license |
| 12 | + * SLA0044, the "License"; You may not use this file except in compliance with |
| 13 | + * the License. You may obtain a copy of the License at: |
| 14 | + * www.st.com/SLA0044 |
| 15 | + * |
| 16 | + ****************************************************************************** |
| 17 | + */ |
| 18 | + |
| 19 | +/* Define to prevent recursive inclusion -------------------------------------*/ |
| 20 | +#ifndef APP_CONF_DEFAULT_H |
| 21 | +#define APP_CONF_DEFAULT_H |
| 22 | + |
| 23 | +/****************************************************************************** |
| 24 | + * Application Config |
| 25 | + ******************************************************************************/ |
| 26 | + |
| 27 | +/**< generic parameters ******************************************************/ |
| 28 | +/* HCI related defines */ |
| 29 | + |
| 30 | +#define ACI_HAL_SET_TX_POWER_LEVEL 0xFC0F |
| 31 | +#define ACI_WRITE_CONFIG_DATA_OPCODE 0xFC0C |
| 32 | +#define ACI_READ_CONFIG_DATA_OPCODE 0xFC0D |
| 33 | +#define MAX_HCI_ACL_PACKET_SIZE (sizeof(TL_PacketHeader_t) + 5 + 251) |
| 34 | +#define HCI_RESET 0x0C03 |
| 35 | + |
| 36 | +#ifndef BLE_SHARED_MEM_BYTE_ORDER |
| 37 | +#define BLE_SHARED_MEM_BYTE_ORDER MSBFIRST |
| 38 | +#endif |
| 39 | +#define BLE_MODULE_SHARED_MEM_BUFFER_SIZE 128 |
| 40 | + |
| 41 | +/** |
| 42 | + * Define Tx Power |
| 43 | + */ |
| 44 | +#ifndef CFG_TX_POWER |
| 45 | +#define CFG_TX_POWER (0x18) /* -0.15dBm */ |
| 46 | +#endif |
| 47 | + |
| 48 | +/****************************************************************************** |
| 49 | + * BLE Stack |
| 50 | + ******************************************************************************/ |
| 51 | +/** |
| 52 | + * Maximum number of simultaneous connections that the device will support. |
| 53 | + * Valid values are from 1 to 8 |
| 54 | + */ |
| 55 | +#ifndef CFG_BLE_NUM_LINK |
| 56 | +#define CFG_BLE_NUM_LINK 8 |
| 57 | +#endif |
| 58 | + |
| 59 | +/** |
| 60 | + * Maximum number of Services that can be stored in the GATT database. |
| 61 | + * Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user |
| 62 | + * services |
| 63 | + */ |
| 64 | +#ifndef CFG_BLE_NUM_GATT_SERVICES |
| 65 | +#define CFG_BLE_NUM_GATT_SERVICES 8 |
| 66 | +#endif |
| 67 | + |
| 68 | +/** |
| 69 | + * Maximum number of Attributes |
| 70 | + * (i.e. the number of characteristic + the number of characteristic values + the number of descriptors, excluding the |
| 71 | + * services) that can be stored in the GATT database. Note that certain characteristics and relative descriptors are |
| 72 | + * added automatically during device initialization so this parameters should be 9 plus the number of user Attributes |
| 73 | + */ |
| 74 | +#ifndef CFG_BLE_NUM_GATT_ATTRIBUTES |
| 75 | +#define CFG_BLE_NUM_GATT_ATTRIBUTES 68 |
| 76 | +#endif |
| 77 | + |
| 78 | +/** |
| 79 | + * Maximum supported ATT_MTU size |
| 80 | + */ |
| 81 | +#ifndef CFG_BLE_MAX_ATT_MTU |
| 82 | +#define CFG_BLE_MAX_ATT_MTU (156) |
| 83 | +#endif |
| 84 | + |
| 85 | +/** |
| 86 | + * Size of the storage area for Attribute values |
| 87 | + * This value depends on the number of attributes used by application. In particular the sum of the following |
| 88 | + * quantities (in octets) should be made for each attribute: |
| 89 | + * - attribute value length |
| 90 | + * - 5, if UUID is 16 bit; 19, if UUID is 128 bit |
| 91 | + * - 2, if server configuration descriptor is used |
| 92 | + * - 2*DTM_NUM_LINK, if client configuration descriptor is used |
| 93 | + * - 2, if extended properties is used |
| 94 | + * The total amount of memory needed is the sum of the above quantities for each attribute. |
| 95 | + */ |
| 96 | +#ifndef CFG_BLE_ATT_VALUE_ARRAY_SIZE |
| 97 | +#define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344) |
| 98 | +#endif |
| 99 | + |
| 100 | +/** |
| 101 | + * Prepare Write List size in terms of number of packet |
| 102 | + */ |
| 103 | +//#define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU) |
| 104 | +#ifndef CFG_BLE_PREPARE_WRITE_LIST_SIZE |
| 105 | +#define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A) |
| 106 | +#endif |
| 107 | + |
| 108 | +/** |
| 109 | + * Number of allocated memory blocks |
| 110 | + */ |
| 111 | +//#define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU, |
| 112 | +// CFG_BLE_NUM_LINK)) |
| 113 | +#ifndef CFG_BLE_MBLOCK_COUNT |
| 114 | +#define CFG_BLE_MBLOCK_COUNT (0x79) |
| 115 | +#endif |
| 116 | + |
| 117 | +/** |
| 118 | + * Enable or disable the Extended Packet length feature. Valid values are 0 or 1. |
| 119 | + */ |
| 120 | +#ifndef CFG_BLE_DATA_LENGTH_EXTENSION |
| 121 | +#define CFG_BLE_DATA_LENGTH_EXTENSION 1 |
| 122 | +#endif |
| 123 | + |
| 124 | +/** |
| 125 | + * Sleep clock accuracy in Slave mode (ppm value) |
| 126 | + */ |
| 127 | +#ifndef CFG_BLE_SLAVE_SCA |
| 128 | +#define CFG_BLE_SLAVE_SCA 500 |
| 129 | +#endif |
| 130 | + |
| 131 | +/** |
| 132 | + * Sleep clock accuracy in Master mode |
| 133 | + * 0 : 251 ppm to 500 ppm |
| 134 | + * 1 : 151 ppm to 250 ppm |
| 135 | + * 2 : 101 ppm to 150 ppm |
| 136 | + * 3 : 76 ppm to 100 ppm |
| 137 | + * 4 : 51 ppm to 75 ppm |
| 138 | + * 5 : 31 ppm to 50 ppm |
| 139 | + * 6 : 21 ppm to 30 ppm |
| 140 | + * 7 : 0 ppm to 20 ppm |
| 141 | + */ |
| 142 | +#ifndef CFG_BLE_MASTER_SCA |
| 143 | +#define CFG_BLE_MASTER_SCA 0 |
| 144 | +#endif |
| 145 | + |
| 146 | +/** |
| 147 | + * Source for the 32 kHz slow speed clock |
| 148 | + * 1 : internal RO |
| 149 | + * 0 : external crystal ( no calibration ) |
| 150 | + */ |
| 151 | +#ifndef CFG_BLE_LSE_SOURCE |
| 152 | +#define CFG_BLE_LSE_SOURCE 0 |
| 153 | +#endif |
| 154 | + |
| 155 | +/** |
| 156 | + * Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us) |
| 157 | + */ |
| 158 | +#ifndef CFG_BLE_HSE_STARTUP_TIME |
| 159 | +#define CFG_BLE_HSE_STARTUP_TIME 0x148 |
| 160 | +#endif |
| 161 | + |
| 162 | +/** |
| 163 | + * Maximum duration of the connection event when the device is in Slave mode in units of 625/256 us (~2.44 us) |
| 164 | + */ |
| 165 | +#ifndef CFG_BLE_MAX_CONN_EVENT_LENGTH |
| 166 | +#define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF) |
| 167 | +#endif |
| 168 | + |
| 169 | +/** |
| 170 | + * Viterbi Mode |
| 171 | + * 1 : enabled |
| 172 | + * 0 : disabled |
| 173 | + */ |
| 174 | +#define CFG_BLE_VITERBI_MODE 1 |
| 175 | + |
| 176 | +/** |
| 177 | + * LL Only Mode |
| 178 | + * 1 : LL Only |
| 179 | + * 0 : LL + Host |
| 180 | + */ |
| 181 | +#define CFG_BLE_LL_ONLY 1 |
| 182 | + |
| 183 | +#endif /* APP_CONF_DEFAULT_H */ |
| 184 | + |
| 185 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
0 commit comments