/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file app_conf.h * @author MCD Application Team * @brief Application configuration file for STM32WPAN Middleware. ****************************************************************************** * @attention * * Copyright (c) 2022 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef APP_CONF_H #define APP_CONF_H /* Includes ------------------------------------------------------------------*/ #include "hw_if.h" #include "utilities_conf.h" /* #include "log_module.h" */ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ /****************************************************************************** * Application Config ******************************************************************************/ /**< generic parameters ******************************************************/ /** * Define Tx Power */ #define CFG_TX_POWER (0x19) /* 0x19 <=> -0.3 dBm */ /** * Define Advertising parameters */ #define CFG_BD_ADDRESS (0x0008E12A1234) /** * Define BD_ADDR type: define proper address. Can only be GAP_PUBLIC_ADDR (0x00) or GAP_STATIC_RANDOM_ADDR (0x01) */ #define CFG_BD_ADDRESS_TYPE (GAP_PUBLIC_ADDR) /** * Define privacy: PRIVACY_DISABLED or PRIVACY_ENABLED */ #define CFG_PRIVACY (PRIVACY_DISABLED) /** * Define BLE Address Type * Bluetooth address types defined in ble_legacy.h * if CFG_PRIVACY equals PRIVACY_DISABLED, CFG_BLE_ADDRESS_TYPE has 2 allowed values: GAP_PUBLIC_ADDR or GAP_STATIC_RANDOM_ADDR * if CFG_PRIVACY equals PRIVACY_ENABLED, CFG_BLE_ADDRESS_TYPE has 2 allowed values: GAP_RESOLVABLE_PRIVATE_ADDR or GAP_NON_RESOLVABLE_PRIVATE_ADDR */ #define CFG_BLE_ADDRESS_TYPE (GAP_PUBLIC_ADDR) #define ADV_INTERVAL_MIN (0x0080) #define ADV_INTERVAL_MAX (0x00A0) #define ADV_LP_INTERVAL_MIN (0x0640) #define ADV_LP_INTERVAL_MAX (0x0FA0) #define ADV_TYPE ADV_IND #define ADV_FILTER NO_WHITE_LIST_USE /** * Define IO Authentication */ #define CFG_BONDING_MODE (1) #define CFG_USED_FIXED_PIN (0) /* 0->fixed pin is used ; 1->No fixed pin used*/ #define CFG_FIXED_PIN (111111) #define CFG_ENCRYPTION_KEY_SIZE_MAX (16) #define CFG_ENCRYPTION_KEY_SIZE_MIN (8) /** * Define Input Output capabilities */ #define CFG_IO_CAPABILITY (IO_CAP_DISPLAY_YES_NO) /** * Define Man In The Middle modes */ #define CFG_MITM_PROTECTION (MITM_PROTECTION_REQUIRED) /** * Define Secure Connections Support */ #define CFG_SC_SUPPORT (SC_PAIRING_OPTIONAL) /** * Define Keypress Notification Support */ #define CFG_KEYPRESS_NOTIFICATION_SUPPORT (KEYPRESS_NOT_SUPPORTED) /** * Identity root key used to derive IRK and DHK(Legacy) */ #define CFG_BLE_IR {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0} /** * Encryption root key used to derive LTK(Legacy) and CSRK */ #define CFG_BLE_ER {0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21} /* USER CODE BEGIN Generic_Parameters */ /* USER CODE END Generic_Parameters */ /**< specific parameters */ /*****************************************************/ /* USER CODE BEGIN Specific_Parameters */ /* USER CODE END Specific_Parameters */ /****************************************************************************** * BLE Stack ******************************************************************************/ /** * BLE stack options, bitmap to active or not some features at BleStack_Init() function call. */ #define CFG_BLE_OPTIONS (0 | \ 0 | \ 0 | \ 0 | \ 0 | \ 0 | \ 0 | \ 0) /** * Maximum number of simultaneous connections and advertising that the device will support. * This setting should not exceed the number of BLE connection supported by BLE host stack. */ #define CFG_BLE_NUM_LINK (2) /** * Maximum number of Services that can be stored in the GATT database. * Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user services */ #define CFG_BLE_NUM_GATT_SERVICES (8) /** * Maximum number of Attributes * (i.e. the number of characteristic + the number of characteristic values + the number of descriptors, excluding the services) * that can be stored in the GATT database. * Note that certain characteristics and relative descriptors are added automatically during device initialization * so this parameters should be 9 plus the number of user Attributes */ #define CFG_BLE_NUM_GATT_ATTRIBUTES (68) /** * Maximum supported ATT_MTU size * This setting should be aligned with ATT_MTU value configured in the ble host */ #define CFG_BLE_ATT_MTU_MAX (251) /** * Size of the storage area for Attribute values * This value depends on the number of attributes used by application. In particular the sum of the following quantities (in octets) should be made for each attribute: * - attribute value length * - 5, if UUID is 16 bit; 19, if UUID is 128 bit * - 2, if server configuration descriptor is used * - 2*DTM_NUM_LINK, if client configuration descriptor is used * - 2, if extended properties is used * The total amount of memory needed is the sum of the above quantities for each attribute. */ #define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344) /** * depth of the PREPARE WRITE queue when PREPARE WRITE REQUEST */ #define CFG_BLE_ATTR_PREPARE_WRITE_VALUE_SIZE (30) #define CFG_BLE_MBLOCK_COUNT_MARGIN (0x15) #define PREP_WRITE_LIST_SIZE (BLE_DEFAULT_PREP_WRITE_LIST_SIZE) /** * Number of allocated memory blocks used to transmit and receive data packets */ #define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(PREP_WRITE_LIST_SIZE, \ CFG_BLE_ATT_MTU_MAX, CFG_BLE_NUM_LINK) \ + CFG_BLE_MBLOCK_COUNT_MARGIN) /** * Appearance of device set into BLE GAP */ #define CFG_GAP_APPEARANCE (GAP_APPEARANCE_UNKNOWN) /** * Connection Oriented Channel parameters */ #define CFG_BLE_COC_NBR_MAX (64) #define CFG_BLE_COC_MPS_MAX (248) #define CFG_BLE_COC_INITIATOR_NBR_MAX (32) /** * PHY preferences */ #define CFG_PHY_PREF (0) #define CFG_PHY_PREF_TX (HCI_TX_PHYS_LE_2M_PREF) #define CFG_PHY_PREF_RX (HCI_RX_PHYS_LE_2M_PREF) /* USER CODE BEGIN BLE_Stack */ /* USER CODE END BLE_Stack */ /****************************************************************************** * Low Power * * When CFG_LPM_LEVEL is set to: * - 0 : Low Power Mode is not activated, RUN mode will be used. * - 1 : Low power active, the one selected with CFG_LPM_STDBY_SUPPORTED * - 2 : In addition, force to disable modules to reach lowest power figures. * * When CFG_LPM_STDBY_SUPPORTED is set to: * - 1 : Standby is used as low power mode. * - 0 : Standby is not used, so stop mode 1 is used as low power mode. * ******************************************************************************/ #define CFG_LPM_LEVEL (2) #define CFG_LPM_STDBY_SUPPORTED (1) /* USER CODE BEGIN Low_Power 0 */ /* USER CODE END Low_Power 0 */ /** * Supported requester to the MCU Low Power Manager - can be increased up to 32 * It list a bit mapping of all user of the Low Power Manager */ typedef enum { CFG_LPM_APP, CFG_LPM_LOG, /* USER CODE BEGIN CFG_LPM_Id_t */ /* USER CODE END CFG_LPM_Id_t */ } CFG_LPM_Id_t; /* USER CODE BEGIN Low_Power 1 */ /* USER CODE END Low_Power 1 */ /* Core voltage supply selection, it can be PWR_LDO_SUPPLY or PWR_SMPS_SUPPLY */ #define CFG_CORE_SUPPLY (PWR_LDO_SUPPLY) /****************************************************************************** * RTC ******************************************************************************/ #define RTC_N_PREDIV_S (10) #define RTC_PREDIV_S ((1< NO ; 1 --> YES) */ #define USE_TEMPERATURE_BASED_RADIO_CALIBRATION (0) #define RADIO_INTR_NUM RADIO_IRQn /* 2.4GHz RADIO global interrupt */ #define RADIO_INTR_PRIO_HIGH (0) /* 2.4GHz RADIO interrupt priority when radio is Active */ #define RADIO_INTR_PRIO_LOW (5) /* 2.4GHz RADIO interrupt priority when radio is Not Active - Sleep Timer Only */ #if (USE_RADIO_LOW_ISR == 1) #define RADIO_SW_LOW_INTR_NUM HASH_IRQn /* Selected interrupt vector for 2.4GHz RADIO low ISR */ #define RADIO_SW_LOW_INTR_PRIO (15) /* 2.4GHz RADIO low ISR priority */ #endif /* USE_RADIO_LOW_ISR */ /* Link Layer supported number of antennas */ #define RADIO_NUM_OF_ANTENNAS (4) #define RCC_INTR_PRIO (1) /* HSERDY and PLL1RDY */ /* RF TX power table ID selection: * 0 -> RF TX output level from -20 dBm to +10 dBm * 1 -> RF TX output level from -20 dBm to +3 dBm */ #define CFG_RF_TX_POWER_TABLE_ID (1) /* USER CODE BEGIN Radio_Configuration */ /* USER CODE END Radio_Configuration */ /****************************************************************************** * HW_RNG configuration ******************************************************************************/ /* Number of 32-bit random values stored in internal pool */ #define CFG_HW_RNG_POOL_SIZE (32) /* USER CODE BEGIN HW_RNG_Configuration */ /* USER CODE END HW_RNG_Configuration */ /****************************************************************************** * MEMORY MANAGER ******************************************************************************/ #define CFG_MM_POOL_SIZE (4000) #define CFG_PWR_VOS2_SUPPORTED (0) /* VOS2 power configuration not currently supported with radio activity */ #define CFG_AMM_VIRTUAL_MEMORY_NUMBER (2u) #define CFG_AMM_VIRTUAL_STACK_BLE (1U) #define CFG_AMM_VIRTUAL_STACK_BLE_BUFFER_SIZE (400U) #define CFG_AMM_VIRTUAL_APP_BLE (2U) #define CFG_AMM_VIRTUAL_APP_BLE_BUFFER_SIZE (200U) #define CFG_AMM_POOL_SIZE DIVC(CFG_MM_POOL_SIZE, sizeof (uint32_t)) \ + (AMM_VIRTUAL_INFO_ELEMENT_SIZE * CFG_AMM_VIRTUAL_MEMORY_NUMBER) /* USER CODE BEGIN MEMORY_MANAGER_Configuration */ /* USER CODE END MEMORY_MANAGER_Configuration */ /* USER CODE BEGIN Defines */ /** * User interaction * When CFG_LED_SUPPORTED is set, LEDS are activated if requested * When CFG_BUTTON_SUPPORTED is set, the push button are activated if requested */ #define CFG_LED_SUPPORTED (0) #define CFG_BUTTON_SUPPORTED (1) /** * Overwrite some configuration imposed by Low Power level selected. */ #if (CFG_LPM_LEVEL > 1) #if CFG_LED_SUPPORTED #undef CFG_LED_SUPPORTED #define CFG_LED_SUPPORTED (0) #endif /* CFG_LED_SUPPORTED */ #endif /* CFG_LPM_LEVEL */ /* USER CODE END Defines */ /** * Overwrite some configuration imposed by Low Power level selected. */ #if (CFG_LPM_LEVEL > 1) #if CFG_LOG_SUPPORTED #undef CFG_LOG_SUPPORTED #define CFG_LOG_SUPPORTED (0) #endif /* CFG_LOG_SUPPORTED */ #if CFG_DEBUGGER_LEVEL #undef CFG_DEBUGGER_LEVEL #define CFG_DEBUGGER_LEVEL (0) #endif /* CFG_DEBUGGER_LEVEL */ #endif /* CFG_LPM_LEVEL */ #if (CFG_LPM_STDBY_SUPPORTED == 1) #if CFG_LOG_SUPPORTED #undef CFG_LOG_SUPPORTED #define CFG_LOG_SUPPORTED (0) #endif /* CFG_LOG_SUPPORTED */ #endif /* CFG_LPM_STDBY_SUPPORTED */ /* USER CODE BEGIN Defines_2 */ /* USER CODE END Defines_2 */ #endif /*APP_CONF_H */