v850e_timer_c.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * include/asm-v850/v850e_timer_c.h -- `Timer C' component often used
  3. * with the V850E cpu core
  4. *
  5. * Copyright (C) 2001,03 NEC Electronics Corporation
  6. * Copyright (C) 2001,03 Miles Bader <miles@gnu.org>
  7. *
  8. * This file is subject to the terms and conditions of the GNU General
  9. * Public License. See the file COPYING in the main directory of this
  10. * archive for more details.
  11. *
  12. * Written by Miles Bader <miles@gnu.org>
  13. */
  14. /* NOTE: this include file currently contains only enough to allow us to
  15. use timer C as an interrupt pass-through. */
  16. #ifndef __V850_V850E_TIMER_C_H__
  17. #define __V850_V850E_TIMER_C_H__
  18. #include <asm/types.h>
  19. #include <asm/machdep.h> /* Pick up chip-specific defs. */
  20. /* Timer C (16-bit interval timers). */
  21. /* Control register 0 for timer C. */
  22. #define V850E_TIMER_C_TMCC0_ADDR(n) (V850E_TIMER_C_BASE_ADDR + 0x6 + 0x10 *(n))
  23. #define V850E_TIMER_C_TMCC0(n) (*(volatile u8 *)V850E_TIMER_C_TMCC0_ADDR(n))
  24. #define V850E_TIMER_C_TMCC0_CAE 0x01 /* clock action enable */
  25. #define V850E_TIMER_C_TMCC0_CE 0x02 /* count enable */
  26. /* ... */
  27. /* Control register 1 for timer C. */
  28. #define V850E_TIMER_C_TMCC1_ADDR(n) (V850E_TIMER_C_BASE_ADDR + 0x8 + 0x10 *(n))
  29. #define V850E_TIMER_C_TMCC1(n) (*(volatile u8 *)V850E_TIMER_C_TMCC1_ADDR(n))
  30. #define V850E_TIMER_C_TMCC1_CMS0 0x01 /* capture/compare mode select (ccc0) */
  31. #define V850E_TIMER_C_TMCC1_CMS1 0x02 /* capture/compare mode select (ccc1) */
  32. /* ... */
  33. /* Interrupt edge-sensitivity control for timer C. */
  34. #define V850E_TIMER_C_SESC_ADDR(n) (V850E_TIMER_C_BASE_ADDR + 0x9 + 0x10 *(n))
  35. #define V850E_TIMER_C_SESC(n) (*(volatile u8 *)V850E_TIMER_C_SESC_ADDR(n))
  36. /* ...etc... */
  37. #endif /* __V850_V850E_TIMER_C_H__ */