ducky's telemetry library

Committer:
ikrase
Date:
Tue Mar 31 19:07:34 2015 +0000
Revision:
0:79b031fc31ac
untested telemetry code

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ikrase 0:79b031fc31ac 1 // Make this less hacky and detect properly
ikrase 0:79b031fc31ac 2 #ifdef __ARMCC_VERSION
ikrase 0:79b031fc31ac 3 #ifndef TELEMETRY_MBED_H_
ikrase 0:79b031fc31ac 4 #define TELEMETRY_MBED_H_
ikrase 0:79b031fc31ac 5
ikrase 0:79b031fc31ac 6 #include "telemetry.h"
ikrase 0:79b031fc31ac 7 #include "mbed.h"
ikrase 0:79b031fc31ac 8 #include "MODSERIAL.h"
ikrase 0:79b031fc31ac 9
ikrase 0:79b031fc31ac 10 namespace telemetry {
ikrase 0:79b031fc31ac 11
ikrase 0:79b031fc31ac 12 class MbedHal : public HalInterface {
ikrase 0:79b031fc31ac 13 public:
ikrase 0:79b031fc31ac 14 MbedHal(MODSERIAL& serial) :
ikrase 0:79b031fc31ac 15 serial(serial) {
ikrase 0:79b031fc31ac 16 timer.start();
ikrase 0:79b031fc31ac 17 }
ikrase 0:79b031fc31ac 18
ikrase 0:79b031fc31ac 19 virtual void transmit_byte(uint8_t data);
ikrase 0:79b031fc31ac 20 virtual size_t rx_available();
ikrase 0:79b031fc31ac 21 virtual uint8_t receive_byte();
ikrase 0:79b031fc31ac 22
ikrase 0:79b031fc31ac 23 virtual void do_error(const char* message);
ikrase 0:79b031fc31ac 24
ikrase 0:79b031fc31ac 25 virtual uint32_t get_time_ms();
ikrase 0:79b031fc31ac 26
ikrase 0:79b031fc31ac 27 protected:
ikrase 0:79b031fc31ac 28 MODSERIAL& serial;
ikrase 0:79b031fc31ac 29 Timer timer;
ikrase 0:79b031fc31ac 30 };
ikrase 0:79b031fc31ac 31
ikrase 0:79b031fc31ac 32 }
ikrase 0:79b031fc31ac 33
ikrase 0:79b031fc31ac 34 #endif
ikrase 0:79b031fc31ac 35 #endif // ifdef MBED