asdf
Dependencies: L3GD20 LSM303DLHC mbed
Headers/Communication.h@0:c2ec30f28676, 2014-03-29 (annotated)
- Committer:
- goy5022
- Date:
- Sat Mar 29 03:06:46 2014 +0000
- Revision:
- 0:c2ec30f28676
- Child:
- 2:997f57aee3b7
dcsddf
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
goy5022 | 0:c2ec30f28676 | 1 | #ifndef COMMUNICATION_H |
goy5022 | 0:c2ec30f28676 | 2 | #define COMMUNICATION_H |
goy5022 | 0:c2ec30f28676 | 3 | |
goy5022 | 0:c2ec30f28676 | 4 | #include "Core.h" |
goy5022 | 0:c2ec30f28676 | 5 | |
goy5022 | 0:c2ec30f28676 | 6 | class CommunicationInterface : public Serial { |
goy5022 | 0:c2ec30f28676 | 7 | public: |
goy5022 | 0:c2ec30f28676 | 8 | |
goy5022 | 0:c2ec30f28676 | 9 | explicit CommunicationInterface(PinName a, PinName b) : Serial(a, b) {} |
goy5022 | 0:c2ec30f28676 | 10 | |
goy5022 | 0:c2ec30f28676 | 11 | char getChar() |
goy5022 | 0:c2ec30f28676 | 12 | { |
goy5022 | 0:c2ec30f28676 | 13 | if(readable()) { |
goy5022 | 0:c2ec30f28676 | 14 | return getc(); |
goy5022 | 0:c2ec30f28676 | 15 | } |
goy5022 | 0:c2ec30f28676 | 16 | |
goy5022 | 0:c2ec30f28676 | 17 | return (char)0; |
goy5022 | 0:c2ec30f28676 | 18 | } |
goy5022 | 0:c2ec30f28676 | 19 | }; |
goy5022 | 0:c2ec30f28676 | 20 | |
goy5022 | 0:c2ec30f28676 | 21 | typedef CommunicationInterface ComInterface; |
goy5022 | 0:c2ec30f28676 | 22 | |
goy5022 | 0:c2ec30f28676 | 23 | ComInterface WIRELESS(p28, p27); |
goy5022 | 0:c2ec30f28676 | 24 | |
goy5022 | 0:c2ec30f28676 | 25 | #endif |