Pacemaker code Implementation for SFWRENG 3K04

Dependencies:   FXOS8700Q Queue mbed-rtos mbed

Fork of Pacemaker by Eric dollar

Committer:
trane3
Date:
Tue Nov 15 00:52:39 2016 +0000
Revision:
8:75c1dd8b0d61
Parent:
1:fbba2687ddfe
Child:
18:aef2f75f216b
Child:
21:fc6c33206152
added voor functionality including preliminary pacing

Who changed what in which revision?

UserRevisionLine numberNew 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 1:fbba2687ddfe 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
trane3 8:75c1dd8b0d61 26 void pulse::setChamber(chamberData* c){
trane3 8:75c1dd8b0d61 27 myChamber = c;
trane3 8:75c1dd8b0d61 28 }
trane3 8:75c1dd8b0d61 29
FiveDollar 0:b2b3955cd77b 30
FiveDollar 0:b2b3955cd77b 31 void pulse::startPulse(){
FiveDollar 0:b2b3955cd77b 32 // while(true){
FiveDollar 0:b2b3955cd77b 33 pc = myIOpins->getSerial();
FiveDollar 0:b2b3955cd77b 34 aOut = myIOpins->getChamber(myChamber->getChamberType());
FiveDollar 0:b2b3955cd77b 35 aOut->write(myChamber->getPaceAmp());
FiveDollar 0:b2b3955cd77b 36 wait(myChamber->getPaceWidth());
FiveDollar 0:b2b3955cd77b 37 aOut->write(0);
FiveDollar 0:b2b3955cd77b 38
FiveDollar 0:b2b3955cd77b 39 pc->printf("\nPulsing...check your oscilloscope!");
FiveDollar 0:b2b3955cd77b 40 // wait(myChamber->getPaceWidth());
FiveDollar 0:b2b3955cd77b 41
FiveDollar 0:b2b3955cd77b 42 // }
FiveDollar 0:b2b3955cd77b 43 }
FiveDollar 0:b2b3955cd77b 44