please dont rip this site
//////////////////////////////////////////////////////////////////////////////
//
//				defs.h
//
//	Header file for "all" SRI projects.
//
//////////////////////////////////////////////////////////////////////////////
//
//		SRI, Inc.
//		111 Prospect Street
//		Westfield, NJ
//		908-654-4000
//
//////////////////////////////////////////////////////////////////////////////
//
//	Version		1.2
//	Date		4 Dec 97
//	Programmer	AK
//
//	Added macros "is*" from MPLABC.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Version		1.1
//	Date		13 Nov 97
//	Programmer	AK
//
//	This version implements changes to support MSVC++ v1.5 and
//	Hi-Tech PIC C v7.72-1.  As you add new compilers, use the same
//	notation found below.  The Microsoft version is the default -
//	all others should refer to compiler switches defined by the
//	vendor, with nestings so as to generate the final #else to
//	default to MSVC++.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Project		Generic Module
//	Version		1.0 (original, not verified)
//	Date		11 Nov 97
//	Programmer	AK
//
//////////////////////////////////////////////////////////////////////////////

#ifndef _DEFS_H

#define	_DEFS_H

#if HI_TECH_C
//////////////////////////////////////////////////////////////////////////////
//
//			Hi-Tech C Compiler (PIC C v7.72-1)
//
//////////////////////////////////////////////////////////////////////////////

typedef bit			BOOLEAN;	/* Bit flag */
typedef	bit			BIT;		/* Bit flag */

typedef unsigned char 		BYTE;		/* Unsigned 8-bit */
typedef unsigned char 		byte;		/* Unsigned 8-bit */
typedef	unsigned char		UCHAR;		/* Unsigned 8-bit */
typedef	signed char		SBYTE;		/* Signed 8-bit */
typedef signed char		SCHAR;		/* Signed 8-bit */

typedef unsigned int		WORD;		/* Unsigned 16-bit */
typedef	unsigned int		UINT;		/* Unsigned 16-bit */

typedef	long int		LONG;		/* Signed 32-bit */
typedef	long int		LONGINT;	/* Signed 32-bit */

typedef	unsigned long int	ULONG;		/* Unsigned 32-bit */
typedef	unsigned long int	LWORD;		/* Unsigned 32-bit */

#define	ALL_BITS_SET	(~0)
#define	NOP()			asm("nop")
#else
//////////////////////////////////////////////////////////////////////////////
//
//			Default (MSVC++ v1.5)
//
//////////////////////////////////////////////////////////////////////////////

typedef unsigned char		BOOLEAN;	/* Unsigned 8-bit to hold TRUE/FALSE */
typedef unsigned char 		BYTE;		/* Unsigned 8-bit */
typedef unsigned int		WORD;		/* Unsigned 16-bit */
typedef	unsigned long int	LWORD;		/* Unsigned 32-bit */

typedef	unsigned char		UCHAR;		/* Unsigned 8-bit */
typedef	unsigned int		UINT;		/* Unsigned 16-bit */
typedef	unsigned long int	ULONG;		/* Unsigned 32-bit */

typedef	long int			LONGINT;	/* Signed 32-bit */
typedef	long int			LONG;		/* Signed 32-bit */
#define	ALL_BITS_SET	(~0)
#endif

//////////////////////////////////////////////////////////////////////////////

#define	TRUE		(1)
#define	FALSE		(0)
#define	YES		(1)
#define	NO		(0)

#define LOBYTE(w)	((BYTE)(w))
#define HIBYTE(w)	((BYTE)(((UINT)(w) >> 8) & 0xFF))

//////////////////////////////////////////////////////////////////////////////

