fsensor.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //! @file
  2. #ifndef FSENSOR_H
  3. #define FSENSOR_H
  4. #include <inttypes.h>
  5. #include "config.h"
  6. //! minimum meassured chunk length in steps
  7. extern int16_t fsensor_chunk_len;
  8. // enable/disable flag
  9. extern bool fsensor_enabled;
  10. // not responding flag
  11. extern bool fsensor_not_responding;
  12. //enable/disable quality meassurement
  13. extern bool fsensor_oq_meassure_enabled;
  14. //! @name save restore printing
  15. //! @{
  16. extern void fsensor_stop_and_save_print(void);
  17. //! restore print - restore position and heatup to original temperature
  18. extern void fsensor_restore_print_and_continue(void);
  19. //! @}
  20. //! initialize
  21. extern void fsensor_init(void);
  22. //! @name enable/disable
  23. //! @{
  24. extern bool fsensor_enable(bool bUpdateEEPROM=true);
  25. extern void fsensor_disable(bool bUpdateEEPROM=true);
  26. //! @}
  27. //autoload feature enabled
  28. extern bool fsensor_autoload_enabled;
  29. extern void fsensor_autoload_set(bool State);
  30. extern void fsensor_update(void);
  31. #ifdef PAT9125
  32. //! setup pin-change interrupt
  33. extern void fsensor_setup_interrupt(void);
  34. //! @name autoload support
  35. //! @{
  36. extern void fsensor_autoload_check_start(void);
  37. extern void fsensor_autoload_check_stop(void);
  38. #endif //PAT9125
  39. extern bool fsensor_check_autoload(void);
  40. //! @}
  41. //! @name optical quality measurement support
  42. //! @{
  43. extern void fsensor_oq_meassure_set(bool State);
  44. extern void fsensor_oq_meassure_start(uint8_t skip);
  45. extern void fsensor_oq_meassure_stop(void);
  46. extern bool fsensor_oq_result(void);
  47. //! @}
  48. #include "planner.h"
  49. //! @name callbacks from stepper
  50. //! @{
  51. extern void fsensor_st_block_begin(block_t* bl);
  52. extern void fsensor_st_block_chunk(block_t* bl, int cnt);
  53. //! @}
  54. #if IR_SENSOR_ANALOG
  55. #define IR_SENSOR_STEADY 10 // [ms]
  56. enum class ClFsensorPCB:uint_least8_t
  57. {
  58. _Old=0,
  59. _Rev03b=1,
  60. _Undef=EEPROM_EMPTY_VALUE
  61. };
  62. enum class ClFsensorActionNA:uint_least8_t
  63. {
  64. _Continue=0,
  65. _Pause=1,
  66. _Undef=EEPROM_EMPTY_VALUE
  67. };
  68. extern ClFsensorPCB oFsensorPCB;
  69. extern ClFsensorActionNA oFsensorActionNA;
  70. extern bool fsensor_IR_check();
  71. #endif //IR_SENSOR_ANALOG
  72. #endif //FSENSOR_H