fsensor.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //! @file
  2. #ifndef FSENSOR_H
  3. #define FSENSOR_H
  4. #include <inttypes.h>
  5. //! minimum meassured chunk length in steps
  6. extern int16_t fsensor_chunk_len;
  7. // enable/disable flag
  8. extern bool fsensor_enabled;
  9. // not responding flag
  10. extern bool fsensor_not_responding;
  11. //enable/disable quality meassurement
  12. extern bool fsensor_oq_meassure_enabled;
  13. //! @name save restore printing
  14. //! @{
  15. extern void fsensor_stop_and_save_print(void);
  16. //! restore print - restore position and heatup to original temperature
  17. extern void fsensor_restore_print_and_continue(void);
  18. //! @}
  19. //! initialize
  20. extern void fsensor_init(void);
  21. //! @name enable/disable
  22. //! @{
  23. extern bool fsensor_enable(void);
  24. extern void fsensor_disable(void);
  25. //! @}
  26. //autoload feature enabled
  27. extern bool fsensor_autoload_enabled;
  28. extern void fsensor_autoload_set(bool State);
  29. extern void fsensor_update(void);
  30. #ifdef PAT9125
  31. //! setup pin-change interrupt
  32. extern void fsensor_setup_interrupt(void);
  33. //! @name autoload support
  34. //! @{
  35. extern void fsensor_autoload_check_start(void);
  36. extern void fsensor_autoload_check_stop(void);
  37. #endif //PAT9125
  38. extern bool fsensor_check_autoload(void);
  39. //! @}
  40. //! @name optical quality measurement support
  41. //! @{
  42. extern void fsensor_oq_meassure_set(bool State);
  43. extern void fsensor_oq_meassure_start(uint8_t skip);
  44. extern void fsensor_oq_meassure_stop(void);
  45. extern bool fsensor_oq_result(void);
  46. //! @}
  47. //! @name callbacks from stepper
  48. //! @{
  49. extern void fsensor_st_block_chunk(int cnt);
  50. // There's really nothing to do in block_begin: the stepper ISR likely has
  51. // called us already at the end of the last block, making this integration
  52. // redundant. LA1.5 might not always do that during a coasting move, so attempt
  53. // to drain fsensor_st_cnt anyway at the beginning of the new block.
  54. #define fsensor_st_block_begin(rev) fsensor_st_block_chunk(0)
  55. //! @}
  56. #endif //FSENSOR_H