Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Power Save

         Here are listed all the functions that implement the Power-Save APIs.

Functions

sint8 m2m_wifi_enable_XO_during_sleep (uint8 bXOSleepEnable)
 Specifies whether the crystal oscillator is left on or off during deep sleep (defaults to off). More...
 
uint8 m2m_wifi_get_sleep_mode (void)
 Get the current Power save mode. More...
 
sint8 m2m_wifi_request_sleep (uint32 u32SlpReqTime)
 API to place the WINC IC into sleep mode for a specified period of time. More...
 
sint8 m2m_wifi_set_lsn_int (tstrM2mLsnInt *pstrM2mLsnInt)
 Set the Wi-Fi listen interval for power save operation. It is represented in units of AP Beacon periods. More...
 
sint8 m2m_wifi_set_power_profile (uint8 u8PwrMode)
 Change the power profile mode. More...
 
sint8 m2m_wifi_set_sleep_mode (uint8 PsTyp, uint8 BcastEn)
 Set the power saving mode for the WINC1500. More...
 

sint8 m2m_wifi_enable_XO_during_sleep ( uint8  bXOSleepEnable)

Specifies whether the crystal oscillator is left on or off during deep sleep (defaults to off).

m2m_wifi_enable_XO_during_sleep controls the state of the crystal oscillator during deep sleep.
Parameters
[in]bXOSleepEnable0 : The XO will be switched off during deep sleep 1 : The XO will be kept on during deep sleep
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.

References hif_send(), M2M_ERR_INVALID_ARG, M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_XO_SLEEP_ENABLE, NULL, and tstrM2mWiFiXOSleepEnable::u8EnableXODuringSleep.

NMI_API uint8 m2m_wifi_get_sleep_mode ( void  )

Get the current Power save mode.

Synchronous power save mode retrieval function.

Returns
The current operating power saving mode.
See Also
tenuPowerSaveModes , m2m_wifi_set_sleep_mode
Returns
The current operating power saving mode based on the enumerated sleep modes tenuPowerSaveModes.
See Also
tenuPowerSaveModes m2m_wifi_set_sleep_mode

References hif_get_sleep_mode().

NMI_API sint8 m2m_wifi_request_sleep ( uint32  u32SlpReqTime)

API to place the WINC IC into sleep mode for a specified period of time.

Synchronous power-save sleep request function, which requests the WINC device to sleep in the currently configured
power save mode, as set using @ref m2m_wifi_set_sleep_mode, for a specific time as defined by the passed in parameter.
This function should be used in the @ref M2M_PS_MANUAL power save mode only.
A wake up request is automatically performed by the WINC device when any host driver API function, e.g. Wi-Fi or socket operation is called.
Parameters
[in]u32SlpReqTimeRequest sleep time in ms.
The best recommended sleep duration is left to be determined by the application. Taking into account that if the application sends notifications very rarely, sleeping for a long time can be a power-efficient decision. In contrast, applications that are sensitive for long periods of absence can experience performance degradation in the connection if long sleeping times are used.
Returns
The function returns M2M_SUCCESS for successful operation and a negative value otherwise.
Warning
The function should be called in M2M_PS_MANUAL power save mode only. As enumerated in tenuPowerSaveModes. It's also important to note that during the sleeping time while in the M2M_PS_MANUAL mode, AP beacon monitoring is bypassed and the wifi-connection may drop if the sleep period is elongated.
See Also
tenuPowerSaveModes m2m_wifi_set_sleep_mode

References hif_get_sleep_mode(), hif_send(), M2M_PS_MANUAL, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_DOZE, NULL, and tstrM2mSlpReqTime::u32SleepTime.

Referenced by main().

NMI_API sint8 m2m_wifi_set_lsn_int ( tstrM2mLsnInt pstrM2mLsnInt)

Set the Wi-Fi listen interval for power save operation. It is represented in units of AP Beacon periods.

API to set Wi-Fi listen interval for power save operation.