#define   isalnum(c)  (isalpha(c) || isdigit(c))
#define   isalpha(c)  (islower(c) || isupper(c))
#define   isascii(c)  (((c) >= 0) && ((c) <= 0x7f))
#define   iscntrl(c)  ((((c) >= 0) && ((c) <= 0x1f)) || ((c) == 0x7f))
#define   isdigit(c)  (((c) >= '0') && ((c) <= '9'))
//#define   isgraph(c)  (((c) >= 0x21) && ((c) <= 0x7e))
#define   islower(c)  (((c) >= 'a') && ((c) <= 'z'))
#define   isprint(c)  (((c) >= 0x20) && ((c) <= 0x7e))
#define   ispunct(c)  ((((c) >= 0x20) && ((c) <= 0x2f)) || \
                       (((c) >= 0x3a) && ((c) <= 0x40)) || \
                       (((c) >= 0x5b) && ((c) <= 0x60)) || \
                       (((c) >= 0x7b) && ((c) <= 0x7e)))
#define   isspace(c)  (((c) == 0x09) || ((c) == 0x0a) || \
                       ((c) == 0x0b) || ((c) == 0x0c) || \
                       ((c) == 0x0d) || ((c) == 0x20))
#define   isupper(c)  (((c) >= 'A') && ((c) <= 'Z'))
#define   isxdigit(c) (isdigit(c) || (((c) >= 'a') && ((c) <= 'f')) || \
                       (((c) >= 'A') && ((c) <= 'F')))
#define   tolower(c)  (isupper(c) ? ((c) + 'a' - 'A'): (c))
#define   toupper(c)  (islower(c) ? ((c) - 'a' + 'A'): (c))

#define IDFUSE_ADDR	0x2000

#if defined(_16C74)
#define	LP_OSC		0b00000000
#define	XT_OSC		0b00000001
#define	HS_OSC		0b00000010
#define	RC_OSC		0b00000011

#define	WDT_ENABLED	0b00000100
#define	WDT_DISABLED	0b00000000

#define	PWRT_ENABLED	0b00001000
#define	PWRT_DISABLED	0b00000000

#define	CP_OFF		0x3FB0
#define	CP_1_2		0x2AA0
#define	CP_3_4		0x1590
#define	CP_FULL		0x0080
#endif

#if defined(_16C74A)
#define	LP_OSC		0x00
#define	XT_OSC		0x01
#define	HS_OSC		0x02
#define	RC_OSC		0x03

#define	WDT_ENABLED	0x04
#define	WDT_DISABLED	0x00

#define	PWRT_ENABLED	0x00
#define	PWRT_DISABLED	0x08

#define	BOD_ENABLED	0x40
#define	BOD_DISABLED	0x00

#define	CP_OFF		0x3FB0
#define	CP_1_2		0x2AA0
#define	CP_3_4		0x1590
#define	CP_FULL		0x0080
#endif

#if defined(_16C77)
#define	LP_OSC		0x00
#define	XT_OSC		0x01
#define	HS_OSC		0x02
#define	RC_OSC		0x03

#define	WDT_ENABLED	0x04
#define	WDT_DISABLED	0x00

#define	PWRT_ENABLED	0x00
#define	PWRT_DISABLED	0x08

#define	BOD_ENABLED	0x40
#define	BOD_DISABLED	0x00

#define	CP_OFF		0x3FB0
#define	CP_1_2		0x2AA0
#define	CP_3_4		0x1590
#define	CP_FULL		0x0080
#endif

#if defined(_16C873) || defined(_16C874) || defined(_16C876) || defined(_16C877) || defined(_16F873) || defined(_16F874) || defined(_16F876) || defined(_16F877)
#define	LP_OSC		0x0000
#define	XT_OSC		0x0001
#define	HS_OSC		0x0002
#define	RC_OSC		0x0003

#define	WDT_ENABLED	0x0004		// Watchdog runs
#define	WDT_DISABLED	0x0000

#define	PWRT_ENABLED	0x0000		// Power-up Timer runs
#define	PWRT_DISABLED	0x0008

#define	BOD_ENABLED	0x0040		// Brown-Out Detect active
#define	BOD_DISABLED	0x0000

