NewAskSin
 All Classes Files Functions Variables Groups Pages
Battery.h
1 //- -----------------------------------------------------------------------------------------------------------------------
2 // AskSin driver implementation
3 // 2013-08-03 <trilu@gmx.de> Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/
4 //- -----------------------------------------------------------------------------------------------------------------------
5 //- AskSin battery status functions ---------------------------------------------------------------------------------------
6 //- with a lot of support from dirk at FHEM forum
7 //- -----------------------------------------------------------------------------------------------------------------------
8 
9 #ifndef _BT_H
10 #define _BT_H
11 
12 #include "HAL.h"
13 
14 
15 class BT {
16  friend class AS;
17 
18  public: //---------------------------------------------------------------------------------------------------------
19  protected: //---------------------------------------------------------------------------------------------------------
20  private: //---------------------------------------------------------------------------------------------------------
21 
22  class AS *pHM; // pointer to main class for function calls
23 
24  uint8_t checkTenthVolt; // holds the proof point
25  uint8_t measureTenthVolt; // variable to hold last measured value
26  uint8_t bState :1; // holds status bit
27  uint8_t bMode :2; // mode variable
28  uint32_t bDuration; // duration for the next check
29 
30  public: //---------------------------------------------------------------------------------------------------------
31  BT();
32  void set(uint8_t tenthVolt, uint32_t duration);
33 
34  protected: //---------------------------------------------------------------------------------------------------------
35  private: //---------------------------------------------------------------------------------------------------------
36  void init(AS *ptrMain);
37  void poll(void);
38  uint8_t getStatus(void);
39 };
40 
41 
42 #endif
Main class for implementation of the AskSin protocol stack. Every device needs exactly one instance o...
Definition: AS.h:39
void init(void)
Initialize the AS module.
Definition: AS.cpp:20
Definition: Battery.h:15
void poll(void)
Poll routine for regular operation.
Definition: AS.cpp:44