/***************************************************************************** * FUNCTION: WF_Init * * RETURNS: None * * PARAMS: * N/A. * * * NOTES: This function must be called once prior to calling any other WF... * functions. This function initializes the Wifi Driver internal State. * It also verifies functionality of the lower level SPI driver and * connected hardware. *****************************************************************************/ void WF_Init(void) { UINT8 version; /* initialize WiFi drivers, reset MRF24WB0M */ WFHardwareInit(); RawInit(); WFEnableMRF24WB0MMode(); WFGetMRF24WB0MVersion(&version); WF_ASSERT(version == EXPECTED_MRF24WB0M_VERSION_NUMBER); /* send init messages to MRF24WB0M */ WF_LibInitialize(); }
/***************************************************************************** * FUNCTION: WF_Init * * RETURNS: true if success * false otherwise * * PARAMS: * N/A. * * * NOTES: This function must be called once prior to calling any other WF... * functions. This function initializes the Wifi Driver internal State. * It also verifies functionality of the lower level SPI driver and * connected hardware. *****************************************************************************/ bool WF_Init(const void* pNetIf) { tWFDeviceInfo deviceInfo; if(!WFHardwareInit()) { return false; } RawInit(); WFEnableMRF24WMode(); WF_GetDeviceInfo(&deviceInfo); // if MRF24W if (deviceInfo.deviceType == MRF24WB0M_DEVICE) { SYS_ASSERT(deviceInfo.romVersion == 0x12, ""); SYS_ASSERT(deviceInfo.patchVersion >= 0x02, ""); if (deviceInfo.romVersion == 0x12 && deviceInfo.patchVersion >= 0x09) { gRFModuleVer1209orLater = true; } } /* send init messages to MRF24W */ WF_LibInitialize((NET_CONFIG*)pNetIf); #if defined(WF_CONSOLE) WFConsoleInit(); #if defined(APP_USE_IPERF) // IperfConsoleInit(); IperfAppInit("MRF24W"); #endif #endif // save network handle SetNetworkConfig((NET_CONFIG *)pNetIf); return true; }
/***************************************************************************** * FUNCTION: WF_Init * * RETURNS: None * * PARAMS: * N/A. * * * NOTES: This function must be called once prior to calling any other WF... * functions. This function initializes the Wifi Driver internal State. * It also verifies functionality of the lower level SPI driver and * connected hardware. *****************************************************************************/ void WF_Init(void) { tWFDeviceInfo deviceInfo; WFHardwareInit(); RawInit(); WFEnableMRF24WB0MMode(); WF_GetDeviceInfo(&deviceInfo); // if MRF24WB #if !defined(MRF24WG) WF_ASSERT(deviceInfo.romVersion == 0x12); WF_ASSERT(deviceInfo.patchVersion >= 0x02); if (deviceInfo.romVersion == 0x12 && deviceInfo.patchVersion >= 0x09) { gRFModuleVer1209orLater = TRUE; } #else // must be a MRF24WG WF_ASSERT(deviceInfo.romVersion == 0x30 || deviceInfo.romVersion == 0x31); #endif /* send init messages to MRF24W */ WF_LibInitialize(); #if defined(WF_CONSOLE) WFConsoleInit(); #if defined(WF_CONSOLE_DEMO) IperfAppInit(); #endif #endif if(DHCPIsEnabled(0)) { SetDhcpProgressState(); } }