pgrl.h File Reference

Microchip PIC C Generic, General defines. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define NULL   0
 
#define NEAR   near
 
#define LONG   long
 
#define VOID   void
 
#define PASCAL   pascal
 
#define MAKELONG(a, b)   ((LONG)(((WORD)(a)) | (((DWORD)((WORD)(b))) << 16)))
 
#define LOWORD(l)   ((WORD)(l))
 
#define HIWORD(l)   ((WORD)((DWORD)(l) >> 16))
 
#define LOBYTE(w)   ((BYTE)(w))
 
#define HIBYTE(w)   ((BYTE)((WORD)(w) >> 8))
 
#define MAKELPARAM(low, high)   ((LPARAM)MAKELONG(low, high))
 
#define MAKELRESULT(low, high)   ((LRESULT)MAKELONG(low, high))
 
#define MAKELP(sel, off)   ((void FAR*)MAKELONG((off), (sel)))
 
#define SELECTOROF(lp)   HIWORD(lp)
 
#define OFFSETOF(lp)   LOWORD(lp)
 
#define FIELDOFFSET(type, field)   ((int)(&((type NEAR*)1)->field)-1)
 
#define bitset(var, bitno)   ((var) |= 1 << (bitno))
 
#define bitclr(var, bitno)   ((var) &= ~(1 << (bitno)))
 
#define bittst(var, bitno)   ((var)&(1<<(bitno)))
 
#define ENABLE   1
 
#define DISABLE   0
 
#define HIGH   1
 
#define LOW   0
 
#define HENABLE   1
 
#define LDISABLE   0
 
#define LENABLE   0
 
#define HDISABLE   1
 
#define ON   1
 
#define OFF   0
 
#define TRUE   1
 
#define FALSE   0
 
#define HPULSE   1
 
#define LPULSE   0
 
#define CLEAR   0
 
#define SET   1
 
#define DIR_OUT   0
 
#define DIR_IN   1
 
#define SLEEP()   asm(" sleep")
 

Typedefs

typedef unsigned char BYTE
 
typedef unsigned int UINT
 
typedef short int SINT
 
typedef short int SHORT
 
typedef unsigned short int USHORT
 
typedef int BOOL
 
typedef unsigned int WORD
 
typedef unsigned long DWORD
 
typedef const char far * LPCSTR
 
typedef const char * PCSTR
 
typedef char * PSTR
 
typedef char near * NPSTR
 
typedef char far * LPSTR
 
typedef BYTE near * PBYTE
 
typedef BYTE far * LPBYTE
 
typedef int near * PINT
 
typedef int far * LPINT
 
typedef WORD near * PWORD
 
typedef WORD far * LPWORD
 
typedef long near * PLONG
 
typedef long far * LPLONG
 
typedef DWORD near * PDWORD
 
typedef DWORD far * LPDWORD
 
typedef void far * LPVOID
 
typedef UINT WPARAM
 
typedef LONG LPARAM
 
typedef LONG LRESULT
 

Detailed Description

Microchip PIC C Generic, General defines.

This file is part of JADEKU Portable ADQ device for Routines Control.

Copyright (C) 2006-2009, Hernan Monserrat hemonserrat<at>gmail<dot>com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file pgrl.h.

Macro Definition Documentation

◆ bitclr

#define bitclr (   var,
  bitno 
)    ((var) &= ~(1 << (bitno)))

Definition at line 82 of file pgrl.h.

◆ bitset

#define bitset (   var,
  bitno 
)    ((var) |= 1 << (bitno))

Definition at line 81 of file pgrl.h.

◆ bittst

#define bittst (   var,
  bitno 
)    ((var)&(1<<(bitno)))

Definition at line 83 of file pgrl.h.

◆ CLEAR

#define CLEAR   0

Definition at line 103 of file pgrl.h.

◆ DIR_IN

#define DIR_IN   1

Definition at line 106 of file pgrl.h.

◆ DIR_OUT

#define DIR_OUT   0

Definition at line 105 of file pgrl.h.

◆ DISABLE

#define DISABLE   0

Definition at line 86 of file pgrl.h.

◆ ENABLE

#define ENABLE   1

Definition at line 85 of file pgrl.h.

◆ FALSE

#define FALSE   0

Definition at line 98 of file pgrl.h.

◆ FIELDOFFSET

#define FIELDOFFSET (   type,
  field 
)    ((int)(&((type NEAR*)1)->field)-1)

Definition at line 79 of file pgrl.h.

◆ HDISABLE

#define HDISABLE   1

Definition at line 92 of file pgrl.h.

◆ HENABLE

#define HENABLE   1

Definition at line 89 of file pgrl.h.

◆ HIBYTE

#define HIBYTE (   w)    ((BYTE)((WORD)(w) >> 8))

Definition at line 73 of file pgrl.h.

◆ HIGH

#define HIGH   1

Definition at line 87 of file pgrl.h.

◆ HIWORD

#define HIWORD (   l)    ((WORD)((DWORD)(l) >> 16))

Definition at line 71 of file pgrl.h.

◆ HPULSE

#define HPULSE   1

Definition at line 101 of file pgrl.h.

◆ LDISABLE

