F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LinuxSpiDriverComponentImpl.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title LinuxSpiDriverImpl.hpp
3 // \author tcanham
4 // \brief hpp file for LinuxSpiDriver 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 LinuxSpiDriver_HPP
14 #define LinuxSpiDriver_HPP
15 
17 
18 namespace Drv {
19 
28  SPI_FREQUENCY_1MHZ = 1000000UL,
29  SPI_FREQUENCY_5MHZ = 5000000UL,
30  SPI_FREQUENCY_10MHZ = 10000000UL,
31  SPI_FREQUENCY_15MHZ = 15000000UL,
32  SPI_FREQUENCY_20MHZ = 20000000UL,
33 };
34 
46 enum SpiMode {
51 };
52 
54  public:
55  // ----------------------------------------------------------------------
56  // Construction, initialization, and destruction
57  // ----------------------------------------------------------------------
58 
61  LinuxSpiDriverComponentImpl(const char* const compName
62  );
63 
67 
69  bool open(FwIndexType device,
70  FwIndexType select,
71  SpiFrequency clock,
73 
74  private:
75  // ----------------------------------------------------------------------
76  // Handler implementations for user-defined typed input ports
77  // ----------------------------------------------------------------------
78 
81  void SpiReadWrite_handler(const FwIndexType portNum,
82  Fw::Buffer& WriteBuffer,
83  Fw::Buffer& readBuffer);
84 
85  int m_fd;
86  FwIndexType m_device;
87  FwIndexType m_select;
88  FwSizeType m_bytes;
89 };
90 
91 } // end namespace Drv
92 
93 #endif
bool open(FwIndexType device, FwIndexType select, SpiFrequency clock, SpiMode spiMode=SpiMode::SPI_MODE_CPOL_LOW_CPHA_LOW)
Open device.
PlatformSizeType FwSizeType
Auto-generated base for LinuxSpiDriver component.
PlatformIndexType FwIndexType