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: CANController/FanPump/FanPump.h
- Revision:
- 22:fc802e7715f8
- Parent:
- 18:915a235bc099
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/CANController/FanPump/FanPump.h Fri Nov 07 21:09:50 2014 +0000
@@ -0,0 +1,24 @@
+#ifndef _FILE_FANPUMP_H
+#define _FILE_FANPUMP_H
+
+#include "mbed.h"
+
+class FanPump{
+public:
+ // Takes Pwmout pin, period (seconds), duty cycle slew rate in second^-1 (1 means duty 0 to 1 occurs over 1 second, 0 means no slew)
+ // Use slew rate to implement soft start
+ FanPump(PinName pin, float period, float slew);
+ void write(float duty);
+ float read(); // Read the last setpoint
+ float readRaw(); // Read the raw current duty (may be mid-transition)
+ void directOff(); // Turn off the channel immediately (no slew)
+ int slew(); // Slew rate callback function
+private:
+ PwmOut pwm; // mbed PWM out
+ volatile int chan; // pwm channel#
+ static uint32_t period_us; // Period in microseconds (shared by all channels)
+ volatile uint32_t setPoint_us;
+ volatile uint32_t maxChange_us; // Max pulsewidth change allowed to achieve the slew rate
+};
+
+#endif
\ No newline at end of file
