Pacemaker code Implementation for SFWRENG 3K04
Dependencies: FXOS8700Q Queue mbed-rtos mbed
Fork of Pacemaker by
hardware.cpp@10:0e0130742e87, 2016-11-15 (annotated)
- Committer:
- FiveDollar
- Date:
- Tue Nov 15 21:38:27 2016 +0000
- Revision:
- 10:0e0130742e87
- Parent:
- 8:75c1dd8b0d61
- Child:
- 16:08d5e5a3ee74
one letter change (gareth);
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 | 10:0e0130742e87 | 5 | PwmOut atrium(PTC10); |
FiveDollar | 10:0e0130742e87 | 6 | PwmOut ventricle(PTC11); |
FiveDollar | 0:b2b3955cd77b | 7 | Serial pc(USBTX,USBRX); |
FiveDollar | 0:b2b3955cd77b | 8 | |
FiveDollar | 0:b2b3955cd77b | 9 | |
FiveDollar | 10:0e0130742e87 | 10 | hardware::hardware(): atrium(PTC10) , ventricle(PTC11) , 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 | |
trane3 | 5:253c33930e91 | 21 | PwmOut* hardware::getChamber(char chamber){ |
FiveDollar | 0:b2b3955cd77b | 22 | if(chamber == 'a'){ |
FiveDollar | 1:fbba2687ddfe | 23 | PwmOut* a = &atrium; |
FiveDollar | 0:b2b3955cd77b | 24 | return a; |
FiveDollar | 0:b2b3955cd77b | 25 | } |
FiveDollar | 0:b2b3955cd77b | 26 | else { |
FiveDollar | 1:fbba2687ddfe | 27 | PwmOut* v = &ventricle; |
FiveDollar | 0:b2b3955cd77b | 28 | return v; |
FiveDollar | 0:b2b3955cd77b | 29 | } |
trane3 | 8:75c1dd8b0d61 | 30 | } |