Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: CANInterface.h
- 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