F´ Flight Software - C/C++ Documentation
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
16
17 void BlockDriverImpl::InterruptReport_internalInterfaceHandler(U32 ip) {
18 // get time
19 Os::RawTime time;
20 time.now();
21 // call output timing signal
22 this->CycleOut_out(0,time);
23 // increment cycles and write channel
24 this->tlmWrite_BD_Cycles(this->m_cycles);
25 this->m_cycles++;
26 }
27
28 void BlockDriverImpl::BufferIn_handler(NATIVE_INT_TYPE portNum, Drv::DataBuffer& buffer) {
29 // just a pass-through
30 this->BufferOut_out(0,buffer);
31 }
32
33 void BlockDriverImpl::Sched_handler(NATIVE_INT_TYPE portNum, U32 context) {
34 }
35
37 s_driverISR(this);
38 }
39
40 void BlockDriverImpl::s_driverISR(void* arg) {
41 FW_ASSERT(arg);
42 // cast argument to component instance
43 BlockDriverImpl* compPtr = static_cast<BlockDriverImpl*>(arg);
44 compPtr->InterruptReport_internalInterfaceHandler(0);
45 }
46
47 void BlockDriverImpl::PingIn_handler(
48 const NATIVE_INT_TYPE portNum,
49 U32 key
50 )
51 {
52 // call ping output port
53 this->PingOut_out(0,key);
54 }
55
56
57}
#define FW_ASSERT(...)
Definition Assert.hpp:14
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:55
C++-compatible configuration header for fprime configuration.
Auto-generated base for BlockDriver component.
void BufferOut_out(FwIndexType portNum, Drv::DataBuffer &buff)
Invoke output port BufferOut.
void CycleOut_out(FwIndexType portNum, Os::RawTime &cycleStart)
Invoke output port CycleOut.
void tlmWrite_BD_Cycles(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void PingOut_out(FwIndexType portNum, U32 key)
Invoke output port PingOut.
BlockDriverImpl(const char *compName)
Status now() override
Get the current time.
Definition RawTime.cpp:36