softpwm.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * The MIT License (MIT)
  3. *
  4. * Copyright (c) 2013-2016 The MicroPython-on-micro:bit Developers:
  5. * Damien P. George (@dpgeorge)
  6. * Nicholas H. Tollervey (@ntoll)
  7. * Matthew Else (@matthewelse)
  8. * Alan M. Jackson (@alanmjackson)
  9. * Mark Shannon (@markshannon)
  10. * Larry Hastings (@larryhastings)
  11. * Mariia Koroliuk (@marichkakorolyuk)
  12. * Andrew Mulholland (@gbaman)
  13. * Joe Glancy (@JoeGlancy)
  14. *
  15. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16. * of this software and associated documentation files (the "Software"), to deal
  17. * in the Software without restriction, including without limitation the rights
  18. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19. * copies of the Software, and to permit persons to whom the Software is
  20. * furnished to do so, subject to the following conditions:
  21. *
  22. * The above copyright notice and this permission notice shall be included in
  23. * all copies or substantial portions of the Software.
  24. *
  25. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  26. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  27. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  28. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  29. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  30. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  31. * THE SOFTWARE.
  32. */
  33. #ifndef __MICROPY_INCLUDED_LIB_PWM_H__
  34. #define __MICROPY_INCLUDED_LIB_PWM_H__
  35. void softpwm_init0(void);
  36. void pwm_start(void);
  37. void pwm_stop(void);
  38. int pwm_set_period_us(int32_t us);
  39. int32_t pwm_get_period_us(void);
  40. void pwm_set_duty_cycle(int32_t pin, int32_t value);
  41. void pwm_release(int32_t pin);
  42. #endif // __MICROPY_INCLUDED_LIB_PWM_H__