platform.h
资源名称:Profibus.rar [点击查看]
上传用户:hualang
上传日期:2022-04-11
资源大小:104k
文件大小:11k
源码类别:
能源行业(电力石油煤炭)
开发平台:
C/C++
- /************************ Filename: platform.h *****************************/
- /* ========================================================================= */
- /* */
- /* 0000 000 000 00000 0 000 0 0 0 0000 */
- /* 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 */
- /* 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Einsteinstra遝 6 */
- /* 0000 000 0 0 000 0 0 00000 0 0000 91074 Herzogenaurach */
- /* 0 00 0 0 0 0 0 0 0 0 0 */
- /* 0 0 0 0 0 0 0 0 0 0 0 0 0 Tel: ++49-9132-744-200 */
- /* 0 0 0 000 0 0 000 0 0 0 0 GmbH Fax: ++49-9132-744-204 */
- /* */
- /* ========================================================================= */
- /* */
- /* Description: User defines (microcontroller, data types, ... ). */
- /* */
- /* ------------------------------------------------------------------------- */
- /* */
- /* Technical support: P. Fredehorst */
- /* Tel. : ++49-9132/744-214 */
- /* Fax. : -204 */
- /* eMail: pfredehorst@profichip.com */
- /* support@profichip.com */
- /* */
- /*****************************************************************************/
- /*****************************************************************************/
- /* contents:
- - header include hierarchy for system environment
- */
- /*****************************************************************************/
- /* reinclude protection */
- #ifndef PLATFORM_H
- #define PLATFORM_H
- //#include "E5_BaseTypes.h"
- #ifndef DSP28_DATA_TYPES
- # define DSP28_DATA_TYPES
- typedef unsigned char uint8; /* 无符号8位整型变量 */
- typedef signed char int8; /* 有符号8位整型变量 */
- typedef unsigned short uint16; /* 无符号16位整型变量 */
- typedef signed short int16; /* 有符号16位整型变量 */
- typedef unsigned int uint32; /* 无符号32位整型变量 */
- typedef signed int int32; /* 有符号32位整型变量 */
- typedef short bool16;
- #ifndef WIN32
- typedef unsigned long long uint64; /* 无符号64位整型变量 */
- typedef signed long long int64; /* 有符号64位整型变量 */
- #else
- typedef unsigned __int64 uint64; /* 无符号64位整型变量 */
- typedef __int64 int64; /* 有符号64位整型变量 */
- #endif
- typedef float fp32; /* 单精度浮点数(32位长度) */
- typedef double fp64; /* 双精度浮点数(64位长度) */
- #endif
- #define SECTION_DEF_CommuData
- #define SECTION_DEF_CommuCode
- #define TRACE()
- #define ASSERT()
- /*****************************************************************************/
- /* header include hierarchy for system environment */
- /*---------------------------------------------------------------------------*/
- /* COMPILER */
- /*---------------------------------------------------------------------------*/
- #define _KEIL_C51
- #undef _KEIL_C51
- /*---------------------------------------------------------------------------*/
- /* Hardwareplatform */
- /*---------------------------------------------------------------------------*/
- //#define EvaBoard_AT89C5132
- /*---------------------------------------------------------------------------*/
- /* include hierarchy, data types */
- /*---------------------------------------------------------------------------*/
- // sign the byte order of a word in your device
- // possible: LITTLE_ENDIAN lower address - high byte
- // higher address - low byte
- // BIG_ENDIAN lower address - low byte
- // higher address - high byte
- #define BIG_ENDIAN
- //#define LITTLE_ENDIAN
- //#undef BIG_ENDIAN
- //#include <intrins.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- //#define TRUE 1
- //#define FALSE !(TRUE)
- #define UBYTE unsigned char
- #define UWORD unsigned short
- //#define BOOL unsigned char
- #define ULONG unsigned long
- #define UINT16 unsigned short
- #define PTR_ATTR
- #define VPC3_PTR PTR_ATTR *
- #define VPC3_ADR unsigned long//int?
- #define VPC3_UNSIGNED8_PTR UBYTE PTR_ATTR *
- #define NULL_PTR (void VPC3_PTR)0
- #define ROMCONST__ const
- #define NOP__() __asm{ NOP }
- #include "dp_cfg.h" // default configuration
- #include "..dpv0_drvdpl_list.h" // double pointered list, makros
- #include "..dpv0_drvdp_if.h" // mpi structure, makros
- #ifndef FALSE
- #define FALSE 0
- #endif
- #ifndef TRUE
- #define TRUE 1
- #endif
- #ifndef mmin
- #define mmin(a,b) (((a) < (b)) ? (a) : (b))
- #endif
- /*---------------------------------------------------------------------------*/
- /* hardware settings */
- /*---------------------------------------------------------------------------*/
- /*------------------------------------------------------------------------*/
- /* VPC3 reset settings */
- /*------------------------------------------------------------------------*/
- //sbit RES_VPC3 = 0x90; // hardware port pin 1.0
- //#define VPC3_RESET__ RES_VPC3 = 1
- //#define VPC3_CLEAR_RESET__ RES_VPC3 = 0
- //#define VPC3_RESET__ IO0DIR=1<<21;
- // IO0SET=1<<21;
- //#define VPC3_CLEAR_RESET__ IO0CLR=1<<21;
- /*------------------------------------------------------------------------*/
- /* MPI12x interrupt settings */
- /*------------------------------------------------------------------------*/
- //#define ENABLE_VPC3_INT__ EX0 = 1
- //#define DISABLE_VPC3_INT__ EX0 = 0
- //#define SET_FALLING_EDGE__ IT0 = 1
- //#define SET_HIGH_PRIORITY__
- /*------------------------------------------------------------------------*/
- /* LEDs */
- /*------------------------------------------------------------------------*/
- //sbit LED_RED = 0x94; // hardware port pin 1.4
- //sbit LED_YLW = 0x95; // hardware port pin 1.5
- //#define TOGGLE_LED_RED__ LED_RED ^= 1
- //#define CLR_LED_RED__ LED_RED = 1
- //#define SET_LED_RED__ LED_RED = 0
- //#define TOGGLE_LED_YLW__ LED_YLW ^= 1
- //#define CLR_LED_YLW__ LED_YLW = 1
- //#define SET_LED_YLW__ LED_YLW = 0
- /*------------------------------------------------------------------------*/
- /* Testpins */
- /*------------------------------------------------------------------------*/
- //sbit TEST_PIN_6 = 0x96; // hardware port pin 1.6
- //sbit TEST_PIN_7 = 0x97; // hardware port pin 1.7
- //#define TOGGLE_TEST6__ TEST_PIN_6 ^= 1
- //#define CLR_TEST6__ TEST_PIN_6 = 0
- //#define SET_TEST6__ TEST_PIN_6 = 1
- //#define TOGGLE_TEST7__ TEST_PIN_7 ^= 1
- //#define CLR_TEST7__ TEST_PIN_7 = 0
- //#define SET_TEST7__ TEST_PIN_7 = 1
- /*------------------------------------------------------------------------*/
- /* LWL interface macro */
- /*------------------------------------------------------------------------*/
- //sbit VPC3_ADR10 = 0xB3; // hardware port pin 3.3
- //sbit DIR_AB = 0xB4; // hardware port pin 3.4
- //sbit EN_LWL_B = 0xB5; // hardware port pin 3.5
- //#define DISABLE_LWL_INTERFACE_B__ EN_LWL_B = 0
- //#define ENABLE_LWL_INTERFACE_B__ EN_LWL_B = 1
- //#define SET_DIR_AB__ DIR_AB = 0
- //#define SET_DIR_BA__ DIR_AB = 1
- //#define SET_VPC3_ADR10__ VPC3_ADR10 = 1
- //#define CLR_VPC3_ADR10__ VPC3_ADR10 = 0
- //#define DISABLE_ALL_INTERRUPT_BIT__ EA = 0
- //#define ENABLE_ALL_INTERRUPT_BIT__ EA = 1
- /*------------------------------------------------------------------------*/
- /* XRAM area */
- /*------------------------------------------------------------------------*/
- //老板子
- //#define VPC3_ASIC_ADDRESS(dev_num) (unsigned char *)(0x20220000 + 0x20000*dev_num)//BLACKFIN
- //新板子 ver2
- //#define VPC3_ASIC_ADDRESS(dev_num) (unsigned char *)(0x200000)//BLACKFIN
- #define VPC3_ASIC_ADDRESS(dev_num) (unsigned char *)(0x004000)//BLACKFIN
- //#define RTC_ADDRESS ((unsigned char *)0x2B000L)
- //#define LCD_ADDRESS ((unsigned char *)0x2C000L)
- //#define READ_PORT0 ((unsigned char *)0x2D000L)
- //#define READ_PORT1 ((unsigned char *)0x2E000L)
- //#define READ_PORT2 ((unsigned char *)0x2F000L)
- //#define WRITE_PORT0 ((unsigned char *)0x2D000L)
- //#define WRITE_PORT1 ((unsigned char *)0x2E000L)
- //#define WRITE_PORT2 ((unsigned char *)0x2F000L)
- #define logMsg(format,arg1,arg2,arg3,arg4,arg5,arg6) //printf(format,arg1,arg2,arg3,arg4,arg5,arg6)
- #define logMsg2(format,arg1,arg2,arg3,arg4,arg5,arg6) //printf(format,arg1,arg2,arg3,arg4,arg5,arg6)
- /*****************************************************************************/
- /* reinclude-protection */
- #else
- #pragma message "The header PLATFORM.H is included twice or more !"
- #endif
- /*****************************************************************************/
- /* Copyright (C) profichip GmbH 2005. Confidential. */
- /*****************************************************************************/