Parameters
[in]pstrM2mLsnIntStructure holding the listen interval configurations.
Returns
The function SHALL return 0 for success and a negative value otherwise.
See Also
tstrM2mLsnInt , m2m_wifi_set_sleep_mode
Precondition
m2m_wifi_set_sleep_mode shall be called first
Warning
The Function called once after initialization.
This is one of the two synchronous power-save setting functions that
allow the host MCU application to tweak the system power consumption. Such tweaking can be done by modifying the 
Wi-Fi listen interval. The listen interval is how many beacon periods the station can sleep before it wakes up to receive data buffered in the AP.
It is represented in units of AP beacon periods(100ms).  
Warning
The function should be called once after initialization.
Parameters
[in]pstrM2mLsnIntStructure holding the listen interval configuration.
Precondition
The function m2m_wifi_set_sleep_mode shall be called first, to set the power saving mode required.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC and a negative value otherwise.
See Also
tstrM2mLsnInt m2m_wifi_set_sleep_mode

References hif_send(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_LSN_INT, and NULL.

Referenced by main().

NMI_API sint8 m2m_wifi_set_power_profile ( uint8  u8PwrMode)

Change the power profile mode.

Parameters
[in]u8PwrModeChange the WINC power profile to different mode PWR_LOW1/PWR_LOW2/PWR_HIGH/PWR_AUTO (tenuM2mPwrMode)
Returns
The function SHALL return M2M_SUCCESS for success and a negative value otherwise.
See Also
tenuM2mPwrMode
Precondition
m2m_wifi_init
Warning
must be called after the initializations and before any connection request and can't be changed in run time,
Parameters
[in]u8PwrModeChange the WINC power profile to different mode based on the enumeration tenuM2mPwrMode.
Warning
May only be called after initialization, before any connection request, and may not be used to change the power mode thereafter.
Returns
The function SHALL return M2M_SUCCESS for success and a negative value otherwise.
See Also
tenuM2mPwrMode m2m_wifi_init

References hif_send(), M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_SET_POWER_PROFILE, NULL, and tstrM2mPwrMode::u8PwrMode.

NMI_API sint8 m2m_wifi_set_sleep_mode ( uint8  PsTyp,
uint8  BcastEn 
)

Set the power saving mode for the WINC1500.

Synchronous API to set the power-save mode of the WINC IC.

Parameters
[in]PsTypDesired power saving mode. Supported types are defined in tenuPowerSaveModes.
[in]BcastEnBroadcast reception enable flag. If it is 1, the WINC1500 must be awake each DTIM Beacon for receiving Broadcast traffic. If it is 0, the WINC1500 will not wakeup at the DTIM Beacon, but its wakeup depends only on the the configured Listen Interval.
Returns
The function SHALL return 0 for success and a negative value otherwise.
See Also
tenuPowerSaveModes
Warning
The function called once after initialization.
This is one of the two synchronous power-save setting functions that allow the host MCU application
to tweak the system power consumption. Such tweaking can be done through one of two ways:
- 1) Changing the power save mode, to one of the allowed power save modes (see @ref tenuPowerSaveModes). This is done by setting the first parameter.
- 2) Configuring DTIM monitoring: Configuring beacon monitoring parameters by enabling or disabling the reception of broadcast/multicast data.
     This is done by setting the second parameter.
Parameters
[in]PsTypDesired power saving mode. Supported types are enumerated in tenuPowerSaveModes.
[in]BcastEnBroadcast reception enable flag. If it is 1, the WINC will be awake for each DTIM beacon in order to check for and receive broadcast traffic. If it is 0, the WINC will ignore broadcast traffic. Through this flag the WINC will not wakeup at the DTIM beacon, but instead it will wakeup only based on the configured Listen Interval.
Warning
The function called once after initialization.
Returns
The function returns M2M_SUCCESS for successful operation and a negative value otherwise.
See Also
tenuPowerSaveModes m2m_wifi_get_sleep_mode m2m_wifi_set_lsn_int

References hif_send(), hif_set_sleep_mode(), M2M_INFO, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_SLEEP, NULL, tstrM2mPsType::u8BcastEn, and tstrM2mPsType::u8PsType.

Referenced by main().