13 #include "../includes/debug.h"
14 #include "../includes/parameters.h"
22 #define BlowerSpeed2MicroSeconds(value) map(value, 0, 1800, 1000, 1950)
39 Blower(HardwareTimer* p_hardwareTimer, uint16_t p_timerChannel, uint16_t p_blowerPin);
HardwareTimer * actuator
Hardware timer used to control the blower.
uint16_t getSpeed() const
Get speed value.
bool m_stopped
Current state.
uint16_t getTargetSpeed() const
Get target speed value.
void setup()
Initialize the hardware timer used to control the blower.
uint16_t m_targetSpeed
target speed
uint16_t timerChannel
Channel of the hardware timer used to control the blower.
int32_t getBlowerPressure(int32_t p_flow)
Given a flow in mL/min, return an estimated pressure just at the output of the blower.
void stop()
Stops the blower.
void runSpeedWithRampUp(uint16_t p_targetSpeed)
Run the blower to a given speed applying a ramp-up to prevent high current drain.
uint16_t blowerPin
Pin of the blower.
void runSpeed(uint16_t p_runSpeed)
Run the blower to a given speed.
uint16_t m_speed
Current speed.
Blower()
Default constructor.