amiro-os / devices / PowerManagement / PowerManagement.h @ 3aee55de
History | View | Annotate | Download (1.27 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 | 8c99e03a | galberding | void setStrategy(uint8_t strategy);
|
28 | 58fe0e0b | Thomas Schöpping | |
29 | types::power_status& getPowerStatus(); |
||
30 | |||
31 | protected:
|
||
32 | virtual msg_t receiveMessage(CANRxFrame *frame); |
||
33 | virtual msg_t updateSensorVal(); |
||
34 | virtual void periodicBroadcast();
|
||
35 | 8c99e03a | galberding | |
36 | 58fe0e0b | Thomas Schöpping | void calibrateProximityRingValues();
|
37 | |||
38 | private:
|
||
39 | uint32_t bc_counter; |
||
40 | |||
41 | }; |
||
42 | |||
43 | } |
||
44 | |||
45 | #endif /* AMIRO_POWER_MANAGEMENT_H_ */ |