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.
hardware.cpp@2:fbba2687ddfe, 2016-11-14 (annotated)
- Committer:
- FiveDollar
- Date:
- Mon Nov 14 01:27:31 2016 +0000
- Revision:
- 2:fbba2687ddfe
- Parent:
- 0:b2b3955cd77b
- Child:
- 5:253c33930e91
nov 13 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 "hardware.h" |
FiveDollar | 0:b2b3955cd77b | 3 | #include "mbed.h" |
FiveDollar | 0:b2b3955cd77b | 4 | |
FiveDollar | 2:fbba2687ddfe | 5 | PwmOut atrium(PTC12); |
FiveDollar | 2:fbba2687ddfe | 6 | PwmOut ventricle(PTC12; |
FiveDollar | 0:b2b3955cd77b | 7 | Serial pc(USBTX,USBRX); |
FiveDollar | 0:b2b3955cd77b | 8 | |
FiveDollar | 0:b2b3955cd77b | 9 | |
FiveDollar | 2:fbba2687ddfe | 10 | hardware::hardware(): atrium(PTC12) , ventricle(PTC12) , pc(USBTX,USBRX){ |
FiveDollar | 0:b2b3955cd77b | 11 | pc.baud(9600); |
FiveDollar | 0:b2b3955cd77b | 12 | } |
FiveDollar | 0:b2b3955cd77b | 13 | |
FiveDollar | 0:b2b3955cd77b | 14 | hardware::~hardware(){}; |
FiveDollar | 0:b2b3955cd77b | 15 | |
FiveDollar | 0:b2b3955cd77b | 16 | Serial* hardware::getSerial(){ |
FiveDollar | 0:b2b3955cd77b | 17 | Serial* p = &pc; |
FiveDollar | 0:b2b3955cd77b | 18 | return p; |
FiveDollar | 0:b2b3955cd77b | 19 | } |
FiveDollar | 0:b2b3955cd77b | 20 | |
FiveDollar | 0:b2b3955cd77b | 21 | AnalogOut* hardware::getChamber(char chamber){ |
FiveDollar | 0:b2b3955cd77b | 22 | if(chamber == 'a'){ |
FiveDollar | 2:fbba2687ddfe | 23 | PwmOut* a = &atrium; |
FiveDollar | 0:b2b3955cd77b | 24 | return a; |
FiveDollar | 0:b2b3955cd77b | 25 | } |
FiveDollar | 0:b2b3955cd77b | 26 | else { |
FiveDollar | 2:fbba2687ddfe | 27 | PwmOut* v = &ventricle; |
FiveDollar | 0:b2b3955cd77b | 28 | return v; |
FiveDollar | 0:b2b3955cd77b | 29 | } |
FiveDollar | 0:b2b3955cd77b | 30 | } |