chip.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #ifndef _LIB_CHIP_AMT630HV160_
  2. #define _LIB_CHIP_AMT630HV160_
  3. /*
  4. * Peripherals registers definitions
  5. */
  6. #if defined AMT630HV160
  7. #include "include/amt630hv160.h"
  8. #else
  9. #warning Library does not support the specified chip, specifying AMT630HV160
  10. #define AMT630HV160
  11. #include "include/amt630hv160.h"
  12. #endif
  13. /* Define attribute */
  14. #if defined ( __CC_ARM ) /* Keil 礦ision 4 */
  15. #define WEAK __attribute__ ((weak))
  16. #elif defined ( __ICCARM__ ) /* IAR Ewarm 5.41+ */
  17. #define WEAK __weak
  18. #elif defined ( __GNUC__ ) /* GCC CS3 2009q3-68 */
  19. #define WEAK __attribute__ ((weak))
  20. #endif
  21. /* Define NO_INIT attribute and compiler specific symbols */
  22. #if defined ( __CC_ARM )
  23. #define NO_INIT
  24. #define __ASM __asm /*!< asm keyword for ARM Compiler */
  25. #define __INLINE __inline /*!< inline keyword for ARM Compiler */
  26. #elif defined ( __ICCARM__ )
  27. #define NO_INIT __no_init
  28. #define __ASM __asm /*!< asm keyword for IAR Compiler */
  29. #define __INLINE inline /*!< inline keyword for IAR Compiler. Only avaiable in High optimization mode! */
  30. #elif defined ( __GNUC__ )
  31. #define __ASM asm /*!< asm keyword for GNU Compiler */
  32. #define __INLINE inline /*!< inline keyword for GNU Compiler */
  33. #define NO_INIT
  34. #endif
  35. #define CP15_PRESENT
  36. struct device {
  37. const char *init_name;
  38. };
  39. #include <stdbool.h>
  40. /*
  41. * Peripherals
  42. */
  43. #include "errno.h"
  44. #include "mmu.h"
  45. #include "cp15/cp15.h"
  46. #include "trace.h"
  47. #include "sysctl.h"
  48. #include "gic.h"
  49. #include "timer.h"
  50. #include "uart.h"
  51. #include "clock.h"
  52. #include "pinctrl.h"
  53. #include "gpio.h"
  54. #include "i2c.h"
  55. #include "i2c-gpio.h"
  56. #include "i2c-dw.h"
  57. #include "spi.h"
  58. #include "wdt.h"
  59. #include "rtc.h"
  60. #include "dma.h"
  61. #include "lcd.h"
  62. #include "pwm.h"
  63. #include "itu.h"
  64. #include "pxp.h"
  65. #include "adc.h"
  66. #include "sdmmc.h"
  67. #include "mmcsd_core.h"
  68. #include "vdec.h"
  69. #include "blend2d.h"
  70. #include "remote.h"
  71. #include "video_buf.h"
  72. #include "sema.h"
  73. #include "mailbox.h"
  74. #include "rdc.h"
  75. #include "i2s.h"
  76. #include "eth.h"
  77. #include "qoi_dec.h"
  78. #include "adc.h"
  79. #include "crc.h"
  80. #include "mailbox_message.h"
  81. typedef enum {
  82. CHIP_HVER_NONE = -1,
  83. CHIP_HVER_0 = 0,
  84. CHIP_HVER_1 = 1,
  85. CHIP_HVER_COUNT
  86. } ChipHardwareVersion;
  87. typedef struct {
  88. uint32_t hver; /* chip hardware version number */
  89. uint32_t reserved[14];
  90. uint32_t crc;
  91. } ChipInfo;
  92. uint32_t GetChipHWVeriosn(void);
  93. #endif /* _LIB_CHIP_AMT630HV100_ */