Shuto Naruse
/
Eurobot2012_Beacons
Eurobot2012_Beacons
Diff: RF12B/RFSerial.cpp
- Revision:
- 0:b8be0a00c4f8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RF12B/RFSerial.cpp Wed Apr 18 21:08:20 2012 +0000 @@ -0,0 +1,26 @@ + +/* Constructor */ +#include "RFSerial.h" + +RFSerial::RFSerial(PinName _SDI, + PinName _SDO, + PinName _SCK, + PinName _NCS, + PinName _NIRQ, + PinName _TRIG) +:RF12B(_SDI, _SDO, _SCK, _NCS, _NIRQ, _TRIG) { + +} + +// Stream implementation functions +int RFSerial::_putc(int value) { + RF12B::write((unsigned char) value); + return value; +} +int RFSerial::_getc() { + if(available()) { + return RF12B::read(); + } else { + return EOF; + } +} \ No newline at end of file