/* Used to give a 32k clock to EMW1062 wifi rf module */ OSStatus host_platform_init_wlan_powersave_clock( void ) { #if defined ( MICO_USE_WIFI_32K_CLOCK_MCO ) && defined ( MICO_USE_WIFI_32K_PIN ) platform_gpio_set_alternate_function( wifi_control_pins[WIFI_PIN_32K_CLK].port, wifi_control_pins[WIFI_PIN_32K_CLK].pin_number, GPIO_OType_PP, GPIO_PuPd_NOPULL, GPIO_AF_MCO ); /* enable LSE output on MCO1 */ RCC_MCO1Config( RCC_MCO1Source_LSE, RCC_MCO1Div_1 ); return kNoErr; #elif defined ( MICO_USE_WIFI_32K_PIN ) return host_platform_deinit_wlan_powersave_clock( ); #else return kNoErr; #endif }
OSStatus host_platform_init( void ) { host_platform_deinit_wlan_powersave_clock( ); #if defined ( MICO_USE_WIFI_RESET_PIN ) platform_gpio_init( &wifi_control_pins[WIFI_PIN_RESET], OUTPUT_PUSH_PULL ); host_platform_reset_wifi( true ); /* Start wifi chip in reset */ #endif #if defined ( MICO_USE_WIFI_POWER_PIN ) platform_gpio_init( &wifi_control_pins[WIFI_PIN_POWER], OUTPUT_PUSH_PULL ); host_platform_power_wifi( false ); /* Start wifi chip with regulators off */ #endif return kNoErr; }