Andrea Faustinelli / espresso-for-geeks-master
Embed: (wiki syntax)

« Back to documentation index

BrewControl Class Reference

BrewControl Class Reference

This is the main class where all brew functions and sensors are handled. More...

#include <brewcontrol.h>

Public Member Functions

 BrewControl (PinName brew_pin, PinName flow_sensor_pin, PinName zcd_input_pin, PinName pump_control_pin, PinName pressure_sensor_pin, PinName temp_sensor_pin, PinName temp2_sensor_pin, PinName boiler_pwm_pin)
 Constructor requires the pin numbers for all inputs and outputs.
void set_shot_temperature (float temperature)
 Set the target shot temperature in C.
float get_shot_temperature ()
 Get the target shot temperature in C.
float get_current_temperature ()
 Get the live temperature of water in the boiler in C.
void set_shot_time (int time)
 Set the target shot time in s.
int get_shot_time ()
 Get the target shot time in s.
float get_current_time ()
 Get the live shot clock time in s.
void set_preinfuse_time (int time)
 Set the required pre-infuse time in s, 0 for no pre-infuse.
int get_preinfuse_time ()
 Get the current set pre-infuse time in s, 0 if no pre-infuse is set.
void stop_preinfuse_now ()
 Function call to manually set pre-infuse quantity.
void set_shot_volume (int volume)
 Set the target shot volume in ml (default 60ml)
int get_shot_volume ()
 Get the target shot volume in ml.
float get_current_volume ()
 Get the live shot volume in ml.
void set_shot_flow_rate (float flow_rate)
 Set the target shot flow rate in ml/s.
float get_shot_flow_rate ()
 Get the target shot flow rate in ml/s.
float get_current_flow_rate ()
 Get the live shot flow rate in ml/s.
void set_shot_pressure (float pressure)
 Set the target pressure in bars.
float get_shot_pressure ()
 Get the target pressure in bars.
float get_current_pressure ()
 Get the current measured pressure in bars.
uint8_t get_pump_level ()
 Get the currently set pump level (0 to 100%)
uint8_t get_state ()
 Return 1 if currently brewing, 0 if not.
uint8_t toggle (uint8_t mode)
 Toggle brewing.
uint8_t start (uint8_t mode)
 Start brewing, this resets all live variables and based on set targets initiates the right brew mode, returns set mode.
void soft_stop ()
 Stop brewing with reduced backflush.
void enable_boiler ()
 Enable PID boiler control.
void disable_boiler ()
 Disable PID boiler control, this means water remains cold.
bool toggle_boiler ()
 Toggle PID boiler control.
float get_average_pressure ()
 Get average pressure of last shot.

Detailed Description

This is the main class where all brew functions and sensors are handled.

Definition at line 45 of file brewcontrol.h.


Constructor & Destructor Documentation

BrewControl ( PinName  brew_pin,
PinName  flow_sensor_pin,
PinName  zcd_input_pin,
PinName  pump_control_pin,
PinName  pressure_sensor_pin,
PinName  temp_sensor_pin,
PinName  temp2_sensor_pin,
PinName  boiler_pwm_pin 
)

Constructor requires the pin numbers for all inputs and outputs.

Definition at line 42 of file brewcontrol.cpp.


Member Function Documentation

void disable_boiler (  )

Disable PID boiler control, this means water remains cold.

Definition at line 193 of file brewcontrol.cpp.

void enable_boiler (  )

Enable PID boiler control.

Definition at line 188 of file brewcontrol.cpp.

float get_average_pressure (  )

Get average pressure of last shot.

Definition at line 548 of file brewcontrol.cpp.

float get_current_flow_rate (  )

Get the live shot flow rate in ml/s.

Definition at line 294 of file brewcontrol.cpp.

float get_current_pressure (  )

Get the current measured pressure in bars.

Definition at line 143 of file brewcontrol.cpp.

float get_current_temperature (  )

Get the live temperature of water in the boiler in C.

Definition at line 102 of file brewcontrol.cpp.

float get_current_time (  )

Get the live shot clock time in s.

Definition at line 282 of file brewcontrol.cpp.

float get_current_volume (  )

Get the live shot volume in ml.

Definition at line 288 of file brewcontrol.cpp.

int get_preinfuse_time (  )

Get the current set pre-infuse time in s, 0 if no pre-infuse is set.

Definition at line 235 of file brewcontrol.cpp.

uint8_t get_pump_level (  )

Get the currently set pump level (0 to 100%)

Definition at line 245 of file brewcontrol.cpp.

float get_shot_flow_rate (  )

Get the target shot flow rate in ml/s.

float get_shot_pressure (  )

Get the target pressure in bars.

float get_shot_temperature (  )

Get the target shot temperature in C.

Definition at line 123 of file brewcontrol.cpp.

int get_shot_time (  )

Get the target shot time in s.

int get_shot_volume (  )

Get the target shot volume in ml.

Definition at line 148 of file brewcontrol.cpp.

uint8_t get_state (  )

Return 1 if currently brewing, 0 if not.

Definition at line 300 of file brewcontrol.cpp.

void set_preinfuse_time ( int  time )

Set the required pre-infuse time in s, 0 for no pre-infuse.

Definition at line 223 of file brewcontrol.cpp.

void set_shot_flow_rate ( float  flow_rate )

Set the target shot flow rate in ml/s.

Definition at line 272 of file brewcontrol.cpp.

void set_shot_pressure ( float  pressure )

Set the target pressure in bars.

Definition at line 128 of file brewcontrol.cpp.

void set_shot_temperature ( float  temperature )

Set the target shot temperature in C.

Definition at line 109 of file brewcontrol.cpp.

void set_shot_time ( int  time )

Set the target shot time in s.

Definition at line 251 of file brewcontrol.cpp.

void set_shot_volume ( int  volume )

Set the target shot volume in ml (default 60ml)

Definition at line 261 of file brewcontrol.cpp.

void soft_stop (  )

Stop brewing with reduced backflush.

Definition at line 521 of file brewcontrol.cpp.

uint8_t start ( uint8_t  mode )

Start brewing, this resets all live variables and based on set targets initiates the right brew mode, returns set mode.

Definition at line 439 of file brewcontrol.cpp.

void stop_preinfuse_now (  )

Function call to manually set pre-infuse quantity.

Definition at line 240 of file brewcontrol.cpp.

uint8_t toggle ( uint8_t  mode )

Toggle brewing.

Definition at line 553 of file brewcontrol.cpp.

bool toggle_boiler (  )

Toggle PID boiler control.

Definition at line 199 of file brewcontrol.cpp.