Team 9 / telemetry
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers telemetry-mbed.h Source File

telemetry-mbed.h

00001 // Make this less hacky and detect properly
00002 #ifdef __ARMCC_VERSION
00003 
00004 #ifndef TELEMETRY_MBED_H
00005 #define TELEMETRY_MBED_H
00006 
00007 #include "telemetry.h"
00008 #include "mbed.h"
00009 #include "MODSERIAL.h"
00010 
00011 namespace telemetry {
00012 
00013 class MbedHal : public HalInterface {
00014 public:
00015   MbedHal(MODSERIAL& serial) :
00016     serial(serial) {
00017       timer.start();
00018   }
00019 
00020   virtual void transmit_byte(uint8_t data);
00021   virtual size_t rx_available();
00022   virtual uint8_t receive_byte();
00023 
00024   virtual void do_error(const char* message);
00025 
00026   virtual uint32_t get_time_ms();
00027 
00028 protected:
00029   MODSERIAL& serial;
00030   Timer timer;
00031 };
00032 
00033 }
00034 
00035 #endif // ifdef MBED
00036 #endif