Statistics
| Branch: | Tag: | Revision:

amiro-os / include / amiro / FileSystemInputOutput / FSIOPowerManagement.hpp @ 1b3adcdd

History | View | Annotate | Download (1.49 KB)

1
#ifndef AMIRO_FSIOPOWERMANAGEMENT_H_
2
#define AMIRO_FSIOPOWERMANAGEMENT_H_
3

    
4
/*! \brief memory layout for the eeproms
5
 *
6
 * This header defines the memory layout of the
7
 * at24c01 on the PowerManagement board.
8
 */
9

    
10
#include <amiro/eeprom/at24.hpp>
11
#include <amiro/FileSystemInputOutput/FileSystemInputOutputBase.hpp>
12

    
13
using namespace chibios_rt;
14

    
15
namespace amiro {
16
namespace fileSystemIo {
17

    
18
class FSIOPowerManagement : public FileSystemIoBase {
19
  private:
20

    
21
    /** \brief Layout for FSIOPowerManagement with BSMV 1 and bsmv 1*/
22
    struct PowerManagement_1_1 {
23
      uint8_t  reserved_0x00_0x14[20];
24
      uint16_t vcnl4020offset[8];        // U1.Proximity [11, 21, 31, 41, 12, 22, 32, 42]
25
      uint8_t  generalPurpose[88];       // 24x_7Cx
26
      uint8_t  reserved_0x7D_0x80[4];
27
    };
28

    
29
  public:
30
    FSIOPowerManagement(AT24 &at24c01, uint8_t BSMV, uint8_t bsmv, uint8_t HMV, uint8_t hmv)
31
      : FileSystemIoBase(at24c01, BSMV, bsmv, HMV, hmv) {}
32

    
33
    /**
34
     * \brief Read the VCNL4020 offset from memory
35
     * @param buffer Content to write in from the memory
36
     * @param idx Index of the VCNL4020 sensor
37
     * @return FSIO return types
38
     */
39
    msg_t getVcnl4020Offset (uint16_t *buffer, uint8_t idx);
40

    
41
    /**
42
     * \brief Write new data to the VCNL4020 offset
43
     * @param buffer Content to write to the memory
44
     * @param idx Index of the VCNL4020 sensor
45
     * @return FSIO return types
46
     */
47
    msg_t setVcnl4020Offset (uint16_t buffer, uint8_t idx);
48
};
49

    
50
}
51
}
52

    
53
#endif /* AMIRO_FSIOPOWERMANAGEMENT_H_ */