Statistics
| Branch: | Tag: | Revision:

amiro-os / devices / PowerManagement / PowerManagement.h @ 2330e415

History | View | Annotate | Download (1.227 KB)

1 58fe0e0b Thomas Schöpping
#ifndef AMIRO_POWER_MANAGEMENT_H_
2
#define AMIRO_POWER_MANAGEMENT_H_
3
4
#include <amiro/ControllerAreaNetworkRx.h>
5
#include <amiro/ControllerAreaNetworkTx.h>
6
#include <amiro/proximity/vcnl4020.hpp>
7
#include <amiro/FileSystemInputOutput/FSIOPowerManagement.hpp>
8
#include <amiro/power/bq27500.hpp>
9
#include <amiro/power/ltc4412.hpp>
10
11
namespace amiro {
12
13
  class VCNL4020;
14
15
  class PowerManagement : public ControllerAreaNetworkTx, public ControllerAreaNetworkRx  {
16
  public:
17
    PowerManagement(CANDriver *can);
18
    virtual void  calibrate();
19
20
    /** \brief Handle the termination of ControllerAreaNetworkTx and ControllerAreaNetworkRx threads
21
     *         This includes waiting until the threads have terminated, thus this function might block a relatively long time.
22
     */
23
    msg_t terminate(void);
24
25
    /** \brief Handle the start of ControllerAreaNetworkTx and ControllerAreaNetworkRx threads */
26
    ThreadReference start(tprio_t PRIO);
27
28
    types::power_status& getPowerStatus();
29
30
  protected:
31
    virtual msg_t receiveMessage(CANRxFrame *frame);
32
    virtual msg_t updateSensorVal();
33
    virtual void periodicBroadcast();
34
35
    void  calibrateProximityRingValues();
36
37
  private:
38
    uint32_t bc_counter;
39
40
  };
41
42
}
43
44
#endif /* AMIRO_POWER_MANAGEMENT_H_ */