Pacemaker code Implementation for SFWRENG 3K04

Dependencies:   mbed Queue mbed-rtos FXOS8700Q

Fork of Pacemaker by Eric dollar

SWFRENG 3K04 Project to design, develop, and document a functional pacemaker.

The project uses the Freescale K64F Microcontroller and C++ mbed library.

Committer:
noahzwiep
Date:
Sun Dec 18 02:29:59 2016 +0000
Revision:
36:b6431cd8ecd6
Parent:
32:69cd1390bc21
All ogre.

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 "hardware.h"
FiveDollar 0:b2b3955cd77b 4 #include "chamberData.h"
FiveDollar 0:b2b3955cd77b 5
FiveDollar 0:b2b3955cd77b 6 class pulse{
FiveDollar 0:b2b3955cd77b 7 public:
FiveDollar 0:b2b3955cd77b 8 pulse();
FiveDollar 0:b2b3955cd77b 9 pulse(chamberData*, hardware*);
FiveDollar 0:b2b3955cd77b 10 ~pulse();
FiveDollar 0:b2b3955cd77b 11 void startPulse();
noahzwiep 32:69cd1390bc21 12 void pace_charge_shutdown();
noahzwiep 32:69cd1390bc21 13 // void pulsegenerator_initialize ();
noahzwiep 32:69cd1390bc21 14 // void setChamber(chamberData*); //used in VOOR (for now; might change) - eric
FiveDollar 0:b2b3955cd77b 15
FiveDollar 0:b2b3955cd77b 16 private:
noahzwiep 32:69cd1390bc21 17 double myPaceWidth; //mSec; width of ventricular pace
noahzwiep 32:69cd1390bc21 18 double myPaceAmp; //mV; amplitude of ventricular pace
noahzwiep 32:69cd1390bc21 19 double myRP; //mSec; duration of refractory period
FiveDollar 0:b2b3955cd77b 20 float p_hysteresisInterval;
FiveDollar 0:b2b3955cd77b 21 float p_lowrateInterval;
FiveDollar 0:b2b3955cd77b 22 bool p_hysteresis;
FiveDollar 0:b2b3955cd77b 23 Serial* pc;
FiveDollar 2:fbba2687ddfe 24 PwmOut* aOut;
FiveDollar 0:b2b3955cd77b 25 chamberData* myChamber;
trane3 10:35b259e70c9a 26 hardware* myIOpins;
noahzwiep 32:69cd1390bc21 27 void vent_pace_prime ();
noahzwiep 32:69cd1390bc21 28 void atr_pace_prime ();
noahzwiep 32:69cd1390bc21 29 void pace_vent (double pulse_width_us);
noahzwiep 32:69cd1390bc21 30 void pace_atr (double pulse_width_us);
noahzwiep 32:69cd1390bc21 31 AnalogIn atrialIn; // Pin A0
noahzwiep 32:69cd1390bc21 32 AnalogIn ventricleIn; // Pin A1
noahzwiep 32:69cd1390bc21 33 AnalogIn leadImpedence; // Pin A2
noahzwiep 32:69cd1390bc21 34 AnalogIn atr_rect_signal; // Pin A3
noahzwiep 32:69cd1390bc21 35 AnalogIn vent_rect_signal; // Pin A4
noahzwiep 32:69cd1390bc21 36
noahzwiep 32:69cd1390bc21 37 /*=== Digital In ===*/
noahzwiep 32:69cd1390bc21 38 DigitalIn atria_cmp_detect; // Pin D0
noahzwiep 32:69cd1390bc21 39 DigitalIn vent_cmp_detect; // Pin D1
noahzwiep 32:69cd1390bc21 40
noahzwiep 32:69cd1390bc21 41 /*=== PWM Out ===*/
noahzwiep 32:69cd1390bc21 42 /* DigitalOut is used for the REF Signal
noahzwiep 32:69cd1390bc21 43 * due to absence of PWM capabilities of Pins D2 and D4
noahzwiep 32:69cd1390bc21 44 * on the FRDM-K64F Board
noahzwiep 32:69cd1390bc21 45 */
noahzwiep 36:b6431cd8ecd6 46 PwmOut pacing_ref_pwm; // Pin D2 (PTB9)
noahzwiep 36:b6431cd8ecd6 47 DigitalOut vent_ref_pwm; // Pin D3
noahzwiep 32:69cd1390bc21 48 DigitalOut atria_ref_pwm; // Pin D4
noahzwiep 32:69cd1390bc21 49
noahzwiep 32:69cd1390bc21 50
noahzwiep 32:69cd1390bc21 51 /*=== Digital Out ===*/
noahzwiep 32:69cd1390bc21 52 DigitalOut pace_charge_ctrl; // Pin D5
noahzwiep 32:69cd1390bc21 53 DigitalOut z_atria_ctrl; // Pin D6
noahzwiep 32:69cd1390bc21 54 DigitalOut z_vent_ctrl; // Pin D7
noahzwiep 32:69cd1390bc21 55
noahzwiep 32:69cd1390bc21 56 DigitalOut atr_pace_ctrl; // Pin D8
noahzwiep 32:69cd1390bc21 57 DigitalOut vent_pace_ctrl; // Pin D9
noahzwiep 32:69cd1390bc21 58 DigitalOut pace_grnd_ctrl; // Pin D10
noahzwiep 32:69cd1390bc21 59 DigitalOut atr_grnd_ctrl; // Pin D11
noahzwiep 32:69cd1390bc21 60 DigitalOut vent_grnd_ctrl; // Pin D12
noahzwiep 32:69cd1390bc21 61 DigitalOut frontend_ctrl;
FiveDollar 0:b2b3955cd77b 62 };