platform.h
上传用户:hualang
上传日期:2022-04-11
资源大小:104k
文件大小:11k
开发平台:

C/C++

  1. /************************  Filename: platform.h  *****************************/
  2. /* ========================================================================= */
  3. /*                                                                           */
  4. /* 0000  000   000  00000 0  000  0   0 0 0000                               */
  5. /* 0   0 0  0 0   0 0     0 0   0 0   0 0 0   0                              */
  6. /* 0   0 0  0 0   0 0     0 0     0   0 0 0   0      Einsteinstra遝 6        */
  7. /* 0000  000  0   0 000   0 0     00000 0 0000       91074 Herzogenaurach    */
  8. /* 0     00   0   0 0     0 0     0   0 0 0                                  */
  9. /* 0     0 0  0   0 0     0 0   0 0   0 0 0          Tel: ++49-9132-744-200  */
  10. /* 0     0  0  000  0     0  000  0   0 0 0    GmbH  Fax: ++49-9132-744-204  */
  11. /*                                                                           */
  12. /* ========================================================================= */
  13. /*                                                                           */
  14. /* Description: User defines (microcontroller, data types, ... ).           */
  15. /*                                                                           */
  16. /* ------------------------------------------------------------------------- */
  17. /*                                                                           */
  18. /* Technical support:       P. Fredehorst                                    */
  19. /*                          Tel. : ++49-9132/744-214                         */
  20. /*                          Fax. :              -204                         */
  21. /*                          eMail: pfredehorst@profichip.com                 */
  22. /*                              support@profichip.com                 */
  23. /*                                                                           */
  24. /*****************************************************************************/
  25. /*****************************************************************************/
  26. /* contents:
  27.     - header include hierarchy for system environment
  28. */
  29. /*****************************************************************************/
  30. /* reinclude protection */
  31. #ifndef PLATFORM_H
  32. #define PLATFORM_H
  33. //#include "E5_BaseTypes.h"
  34. #ifndef DSP28_DATA_TYPES
  35. # define DSP28_DATA_TYPES
  36. typedef unsigned char  uint8;                   /* 无符号8位整型变量                        */
  37. typedef signed   char  int8;                    /* 有符号8位整型变量                        */
  38. typedef unsigned short uint16;                  /* 无符号16位整型变量                       */
  39. typedef signed   short int16;                   /* 有符号16位整型变量                       */
  40. typedef unsigned int   uint32;                  /* 无符号32位整型变量                       */
  41. typedef signed   int   int32;                   /* 有符号32位整型变量                       */
  42.     typedef short          bool16;
  43. #ifndef WIN32
  44. typedef unsigned long long uint64; /* 无符号64位整型变量                       */
  45. typedef signed long long int64; /* 有符号64位整型变量                       */
  46. #else
  47. typedef  unsigned __int64 uint64; /* 无符号64位整型变量                       */
  48. typedef __int64 int64; /* 有符号64位整型变量                       */
  49. #endif
  50. typedef float          fp32;                    /* 单精度浮点数(32位长度)                 */
  51. typedef double         fp64;                    /* 双精度浮点数(64位长度)                 */
  52. #endif
  53. #define SECTION_DEF_CommuData
  54. #define SECTION_DEF_CommuCode
  55. #define TRACE()
  56. #define ASSERT()
  57. /*****************************************************************************/
  58. /* header include hierarchy for system environment */
  59. /*---------------------------------------------------------------------------*/
  60. /* COMPILER                                                                  */
  61. /*---------------------------------------------------------------------------*/
  62. #define _KEIL_C51
  63. #undef _KEIL_C51
  64. /*---------------------------------------------------------------------------*/
  65. /* Hardwareplatform                                                          */
  66. /*---------------------------------------------------------------------------*/
  67. //#define EvaBoard_AT89C5132
  68. /*---------------------------------------------------------------------------*/
  69. /* include hierarchy, data types                                             */
  70. /*---------------------------------------------------------------------------*/
  71. // sign the byte order of a word in your device
  72. // possible: LITTLE_ENDIAN   lower address  - high byte
  73. //                           higher address - low byte
  74. //           BIG_ENDIAN      lower address  - low byte
  75. //                           higher address - high byte
  76. #define BIG_ENDIAN
  77. //#define LITTLE_ENDIAN
  78. //#undef  BIG_ENDIAN
  79. //#include <intrins.h>
  80. #include <stdio.h>
  81. #include <stdlib.h>
  82. #include <string.h>
  83. //#define TRUE                    1
  84. //#define FALSE                   !(TRUE)
  85. #define UBYTE                   unsigned char
  86. #define UWORD                   unsigned short
  87. //#define BOOL                    unsigned char
  88. #define ULONG                   unsigned long
  89. #define UINT16                  unsigned short
  90. #define PTR_ATTR                 
  91. #define VPC3_PTR                 PTR_ATTR *
  92. #define VPC3_ADR                 unsigned long//int?
  93. #define VPC3_UNSIGNED8_PTR       UBYTE PTR_ATTR *
  94. #define NULL_PTR  (void VPC3_PTR)0
  95. #define ROMCONST__  const
  96. #define NOP__() __asm{ NOP }
  97. #include "dp_cfg.h"             // default configuration
  98. #include "..dpv0_drvdpl_list.h"           // double pointered list, makros
  99. #include "..dpv0_drvdp_if.h"              // mpi structure, makros
  100. #ifndef FALSE
  101. #define FALSE 0
  102. #endif
  103. #ifndef TRUE
  104. #define TRUE 1
  105. #endif
  106. #ifndef mmin
  107. #define mmin(a,b)    (((a) < (b)) ? (a) : (b))
  108. #endif
  109. /*---------------------------------------------------------------------------*/
  110. /* hardware settings                                                         */
  111. /*---------------------------------------------------------------------------*/
  112. /*------------------------------------------------------------------------*/
  113. /* VPC3 reset settings                                                    */
  114. /*------------------------------------------------------------------------*/
  115. //sbit RES_VPC3  = 0x90; // hardware port pin 1.0
  116. //#define VPC3_RESET__          RES_VPC3 = 1
  117. //#define VPC3_CLEAR_RESET__ RES_VPC3 = 0
  118. //#define VPC3_RESET__           IO0DIR=1<<21;
  119. //                                                         IO0SET=1<<21;
  120. //#define VPC3_CLEAR_RESET__ IO0CLR=1<<21;
  121. /*------------------------------------------------------------------------*/
  122. /* MPI12x interrupt settings                                              */
  123. /*------------------------------------------------------------------------*/
  124. //#define ENABLE_VPC3_INT__ EX0 = 1
  125. //#define DISABLE_VPC3_INT__         EX0 = 0
  126. //#define SET_FALLING_EDGE__        IT0 = 1
  127. //#define SET_HIGH_PRIORITY__
  128.                                 
  129. /*------------------------------------------------------------------------*/
  130. /* LEDs                                                   */
  131. /*------------------------------------------------------------------------*/
  132. //sbit LED_RED                 = 0x94; // hardware port pin 1.4
  133. //sbit LED_YLW                 = 0x95; // hardware port pin 1.5
  134.                                 
  135. //#define TOGGLE_LED_RED__     LED_RED ^= 1
  136. //#define CLR_LED_RED__        LED_RED  = 1
  137. //#define SET_LED_RED__        LED_RED  = 0
  138.                                 
  139. //#define TOGGLE_LED_YLW__     LED_YLW ^= 1
  140. //#define CLR_LED_YLW__        LED_YLW  = 1
  141. //#define SET_LED_YLW__        LED_YLW  = 0
  142. /*------------------------------------------------------------------------*/
  143. /* Testpins                                                   */
  144. /*------------------------------------------------------------------------*/
  145. //sbit TEST_PIN_6 = 0x96; // hardware port pin 1.6
  146. //sbit TEST_PIN_7 = 0x97; // hardware port pin 1.7
  147.                                 
  148. //#define TOGGLE_TEST6__       TEST_PIN_6 ^= 1
  149. //#define CLR_TEST6__          TEST_PIN_6  = 0
  150. //#define SET_TEST6__          TEST_PIN_6  = 1
  151. //#define TOGGLE_TEST7__       TEST_PIN_7 ^= 1
  152. //#define CLR_TEST7__          TEST_PIN_7  = 0
  153. //#define SET_TEST7__          TEST_PIN_7  = 1
  154. /*------------------------------------------------------------------------*/
  155. /* LWL interface macro                                                    */
  156. /*------------------------------------------------------------------------*/
  157. //sbit VPC3_ADR10                 = 0xB3; // hardware port pin 3.3
  158. //sbit DIR_AB                  = 0xB4; // hardware port pin 3.4
  159. //sbit EN_LWL_B                = 0xB5; // hardware port pin 3.5
  160. //#define DISABLE_LWL_INTERFACE_B__  EN_LWL_B = 0
  161. //#define ENABLE_LWL_INTERFACE_B__   EN_LWL_B = 1
  162. //#define SET_DIR_AB__               DIR_AB   = 0
  163. //#define SET_DIR_BA__               DIR_AB   = 1
  164. //#define SET_VPC3_ADR10__ VPC3_ADR10 = 1
  165. //#define CLR_VPC3_ADR10__ VPC3_ADR10 = 0
  166. //#define DISABLE_ALL_INTERRUPT_BIT__ EA = 0
  167. //#define ENABLE_ALL_INTERRUPT_BIT__ EA = 1
  168. /*------------------------------------------------------------------------*/
  169. /* XRAM area                                                              */
  170. /*------------------------------------------------------------------------*/
  171. //老板子
  172. //#define VPC3_ASIC_ADDRESS(dev_num)     (unsigned char *)(0x20220000 + 0x20000*dev_num)//BLACKFIN
  173. //新板子  ver2
  174. //#define VPC3_ASIC_ADDRESS(dev_num)     (unsigned char *)(0x200000)//BLACKFIN
  175. #define VPC3_ASIC_ADDRESS(dev_num)     (unsigned char *)(0x004000)//BLACKFIN
  176. //#define RTC_ADDRESS ((unsigned char *)0x2B000L)
  177. //#define LCD_ADDRESS ((unsigned char *)0x2C000L)
  178.             
  179. //#define READ_PORT0           ((unsigned char *)0x2D000L)
  180. //#define READ_PORT1           ((unsigned char *)0x2E000L)
  181. //#define READ_PORT2           ((unsigned char *)0x2F000L)
  182.                             
  183. //#define WRITE_PORT0          ((unsigned char *)0x2D000L)
  184. //#define WRITE_PORT1          ((unsigned char *)0x2E000L)
  185. //#define WRITE_PORT2 ((unsigned char *)0x2F000L)
  186. #define logMsg(format,arg1,arg2,arg3,arg4,arg5,arg6) //printf(format,arg1,arg2,arg3,arg4,arg5,arg6)
  187. #define logMsg2(format,arg1,arg2,arg3,arg4,arg5,arg6) //printf(format,arg1,arg2,arg3,arg4,arg5,arg6)
  188. /*****************************************************************************/
  189. /* reinclude-protection */
  190. #else
  191.     #pragma message "The header PLATFORM.H is included twice or more !"
  192. #endif
  193. /*****************************************************************************/
  194. /*  Copyright (C) profichip GmbH 2005. Confidential.                         */
  195. /*****************************************************************************/