pwm.h 1015 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // See LICENSE for license details.
  2. #ifndef _SIFIVE_PWM_H
  3. #define _SIFIVE_PWM_H
  4. /* Register offsets */
  5. #define PWM_CFG 0x00
  6. #define PWM_COUNT 0x08
  7. #define PWM_S 0x10
  8. #define PWM_CMP0 0x20
  9. #define PWM_CMP1 0x24
  10. #define PWM_CMP2 0x28
  11. #define PWM_CMP3 0x2C
  12. /* Constants */
  13. #define PWM_CFG_SCALE 0x0000000F
  14. #define PWM_CFG_STICKY 0x00000100
  15. #define PWM_CFG_ZEROCMP 0x00000200
  16. #define PWM_CFG_DEGLITCH 0x00000400
  17. #define PWM_CFG_ENALWAYS 0x00001000
  18. #define PWM_CFG_ONESHOT 0x00002000
  19. #define PWM_CFG_CMP0CENTER 0x00010000
  20. #define PWM_CFG_CMP1CENTER 0x00020000
  21. #define PWM_CFG_CMP2CENTER 0x00040000
  22. #define PWM_CFG_CMP3CENTER 0x00080000
  23. #define PWM_CFG_CMP0GANG 0x01000000
  24. #define PWM_CFG_CMP1GANG 0x02000000
  25. #define PWM_CFG_CMP2GANG 0x04000000
  26. #define PWM_CFG_CMP3GANG 0x08000000
  27. #define PWM_CFG_CMP0IP 0x10000000
  28. #define PWM_CFG_CMP1IP 0x20000000
  29. #define PWM_CFG_CMP2IP 0x40000000
  30. #define PWM_CFG_CMP3IP 0x80000000
  31. #endif /* _SIFIVE_PWM_H */