Microchip® Advanced Software Framework

power_save_mode_example/main21.c File Reference

WINC1500 Power Save Mode Example.

Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.

#include "asf.h"
#include "main.h"
#include "driver/include/m2m_periph.h"
#include "driver/include/m2m_wifi.h"
#include "driver/source/nmasic.h"

Macros

#define STRING_EOL   "\r\n"
 
#define STRING_HEADER
 

Functions

static void configure_console (void)
 Configure UART console. More...
 
static void configure_timer (void)
 Configure Timer module. More...
 
static void disable_pullups (void)
 
int main (void)
 Main application function. More...
 
static void timer_callback (struct tcc_module *const module)
 Timer callback function for the Request RSSI. More...
 
static void wifi_cb (uint8_t u8MsgType, void *pvMsg)
 Callback to get the Wi-Fi status update. More...
 

Variables

static struct usart_module cdc_uart_module
 UART module for debug. More...
 
struct tcc_module deep_sleep_tcc_module
 Instance of Timer module. More...
 
static uint8 gu8SleepStatus
 Wi-Fi Sleep status. More...
 

#define STRING_EOL   "\r\n"
#define STRING_HEADER
Value:
"-- WINC1500 Power Save mode example --"STRING_EOL \
"-- "BOARD_NAME " --"STRING_EOL \
"-- Compiled: "__DATE__ " "__TIME__ " --"STRING_EOL
#define BOARD_NAME
Definition: app_init.h:140
#define STRING_EOL
Definition: power_save_mode_example/main21.c:93

Referenced by main().

static void configure_timer ( void  )
static
static void timer_callback ( struct tcc_module *const  module)
static

Timer callback function for the Request RSSI.

References m2m_wifi_req_curr_rssi().

static void wifi_cb ( uint8_t  u8MsgType,
void *  pvMsg 
)
static

Callback to get the Wi-Fi status update.

Parameters
[in]u8MsgTypetype of Wi-Fi notification. Possible types are:
[in]pvMsgA pointer to a buffer containing the notification parameters (if any). It should be casted to the correct data type corresponding to the notification type.

References deep_sleep_tcc_module, gu8SleepStatus, M2M_WIFI_CH_ALL, m2m_wifi_connect(), M2M_WIFI_CONNECTED, M2M_WIFI_DISCONNECTED, M2M_WIFI_REQ_DHCP_CONF, m2m_wifi_request_dhcp_client(), M2M_WIFI_RESP_CON_STATE_CHANGED, M2M_WIFI_RESP_CURRENT_RSSI, MAIN_PS_REQ_SLEEP, MAIN_PS_WAKE, MAIN_WLAN_AUTH, MAIN_WLAN_PSK, MAIN_WLAN_SSID, tcc_enable_callback(), and tstrM2mWifiStateChanged::u8CurrState.

Referenced by main().

struct usart_module cdc_uart_module
static

UART module for debug.

struct tcc_module deep_sleep_tcc_module

Instance of Timer module.

Referenced by configure_timer(), and wifi_cb().

uint8 gu8SleepStatus
static

Wi-Fi Sleep status.

Referenced by main(), and wifi_cb().