15. Battery Lifetime Estimator

Battery Lifetime Estimator tool is available for DA14580/581/583, DA14585/6 and DA1453x families. The tool can be loaded by selecting the the Battery Lifetime Estimator button under Estimator ribbon group.

../_images/batteryLifeEstimator.png

Figure 51 Battery Lifetime Estimator for DA14580/581/583 and DA14585/6 families

Battery Lifetime Estimator for DA1453x shares some common input fields with DA14580/581/583 and DA14585/6 families and includes some extra fields too.

../_images/batteryLifeEstimator_da1453x.png

Figure 52 Battery Lifetime Estimator for DA1453x family

The user can specify the input values for the lifetime estimation. The tool is loaded with the default input values. At the bottom we can see the estimated lifetime in days and a table with results, such as advertising and connection current and charge. The calculations are repeated every time an input value changes. When the validation of an input value fails, a respective message appears and user is expected to correct the value in order to proceed with the lifetime estimation. Advertising interval accepts only specific values, according to the iOS BLE advertising and connection parameters described here: https://developer.apple.com/library/archive/qa/qa1931/_index.html . Advertising/Connection intervals are validated with respect to the calculated advertising/connection active times only for DA14580/581/583 and DA14585/6 family chips.

../_images/invalidRangeError.png

Figure 53 Battery Lifetime Estimator Invalid Range Error

15.1. Connection and Advertising Interval validationQuick Guide

This is a quick startup guide which contains information on how to install/setup/use Sphinx and generate the documentation in html format. The minimum steps for updating the documentation are the following:

  • Install Sphinx. The section describing the configuration of Sphinx can be skipped since it has already been prepared.

  • Update documentation by editing <root_folder>/source/file.rst

  • Run make html.

15.1.1. Sphinx installation

15.1.1.1. Prerequisites

  1. Python 2.7 which can be downloaded from here:

  2. pip package management which can be downloaded from here:

15.1.1.2. Installation via pip

$ pip install Sphinx

15.1.2. First steps with Sphinx

Sphinx comes with a script called sphinx-quickstart that sets up a source directory and creates a default conf.py with the most useful configuration values from a few questions it asks you.

Just run:

$ sphinx-quickstart

More info can be found here:

http://www.sphinx-doc.org/en/stable/tutorial.html

15.1.2.1. Setting up the Python environment in Windows

Should any issue with Sphinx commands arise, the first thing to check is whether the Python enviroment has been set up correctly.

  • Navigate to: Control PanelAll Control Panel ItemsSystem.

  • From the left side panel choose: Advanced System Settings.

  • In the System Properties window that opens select the Advanced Tab and then click Environment Variables.

  • Update PATH variable with the following entries C:Python27;C:Python27Scripts if not so.

  • Press OK.

15.1.3. Generating html documentation

Change directory to root_folder and run:

$ make html

15.1.4. Source code of the documentation

The source code of the documentation is written using the reStructuredText syntax. This is why the source files of the documentation use the extension .rst. More info regarding the syntax can be found here:

http://www.sphinx-doc.org/en/stable/rest.html#rst-primer

15.1.5. Using ReST Eclipse plugin

Editing of the *.rst can be done directly in SmartSnippets Studio.

15.1.5.1. Open .rst file in eclipse

  • Open file.rst. Moving easily from chapter to chapter can be achieved by using the Outline on the right side.

  • Images should be added to media folder of each chapter and must be in .png format.

  • Generate the .html documentation as mentioned above.

  • Open index.html file to preview the documentation by the internal browser of eclipse.