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:
- 12:e0adb697fcdb
- Parent:
- 6:6a04210a3f4f
- Child:
- 13:fbd9b3f5a07c
--- a/FanPump/FanPump.h Sun Oct 19 22:50:30 2014 +0000
+++ b/FanPump/FanPump.h Tue Oct 21 23:44:15 2014 +0000
@@ -6,32 +6,34 @@
#include "CANBuffer.h"
typedef enum {
- Pump = 0,
- Fan1 = 1,
- Fan2 = 2,
- Fan3 = 3,
-} FanSelect;
+ Pump1 = 0,
+ Pump2 = 1,
+ Fan1 = 2,
+ Fan2 = 3,
+} FanPumpSelect;
typedef struct{
- unsigned char cur_duty;
- unsigned char new_duty;
+ float cur_duty;
+ float 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);
+const int TX_FAN_ID = ((0x4 << 8) | 0x11);
+const int RX_FAN_ID = ((0x4 << 8) | 0x81);
+const int TX_PUMP_ID = ((0x4 << 8) | 0x10);
+const int RX_PUMP_ID = ((0x4 << 8) | 0x80);
class FanPump{
public:
FanPump(CANBuffer *can);
- void set_fan(FanSelect fan, unsigned char duty);
- void shutdown(FanSelect fan);
+ void set_fan_pump(FanPumpSelect fan, float duty);
+ void shutdown(FanPumpSelect fan);
void shutdown_all();
void start_update();
private:
Thread *pin_threads[PIN_NUM];
- void free_pin(FanSelect fan);
+ void free_pin(FanPumpSelect fan);
};
#endif
\ No newline at end of file
