F´ Flight Software - C/C++ Documentation  NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
BlockDriverImpl.cpp
Go to the documentation of this file.
2 #include <Fw/Types/BasicTypes.hpp>
3 #include <Fw/Types/Assert.hpp>
4 
5 namespace Drv {
6 
7  BlockDriverImpl::BlockDriverImpl(const char* compName) :
8  BlockDriverComponentBase(compName), m_cycles(0)
9  {
10 
11  }
12 
13  void BlockDriverImpl::init(NATIVE_INT_TYPE queueDepth, NATIVE_INT_TYPE instanceId) {
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 }
Drv::BlockDriverImpl::init
void init(NATIVE_INT_TYPE queueDepth, NATIVE_INT_TYPE instanceId=0)
Definition: BlockDriverImpl.cpp:13
Drv::DataBuffer
Definition: DataBuffer.hpp:9
Drv::BlockDriverImpl::~BlockDriverImpl
~BlockDriverImpl()
Definition: BlockDriverImpl.cpp:17
NATIVE_UINT_TYPE
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
Definition: BasicTypes.hpp:28
Drv
Definition: BlockDriver.hpp:11
BlockDriverImpl.hpp
Svc::TimerVal
Serializable class for carrying timer values.
Definition: TimerVal.hpp:22
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:27
Svc::TimerVal::take
void take()
Function to store a timer value.
Definition: TimerVal.cpp:38
Drv::BlockDriverImpl::BlockDriverImpl
BlockDriverImpl(const char *compName)
Definition: BlockDriverImpl.cpp:7
Drv::BlockDriverImpl::callIsr
void callIsr()
Definition: BlockDriverImpl.cpp:40
FW_ASSERT
#define FW_ASSERT(...)
Definition: Assert.hpp:9
Drv::BlockDriverImpl
Definition: BlockDriverImpl.hpp:8