pi: defined library functions

pi library functions defined so that any one can use pi.
Signed-off-by: Ajay <ajay@moxiedevices.com>
charging mgmt: all charing related decision taken by charing mgmt

Signed-off-by: Ajay <ajay@moxiedevices.com>
battery pi functions defined

Signed-off-by: Ajay <ajay@moxiedevices.com>
battery management decides charing stage

Signed-off-by: Ajay <ajay@moxiedevices.com>
common: pi sense type defined

Sense for PI can be positive or negative. Negative sense decreases will
increase in duty cycle.

Signed-off-by: Ajay <ajay@moxiedevices.com>
added function get_pv_voltage

Signed-off-by: Ajay <ajay@moxiedevices.com>
declared fn measure_pv_voltage

Signed-off-by: Ajay <ajay@moxiedevices.com>
marked calculate duty cycle as static: to be replaced by generic lib

Signed-off-by: Ajay <ajay@moxiedevices.com>
temp.c removed unnecessary functions

Signed-off-by: Ajay <ajay@moxiedevices.com>
removed PWM4OUT = 0 in pwm init

Signed-off-by: Ajay <ajay@moxiedevices.com>
main: removed un-necessary init

Signed-off-by: Ajay <ajay@moxiedevices.com>
Main: changed pv and battery voltage measurement detection

PV and battery voltage is calculated in start of each loop.

is PV ready, battery ready etc are managed by charging_mgmt, so removed
them from main flow.

Signed-off-by: Ajay <ajay@moxiedevices.com>
battery charging_state returns state_t not bool_t

Signed-off-by: Ajay <ajay@moxiedevices.com>
values for lantern

Signed-off-by: Ajay <ajay@moxiedevices.com>
defined negative side PV detection

Signed-off-by: Ajay <ajay@moxiedevices.com>
project files

Signed-off-by: Ajay <ajay@moxiedevices.com>
added stop function in battery pi

Signed-off-by: Ajay <ajay@moxiedevices.com>
initial mobile management code

Signed-off-by: Ajay <ajay@moxiedevices.com>
interrupts: mobile support added

Signed-off-by: Ajay <ajay@moxiedevices.com>
pwm: pwm3 init added

Signed-off-by: Ajay <ajay@moxiedevices.com>