config.h

来自「NEC 的无线通讯方案」· C头文件 代码 · 共 172 行

H
172
字号
/*
* $Id: config.h,v 1.54 2007/11/02 01:53:37 sunny Exp $
*/
/*******************************************************************************

       UBEC (Uniband Electronic Corp.)

       Project: U-NET01, Ubiquitous network platform

       File: config.h

       Version: 0.3.0

       Usage:  System configuration

       Platform: U-NET01 DK with Keil 8051 C compiler

       Reference:

               Silicon Laboratories: C8051F124, C8051F340

               UBEC: UZ2400, UZ2410

       Note :

               Copyright (C) 2007 Uniband Electronic Corporation, All rights reserved

********************************************************************************/

#ifndef	__CONFIG_H__
#define	__CONFIG_H__

#define	DEBUG_MODE		0	// 2007/2/11 22:53:58, Sunny: 1:enable/0:disable debug mode
#define DEBUG_FUNC		0	// 2007/10/17 Chunchia: 1:enable/0:disable debug function

#define	UNET01			1	// 2007/6/26 11:31, Sunny: 0 for non-UNET01 code

#define	UNET01_VERSION		"UNET01 v0.3.0"

#define PAOPEN
//#define TURBO
//#define CHECKSUM
#define USE_BEACON_LIST		0
#define USE_DENIER_LIST		1
#define MAX_DENY_COUNT		10
#define TIMER_1MS
//#define TX_ASO_RSP_FAILURE

#if UNET01
#if defined(IOC8051F124)
	#define	My_MAC_Address7		0x80	// 2007/7/2 12:41, Sunny: the MSB byte (bye 7) of MAC address,
	#define	My_MAC_Address6		0x51	// 2007/7/2 12:41, Sunny: the byte 6 of MAC address,
	#define	My_MAC_Address5		0xF1	// 2007/7/2 12:41, Sunny: the byte 5 of MAC address,
	#define	My_MAC_Address4		0x24	// 2007/7/2 12:41, Sunny: the byte 4 of MAC address,
#elif defined(IOC8051F340)
	#define	My_MAC_Address7		0x80	// 2007/7/2 12:41, Sunny: the MSB byte (bye 7) of MAC address,
	#define	My_MAC_Address6		0x51	// 2007/7/2 12:41, Sunny: the byte 6 of MAC address,
	#define	My_MAC_Address5		0xF3	// 2007/7/2 12:41, Sunny: the byte 5 of MAC address,
	#define	My_MAC_Address4		0x40	// 2007/7/2 12:41, Sunny: the byte 4 of MAC address,
#elif defined(IOUZ2410)
	#define	My_MAC_Address7		0x80	// 2007/7/2 12:41, Sunny: the MSB byte (bye 7) of MAC address,
	#define	My_MAC_Address6		0x51	// 2007/7/2 12:41, Sunny: the byte 6 of MAC address,
	#define	My_MAC_Address5		0x24	// 2007/7/2 12:41, Sunny: the byte 5 of MAC address,
	#define	My_MAC_Address4		0x10	// 2007/7/2 12:41, Sunny: the byte 4 of MAC address,
#elif defined(uPD78F0547_80)
	#define	My_MAC_Address7		0xD7	// 2007/7/2 12:41, Sunny: the MSB byte (bye 7) of MAC address,
	#define	My_MAC_Address6		0x8F	// 2007/7/2 12:41, Sunny: the byte 6 of MAC address,
	#define	My_MAC_Address5		0x05	// 2007/7/2 12:41, Sunny: the byte 5 of MAC address,
	#define	My_MAC_Address4		0x47	// 2007/7/2 12:41, Sunny: the byte 4 of MAC address,
#elif defined(uPD78F0537_64)
	#define	My_MAC_Address7		0xD7	// 2007/7/2 12:41, Sunny: the MSB byte (bye 7) of MAC address,
	#define	My_MAC_Address6		0x8F	// 2007/7/2 12:41, Sunny: the byte 6 of MAC address,
	#define	My_MAC_Address5		0x05	// 2007/7/2 12:41, Sunny: the byte 5 of MAC address,
	#define	My_MAC_Address4		0x37	// 2007/7/2 12:41, Sunny: the byte 4 of MAC address,
#elif defined(uPD78F0525_52)
	#define	My_MAC_Address7		0xD7	// 2007/7/2 12:41, Sunny: the MSB byte (bye 7) of MAC address,
	#define	My_MAC_Address6		0x8F	// 2007/7/2 12:41, Sunny: the byte 6 of MAC address,
	#define	My_MAC_Address5		0x05	// 2007/7/2 12:41, Sunny: the byte 5 of MAC address,
	#define	My_MAC_Address4		0x25	// 2007/7/2 12:41, Sunny: the byte 4 of MAC address,
