Project Configuration

There are two configuration concepts qd_config.h and qd_module.h in this topic. In qd_config, we help developers classify some system configurations, among which power save is the key point. We use the concept of modularity to include the configuration method in qd_module.

About 'qd_config.h'

  • OPL Chip ID check
#if defined(OPL1000_A2) || defined(OPL1000_A3)

#else
#error "no define chip id in global definition in 'Preprocessor Symbols'"
#endif

The chip id should be defined in Keil project file.

  • RF power setting configuration
#ifndef RF_CFG_DEF_PWR_SET
#define RF_CFG_DEF_PWR_SET                      (RF_PWR_LVL_A0)
#endif
  • System configuration

    • Set Power save mode
#ifndef SYS_CFG_PS_MODE
#define SYS_CFG_PS_MODE                         (2)
#endif

There are three default types of SYS_CFG_PS_MODE that 0 means Low Power, 1 means Balance, 2 means Performance, else means user define if choosing user define. There are the following configurations that need to be manually configured by the developer if choosing else.

  • Smart sleep enable
#ifndef PS_ENABLED
#define PS_ENABLED                              (1)
#endif
  • Mac layer sleep after got ip
#ifndef PS_MAC_LAY_ENABLED
#define PS_MAC_LAY_ENABLED                      (1)
#endif 
  • Wi-Fi dtim period time
#ifndef WM_DTIM_PERIOD_TIME
#define WM_DTIM_PERIOD_TIME                     (3000)
#endif
  • Auto-connect retry interval
#ifndef WM_AC_RETRY_INTVL_TBL

static uint32_t g_u32WmAcRetryIntvlTbl[5] =
{
    30000,
    30000,
    60000,
    60000,
    900000,
};

#define WM_AC_RETRY_INTVL_TBL                   (g_u32WmAcRetryIntvlTbl)
#endif

About 'qd_module.h'

The developer can choose to use the desired module in qd_module.h

  • Network Manager module

If wanting to use Network Manager module to implement Wi-Fi process, the developer could set NM_ENABLED (1). At the same time, the developer must set Wi-Fi Manager module on that set WM_ENABLED (1).

#ifndef NM_ENABLED
#define NM_ENABLED                              (1)
#endif

The developer could only use Wi-Fi Manager module to implement Wi-Fi process if the developer don't use Network Manager module. Set NM_ENABLED (0) and WM_ENABLED (1).

  • Wi-Fi Manager module
#ifndef WM_ENABLED
#define WM_ENABLED                              (1)
#endif
  • BLE Manager module

If wanting to use BLE Manager module, the developer sets BM_ENABLED (1).

#ifndef BM_ENABLED
#define BM_ENABLED                              (1)
#endif
  • Time stamp module

If wanting to use Time stamp module, the developer sets TIME_STMP_ENABLED (1).

#ifndef TIME_STMP_ENABLED
#define TIME_STMP_ENABLED                       (1)
#endif
  • Finite state machine

If using Wi-Fi Manager module and BLE manager module, the developer must use Finite state machine module that set FSM_ENABLED (1).

#ifndef FSM_ENABLED
#define FSM_ENABLED                             (1)
#endif