Ashley Mills / CANInterface
Revision:
0:1ce2190bc4d2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CANInterface.h	Wed Apr 30 13:51:22 2014 +0000
@@ -0,0 +1,25 @@
+#pragma once
+#include "mbed.h"
+
+class CANInterface {
+   public:
+      enum BusSpeed {
+         CAN_SPEED_125=125000,
+         CAN_SPEED_250=250000,
+         CAN_SPEED_500=500000
+      };
+   
+      enum MessageType {
+         CAN_PID_REQUEST=0x7DF,
+         CAN_PID_REPLY=0x7E8
+      };
+   
+      CANInterface(PinName rd, PinName td);
+      ~CANInterface();
+      int makeRequest(uint8_t pid,  uint8_t *outBuf, int *outLen);
+      
+   private:
+      CAN *_can;
+      Timer *_timer;
+      int _timeout;
+};
\ No newline at end of file