F´ Flight Software - C/C++ Documentation NASA-v1.6.0
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
18
19 }
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:7
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
PlatformUIntType NATIVE_UINT_TYPE
Definition BasicTypes.h:52
C++-compatible configuration header for fprime configuration.
BlockDriverImpl(const char *compName)
void init(NATIVE_INT_TYPE queueDepth, NATIVE_INT_TYPE instanceId=0)
Serializable class for carrying timer values.
Definition TimerVal.hpp:22
void take()
Function to store a timer value.
Definition TimerVal.cpp:38