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: CANBuffer mbed SystemManagement mbed-rtos
FanPump.h
00001 #ifndef _FILE_FANPUMP_H 00002 #define _FILE_FANPUMP_H 00003 00004 #include "mbed.h" 00005 #include "rtos.h" 00006 #include "CANBuffer.h" 00007 00008 typedef enum { 00009 Pump = 0, 00010 Fan1 = 1, 00011 Fan2 = 2, 00012 Fan3 = 3, 00013 } FanSelect; 00014 00015 typedef struct{ 00016 unsigned char cur_duty; 00017 unsigned char new_duty; 00018 PwmOut *pin; 00019 } PinStatus; 00020 00021 const int PIN_NUM = 4; 00022 const int TX_FAN_ID = ((4 << 8) | 4); 00023 const int RX_FAN_ID = ((4 << 8) | 12); 00024 00025 class FanPump{ 00026 public: 00027 FanPump(CANBuffer *can); 00028 void set_fan(FanSelect fan, unsigned char duty); 00029 void shutdown(FanSelect fan); 00030 void shutdown_all(); 00031 void start_update(); 00032 00033 private: 00034 Thread *pin_threads[PIN_NUM]; 00035 void free_pin(FanSelect fan); 00036 }; 00037 #endif
Generated on Sat Aug 13 2022 03:42:38 by
1.7.2