#define	LVP_ENABLED	0x0080		// Low-voltage programming available
#define	LVP_DISABLED	0x0000

#define	CPD_ENABLED	0x0000		// Data EE Protected
#define	CPD_DISABLED	0x0100

#define	WRT_ENABLED	0x0200		// Internal self-write enabled
#define	WRT_DISABLED	0x0000

#define	DEBUG_ENABLED	0x0000		// RB6/7 are DEBUG pins
#define	DEBUG_DISABLED	0x0800

#define	CP_OFF		0x3430		// Protects nothing
#define	CP_TOP		0x2420		// Protects only top 256 words
#define	CP_HALF		0x1410		// Protects only top 1/2 of program space
#define	CP_FULL		0x0400		// Protects entire chip
#endif

#define	__CHIPID(x)	asm("\tpsect idfuse,class=IDFUSE,delta=2");\
			asm("\tglobal\tchipid_word"); \
			asm("chipid_word"); \
			asm("\tdw "___mkstr(x>>24&0xFF|0x3400));\
			asm("\tdw "___mkstr(x>>16&0xFF|0x3400));\
			asm("\tdw "___mkstr(x>>8&0xFF|0x3400));\
			asm("\tdw "___mkstr(x&0xFF|0x3400))

//Sample command line to use this addition:
//     picc -16C73a -Zg1 -O -L-Pidfuse=2000h sdd.c

#if defined(_16C62)|| defined(_16C64) || defined(_16C65) || defined(_16C73) || defined(_16C74)
#define	LP_OSC		0x00
#define	XT_OSC		0x01
#define	HS_OSC		0x02
#define	RC_OSC		0x03

#define	WDT_ENABLED	0x04
#define	WDT_DISABLED	0x00

#define	PWRT_ENABLED	0x08
#define	PWRT_DISABLED	0x00

#define	CP_OFF		0x3FB0
#define	CP_1_2		0x2AA0
#define	CP_3_4		0x1590
#define	CP_FULL		0x0080
#endif

#if defined(_16C62A) || defined(_16C63) || defined(_16C64A) || defined(_16C65A) || defined(_16C72) || defined(_16C73A) || defined(_16C74A)
#define	LP_OSC		0x00
#define	XT_OSC		0x01
#define	HS_OSC		0x02
#define	RC_OSC		0x03

#define	WDT_ENABLED	0x04
#define	WDT_DISABLED	0x00

#define	PWRT_ENABLED	0x00
#define	PWRT_DISABLED	0x08

#define	BOD_ENABLED	0x40
#define	BOD_DISABLED	0x00

#define	CP_OFF		0x3F30
#define	CP_1_2		0x2A20
#define	CP_3_4		0x1510
#define	CP_FULL		0x0000
#endif

#if defined(_16C76) || defined(_16C77)
#define	LP_OSC		0x00
#define	XT_OSC		0x01
#define	HS_OSC		0x02
#define	RC_OSC		0x03

#define	WDT_ENABLED	0x04
#define	WDT_DISABLED	0x00

#define	PWRT_ENABLED	0x00
#define	PWRT_DISABLED	0x08

#define	BOD_ENABLED	0x40
#define	BOD_DISABLED	0x00

#define	CP_OFF		0x3FB0
#define	CP_1_2		0x2AA0
#define	CP_3_4		0x1590
#define	CP_FULL		0x0080
#endif

#endif


file: /Techref/microchip/language/C/io/lcd/hitachilcd-ak/defs_h.htm, 35KB, , updated: 2000/6/28 13:20, local time: 2024/12/23 19:16,
TOP NEW HELP FIND: 
18.220.227.250:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://techref.massmind.org/Techref/microchip/language/C/io/lcd/hitachilcd-ak/defs_h.htm"> Colorized Source Code</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to massmind.org!

 

Welcome to techref.massmind.org!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .