F´ Flight Software - C/C++ Documentation
NASA-v1.5.0
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
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Functions
a
b
c
d
g
h
i
m
r
s
t
v
w
Variables
Typedefs
Enumerations
Enumerator
a
b
c
f
h
i
l
m
n
o
p
s
t
v
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
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
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
c
t
u
w
Enumerations
b
c
d
e
f
g
h
i
m
o
p
q
s
t
w
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
w
Related Functions
a
b
c
f
g
h
l
p
r
s
t
Files
File List
File Members
All
_
a
b
c
d
f
g
h
i
k
l
m
n
p
r
s
t
u
v
w
Functions
f
i
m
s
u
Variables
_
c
f
i
l
p
t
Typedefs
Enumerations
Enumerator
a
c
d
f
i
m
p
r
s
t
w
Macros
a
c
d
f
g
h
i
k
l
m
n
p
r
s
t
u
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
I2cPortAc.hpp
Go to the documentation of this file.
1
/*
2
* I2cPort.hpp
3
*
4
* Created on: Wednesday, 14 October 2020
5
* Author: mstarch
6
*
7
*/
8
#ifndef DRV_I2C_PORT_HPP_
9
#define DRV_I2C_PORT_HPP_
10
11
#include <cstring>
12
#include <cstdio>
13
#include <
FpConfig.hpp
>
14
#include <
Fw/Port/InputPortBase.hpp
>
15
#include <
Fw/Port/OutputPortBase.hpp
>
16
#include <
Fw/Comp/PassiveComponentBase.hpp
>
17
#include <
Fw/Types/BasicTypes.hpp
>
18
#include <
Fw/Types/Serializable.hpp
>
19
#include <
Fw/Types/StringType.hpp
>
20
#include <
Fw/Buffer/BufferSerializableAc.hpp
>
21
22
23
namespace
Drv
{
24
25
typedef
enum
{
26
I2C_OK
,
// Transaction okay
27
I2C_ADDRESS_ERR
,
// I2C address invalid
28
I2C_WRITE_ERR
,
// I2C write failed
29
I2C_READ_ERR
,
// I2C read failed
30
I2C_OTHER_ERR
,
// Other errors that don't fit
31
I2cStatus_MAX
32
}
I2cStatus
;
33
36
37
class
InputI2cPort
:
public
Fw::InputPortBase
{
38
public
:
39
enum
{
40
SERIALIZED_SIZE
=
sizeof
(U32) +
Fw::Buffer::SERIALIZED_SIZE
41
};
42
typedef
I2cStatus
(*
CompFuncPtr
)(
Fw::PassiveComponentBase
* callComp,
NATIVE_INT_TYPE
portNum, U32 addr,
Fw::Buffer
&serBuffer);
43
44
InputI2cPort
(
void
);
45
void
init
(
void
);
46
void
addCallComp
(
Fw::PassiveComponentBase
* callComp,
CompFuncPtr
funcPtr);
47
I2cStatus
invoke
(U32 addr,
Fw::Buffer
&serBuffer);
48
protected
:
49
private
:
50
CompFuncPtr
m_func;
51
#if FW_PORT_SERIALIZATION == 1
52
Fw::SerializeStatus
invokeSerial(
Fw::SerializeBufferBase
&buffer);
53
#endif
54
};
57
58
class
OutputI2cPort
:
public
Fw::OutputPortBase
{
59
public
:
60
OutputI2cPort
(
void
);
61
void
init
(
void
);
62
void
addCallPort
(
InputI2cPort
* callPort);
63
I2cStatus
invoke
(U32 addr,
Fw::Buffer
&serBuffer);
64
protected
:
65
private
:
66
InputI2cPort
* m_port;
67
};
68
}
// end namespace Drv
69
#endif
/* DRV_I2C_PORT_HPP_ */
70
StringType.hpp
Declares ISF string base class.
InputPortBase.hpp
Fw::Buffer::SERIALIZED_SIZE
@ SERIALIZED_SIZE
Definition:
BufferSerializableAc.hpp:30
PassiveComponentBase.hpp
BufferSerializableAc.hpp
Fw::SerializeBufferBase
Definition:
Serializable.hpp:43
Fw::SerializeStatus
SerializeStatus
forward declaration for string
Definition:
Serializable.hpp:14
Drv::OutputI2cPort::OutputI2cPort
OutputI2cPort(void)
Definition:
I2cPortAc.cpp:70
Drv::OutputI2cPort::init
void init(void)
Definition:
I2cPortAc.cpp:75
Serializable.hpp
Drv
Definition:
BlockDriverComponentAc.cpp:22
Drv::InputI2cPort
Definition:
I2cPortAc.hpp:37
Drv::InputI2cPort::CompFuncPtr
I2cStatus(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, U32 addr, Fw::Buffer &serBuffer)
port callback definition
Definition:
I2cPortAc.hpp:42
Drv::I2C_OTHER_ERR
@ I2C_OTHER_ERR
Definition:
I2cPortAc.hpp:30
Fw::Buffer
Definition:
BufferSerializableAc.hpp:24
Drv::I2cStatus
I2cStatus
Definition:
I2cPortAc.hpp:25
Drv::OutputI2cPort::addCallPort
void addCallPort(InputI2cPort *callPort)
Definition:
I2cPortAc.cpp:79
Fw::PassiveComponentBase
Definition:
PassiveComponentBase.hpp:10
Fw::InputPortBase
Definition:
InputPortBase.hpp:14
Drv::InputI2cPort::InputI2cPort
InputI2cPort(void)
constructor
Definition:
I2cPortAc.cpp:33
OutputPortBase.hpp
Drv::InputI2cPort::addCallComp
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
call to register a component
Definition:
I2cPortAc.cpp:42
FpConfig.hpp
ISF configuration file.
Drv::I2cStatus_MAX
@ I2cStatus_MAX
Definition:
I2cPortAc.hpp:31
Drv::I2C_WRITE_ERR
@ I2C_WRITE_ERR
Definition:
I2cPortAc.hpp:28
Fw::OutputPortBase
Definition:
OutputPortBase.hpp:13
Drv::OutputI2cPort::invoke
I2cStatus invoke(U32 addr, Fw::Buffer &serBuffer)
Definition:
I2cPortAc.cpp:89
Drv::InputI2cPort::invoke
I2cStatus invoke(U32 addr, Fw::Buffer &serBuffer)
invoke port interface
Definition:
I2cPortAc.cpp:52
BasicTypes.hpp
Declares ISF basic types.
Drv::I2C_OK
@ I2C_OK
Definition:
I2cPortAc.hpp:26
Drv::I2C_ADDRESS_ERR
@ I2C_ADDRESS_ERR
Definition:
I2cPortAc.hpp:27
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition:
BasicTypes.hpp:29
Drv::I2C_READ_ERR
@ I2C_READ_ERR
Definition:
I2cPortAc.hpp:29
Drv::InputI2cPort::init
void init(void)
initialization function
Definition:
I2cPortAc.cpp:38
Drv::InputI2cPort::SERIALIZED_SIZE
@ SERIALIZED_SIZE
serialized size of port arguments
Definition:
I2cPortAc.hpp:40
Drv::OutputI2cPort
Definition:
I2cPortAc.hpp:58
build-fprime-automatic-native
F-Prime
Drv
I2cDriverPorts
I2cPortAc.hpp
Generated by
1.8.19