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.
Dependencies: mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP
Fork of SystemManagement by
Diff: FanPump/FanPump.h
- Revision:
- 6:6a04210a3f4f
- Child:
- 12:e0adb697fcdb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/FanPump/FanPump.h Fri Oct 10 20:24:22 2014 +0000
@@ -0,0 +1,37 @@
+#ifndef _FILE_FANPUMP_H
+#define _FILE_FANPUMP_H
+
+#include "mbed.h"
+#include "rtos.h"
+#include "CANBuffer.h"
+
+typedef enum {
+ Pump = 0,
+ Fan1 = 1,
+ Fan2 = 2,
+ Fan3 = 3,
+} FanSelect;
+
+typedef struct{
+ unsigned char cur_duty;
+ unsigned char new_duty;
+ PwmOut *pin;
+} PinStatus;
+
+const int PIN_NUM = 4;
+const int TX_FAN_ID = ((4 << 8) | 4);
+const int RX_FAN_ID = ((4 << 8) | 12);
+
+class FanPump{
+public:
+ FanPump(CANBuffer *can);
+ void set_fan(FanSelect fan, unsigned char duty);
+ void shutdown(FanSelect fan);
+ void shutdown_all();
+ void start_update();
+
+private:
+ Thread *pin_threads[PIN_NUM];
+ void free_pin(FanSelect fan);
+};
+#endif
\ No newline at end of file
