regs-pwm.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * stmp37xx: PWM register definitions
  3. *
  4. * Copyright (c) 2008 Freescale Semiconductor
  5. * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #define REGS_PWM_BASE (STMP3XXX_REGS_BASE + 0x64000)
  22. #define HW_PWM_CTRL 0x0
  23. #define BM_PWM_CTRL_PWM2_ENABLE 0x00000004
  24. #define BM_PWM_CTRL_PWM2_ANA_CTRL_ENABLE 0x00000020
  25. #define HW_PWM_ACTIVE0 (0x10 + 0 * 0x20)
  26. #define HW_PWM_ACTIVE1 (0x10 + 1 * 0x20)
  27. #define HW_PWM_ACTIVE2 (0x10 + 2 * 0x20)
  28. #define HW_PWM_ACTIVE3 (0x10 + 3 * 0x20)
  29. #define HW_PWM_ACTIVEn 0x10
  30. #define BM_PWM_ACTIVEn_ACTIVE 0x0000FFFF
  31. #define BP_PWM_ACTIVEn_ACTIVE 0
  32. #define BM_PWM_ACTIVEn_INACTIVE 0xFFFF0000
  33. #define BP_PWM_ACTIVEn_INACTIVE 16
  34. #define HW_PWM_PERIOD0 (0x20 + 0 * 0x20)
  35. #define HW_PWM_PERIOD1 (0x20 + 1 * 0x20)
  36. #define HW_PWM_PERIOD2 (0x20 + 2 * 0x20)
  37. #define HW_PWM_PERIOD3 (0x20 + 3 * 0x20)
  38. #define HW_PWM_PERIODn 0x20
  39. #define BM_PWM_PERIODn_PERIOD 0x0000FFFF
  40. #define BP_PWM_PERIODn_PERIOD 0
  41. #define BM_PWM_PERIODn_ACTIVE_STATE 0x00030000
  42. #define BP_PWM_PERIODn_ACTIVE_STATE 16
  43. #define BM_PWM_PERIODn_INACTIVE_STATE 0x000C0000
  44. #define BP_PWM_PERIODn_INACTIVE_STATE 18
  45. #define BM_PWM_PERIODn_CDIV 0x00700000
  46. #define BP_PWM_PERIODn_CDIV 20