F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
LinuxI2cDriver.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title LinuxI2cDriver.hpp
3 // \author tcanham
4 // \brief hpp file for LinuxI2cDriver component implementation class
5 //
6 // \copyright
7 // Copyright 2009-2015, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12 
13 #ifndef LinuxI2cDriver_HPP
14 #define LinuxI2cDriver_HPP
15 
17 
18 namespace Drv {
19 
21  public:
22  // ----------------------------------------------------------------------
23  // Construction, initialization, and destruction
24  // ----------------------------------------------------------------------
25 
28  LinuxI2cDriver(const char* const compName);
29 
30  bool open(const char* device);
34 
35  private:
36  // ----------------------------------------------------------------------
37  // Handler implementations for user-defined typed input ports
38  // ----------------------------------------------------------------------
39 
42  I2cStatus write_handler(const FwIndexType portNum,
43  U32 addr,
44  Fw::Buffer& serBuffer);
45 
48  I2cStatus read_handler(const FwIndexType portNum,
49  U32 addr,
50  Fw::Buffer& serBuffer);
51 
54  I2cStatus writeRead_handler(const FwIndexType portNum,
55  U32 addr,
56  Fw::Buffer& writeBuffer,
57  Fw::Buffer& readBuffer);
58 
59 // Prevent unused field error when using stub
60 #ifndef STUBBED_LINUX_I2C_DRIVER
61  int m_fd;
62 #endif
63 };
64 
65 } // end namespace Drv
66 
67 #endif
bool open(const char *device)
LinuxI2cDriver(const char *const compName)
Auto-generated base for LinuxI2cDriver component.
PlatformIndexType FwIndexType