Pacemaker code Implementation for SFWRENG 3K04
Dependencies: mbed Queue mbed-rtos FXOS8700Q
Fork of Pacemaker by
SWFRENG 3K04 Project to design, develop, and document a functional pacemaker.
The project uses the Freescale K64F Microcontroller and C++ mbed library.
pulse.cpp@0:b2b3955cd77b, 2016-10-30 (annotated)
- Committer:
- FiveDollar
- Date:
- Sun Oct 30 16:04:52 2016 +0000
- Revision:
- 0:b2b3955cd77b
- Child:
- 2:fbba2687ddfe
Initial Commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
FiveDollar | 0:b2b3955cd77b | 1 | #pragma once |
FiveDollar | 0:b2b3955cd77b | 2 | #include "mbed.h" |
FiveDollar | 0:b2b3955cd77b | 3 | #include "pulse.h" |
FiveDollar | 0:b2b3955cd77b | 4 | |
FiveDollar | 0:b2b3955cd77b | 5 | pulse::pulse(){} |
FiveDollar | 0:b2b3955cd77b | 6 | |
FiveDollar | 0:b2b3955cd77b | 7 | pulse::pulse(chamberData* chamber, hardware* IOpins){ |
FiveDollar | 0:b2b3955cd77b | 8 | myIOpins = IOpins; |
FiveDollar | 0:b2b3955cd77b | 9 | myChamber = chamber; |
FiveDollar | 0:b2b3955cd77b | 10 | // myPaceWidth = 0; //mSec, width of ventricular pace |
FiveDollar | 0:b2b3955cd77b | 11 | // myPaceAmp = 0; //mV, amplitude of ventricular pace |
FiveDollar | 0:b2b3955cd77b | 12 | // myRP = 0; //mSec, duration of refractory period |
FiveDollar | 0:b2b3955cd77b | 13 | // p_hysteresisInterval = 0; |
FiveDollar | 0:b2b3955cd77b | 14 | // p_lowrateInterval = 0; |
FiveDollar | 0:b2b3955cd77b | 15 | // p_hysteresis = false; |
FiveDollar | 0:b2b3955cd77b | 16 | |
FiveDollar | 0:b2b3955cd77b | 17 | } |
FiveDollar | 0:b2b3955cd77b | 18 | |
FiveDollar | 0:b2b3955cd77b | 19 | pulse::~pulse(){ |
FiveDollar | 0:b2b3955cd77b | 20 | delete myChamber; |
FiveDollar | 0:b2b3955cd77b | 21 | delete myIOpins; |
FiveDollar | 0:b2b3955cd77b | 22 | delete pc; |
FiveDollar | 0:b2b3955cd77b | 23 | delete aOut; |
FiveDollar | 0:b2b3955cd77b | 24 | } |
FiveDollar | 0:b2b3955cd77b | 25 | |
FiveDollar | 0:b2b3955cd77b | 26 | |
FiveDollar | 0:b2b3955cd77b | 27 | |
FiveDollar | 0:b2b3955cd77b | 28 | void pulse::startPulse(){ |
FiveDollar | 0:b2b3955cd77b | 29 | // while(true){ |
FiveDollar | 0:b2b3955cd77b | 30 | pc = myIOpins->getSerial(); |
FiveDollar | 0:b2b3955cd77b | 31 | aOut = myIOpins->getChamber(myChamber->getChamberType()); |
FiveDollar | 0:b2b3955cd77b | 32 | aOut->write(myChamber->getPaceAmp()); |
FiveDollar | 0:b2b3955cd77b | 33 | wait(myChamber->getPaceWidth()); |
FiveDollar | 0:b2b3955cd77b | 34 | aOut->write(0); |
FiveDollar | 0:b2b3955cd77b | 35 | |
FiveDollar | 0:b2b3955cd77b | 36 | pc->printf("\nPulsing...check your oscilloscope!"); |
FiveDollar | 0:b2b3955cd77b | 37 | // wait(myChamber->getPaceWidth()); |
FiveDollar | 0:b2b3955cd77b | 38 | |
FiveDollar | 0:b2b3955cd77b | 39 | // } |
FiveDollar | 0:b2b3955cd77b | 40 | } |
FiveDollar | 0:b2b3955cd77b | 41 |