F´ Flight Software - C/C++ Documentation devel
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
BlockDriverImpl.cpp
Go to the documentation of this file.
2#include <FpConfig.hpp>
3#include <Fw/Types/Assert.hpp>
4
5namespace Drv {
6
7 BlockDriverImpl::BlockDriverImpl(const char* compName) :
8 BlockDriverComponentBase(compName), m_cycles(0)
9 {
10
11 }
12
14 BlockDriverComponentBase::init(queueDepth, instanceId);
15 }
16
20
21 void BlockDriverImpl::InterruptReport_internalInterfaceHandler(U32 ip) {
22 // get time
23 Svc::TimerVal timer;
24 timer.take();
25 // call output timing signal
26 this->CycleOut_out(0,timer);
27 // increment cycles and write channel
28 this->tlmWrite_BD_Cycles(this->m_cycles);
29 this->m_cycles++;
30 }
31
32 void BlockDriverImpl::BufferIn_handler(NATIVE_INT_TYPE portNum, Drv::DataBuffer& buffer) {
33 // just a pass-through
34 this->BufferOut_out(0,buffer);
35 }
36
37 void BlockDriverImpl::Sched_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context) {
38 }
39
41 s_driverISR(this);
42 }
43
44 void BlockDriverImpl::s_driverISR(void* arg) {
45 FW_ASSERT(arg);
46 // cast argument to component instance
47 BlockDriverImpl* compPtr = static_cast<BlockDriverImpl*>(arg);
48 compPtr->InterruptReport_internalInterfaceHandler(0);
49 }
50
51 void BlockDriverImpl::PingIn_handler(
52 const NATIVE_INT_TYPE portNum,
53 U32 key
54 )
55 {
56 // call ping output port
57 this->PingOut_out(0,key);
58 }
59
60
61}
#define FW_ASSERT(...)
Definition Assert.hpp:14
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
PlatformUIntType NATIVE_UINT_TYPE
Definition BasicTypes.h:52
C++-compatible configuration header for fprime configuration.
Auto-generated base for BlockDriver component.
void CycleOut_out(NATIVE_INT_TYPE portNum, Svc::TimerVal &cycleStart)
Invoke output port CycleOut.
void tlmWrite_BD_Cycles(U32 arg, Fw::Time _tlmTime=Fw::Time())
void BufferOut_out(NATIVE_INT_TYPE portNum, Drv::DataBuffer &buff)
Invoke output port BufferOut.
void PingOut_out(NATIVE_INT_TYPE portNum, U32 key)
Invoke output port PingOut.
BlockDriverImpl(const char *compName)
void init()
Object initializer.
Definition ObjBase.cpp:27
Serializable class for carrying timer values.
Definition TimerVal.hpp:22
void take()
Function to store a timer value.
Definition TimerVal.cpp:38