#define LDISABLE   0

Definition at line 90 of file pgrl.h.

◆ LENABLE

#define LENABLE   0

Definition at line 91 of file pgrl.h.

◆ LOBYTE

#define LOBYTE (   w)    ((BYTE)(w))

Definition at line 72 of file pgrl.h.

◆ LONG

#define LONG   long

Definition at line 34 of file pgrl.h.

◆ LOW

#define LOW   0

Definition at line 88 of file pgrl.h.

◆ LOWORD

#define LOWORD (   l)    ((WORD)(l))

Definition at line 70 of file pgrl.h.

◆ LPULSE

#define LPULSE   0

Definition at line 102 of file pgrl.h.

◆ MAKELONG

#define MAKELONG (   a,
 
)    ((LONG)(((WORD)(a)) | (((DWORD)((WORD)(b))) << 16)))

Definition at line 69 of file pgrl.h.

◆ MAKELP

#define MAKELP (   sel,
  off 
)    ((void FAR*)MAKELONG((off), (sel)))

Definition at line 76 of file pgrl.h.

◆ MAKELPARAM

#define MAKELPARAM (   low,
  high 
)    ((LPARAM)MAKELONG(low, high))

Definition at line 74 of file pgrl.h.

◆ MAKELRESULT

#define MAKELRESULT (   low,
  high 
)    ((LRESULT)MAKELONG(low, high))

Definition at line 75 of file pgrl.h.

◆ NEAR

#define NEAR   near

Definition at line 33 of file pgrl.h.

◆ NULL

#define NULL   0

General Purpose Defines

Definition at line 30 of file pgrl.h.

◆ OFF

#define OFF   0

Definition at line 94 of file pgrl.h.

◆ OFFSETOF

#define OFFSETOF (   lp)    LOWORD(lp)

Definition at line 78 of file pgrl.h.

◆ ON

#define ON   1

Definition at line 93 of file pgrl.h.

◆ PASCAL

#define PASCAL   pascal

Definition at line 36 of file pgrl.h.

◆ SELECTOROF

#define SELECTOROF (   lp)    HIWORD(lp)

Definition at line 77 of file pgrl.h.

◆ SET

#define SET   1

Definition at line 104 of file pgrl.h.

◆ SLEEP

#define SLEEP ( )    asm(" sleep")

Definition at line 109 of file pgrl.h.

◆ TRUE

#define TRUE   1

Definition at line 97 of file pgrl.h.

◆ VOID

#define VOID   void

Definition at line 35 of file pgrl.h.

Typedef Documentation

◆ BOOL

typedef int BOOL

Definition at line 43 of file pgrl.h.

◆ BYTE

typedef unsigned char BYTE

Definition at line 38 of file pgrl.h.

◆ DWORD

typedef unsigned long DWORD

Definition at line 46 of file pgrl.h.

◆ LPARAM

typedef LONG LPARAM

Definition at line 66 of file pgrl.h.

◆ LPBYTE

typedef BYTE far* LPBYTE

Definition at line 54 of file pgrl.h.

◆ LPCSTR

typedef const char far* LPCSTR

Definition at line 48 of file pgrl.h.

◆ LPDWORD

typedef DWORD far* LPDWORD

Definition at line 62 of file pgrl.h.

◆ LPINT

typedef int far* LPINT

Definition at line 56 of file pgrl.h.

◆ LPLONG

typedef long far* LPLONG

Definition at line 60 of file pgrl.h.

◆ LPSTR

typedef char far* LPSTR

Definition at line 52 of file pgrl.h.

◆ LPVOID

typedef void far* LPVOID

Definition at line 63 of file pgrl.h.

◆ LPWORD

typedef WORD far* LPWORD

Definition at line 58 of file pgrl.h.

◆ LRESULT

typedef LONG LRESULT

Definition at line 67 of file pgrl.h.

◆ NPSTR

typedef char near* NPSTR

Definition at line 51 of file pgrl.h.

◆ PBYTE

typedef BYTE near* PBYTE

Definition at line 53 of file pgrl.h.

◆ PCSTR

typedef const char* PCSTR

Definition at line 49 of file pgrl.h.

◆ PDWORD

typedef DWORD near* PDWORD

Definition at line 61 of file pgrl.h.

◆ PINT

typedef int near* PINT

Definition at line 55 of file pgrl.h.

◆ PLONG

typedef long near* PLONG

Definition at line 59 of file pgrl.h.

◆ PSTR

typedef char* PSTR

Definition at line 50 of file pgrl.h.

◆ PWORD

typedef WORD near* PWORD

Definition at line 57 of file pgrl.h.

◆ SHORT

typedef short int SHORT

Definition at line 41 of file pgrl.h.

◆ SINT

typedef short int SINT

Definition at line 40 of file pgrl.h.

◆ UINT

typedef unsigned int UINT

Definition at line 39 of file pgrl.h.

◆ USHORT

typedef unsigned short int USHORT

Definition at line 42 of file pgrl.h.

◆ WORD

typedef unsigned int WORD

Definition at line 45 of file pgrl.h.

◆ WPARAM

typedef UINT WPARAM

Definition at line 65 of file pgrl.h.