coffee.h 980 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * coffee.h
  3. *
  4. * Created on: Sep 25, 2017
  5. * Author: Sebastian
  6. */
  7. #ifndef COFFEE_H_
  8. #define COFFEE_H_
  9. #include <csignal>
  10. //define status
  11. typedef enum {
  12. STATE_OFF,
  13. STATE_HEATING,
  14. STATE_INITALHEATING,
  15. STATE_IDLE,
  16. STATE_BREW,
  17. STATE_BREWMANUAL,
  18. STATE_CLEANING,
  19. STATE_ERROR
  20. } coffee_status_t;
  21. #define AMOUNT_PREINFUSION 28 //Preinfusion amount in ml
  22. #define TIME_SOAK 5000 //Time between preinfusion and infusion in ms
  23. #define TIME_INFUSION 25000 //Infusion time in ms
  24. #define AMOUNT_DBLESPRESSO 49.0 //Size of a double espresso in ml
  25. void *coffeeThread(void *threadid);
  26. void coffeeHandler(int signum, siginfo_t *siginfo, void *context);
  27. int getSigValue(void);
  28. bool SigValueEmpty(void);
  29. void changeState(coffee_status_t newState);
  30. coffee_status_t getState(void);
  31. void brewTimeHandler(void);
  32. void coffeeTerminate(void);
  33. void coffeeBrew(void);
  34. void coffeeIncreaseBrewCounter(void);
  35. void coffeeIncreaseHeatingTime(uint64_t heatingTime);
  36. #endif /* COFFEE_H_ */