gk7101.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * File : at91sam926x.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006, RT-Thread Develop Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. */
  23. #ifndef GK7101_H
  24. #define GK7101_H
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. #include <rtthread.h>
  29. /*****************************/
  30. /* CPU Mode */
  31. /*****************************/
  32. #define USERMODE 0x10
  33. #define FIQMODE 0x11
  34. #define IRQMODE 0x12
  35. #define SVCMODE 0x13
  36. #define ABORTMODE 0x17
  37. #define UNDEFMODE 0x1b
  38. #define MODEMASK 0x1f
  39. #define NOINT 0xc0
  40. struct rt_hw_register
  41. {
  42. rt_uint32_t r0;
  43. rt_uint32_t r1;
  44. rt_uint32_t r2;
  45. rt_uint32_t r3;
  46. rt_uint32_t r4;
  47. rt_uint32_t r5;
  48. rt_uint32_t r6;
  49. rt_uint32_t r7;
  50. rt_uint32_t r8;
  51. rt_uint32_t r9;
  52. rt_uint32_t r10;
  53. rt_uint32_t fp;
  54. rt_uint32_t ip;
  55. rt_uint32_t sp;
  56. rt_uint32_t lr;
  57. rt_uint32_t pc;
  58. rt_uint32_t cpsr;
  59. rt_uint32_t ORIG_r0;
  60. };
  61. #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
  62. extern struct clk *clk_get(const char *id);
  63. extern rt_uint32_t clk_get_rate(struct clk *clk);
  64. extern void rt_hw_clock_init(void);
  65. #ifdef __cplusplus
  66. }
  67. #endif
  68. #endif