solenoid.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* Copyright 2018 mtdjr - modified by ishtob
  2. * Driver for solenoid written for QMK
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #pragma once
  18. #ifndef SOLENOID_DEFAULT_DWELL
  19. # define SOLENOID_DEFAULT_DWELL 12
  20. #endif
  21. #ifndef SOLENOID_MAX_DWELL
  22. # define SOLENOID_MAX_DWELL 100
  23. #endif
  24. #ifndef SOLENOID_MIN_DWELL
  25. # define SOLENOID_MIN_DWELL 4
  26. #endif
  27. #ifndef SOLENOID_DWELL_STEP_SIZE
  28. # define SOLENOID_DWELL_STEP_SIZE 1
  29. #endif
  30. #ifndef SOLENOID_DEFAULT_BUZZ
  31. # define SOLENOID_DEFAULT_BUZZ 0
  32. #endif
  33. #ifndef SOLENOID_BUZZ_ACTUATED
  34. # define SOLENOID_BUZZ_ACTUATED SOLENOID_MIN_DWELL
  35. #endif
  36. #ifndef SOLENOID_BUZZ_NONACTUATED
  37. # define SOLENOID_BUZZ_NONACTUATED SOLENOID_MIN_DWELL
  38. #endif
  39. #ifndef SOLENOID_PIN
  40. # error SOLENOID_PIN not defined
  41. #endif
  42. void solenoid_buzz_on(void);
  43. void solenoid_buzz_off(void);
  44. void solenoid_set_buzz(int buzz);
  45. void solenoid_set_dwell(uint8_t dwell);
  46. void solenoid_stop(void);
  47. void solenoid_fire(void);
  48. void solenoid_check(void);
  49. void solenoid_setup(void);
  50. void solenoid_shutdown(void);