int32_t BSP_NvInfoInit(void) { PNV_INFO pNvInfo = (PNV_INFO)&EeBuffer; #ifndef USE_NV_INFO // // 1: USE DEFAULT PARAM // NST_MOVE_MEM(pNvInfo->MaxTxPwr, DefaultTxPwrIdxTbl, sizeof(pNvInfo->MaxTxPwr)); #else // USE_NV_INFO // // 2: USE FLASH PARAM // BSP_QSpiInit(DEFAULT_QSPI_CLK); QSpiFlashRead(NV_INFO_START, (UINT8*)pNvInfo, sizeof(NV_INFO)); // CHECK PARAM CheckParam(pNvInfo); #endif // USE_NV_INFO return NST_STATUS_SUCCESS; }
INT32 BSP_NvInfoInit(VOID) { PNV_INFO pNvInfo = (PNV_INFO)&EeBuffer; #ifndef USE_NV_INFO // // 1: USE DEFAULT PARAM // NST_MOVE_MEM(pNvInfo->MaxTxPwr, DefaultTxPwrIdxTbl, sizeof(pNvInfo->MaxTxPwr)); #else // USE_NV_INFO // // 2: USE FLASH PARAM // { { #ifdef NULINK2_SOC BSP_QSpiInit(DEFAULT_QSPI_CLK); #else BSP_SpiInit(); #endif #ifdef NULINK2_SOC QSpiFlashRead(NV_INFO_START, (UINT8*)pNvInfo, sizeof(NV_INFO)); #else SpiFlashRead(NV_INFO_START, (UINT8*)pNvInfo, sizeof(NV_INFO)); #endif } } // CHECK PARAM CheckParam(pNvInfo); #endif // USE_NV_INFO return NST_STATUS_SUCCESS; }