summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/battery.h
blob: 5bdc91fefc3b75f55633a6b99e995ef6565d8ab6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**************************************************************************//**
\file  battery.h

\brief Interface to the battery sensor.

\author
    Atmel Corporation: http://www.atmel.com \n
    Support email: avr@atmel.com

  Copyright (c) 2008-2011, Atmel Corporation. All rights reserved.
  Licensed under Atmel's Limited License Agreement (BitCloudTM).

\internal
  History:
    29/06/07 E. Ivanov - Created
******************************************************************************/

#ifndef _BATTERY_H
#define _BATTERY_H

/******************************************************************************
                   Includes section
******************************************************************************/
// \cond
#include <types.h>
#include <sensors.h>
// \endcond

/******************************************************************************
                   Prototypes section
******************************************************************************/
/**************************************************************************//**
\brief  Opens the component to use.
\return
  BC_SUCCESS - the component is ready to been use. \n
  BC_FAIL - otherwise.
******************************************************************************/
result_t openBattery(void);

/**************************************************************************//**
\brief  Closes component.
\return
  BC_SUCCESS - always.
******************************************************************************/
result_t closeBattery(void);

/**************************************************************************//**
\brief  Starts ADC request on battery channel.
\param[in]
    callback - callback method.
\param[in]
    data - battery data.
    Can use (4ul * data * 125ul * 3ul) / (1024ul * 100ul) formula to count \n
    battery data in Volts.
\return
    BC_FAIL - battery component was not opened.
    BC_SUCCESS - other case.
******************************************************************************/
result_t readBatteryData(BspBatteryCb_t);

#endif /* _BATTERY_H */
// eof battery.h