F´ Flight Software - C/C++ Documentation  devel
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 
22  {
23 
24  public:
25 
26  // ----------------------------------------------------------------------
27  // Construction, initialization, and destruction
28  // ----------------------------------------------------------------------
29 
32  LinuxI2cDriver(const char *const compName);
33 
34  bool open(const char* device);
38 
39  PRIVATE:
40 
41  // ----------------------------------------------------------------------
42  // Handler implementations for user-defined typed input ports
43  // ----------------------------------------------------------------------
44 
47  I2cStatus write_handler(
48  const NATIVE_INT_TYPE portNum,
49  U32 addr,
50  Fw::Buffer &serBuffer
51  );
52 
55  I2cStatus read_handler(
56  const NATIVE_INT_TYPE portNum,
57  U32 addr,
58  Fw::Buffer &serBuffer
59  );
60 
63  I2cStatus writeRead_handler(
64  const NATIVE_INT_TYPE portNum,
65  U32 addr,
66  Fw::Buffer &writeBuffer,
67  Fw::Buffer &readBuffer
68  );
69 
70  // Prevent unused field error when using stub
71  #ifndef STUBBED_LINUX_I2C_DRIVER
72  NATIVE_INT_TYPE m_fd;
73  #endif
74  };
75 
76 } // end namespace Drv
77 
78 #endif
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:55
Auto-generated base for LinuxI2cDriver component.
LinuxI2cDriver(const char *const compName)
bool open(const char *device)