.. _power-config:

Power Configuration
$$$$$$$$$$$$$$$$$$$

Overview
========

The following sections provides different code and variables to be considered
when designing a low-power mesh network. Power management functionality
is handled by the FreeRTOS power driver and used by the peripheral drivers
(e.g. UART, SPI, I2C, etc).

TX Power Configuration
======================

The following sections provide configurations which can be implemented to
modify the application's TX power, to achieve a greater distance the device
can communicate with other devices on the network, or lower the application's
power consumption for a longer battery life in your device.  More information 
can be found in the "Power saving for ZED" section of the |ZBOSS_UG|.

Changing TX Power Level
-----------------------

By default, the |DEVICE| projects have the TX power set to 0 dBm. To modify the 
TX power level during compile time change the SysConfig *RF Stacks* |rarr| 
*Custom* |rarr| *250 kbps* |rarr| *TX Power* value.  The maximum power level 
supported for a non-PA |DEVICE| device in IEEE 802.15.4 mode is 8 dBm. 

To change the TX power during runtime to a different value, the best place to
call :code:`mac_ti23xx_24_set_tx_power` is at the end of the 
:code:`mac_ti23xx_radio_init` function in ``ti_f3_mac.c``.

Additional Optimizations
========================

To enable the sleepy behavior on an end device, make sure your application calls 
:code:`zb_set_rx_on_when_idle()` with the :code:`ZB_FALSE` parameter.  
:code:`zb_set_keepalive_timeout ` can be used to determine how often the ZED 
wakes up and sends a keepalive message to its parent.

Additionally, shutting down the external flash can save on current consumption.
This is currently handled with  :code:`Board_init` from :code:`main()`
