F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
z
Functions
c
d
e
f
g
i
m
p
r
s
t
v
w
Variables
b
c
d
f
l
m
o
p
s
t
z
Typedefs
Enumerations
c
f
o
p
s
Enumerator
a
b
c
e
f
h
i
m
n
o
p
r
s
t
u
v
w
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Variables
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Typedefs
c
e
p
s
t
u
Enumerations
b
c
d
g
h
l
m
o
p
s
t
u
w
Enumerator
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Related Functions
a
b
c
d
e
f
g
h
l
o
p
r
s
t
u
v
Files
File List
File Members
All
_
a
b
c
d
f
g
h
i
l
m
p
q
r
s
t
u
v
Functions
c
i
m
s
u
Variables
Typedefs
b
c
d
f
i
m
q
r
s
t
u
Enumerations
Enumerator
a
b
c
d
f
g
h
p
r
s
t
Macros
_
a
c
d
f
h
l
m
p
r
s
u
v
Examples
•
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
16
#include "
Drv/LinuxSpiDriver/LinuxSpiDriverComponentAc.hpp
"
17
18
namespace
Drv
{
19
27
enum
SpiFrequency
{
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
{
47
SPI_MODE_CPOL_LOW_CPHA_LOW
,
48
SPI_MODE_CPOL_LOW_CPHA_HIGH
,
49
SPI_MODE_CPOL_HIGH_CPHA_LOW
,
50
SPI_MODE_CPOL_HIGH_CPHA_HIGH
,
51
};
52
53
class
LinuxSpiDriverComponentImpl
final :
public
LinuxSpiDriverComponentBase
{
54
public
:
55
// ----------------------------------------------------------------------
56
// Construction, initialization, and destruction
57
// ----------------------------------------------------------------------
58
61
LinuxSpiDriverComponentImpl
(
const
char
*
const
compName
62
);
63
66
~LinuxSpiDriverComponentImpl
();
67
69
bool
open
(
FwIndexType
device,
70
FwIndexType
select,
71
SpiFrequency
clock,
72
SpiMode
spiMode =
SpiMode::SPI_MODE_CPOL_LOW_CPHA_LOW
);
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
Drv::LinuxSpiDriverComponentImpl
Definition:
LinuxSpiDriverComponentImpl.hpp:53
Drv::LinuxSpiDriverComponentImpl::open
bool open(FwIndexType device, FwIndexType select, SpiFrequency clock, SpiMode spiMode=SpiMode::SPI_MODE_CPOL_LOW_CPHA_LOW)
Open device.
Definition:
LinuxSpiDriverComponentImpl.cpp:69
FwSizeType
PlatformSizeType FwSizeType
Definition:
FwSizeTypeAliasAc.h:15
Drv::SPI_MODE_CPOL_HIGH_CPHA_HIGH
(CPOL = 1, CPHA = 1)
Definition:
LinuxSpiDriverComponentImpl.hpp:50
Drv::LinuxSpiDriverComponentImpl::LinuxSpiDriverComponentImpl
LinuxSpiDriverComponentImpl(const char *const compName)
Definition:
LinuxSpiDriverComponentImplCommon.cpp:22
Drv::SPI_FREQUENCY_10MHZ
Definition:
LinuxSpiDriverComponentImpl.hpp:30
Drv::LinuxSpiDriverComponentBase
Auto-generated base for LinuxSpiDriver component.
Definition:
LinuxSpiDriverComponentAc.hpp:31
Drv::SPI_MODE_CPOL_HIGH_CPHA_LOW
(CPOL = 1, CPHA = 0)
Definition:
LinuxSpiDriverComponentImpl.hpp:49
Drv::SPI_FREQUENCY_20MHZ
Definition:
LinuxSpiDriverComponentImpl.hpp:32
Drv::SPI_MODE_CPOL_LOW_CPHA_LOW
(CPOL = 0, CPHA = 0)
Definition:
LinuxSpiDriverComponentImpl.hpp:47
Drv::SpiMode
SpiMode
Definition:
LinuxSpiDriverComponentImpl.hpp:46
Drv::LinuxSpiDriverComponentImpl::~LinuxSpiDriverComponentImpl
~LinuxSpiDriverComponentImpl()
Definition:
LinuxSpiDriverComponentImpl.cpp:163
Drv::SPI_FREQUENCY_5MHZ
Definition:
LinuxSpiDriverComponentImpl.hpp:29
Drv::SPI_MODE_CPOL_LOW_CPHA_HIGH
(CPOL = 0, CPHA = 1)
Definition:
LinuxSpiDriverComponentImpl.hpp:48
Drv::SPI_FREQUENCY_1MHZ
Definition:
LinuxSpiDriverComponentImpl.hpp:28
FwIndexType
PlatformIndexType FwIndexType
Definition:
FwIndexTypeAliasAc.h:15
Drv
Definition:
ByteStreamDataPortAc.cpp:11
Drv::SPI_FREQUENCY_15MHZ
Definition:
LinuxSpiDriverComponentImpl.hpp:31
LinuxSpiDriverComponentAc.hpp
Fw::Buffer
Definition:
Buffer.hpp:47
Drv::SpiFrequency
SpiFrequency
Definition:
LinuxSpiDriverComponentImpl.hpp:27
Drv
LinuxSpiDriver
LinuxSpiDriverComponentImpl.hpp
Generated by
1.8.14