automat.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "core/config.h"
  2. #if CONFIG_AUTOMAT_MODE && ( CONFIG_KEYSW || CONFIG_NFMBASECLASS )
  3. #ifndef AUTOMAT_H
  4. #define AUTOMAT_H
  5. #include <stdint.h>
  6. #include <stdbool.h>
  7. #include "drivers/keycontrol/keycontrol.h" // KEYCONTROL_STATE_SHORTALL KEYCONTROL_STATE_OPENALL KEYCONTROL_STATE_LOADALL
  8. typedef struct
  9. {
  10. // .Init()
  11. // Initializes the FSM "ACM Automat"
  12. // @ticks_per_1ms - number of ticks ( .Tick() calls ) per one millisecond
  13. // Returns boolean flag: true in case of success, false otherwise.
  14. // Function returns 'false' in case the "ACM Automat" is disabled in settings (Flash-memory)
  15. bool ( * Init)(uint32_t ticks_per_1ms); // Init: TASK ONLY!
  16. // .Tick()
  17. // implements the 1ms tick events for FSM "ACM Automat"
  18. void ( * Tick)(void); // Tick: IRQ ONLY!
  19. // .TemperatureUpdate()
  20. // update current device temperature for FSM "ACM Automat".
  21. // @avgtemp_degree - current temperature in degrees Celsius, integer value.
  22. // @isValueReady - true if the temperature value is ready to be used
  23. void ( * TemperatureUpdate)( int8_t avgtemp_degree, bool isValueReady );
  24. // .DeInit()
  25. // Deinitialize the FSM "ACM Automat"
  26. void ( * DeInit)(void); // Init: TASK ONLY!
  27. }
  28. sNFMAutomatHandle_t;
  29. extern const sNFMAutomatHandle_t NFMAutomatHandle;
  30. #endif
  31. #endif