#elif defined(uPD78F0514_48)
	#define	My_MAC_Address7		0xD7	// 2007/7/2 12:41, Sunny: the MSB byte (bye 7) of MAC address,
	#define	My_MAC_Address6		0x8F	// 2007/7/2 12:41, Sunny: the byte 6 of MAC address,
	#define	My_MAC_Address5		0x05	// 2007/7/2 12:41, Sunny: the byte 5 of MAC address,
	#define	My_MAC_Address4		0x14	// 2007/7/2 12:41, Sunny: the byte 4 of MAC address,
#elif defined(M430F1611)
	#define	My_MAC_Address7		0x43	// 2007/7/2 12:41, Sunny: the MSB byte (bye 7) of MAC address,
	#define	My_MAC_Address6		0x0F	// 2007/7/2 12:41, Sunny: the byte 6 of MAC address,
	#define	My_MAC_Address5		0x16	// 2007/7/2 12:41, Sunny: the byte 5 of MAC address,
	#define	My_MAC_Address4		0x11	// 2007/7/2 12:41, Sunny: the byte 4 of MAC address,
#else
	#error "Unknown CPU type."
#endif

#define	My_MAC_Address3		0x03	// 2007/7/2 12:41, Sunny: the byte 3 of MAC address,
#define	My_MAC_Address2		0x02	// 2007/7/2 12:41, Sunny: the byte 2 of MAC address,
#define	My_MAC_Address1		0x01	// 2007/7/2 12:41, Sunny: the byte 1 of MAC address,
#define	My_MAC_Address0		0x00	// 2007/7/2 12:41, Sunny: the LSB byte (byte 0) of MAC address,

#if 0 && (My_MAC_Address0 == 0x00)
	#define I_Am_Coordinator	// enable the coordinator function.
#endif

//Unet Parameters
#define UNET_PAN_ID			0x1234	// Range: 0x0000 to 0x3FFF
#define UNET_CHANNEL			26	// Range: 11 to 26
#define UNET_MAX_CHILD			5	// Range: 1 to 32
#define UNET_MAX_ROUTER			5	// Range: 0 to UNET_MAX_CHILD
#define UNET_MAX_DEPTH			4	// Range: 2 to 7
#define UNET_POLL_INTERVAL		10000	// unit: ms, (if 0, disable polling)

#define UNET_SCAN_WAIT_TIME		900
#define UNET_COORD_ADDRESS		0x0000
#define UNET_MAX_RETRY			3
#define UNET_MAX_BROCAST_EXPIRE		1

#endif // #if UNET01

/*
In a big-endian system, the most significant value in the sequence is stored at the lowest storage address (i.e., first).
In a little-endian system, the least significant value in the sequence is stored first.
*/

#if defined(__K0__)				// NEC C compiler for 78K0
	#define __LOC__

	#define	BIGENDIAN	0		// This is a little endian type CPU.
	#define DATA_BUS_WIDTH	8		// This is a 8-bit CPU.
	#define REENTRANT
	#include "config_nec78k0.h"

#elif defined(__C51__)				// Keil C51
	#define __LOC__

	#define	BIGENDIAN	1		// This is a big endian type CPU.
	#define DATA_BUS_WIDTH	8		// This is a 8-bit CPU.
	#define REENTRANT	reentrant	// compiler key-words for recursive functions
	#include "config_8051.h"

#elif defined(__ICC430__)			// MSP430 IAR C/C++ Compiler
	#define __STR2__(x) #x
	#define __STR1__(x) __STR2__(x)
	#define __LOC__ __FILE__ "("__STR1__(__LINE__)") : "
	// Usage:
	//	#pragma message(__LOC__ "important part to be changed")

	#define	BIGENDIAN	0		// This is a little endian type CPU.
	#define DATA_BUS_WIDTH	16		// This is a 16-bit CPU.
	#define REENTRANT
	#include "config_msp430.h"

#else
        #error "Unknown Compiler."
#endif

#ifdef CONSOLE
	#define DATAOUT
#endif

#if DEBUG_MODE && !defined(CONSOLE)
	#pragma message(__LOC__ "CONSOLE not defined for debug message output.")
	#undef DEBUG_MODE
	#define DEBUG_MODE		0
#endif

#if defined(I_Am_Coordinator) && USE_DENIER_LIST
	#pragma message(__LOC__ "'USE_DENIER_LIST' is not suitable on coordinator.")
	#undef USE_DENIER_LIST
	#define USE_DENIER_LIST		0
#endif

#endif // #ifndef	__CONFIG_H__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?