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.
Diff: pulse.h
- Revision:
- 32:69cd1390bc21
- Parent:
- 21:fc6c33206152
- Child:
- 36:b6431cd8ecd6
--- a/pulse.h Tue Nov 29 22:01:54 2016 +0000 +++ b/pulse.h Tue Dec 06 20:57:56 2016 +0000 @@ -9,12 +9,14 @@ pulse(chamberData*, hardware*); ~pulse(); void startPulse(); - // void setChamber(chamberData*); //used in VOOR (for now, might change) - eric + void pace_charge_shutdown(); + // void pulsegenerator_initialize (); + // void setChamber(chamberData*); //used in VOOR (for now; might change) - eric private: - double myPaceWidth; //mSec, width of ventricular pace - double myPaceAmp; //mV, amplitude of ventricular pace - double myRP; //mSec, duration of refractory period + double myPaceWidth; //mSec; width of ventricular pace + double myPaceAmp; //mV; amplitude of ventricular pace + double myRP; //mSec; duration of refractory period float p_hysteresisInterval; float p_lowrateInterval; bool p_hysteresis; @@ -22,4 +24,39 @@ PwmOut* aOut; chamberData* myChamber; hardware* myIOpins; + void vent_pace_prime (); + void atr_pace_prime (); + void pace_vent (double pulse_width_us); + void pace_atr (double pulse_width_us); + AnalogIn atrialIn; // Pin A0 + AnalogIn ventricleIn; // Pin A1 + AnalogIn leadImpedence; // Pin A2 + AnalogIn atr_rect_signal; // Pin A3 + AnalogIn vent_rect_signal; // Pin A4 + + /*=== Digital In ===*/ + DigitalIn atria_cmp_detect; // Pin D0 + DigitalIn vent_cmp_detect; // Pin D1 + + /*=== PWM Out ===*/ + /* DigitalOut is used for the REF Signal + * due to absence of PWM capabilities of Pins D2 and D4 + * on the FRDM-K64F Board + */ + DigitalOut pacing_ref_pwm; // Pin D2 (PTB9) + PwmOut vent_ref_pwm; // Pin D3 + DigitalOut atria_ref_pwm; // Pin D4 + + + /*=== Digital Out ===*/ + DigitalOut pace_charge_ctrl; // Pin D5 + DigitalOut z_atria_ctrl; // Pin D6 + DigitalOut z_vent_ctrl; // Pin D7 + + DigitalOut atr_pace_ctrl; // Pin D8 + DigitalOut vent_pace_ctrl; // Pin D9 + DigitalOut pace_grnd_ctrl; // Pin D10 + DigitalOut atr_grnd_ctrl; // Pin D11 + DigitalOut vent_grnd_ctrl; // Pin D12 + DigitalOut frontend_ctrl; }; \ No newline at end of file