
MBED Application board used to control frequency and duty cycle of injector valves
coil-driver.h
- Committer:
- iwolf32
- Date:
- 2017-07-25
- Revision:
- 0:9b2c760c8e5c
File content as of revision 0:9b2c760c8e5c:
#ifndef COIL_DRIVER_H #define COIL_DRIVER_H #include "mbed.h" #include "rtos.h" // Coil driver class. Applies full power for given "spike" time // and then applies a PWM signal to keep the coil energized at a lower power. class Coil { public: Coil(PinName _controlPin, uint16_t _spikeus, uint16_t _holdperiod_us, uint16_t _holdpulse_us); //InterruptIn controlIn; // Input for external coil "ON" signal PwmOut controlOut; // PWM output pin driving coil uint16_t spikeus, holdperiod_us, holdpulse_us, pwmFrequency; void on(); void off(); }; #endif