OpenCores
URL https://opencores.org/ocsvn/copyblaze/copyblaze/trunk

Subversion Repositories copyblaze

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /copyblaze/trunk/copyblaze/sw/tools/comp
    from Rev 45 to Rev 49
    Reverse comparison

Rev 45 → Rev 49

/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/time.h
0,0 → 1,75
/*-------------------------------------------------------------------------
time.h
 
Copyright (C) 2001, Johan Knol <johan.knol AT iduna.nl>
 
This library 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 2.1, or (at your option) any
later version.
 
This library 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 library; see the file COPYING. If not, write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
 
As a special exception, if you link this library with other files,
some of which are compiled with SDCC, to produce an executable,
this library does not by itself cause the resulting executable to
be covered by the GNU General Public License. This exception does
not however invalidate any other reasons why the executable file
might be covered by the GNU General Public License.
-------------------------------------------------------------------------*/
 
#ifndef TIME_H
#define TIME_H
 
#ifndef __TIME_UNSIGNED
#define __TIME_UNSIGNED 1
#endif
 
#if __TIME_UNSIGNED
struct tm
{
unsigned char tm_sec; /* Seconds. [0-60] */
unsigned char tm_min; /* Minutes. [0-59] */
unsigned char tm_hour; /* Hours. [0-23] */
unsigned char tm_mday; /* Day. [1-31] */
unsigned char tm_mon; /* Month. [0-11] */
int tm_year; /* Year since 1900 */
unsigned char tm_wday; /* Day of week. [0-6] */
int tm_yday; /* Days in year.[0-365] */
unsigned char tm_isdst; /* Daylight saving time */
unsigned char tm_hundredth; /* not standard 1/100th sec */
};
#else
struct tm
{
int tm_sec; /* Seconds. [0-60] */
int tm_min; /* Minutes. [0-59] */
int tm_hour; /* Hours. [0-23] */
int tm_mday; /* Day. [1-31] */
int tm_mon; /* Month. [0-11] */
int tm_year; /* Year since 1900 */
int tm_wday; /* Day of week. [0-6] */
int tm_yday; /* Days in year.[0-365] */
int tm_isdst; /* Daylight saving time */
char *tm_zone; /* Abbreviated timezone */
};
#endif
 
typedef unsigned long time_t;
 
time_t time(time_t *t);
struct tm *gmtime(time_t *timep);
struct tm *localtime(time_t *timep);
time_t mktime(struct tm *timeptr);
char *asctime(struct tm *timeptr);
char *ctime(time_t *timep);
 
#endif /* TIME_H */
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/setjmp.h
0,0 → 1,65
/*-------------------------------------------------------------------------
setjmp.h - header file for setjmp & longjmp ANSI routines
 
Copyright (C) 1999, Sandeep Dutta . sandeep.dutta@usa.net
 
This library 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 2.1, or (at your option) any
later version.
 
This library 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 library; see the file COPYING. If not, write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
 
As a special exception, if you link this library with other files,
some of which are compiled with SDCC, to produce an executable,
this library does not by itself cause the resulting executable to
be covered by the GNU General Public License. This exception does
not however invalidate any other reasons why the executable file
might be covered by the GNU General Public License.
-------------------------------------------------------------------------*/
 
#ifndef SDCC_SETJMP_H
#define SDCC_SETJMP_H
 
#define SP_SIZE 1
 
#ifdef SDCC_STACK_AUTO
#define BP_SIZE SP_SIZE
#else
#define BP_SIZE 0
#endif
 
#ifdef SDCC_USE_XSTACK
#define SPX_SIZE 1
#else
#define SPX_SIZE 0
#endif
 
#define BPX_SIZE SPX_SIZE
 
#ifdef SDCC_MODEL_HUGE
#define RET_SIZE 3
#else
#define RET_SIZE 2
#endif
 
typedef unsigned char jmp_buf[RET_SIZE + SP_SIZE + BP_SIZE + SPX_SIZE + BPX_SIZE];
 
int setjmp (jmp_buf);
int longjmp(jmp_buf, int);
 
#undef RET_SIZE
#undef SP_SIZE
#undef BP_SIZE
#undef SPX_SIZE
#undef BPX_SIZE
 
#endif
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/stdint.h
0,0 → 1,181
/*-------------------------------------------------------------------------
stdint.h - ISO C99 7.18 Integer types <stdint.h>
 
Copyright (C) 2005, Maarten Brock, sourceforge.brock@dse.nl
 
This library 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 2.1, or (at your option) any
later version.
 
This library 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 library; see the file COPYING. If not, write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
 
As a special exception, if you link this library with other files,
some of which are compiled with SDCC, to produce an executable,
this library does not by itself cause the resulting executable to
be covered by the GNU General Public License. This exception does
not however invalidate any other reasons why the executable file
might be covered by the GNU General Public License.
-------------------------------------------------------------------------*/
 
#ifndef _STDINT_H
#define _STDINT_H 1
 
/* Exact integral types. */
 
/* Signed. */
 
typedef signed char int8_t;
typedef short int int16_t;
typedef long int int32_t;
 
/* Unsigned. */
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned long int uint32_t;
 
 
/* Small types. */
 
/* Signed. */
typedef signed char int_least8_t;
typedef short int int_least16_t;
typedef long int int_least32_t;
 
/* Unsigned. */
typedef unsigned char uint_least8_t;
typedef unsigned short int uint_least16_t;
typedef unsigned long int uint_least32_t;
 
 
/* Fast types. */
 
/* Signed. */
typedef signed char int_fast8_t;
typedef int int_fast16_t;
typedef long int int_fast32_t;
 
/* Unsigned. */
typedef unsigned char uint_fast8_t;
typedef unsigned int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
 
 
/* Types for `void *' pointers. */
#if defined (SDCC_mcs51) || defined (SDCC_ds390)
typedef long int intptr_t;
typedef unsigned long int uintptr_t;
#else
typedef int intptr_t;
typedef unsigned int uintptr_t;
#endif
 
 
/* Largest integral types. */
typedef long int intmax_t;
typedef unsigned long int uintmax_t;
 
 
/* Limits of integral types. */
 
/* Minimum of signed integral types. */
# define INT8_MIN (-128)
# define INT16_MIN (-32767-1)
# define INT32_MIN (-2147483647L-1)
/* Maximum of signed integral types. */
# define INT8_MAX (127)
# define INT16_MAX (32767)
# define INT32_MAX (2147483647L)
 
/* Maximum of unsigned integral types. */
# define UINT8_MAX (255)
# define UINT16_MAX (65535)
# define UINT32_MAX (4294967295UL)
 
/* Minimum of signed integral types having a minimum size. */
# define INT_LEAST8_MIN (-128)
# define INT_LEAST16_MIN (-32767-1)
# define INT_LEAST32_MIN (-2147483647L-1)
/* Maximum of signed integral types having a minimum size. */
# define INT_LEAST8_MAX (127)
# define INT_LEAST16_MAX (32767)
# define INT_LEAST32_MAX (2147483647L)
 
/* Maximum of unsigned integral types having a minimum size. */
# define UINT_LEAST8_MAX (255)
# define UINT_LEAST16_MAX (65535)
# define UINT_LEAST32_MAX (4294967295UL)
 
/* Minimum of fast signed integral types having a minimum size. */
# define INT_FAST8_MIN (-128)
# define INT_FAST16_MIN (-32767-1)
# define INT_FAST32_MIN (-2147483647L-1)
 
/* Maximum of fast signed integral types having a minimum size. */
# define INT_FAST8_MAX (127)
# define INT_FAST16_MAX (32767)
# define INT_FAST32_MAX (2147483647L)
 
/* Maximum of fast unsigned integral types having a minimum size. */
# define UINT_FAST8_MAX (255)
# define UINT_FAST16_MAX (65535)
# define UINT_FAST32_MAX (4294967295UL)
 
/* Values to test for integral types holding `void *' pointer. */
#if defined (SDCC_mcs51) || defined (SDCC_ds390)
# define INTPTR_MIN (-2147483647L-1)
# define INTPTR_MAX (2147483647L)
# define UINTPTR_MAX (4294967295UL)
#else
# define INTPTR_MIN (-32767-1)
# define INTPTR_MAX (32767)
# define UINTPTR_MAX (65535)
#endif
 
/* Minimum for largest signed integral type. */
# define INTMAX_MIN (-__INT32_C(-2147483647L)-1)
/* Maximum for largest signed integral type. */
# define INTMAX_MAX (__INT32_C(2147483647L))
 
/* Maximum for largest unsigned integral type. */
# define UINTMAX_MAX (__UINT32_C(4294967295UL))
 
 
/* Limits of other integer types. */
 
/* Limits of `ptrdiff_t' type. */
#if defined (SDCC_mcs51) || defined (SDCC_ds390)
# define PTRDIFF_MIN (-2147483647L-1)
# define PTRDIFF_MAX (2147483647L)
#else
# define PTRDIFF_MIN (-32767-1)
# define PTRDIFF_MAX (32767)
#endif
 
/* Limit of `size_t' type. */
# define SIZE_MAX (65535)
 
/* Signed. */
# define INT8_C(c) c
# define INT16_C(c) c
# define INT32_C(c) c ## L
 
/* Unsigned. */
# define UINT8_C(c) c ## U
# define UINT16_C(c) c ## U
# define UINT32_C(c) c ## UL
 
/* Maximal type. */
# define INTMAX_C(c) c ## L
# define UINTMAX_C(c) c ## UL
 
 
#endif /* stdint.h */
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/stdbool.h
0,0 → 1,54
/*-------------------------------------------------------------------------
stdbool.h - ANSI functions forward declarations
 
Copyright (C) 2004, Maarten Brock, sourceforge.brock@dse.nl
 
This library 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 2.1, or (at your option) any
later version.
 
This library 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 library; see the file COPYING. If not, write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
 
As a special exception, if you link this library with other files,
some of which are compiled with SDCC, to produce an executable,
this library does not by itself cause the resulting executable to
be covered by the GNU General Public License. This exception does
not however invalidate any other reasons why the executable file
might be covered by the GNU General Public License.
-------------------------------------------------------------------------*/
 
#ifndef __SDC51_STDBOOL_H
#define __SDC51_STDBOOL_H 1
 
#define true 1
#define false 0
 
#if defined (SDCC_hc08) || defined (SDCC_pic14) || defined (SDCC_pic16)
/* The ports that don't have anything worthy of being bool */
#define BOOL char
#define __SDCC_WEIRD_BOOL 2
#elif defined (SDCC_ds390) || defined (SDCC_mcs51) || defined (SDCC_xa51)
/* The ports that have __bit and use it as an imperfect substitute for bool */
#define _Bool __bit
#define BOOL __bit
#define bool _Bool
#define __bool_true_false_are_defined 1
#define __SDCC_WEIRD_BOOL 1
#else
/* The ports that have bool */
#define bool _Bool
#define BOOL _Bool
#define __bool_true_false_are_defined 1
#endif
 
#endif
 
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/string.h
0,0 → 1,87
/*-------------------------------------------------------------------------
string.h - ISO header for string library functions
 
Copyright (C) 1998, Sandeep Dutta
Copyright (C) 2009, Philipp Klaus Krause . pkk@spth.de
 
This library 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 2.1, or (at your option) any
later version.
 
This library 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 library; see the file COPYING. If not, write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
 
As a special exception, if you link this library with other files,
some of which are compiled with SDCC, to produce an executable,
this library does not by itself cause the resulting executable to
be covered by the GNU General Public License. This exception does
not however invalidate any other reasons why the executable file
might be covered by the GNU General Public License.
-------------------------------------------------------------------------*/
 
#ifndef __SDCC_STRING_H
#define __SDCC_STRING_H 1
 
#ifndef NULL
# define NULL (void *)0
#endif
 
#ifndef _SIZE_T_DEFINED
# define _SIZE_T_DEFINED
typedef unsigned int size_t;
#endif
 
/* The function prototypes are ordered as in the ISO C99 standard. */
 
/* Todo: fix the "restrict" stuff for C99 compliance. */
 
/* Copying functions: */
extern void *memcpy (void * /*restrict */ dest, const void * /*restrict*/ src, size_t n);
extern void *memmove (void *dest, const void *src, size_t n);
extern char *strcpy (char * /*restrit*/ dest, const char * /*restrict*/ src);
extern char *strncpy(char * /*restrict*/ dest, const char * /*restrict*/ src, size_t n);
 
/* Concatenation functions: */
extern char *strcat (char * /*restrict*/ dest, const char * /*restrict*/ src);
extern char *strncat(char * /*restrict*/ dest, const char * /*restrict*/ src, size_t n);
 
/* Comparison functions: */
extern int memcmp (const void *s1, const void *s2, size_t n);
extern int strcmp (const char *s1, const char *s2);
/*inline int strcoll(const char *s1, const char *s2) {return strcmp(s1, s2);}*/
extern int strncmp(const char *s1, const char *s2, size_t n);
/*inline size_t strxfrm(char *dest, const char *src, size_t n) {strncpy(dest, src, n); return strlen(src);}*/
 
/* Search functions: */
extern void *memchr (const void *s, int c, size_t n);
extern char *strchr (const char *s, char c); /* c should be int according to standard. */
extern size_t strcspn(const char *s, const char *reject);
extern char *strpbrk(const char *s, const char *accept);
extern char *strrchr(const char *s, char c); /* c should be int according to standard. */
extern size_t strspn (const char *s, const char *accept);
extern char *strstr (const char *haystack, const char *needle);
extern char *strtok (char * /* restrict*/ str, const char * /*restrict*/ delim);
 
/* Miscanelleous functions: */
extern void *memset (void *s, unsigned char c, size_t n); /* c should be int according to standard. */
/* extern char *strerror(int errnum); */
extern size_t strlen (const char *s);
 
#ifdef SDCC_ds390
extern void __xdata * memcpyx(void __xdata *, void __xdata *, int) __naked;
#endif
 
#ifdef SDCC_z80
#define memcpy(dst, src, n) __builtin_memcpy(dst, src, n)
#endif
 
#endif
 
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/typeof.h
0,0 → 1,54
/*-------------------------------------------------------------------------
typeof.h - Contains enumerations of values returned by __typeof
Copyright (C) 2001, Sandeep Dutta . sandeep.dutta@usa.net
 
This library 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 2.1, or (at your option) any
later version.
 
This library 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 library; see the file COPYING. If not, write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
 
As a special exception, if you link this library with other files,
some of which are compiled with SDCC, to produce an executable,
this library does not by itself cause the resulting executable to
be covered by the GNU General Public License. This exception does
not however invalidate any other reasons why the executable file
might be covered by the GNU General Public License.
-------------------------------------------------------------------------*/
 
#ifndef __SDC51_TYPEOF_H
#define __SDC51_TYPEOF_H 1
 
#define TYPEOF_INT 1
#define TYPEOF_SHORT 2
#define TYPEOF_CHAR 3
#define TYPEOF_LONG 4
#define TYPEOF_FLOAT 5
#define TYPEOF_FIXED16X16 6
#define TYPEOF_BIT 7
#define TYPEOF_BITFIELD 8
#define TYPEOF_SBIT 9
#define TYPEOF_SFR 10
#define TYPEOF_VOID 11
#define TYPEOF_STRUCT 12
#define TYPEOF_ARRAY 13
#define TYPEOF_FUNCTION 14
#define TYPEOF_POINTER 15
#define TYPEOF_FPOINTER 16
#define TYPEOF_CPOINTER 17
#define TYPEOF_GPOINTER 18
#define TYPEOF_PPOINTER 19
#define TYPEOF_IPOINTER 20
#define TYPEOF_EEPPOINTER 21
 
#endif
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/stddef.h
0,0 → 1,43
/*-------------------------------------------------------------------------
stddef.h - ANSI functions forward declarations
 
Copyright (C) 2004, Maarten Brock / sourceforge.brock@dse.nl
 
This library 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 2.1, or (at your option) any
later version.
 
This library 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 library; see the file COPYING. If not, write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
 
As a special exception, if you link this library with other files,
some of which are compiled with SDCC, to produce an executable,
this library does not by itself cause the resulting executable to
be covered by the GNU General Public License. This exception does
not however invalidate any other reasons why the executable file
might be covered by the GNU General Public License.
-------------------------------------------------------------------------*/
 
#ifndef __SDCC_STDDEF_H
#define __SDCC_STDDEF_H 1
 
#ifndef NULL
#define NULL (void *)0
#endif
 
#ifndef _SIZE_T_DEFINED
#define _SIZE_T_DEFINED
typedef unsigned int size_t;
#endif
 
#define offsetof(s, m) __builtin_offsetof (s, m)
 
#endif
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/sdcc-lib.h
0,0 → 1,51
/*-------------------------------------------------------------------------
sdcc-lib.h - Top level header file for the sdcc libraries that enables
target specific features.
 
Copyright (C) 2004, Maarten Brock, sourceforge.brock@dse.nl
 
This library 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 2.1, or (at your option) any
later version.
 
This library 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 library; see the file COPYING. If not, write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
 
As a special exception, if you link this library with other files,
some of which are compiled with SDCC, to produce an executable,
this library does not by itself cause the resulting executable to
be covered by the GNU General Public License. This exception does
not however invalidate any other reasons why the executable file
might be covered by the GNU General Public License.
-------------------------------------------------------------------------*/
 
#ifndef __SDC51_SDCC_LIB_H
#define __SDC51_SDCC_LIB_H 1
 
#if defined(__z80)
#include <asm/z80/features.h>
 
#elif defined(__gbz80)
#include <asm/gbz80/features.h>
 
#elif defined(__mcs51)
#include <asm/mcs51/features.h>
 
#elif defined(__ds390)
#include <asm/ds390/features.h>
 
#else
/* PENDING */
#include <asm/default/features.h>
 
#endif
 
#endif
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/tinibios.h
0,0 → 1,153
/*-------------------------------------------------------------------------
time.h
 
Copyright (C) 2001, Johan Knol <johan.knol AT iduna.nl>
 
This library 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 2.1, or (at your option) any
later version.
 
This library 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 library; see the file COPYING. If not, write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
 
As a special exception, if you link this library with other files,
some of which are compiled with SDCC, to produce an executable,
this library does not by itself cause the resulting executable to
be covered by the GNU General Public License. This exception does
not however invalidate any other reasons why the executable file
might be covered by the GNU General Public License.
-------------------------------------------------------------------------*/
 
#ifndef TINIBIOS_H
 
#define TINIBIOS_H
 
#include <ds80c390.h>
#include <time.h>
 
void Serial0Init (unsigned long baud, unsigned char buffered);
char Serial0GetChar(void);
void Serial0PutChar(char);
char Serial0CharArrived(void);
void Serial0Baud(unsigned long baud);
void Serial0SendBreak(void);
void Serial0Flush(void);
 
void Serial0SwitchToBuffered(void); /* ds400 only. */
 
void Serial1Init (unsigned long baud, unsigned char buffered);
char Serial1GetChar(void);
void Serial1PutChar(char);
char Serial1CharArrived(void);
void Serial1Baud(unsigned long baud);
void Serial1SendBreak(void);
void Serial1Flush(void);
 
unsigned long ClockTicks();
void ClockMilliSecondsDelay(unsigned long ms);
void ClockMicroSecondsDelay(unsigned int us);
 
#define SERIAL_0_BAUD 115200L
#define SERIAL_1_BAUD 9600L
 
/* these need to be binary numbers */
#define SERIAL_0_RECEIVE_BUFFER_SIZE 1024
#define SERIAL_1_RECEIVE_BUFFER_SIZE 64
 
/* I know someone is fooling with the crystals */
#if defined(SDCC_ds400)
# define OSCILLATOR 14745600L
#else
# define OSCILLATOR 18432000L
#endif
 
/* Set the cpu speed in clocks per machine cycle, valid values are:
1024: Divide-by-1024 (power management) mode (screws ALL timers and serial)
4: Standard 8051 divide-by-4 mode
2: Use 2x xtal multiplier
1: Use 4x xtal multiplier (Don't do this with a TINI at 18.432MHz)
*/
#define CPU_SPEED 2
void CpuSpeed(unsigned int speed);
 
/* The MOVX stretch cycles, see datasheet */
#define CPU_MOVX_STRETCH 0x01
 
/* from rtc390.c */
#define HAVE_RTC
unsigned char RtcRead(struct tm *rtcDate);
void RtcWrite(struct tm *rtcDate);
 
/* from lcd390.c */
extern void LcdInit(void);
extern void LcdOn(void);
extern void LcdOff(void);
extern void LcdClear(void);
extern void LcdHome(void);
extern void LcdGoto(unsigned int collumnRow);
extern void LcdPutChar(char c);
extern void LcdPutString(char *string);
extern void LcdLPutString(unsigned int collumnRow, char *string);
extern void LcdPrintf(const char *format, ...) __reentrant;
extern void LcdLPrintf(unsigned int collumnRow, const char *format, ...) __reentrant;
 
/* from i2c390.c */
#define I2C_BUFSIZE 128
extern char I2CReset(void);
extern char I2CStart(void);
extern char I2CStop(void);
extern char I2CSendStop(char addr, char count,
char send_stop);
extern char I2CReceive(char addr, char count);
extern char I2CSendReceive(char addr, char tx_count,
char rx_count);
/*extern char I2CByteOut(char);*/
/*extern void I2CDumpError(char);*/
 
/* global transfer buffers */
extern char i2cTransmitBuffer[I2C_BUFSIZE];
extern char i2cReceiveBuffer[I2C_BUFSIZE];
 
/* Macro for normal send transfer ending with a stop condition */
#define I2CSend(addr, count) I2CSendStop(addr, count, 1)
 
 
/* internal functions used by tinibios.c */
unsigned char _sdcc_external_startup(void);
void Serial0IrqHandler (void) __interrupt 4;
void Serial1IrqHandler (void) __interrupt 7;
 
#if !defined(SDCC_ds400)
void ClockInit();
void ClockIrqHandler (void) __interrupt 1 __naked;
#endif
 
#if defined(SDCC_ds400)
/* functions for dealing with the ds400 ROM firmware. */
 
/* A wrapper which calls rom_init allocating all available RAM in CE0
to the heap, sets the serial port to SERIAL_0_BAUD, sets up the
millisecond timer, and diddles the clock multiplier. */
 
/* Values for the romInit "speed" parameter. */
#define SPEED_1X 0 /* no clock multiplier, normal speed. */
#define SPEED_2X 1 /* 2x clock multiplier. */
#define SPEED_4X 2 /* 4x clock, DOESN'T WORK ON TINIm400! */
 
unsigned char romInit(unsigned char noisy,
char speed);
 
/* Install an interrupt handler. */
void installInterrupt(void (*isrPtr)(void), unsigned char offset);
#endif
 
 
#endif /* TINIBIOS_H */
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/stdlib.h
0,0 → 1,55
/*-------------------------------------------------------------------------
stdlib.h - ANSI functions forward declarations
 
Copyright (C)1998, Sandeep Dutta . sandeep.dutta@usa.net
 
This library 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 2.1, or (at your option) any
later version.
 
This library 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 library; see the file COPYING. If not, write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
 
As a special exception, if you link this library with other files,
some of which are compiled with SDCC, to produce an executable,
this library does not by itself cause the resulting executable to
be covered by the GNU General Public License. This exception does
not however invalidate any other reasons why the executable file
might be covered by the GNU General Public License.
-------------------------------------------------------------------------*/
 
#ifndef __SDC51_STDLIB_H
#define __SDC51_STDLIB_H 1
 
#ifndef NULL
# define NULL (void *)0
#endif
 
#include <malloc.h>
 
int abs(int j);
long int labs(long int j);
 
extern float atof (const char *);
extern int atoi (const char *);
extern long atol (const char *);
 
extern void _uitoa(unsigned int, char*, unsigned char);
extern void _itoa(int, char*, unsigned char);
 
extern void _ultoa(unsigned long, char*, unsigned char);
extern void _ltoa(long, char*, unsigned char);
 
#define RAND_MAX 32767
 
int rand(void);
void srand(unsigned int seed);
#endif
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/stdio.h
0,0 → 1,71
/*-------------------------------------------------------------------------
stdio.h - ANSI functions forward declarations
 
Copyright (C) 1998, Sandeep Dutta . sandeep.dutta@usa.net
 
This library 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 2.1, or (at your option) any
later version.
 
This library 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 library; see the file COPYING. If not, write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
 
As a special exception, if you link this library with other files,
some of which are compiled with SDCC, to produce an executable,
this library does not by itself cause the resulting executable to
be covered by the GNU General Public License. This exception does
not however invalidate any other reasons why the executable file
might be covered by the GNU General Public License.
-------------------------------------------------------------------------*/
 
#ifndef __SDC51_STDIO_H
#define __SDC51_STDIO_H 1
 
#include <stdarg.h>
 
#ifdef __ds390
#include <tinibios.h>
#endif
 
#include <sdcc-lib.h>
 
#ifndef NULL
#define NULL (void *)0
#endif
 
#ifndef _SIZE_T_DEFINED
#define _SIZE_T_DEFINED
typedef unsigned int size_t;
#endif
 
typedef void (*pfn_outputchar)(char c, void* p) _REENTRANT;
 
extern int _print_format (pfn_outputchar pfn, void* pvoid, const char *format, va_list ap);
 
/*-----------------------------------------------------------------------*/
 
extern void printf_small (char *,...) _REENTRANT;
extern int printf (const char *,...);
extern int vprintf (const char *, va_list);
extern int sprintf (char *, const char *, ...);
extern int vsprintf (char *, const char *, va_list);
extern int puts(const char *);
extern char *gets(char *);
extern char getchar(void);
extern void putchar(char);
 
#if defined(SDCC_mcs51) && !defined(SDCC_USE_XSTACK)
extern void printf_fast(__code const char *fmt, ...) _REENTRANT;
extern void printf_fast_f(__code const char *fmt, ...) _REENTRANT;
extern void printf_tiny(__code const char *fmt, ...) _REENTRANT;
#endif
 
#endif /* __SDC51_STDIO_H */
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/stdarg.h
0,0 → 1,60
/*-------------------------------------------------------------------------
stdarg.h - ANSI macros for variable parameter list
 
Copyright (C) 2000, Michael Hope
 
This library 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 2.1, or (at your option) any
later version.
 
This library 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 library; see the file COPYING. If not, write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
 
As a special exception, if you link this library with other files,
some of which are compiled with SDCC, to produce an executable,
this library does not by itself cause the resulting executable to
be covered by the GNU General Public License. This exception does
not however invalidate any other reasons why the executable file
might be covered by the GNU General Public License.
-------------------------------------------------------------------------*/
 
#ifndef __SDC51_STDARG_H
#define __SDC51_STDARG_H 1
 
#if defined(__z80) || defined(__gbz80) || defined(__hc08)
 
typedef unsigned char * va_list;
#define va_start(marker, last) { marker = (va_list)&last + sizeof(last); }
#define va_arg(marker, type) *((type *)((marker += sizeof(type)) - sizeof(type)))
 
#elif defined(__ds390) || defined(__ds400)
 
typedef unsigned char * va_list;
#define va_start(marker, first) { marker = (va_list)&first; }
#define va_arg(marker, type) *((type *)(marker -= sizeof(type)))
 
#elif defined(SDCC_USE_XSTACK)
 
typedef unsigned char __pdata * va_list;
#define va_start(marker, first) { marker = (va_list)&first; }
#define va_arg(marker, type) *((type __pdata *)(marker -= sizeof(type)))
 
#else
 
typedef unsigned char __data * va_list;
#define va_start(marker, first) { marker = (va_list)&first; }
#define va_arg(marker, type) *((type __data * )(marker -= sizeof(type)))
 
#endif
 
#define va_end(marker) marker = (va_list) 0;
 
#endif
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/pblaze/math.h
0,0 → 1,80
/*
* math.h - Basic Mathematical (decimal only) functions header file
*
* adopted for SDCC and picoBlaze port by Zbynek Krivka, 2010 <krivka @ fit.vutbr.cz>
*
*/
 
#ifndef __MATH_H__
#define __MATH_H__
 
/*
#pragma library math
 
#include <sdcc-lib.h>
 
#define PI 3.1415926536
#define TWO_PI 6.2831853071
#define HALF_PI 1.5707963268
#define QUART_PI 0.7853981634
#define iPI 0.3183098862
#define iTWO_PI 0.1591549431
#define TWO_O_PI 0.6366197724
 
// EPS=B**(-t/2), where B is the radix of the floating-point representation
// and there are t base-B digits in the significand. Therefore, for floats
// EPS=2**(-12). Also define EPS2=EPS*EPS.
#define EPS 244.14062E-6
#define EPS2 59.6046E-9
#define XMAX 3.402823466E+38
 
union float_long
{
float f;
long l;
};
*/
 
/**********************************************
* Prototypes for float ANSI C math functions *
**********************************************/
 
/* Trigonometric functions */
/*
float sinf(const float x) _MATH_REENTRANT;
float cosf(const float x) _MATH_REENTRANT;
float tanf(const float x) _MATH_REENTRANT;
float cotf(const float x) _MATH_REENTRANT;
float asinf(const float x) _MATH_REENTRANT;
float acosf(const float x) _MATH_REENTRANT;
float atanf(const float x) _MATH_REENTRANT;
float atan2f(const float x, const float y);
*/
/* Hyperbolic functions */
/*
float sinhf(const float x) _MATH_REENTRANT;
float coshf(const float x) _MATH_REENTRANT;
float tanhf(const float x) _MATH_REENTRANT;
 
/* Exponential, logarithmic and power functions */
/*
float expf(const float x);
float logf(const float x) _MATH_REENTRANT;
float log10f(const float x) _MATH_REENTRANT;
float powf(const float x, const float y);
float sqrtf(const float a) _MATH_REENTRANT;
*/
/* Nearest integer, absolute value, and remainder functions */
/*
float fabsf(const float x) _MATH_REENTRANT;
float frexpf(const float x, int *pw2);
float ldexpf(const float x, const int pw2);
float ceilf(float x) _MATH_REENTRANT;
float floorf(float x) _MATH_REENTRANT;
float modff(float x, float * y);
*/
 
unsigned int pow(const unsigned int x, const unsigned int y);
unsigned int sqrt(const unsigned int a); //_MATH_REENTRANT;
 
#endif /* __MATH_H */
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/pblaze/intr.h
0,0 → 1,59
/*
* intr.h - Interrupts functions header file for FITKit
*
* adopted for SDCC and picoBlaze port by Zbynek Krivka, 2010 <krivka @ fit.vutbr.cz>
*
*/
 
#ifndef __INTR_H__
#define __INTR_H__
 
#define KCPSM
 
#ifdef KCPSM
#define EINT ENABLE INTERRUPT
#define DINT DISABLE INTERRUPT
#else
#define EINT EINT
#define DINT DINT
#endif
 
#define BOOL unsigned char
 
void pbcc_enable_interrupt(void);
void pbcc_disable_interrupt(void);
//inline bool pbcc_enabled_interrupt();
//void pbcc_set_interrupt_handler(void *(void))
//void pbcc_set_interrupt(BOOL enable);
 
 
void pbcc_enable_interrupt(void)
{
__asm
EINT
__endasm;
}
 
void pbcc_disable_interrupt(void)
{
__asm;
DINT
__endasm;
}
/*
void pbcc_set_interrupt(BOOL enable)
{
if (enable)
{
pbcc_enable_interrupt();
}
else
{
pbcc_disable_interrupt();
}
 
}
*/
#endif
 
 
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/pblaze/delay.h
0,0 → 1,75
 
/*
* delay.h - delay functions header file
*
* adopted for SDCC and picoBlaze port by Zbynek Krivka, 2010 <krivka @ fit.vutbr.cz>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This library 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
 
#ifndef __DELAY_H__
#define __DELAY_H__
 
 
//#pragma library c
 
/*
* the delayNNtcy family of functions performs a
* delay of NN cycles. Possible values for NN are:
* 10 10*n cycles delay
* 100 100*n cycles delay
* 1k 1000*n cycles delay
* 10k 10000*n cycles delay
* 100k 100000*n cycles delay
* 1m 1000000*n cycles delay
*/
/*
void delay10tcy(unsigned char) __wparam;
void delay100tcy(unsigned char) __wparam;
void delay1ktcy(unsigned char) __wparam;
void delay10ktcy(unsigned char) __wparam;
void delay100ktcy(unsigned char) __wparam;
void delay1mtcy(unsigned char) __wparam;
*/
 
void delay(unsigned char time);
//TODO: void delay(unsigned int time);
 
void delay(unsigned char time)
{
volatile unsigned char i = time;
for(; i > 0; i--)
{
__asm
LOAD s2, 00
ADD s2, 01
 
LOAD s1, 00
rpt22:
ADD s1, 01
 
LOAD s0, 00
rpt11:
ADD s0, 01
JUMP NZ, rpt11
 
COMPARE s1, 00
JUMP NZ, rpt22
__endasm;
}
}
#endif
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/pblaze/pblaze3.h
0,0 → 1,1070
 
/*
* pblaze.h - PicoBlaze3 Device Library Header
*
* This file is part of the GNU PIC Library.
*
* January, 2004
* The GNU PIC Library is maintained by,
* Vangelis Rokas <vrokas@otenet.gr>
*
* $Id: pic18f452.h 3769 2005-05-24 11:22:24Z tecodev $
*
*/
 
#ifndef __PBLAZE3_H__
#define __PBLAZE3_H__
 
extern __sfr __at (0xf80) PORTA;
typedef union {
struct {
unsigned RA0:1;
unsigned RA1:1;
unsigned RA2:1;
unsigned RA3:1;
unsigned RA4:1;
unsigned RA5:1;
unsigned RA6:1;
unsigned :1;
};
 
struct {
unsigned AN0:1;
unsigned AN1:1;
unsigned AN2:1;
unsigned AN3:1;
unsigned :1;
unsigned AN4:1;
unsigned OSC2:1;
unsigned :1;
};
 
struct {
unsigned :1;
unsigned :1;
unsigned VREFM:1;
unsigned VREFP:1;
unsigned T0CKI:1;
unsigned SS:1;
unsigned CLK0:1;
unsigned :1;
};
 
struct {
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned LVDIN:1;
unsigned :1;
unsigned :1;
};
} __PORTAbits_t;
 
extern volatile __PORTAbits_t __at (0xf80) PORTAbits;
 
extern __sfr __at (0xf81) PORTB;
typedef union {
struct {
unsigned RB0:1;
unsigned RB1:1;
unsigned RB2:1;
unsigned RB3:1;
unsigned RB4:1;
unsigned RB5:1;
unsigned RB6:1;
unsigned RB7:1;
};
 
struct {
unsigned INT0:1;
unsigned INT1:1;
unsigned INT2:1;
unsigned INT3:1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
};
} __PORTBbits_t;
 
extern volatile __PORTBbits_t __at (0xf81) PORTBbits;
 
extern __sfr __at (0xf82) PORTC;
typedef union {
struct {
unsigned RC0:1;
unsigned RC1:1;
unsigned RC2:1;
unsigned RC3:1;
unsigned RC4:1;
unsigned RC5:1;
unsigned RC6:1;
unsigned RC7:1;
};
 
struct {
unsigned T1OSO:1;
unsigned T1OSI:1;
unsigned :1;
unsigned SCK:1;
unsigned SDI:1;
unsigned SDO:1;
unsigned TX:1;
unsigned RX:1;
};
 
struct {
unsigned T1CKI:1;
unsigned CCP2:1;
unsigned CCP1:1;
unsigned SCL:1;
unsigned SDA:1;
unsigned :1;
unsigned CK:1;
unsigned DT:1;
};
} __PORTCbits_t;
 
extern volatile __PORTCbits_t __at (0xf82) PORTCbits;
 
extern __sfr __at (0xf83) PORTD;
typedef union {
struct {
unsigned RD0:1;
unsigned RD1:1;
unsigned RD2:1;
unsigned RD3:1;
unsigned RD4:1;
unsigned RD5:1;
unsigned RD6:1;
unsigned RD7:1;
};
 
struct {
unsigned AD0:1;
unsigned AD1:1;
unsigned AD2:1;
unsigned AD3:1;
unsigned AD4:1;
unsigned AD5:1;
unsigned AD6:1;
unsigned AD7:1;
};
} __PORTDbits_t;
 
extern volatile __PORTDbits_t __at (0xf83) PORTDbits;
 
extern __sfr __at (0xf84) PORTE;
typedef union {
struct {
unsigned RE0:1;
unsigned RE1:1;
unsigned RE2:1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
};
 
struct {
unsigned ALE:1;
unsigned OE:1;
unsigned WRL:1;
unsigned WRH:1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned CCP2:1;
};
 
struct {
unsigned AN5:1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
};
} __PORTEbits_t;
 
extern volatile __PORTEbits_t __at (0xf84) PORTEbits;
 
extern __sfr __at (0xf89) LATA;
typedef union {
struct {
unsigned LATA0:1;
unsigned LATA1:1;
unsigned LATA2:1;
unsigned LATA3:1;
unsigned LATA4:1;
unsigned LATA5:1;
unsigned LATA6:1;
unsigned :1;
};
} __LATAbits_t;
 
extern volatile __LATAbits_t __at (0xf89) LATAbits;
 
extern __sfr __at (0xf8a) LATB;
typedef union {
struct {
unsigned LATB0:1;
unsigned LATB1:1;
unsigned LATB2:1;
unsigned LATB3:1;
unsigned LATB4:1;
unsigned LATB5:1;
unsigned LATB6:1;
unsigned LATB7:1;
};
} __LATBbits_t;
 
extern volatile __LATBbits_t __at (0xf8a) LATBbits;
 
extern __sfr __at (0xf8b) LATC;
typedef union {
struct {
unsigned LATC0:1;
unsigned LATC1:1;
unsigned LATC2:1;
unsigned LATC3:1;
unsigned LATC4:1;
unsigned LATC5:1;
unsigned LATC6:1;
unsigned LATC7:1;
};
} __LATCbits_t;
 
extern volatile __LATCbits_t __at (0xf8b) LATCbits;
 
extern __sfr __at (0xf8c) LATD;
typedef union {
struct {
unsigned LATD0:1;
unsigned LATD1:1;
unsigned LATD2:1;
unsigned LATD3:1;
unsigned LATD4:1;
unsigned LATD5:1;
unsigned LATD6:1;
unsigned LATD7:1;
};
} __LATDbits_t;
 
extern volatile __LATDbits_t __at (0xf8c) LATDbits;
 
extern __sfr __at (0xf8d) LATE;
typedef union {
struct {
unsigned LATE0:1;
unsigned LATE1:1;
unsigned LATE2:1;
unsigned LATE3:1;
unsigned LATE4:1;
unsigned LATE5:1;
unsigned LATE6:1;
unsigned LATE7:1;
};
} __LATEbits_t;
 
extern volatile __LATEbits_t __at (0xf8d) LATEbits;
 
extern __sfr __at (0xf92) TRISA;
typedef union {
struct {
unsigned TRISA0:1;
unsigned TRISA1:1;
unsigned TRISA2:1;
unsigned TRISA3:1;
unsigned TRISA4:1;
unsigned TRISA5:1;
unsigned TRISA6:1;
unsigned :1;
};
} __TRISAbits_t;
 
extern volatile __TRISAbits_t __at (0xf92) TRISAbits;
 
extern __sfr __at (0xf93) TRISB;
typedef union {
struct {
unsigned TRISB0:1;
unsigned TRISB1:1;
unsigned TRISB2:1;
unsigned TRISB3:1;
unsigned TRISB4:1;
unsigned TRISB5:1;
unsigned TRISB6:1;
unsigned TRISB7:1;
};
} __TRISBbits_t;
 
extern volatile __TRISBbits_t __at (0xf93) TRISBbits;
 
extern __sfr __at (0xf94) TRISC;
typedef union {
struct {
unsigned TRISC0:1;
unsigned TRISC1:1;
unsigned TRISC2:1;
unsigned TRISC3:1;
unsigned TRISC4:1;
unsigned TRISC5:1;
unsigned TRISC6:1;
unsigned TRISC7:1;
};
} __TRISCbits_t;
 
extern volatile __TRISCbits_t __at (0xf94) TRISCbits;
 
extern __sfr __at (0xf95) TRISD;
typedef union {
struct {
unsigned TRISD0:1;
unsigned TRISD1:1;
unsigned TRISD2:1;
unsigned TRISD3:1;
unsigned TRISD4:1;
unsigned TRISD5:1;
unsigned TRISD6:1;
unsigned TRISD7:1;
};
} __TRISDbits_t;
 
extern volatile __TRISDbits_t __at (0xf95) TRISDbits;
 
extern __sfr __at (0xf96) TRISE;
typedef union {
struct {
unsigned TRISE0:1;
unsigned TRISE1:1;
unsigned TRISE2:1;
unsigned :1;
unsigned PSPMODE:1;
unsigned IBOV:1;
unsigned OBF:1;
unsigned IBF:1;
};
} __TRISEbits_t;
 
extern volatile __TRISEbits_t __at (0xf96) TRISEbits;
 
extern __sfr __at (0xf9d) PIE1;
typedef union {
struct {
unsigned TMR1IE:1;
unsigned TMR2IE:1;
unsigned CCP1IE:1;
unsigned SSPIE:1;
unsigned TXIE:1;
unsigned RCIE:1;
unsigned ADIE:1;
unsigned PSPIE:1;
};
} __PIE1bits_t;
 
extern volatile __PIE1bits_t __at (0xf9d) PIE1bits;
 
extern __sfr __at (0xf9e) PIR1;
typedef union {
struct {
unsigned TMR1IF:1;
unsigned TMR2IF:1;
unsigned CCP1IF:1;
unsigned SSPIF:1;
unsigned TXIF:1;
unsigned RCIF:1;
unsigned ADIF:1;
unsigned PSPIF:1;
};
} __PIR1bits_t;
 
extern volatile __PIR1bits_t __at (0xf9e) PIR1bits;
 
extern __sfr __at (0xf9f) IPR1;
typedef union {
struct {
unsigned TMR1IP:1;
unsigned TMR2IP:1;
unsigned CCP1IP:1;
unsigned SSPIP:1;
unsigned TXIP:1;
unsigned RCIP:1;
unsigned ADIP:1;
unsigned PSPIP:1;
};
} __IPR1bits_t;
 
extern volatile __IPR1bits_t __at (0xf9f) IPR1bits;
 
extern __sfr __at (0xfa0) PIE2;
typedef union {
struct {
unsigned CCP2IE:1;
unsigned TMR3IE:1;
unsigned LVDIE:1;
unsigned BCLIE:1;
unsigned EEIE:1;
unsigned :1;
unsigned :1;
unsigned :1;
};
} __PIE2bits_t;
 
extern volatile __PIE2bits_t __at (0xfa0) PIE2bits;
 
extern __sfr __at (0xfa1) PIR2;
typedef union {
struct {
unsigned CCP2IF:1;
unsigned TMR3IF:1;
unsigned LVDIF:1;
unsigned BCLIF:1;
unsigned EEIF:1;
unsigned :1;
unsigned :1;
unsigned :1;
};
} __PIR2bits_t;
 
extern volatile __PIR2bits_t __at (0xfa1) PIR2bits;
 
extern __sfr __at (0xfa2) IPR2;
typedef union {
struct {
unsigned CCP2IP:1;
unsigned TMR3IP:1;
unsigned LVDIP:1;
unsigned BCLIP:1;
unsigned EEIP:1;
unsigned :1;
unsigned :1;
unsigned :1;
};
} __IPR2bits_t;
 
extern volatile __IPR2bits_t __at (0xfa2) IPR2bits;
 
extern __sfr __at (0xfa6) EECON1;
typedef union {
struct {
unsigned RD:1;
unsigned WR:1;
unsigned WREN:1;
unsigned WRERR:1;
unsigned FREE:1;
unsigned :1;
unsigned CFGS:1;
unsigned EEPGD:1;
};
} __EECON1bits_t;
 
extern volatile __EECON1bits_t __at (0xfa6) EECON1bits;
 
extern __sfr __at (0xfa7) EECON2;
extern __sfr __at (0xfa8) EEDATA;
extern __sfr __at (0xfa9) EEADR;
extern __sfr __at (0xfab) RCSTA;
typedef union {
struct {
unsigned RX9D:1;
unsigned OERR:1;
unsigned FERR:1;
unsigned ADDEN:1;
unsigned CREN:1;
unsigned SREN:1;
unsigned RX9:1;
unsigned SPEN:1;
};
} __RCSTAbits_t;
 
extern volatile __RCSTAbits_t __at (0xfab) RCSTAbits;
 
extern __sfr __at (0xfac) TXSTA;
typedef union {
struct {
unsigned TX9D:1;
unsigned TRMT:1;
unsigned BRGH:1;
unsigned :1;
unsigned SYNC:1;
unsigned TXEN:1;
unsigned TX9:1;
unsigned CSRC:1;
};
} __TXSTAbits_t;
 
extern volatile __TXSTAbits_t __at (0xfac) TXSTAbits;
 
extern __sfr __at (0xfad) TXREG;
extern __sfr __at (0xfae) RCREG;
extern __sfr __at (0xfaf) SPBRG;
extern __sfr __at (0xfb1) T3CON;
typedef union {
struct {
unsigned TMR3ON:1;
unsigned TMR3CS:1;
unsigned T3SYNC:1;
unsigned T3CCP1:1;
unsigned T3CKPS0:1;
unsigned T3CKPS1:1;
unsigned T3CCP2:1;
unsigned RD16:1;
};
} __T3CONbits_t;
 
extern volatile __T3CONbits_t __at (0xfb1) T3CONbits;
 
extern __sfr __at (0xfb2) TMR3L;
extern __sfr __at (0xfb3) TMR3H;
extern __sfr __at (0xfba) CCP2CON;
typedef union {
struct {
unsigned CCP2M0:1;
unsigned CCP2M1:1;
unsigned CCP2M2:1;
unsigned CCP2M3:1;
unsigned DCCP2Y:1;
unsigned DCCP2X:1;
unsigned :1;
unsigned :1;
};
} __CCP2CONbits_t;
 
extern volatile __CCP2CONbits_t __at (0xfba) CCP2CONbits;
 
extern __sfr __at (0xfbb) CCPR2L;
extern __sfr __at (0xfbc) CCPR2H;
extern __sfr __at (0xfbd) CCP1CON;
typedef union {
struct {
unsigned CCP1M0:1;
unsigned CCP1M1:1;
unsigned CCP1M2:1;
unsigned CCP1M3:1;
unsigned DCCP1Y:1;
unsigned DCCP1X:1;
unsigned :1;
unsigned :1;
};
} __CCP1CONbits_t;
 
extern volatile __CCP1CONbits_t __at (0xfbd) CCP1CONbits;
 
extern __sfr __at (0xfbe) CCPR1L;
extern __sfr __at (0xfbf) CCPR1H;
extern __sfr __at (0xfc1) ADCON1;
typedef union {
struct {
unsigned PCFG0:1;
unsigned PCFG1:1;
unsigned PCFG2:1;
unsigned PCFG3:1;
unsigned :1;
unsigned :1;
unsigned ADCS2:1;
unsigned ADFM:1;
};
} __ADCON1bits_t;
 
extern volatile __ADCON1bits_t __at (0xfc1) ADCON1bits;
 
extern __sfr __at (0xfc2) ADCON0;
typedef union {
struct {
unsigned ADON:1;
unsigned :1;
unsigned GO:1;
unsigned CHS0:1;
unsigned CHS1:1;
unsigned CHS2:1;
unsigned ADCS0:1;
unsigned ADCS1:1;
};
} __ADCON0bits_t;
 
extern volatile __ADCON0bits_t __at (0xfc2) ADCON0bits;
 
extern __sfr __at (0xfc3) ADRESL;
extern __sfr __at (0xfc4) ADRESH;
extern __sfr __at (0xfc5) SSPCON2;
typedef union {
struct {
unsigned SEN:1;
unsigned RSEN:1;
unsigned PEN:1;
unsigned RCEN:1;
unsigned ACKEN:1;
unsigned ACKDT:1;
unsigned ACKSTAT:1;
unsigned GCEN:1;
};
} __SSPCON2bits_t;
 
extern volatile __SSPCON2bits_t __at (0xfc5) SSPCON2bits;
 
extern __sfr __at (0xfc6) SSPCON1;
typedef union {
struct {
unsigned SSPM0:1;
unsigned SSPM1:1;
unsigned SSPM2:1;
unsigned SSPM3:1;
unsigned CKP:1;
unsigned SSPEN:1;
unsigned SSPOV:1;
unsigned WCOL:1;
};
} __SSPCON1bits_t;
 
extern volatile __SSPCON1bits_t __at (0xfc6) SSPCON1bits;
 
extern __sfr __at (0xfc7) SSPSTAT;
typedef union {
struct {
unsigned BF:1;
unsigned UA:1;
unsigned R_W:1;
unsigned S:1;
unsigned P:1;
unsigned D_A:1;
unsigned CKE:1;
unsigned SMP:1;
};
} __SSPSTATbits_t;
 
extern volatile __SSPSTATbits_t __at (0xfc7) SSPSTATbits;
 
extern __sfr __at (0xfc8) SSPADD;
extern __sfr __at (0xfc9) SSPBUF;
extern __sfr __at (0xfca) T2CON;
typedef union {
struct {
unsigned T2CKPS0:1;
unsigned T2CKPS1:1;
unsigned TMR2ON:1;
unsigned TOUTPS0:1;
unsigned TOUTPS1:1;
unsigned TOUTPS2:1;
unsigned TOUTPS3:1;
unsigned :1;
};
} __T2CONbits_t;
 
extern volatile __T2CONbits_t __at (0xfca) T2CONbits;
 
extern __sfr __at (0xfcb) PR2;
extern __sfr __at (0xfcc) TMR2;
extern __sfr __at (0xfcd) T1CON;
typedef union {
struct {
unsigned TMR1ON:1;
unsigned TMR1CS:1;
unsigned NOT_T1SYNC:1;
unsigned T1OSCEN:1;
unsigned T1CKPS0:1;
unsigned T1CKPS1:1;
unsigned :1;
unsigned RD16:1;
};
} __T1CONbits_t;
 
extern volatile __T1CONbits_t __at (0xfcd) T1CONbits;
 
extern __sfr __at (0xfce) TMR1L;
extern __sfr __at (0xfcf) TMR1H;
extern __sfr __at (0xfd0) RCON;
typedef union {
struct {
unsigned BOR:1;
unsigned POR:1;
unsigned PD:1;
unsigned TO:1;
unsigned RI:1;
unsigned :1;
unsigned :1;
unsigned IPEN:1;
};
} __RCONbits_t;
 
extern volatile __RCONbits_t __at (0xfd0) RCONbits;
 
extern __sfr __at (0xfd1) WDTCON;
typedef union {
struct {
unsigned SWDTEN:1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
};
 
struct {
unsigned SWDTE:1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
};
} __WDTCONbits_t;
 
extern volatile __WDTCONbits_t __at (0xfd1) WDTCONbits;
 
extern __sfr __at (0xfd2) LVDCON;
typedef union {
struct {
unsigned LVDL0:1;
unsigned LVDL1:1;
unsigned LVDL2:1;
unsigned LVDL3:1;
unsigned LVDEN:1;
unsigned VRST:1;
unsigned :1;
unsigned :1;
};
 
struct {
unsigned LVV0:1;
unsigned LVV1:1;
unsigned LVV2:1;
unsigned LVV3:1;
unsigned :1;
unsigned BGST:1;
unsigned :1;
unsigned :1;
};
} __LVDCONbits_t;
 
extern volatile __LVDCONbits_t __at (0xfd2) LVDCONbits;
 
extern __sfr __at (0xfd3) OSCCON;
typedef union {
struct {
unsigned SCS:1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
unsigned :1;
};
} __OSCCONbits_t;
 
extern volatile __OSCCONbits_t __at (0xfd3) OSCCONbits;
 
extern __sfr __at (0xfd5) T0CON;
typedef union {
struct {
unsigned T0PS0:1;
unsigned T0PS1:1;
unsigned T0PS2:1;
unsigned PSA:1;
unsigned T0SE:1;
unsigned T0CS:1;
unsigned T08BIT:1;
unsigned TMR0ON:1;
};
} __T0CONbits_t;
 
extern volatile __T0CONbits_t __at (0xfd5) T0CONbits;
 
extern __sfr __at (0xfd6) TMR0L;
extern __sfr __at (0xfd7) TMR0H;
extern __sfr __at (0xfd8) STATUS;
typedef union {
struct {
unsigned C:1;
unsigned DC:1;
unsigned Z:1;
unsigned OV:1;
unsigned N:1;
unsigned :1;
unsigned :1;
unsigned :1;
};
} __STATUSbits_t;
 
extern volatile __STATUSbits_t __at (0xfd8) STATUSbits;
 
extern __sfr __at (0xfd9) FSR2L;
extern __sfr __at (0xfda) FSR2H;
extern __sfr __at (0xfdb) PLUSW2;
extern __sfr __at (0xfdc) PREINC2;
extern __sfr __at (0xfdd) POSTDEC2;
extern __sfr __at (0xfde) POSTINC2;
extern __sfr __at (0xfdf) INDF2;
extern __sfr __at (0xfe0) BSR;
extern __sfr __at (0xfe1) FSR1L;
extern __sfr __at (0xfe2) FSR1H;
extern __sfr __at (0xfe3) PLUSW1;
extern __sfr __at (0xfe4) PREINC1;
extern __sfr __at (0xfe5) POSTDEC1;
extern __sfr __at (0xfe6) POSTINC1;
extern __sfr __at (0xfe7) INDF1;
extern __sfr __at (0xfe8) WREG;
extern __sfr __at (0xfe9) FSR0L;
extern __sfr __at (0xfea) FSR0H;
extern __sfr __at (0xfeb) PLUSW0;
extern __sfr __at (0xfec) PREINC0;
extern __sfr __at (0xfed) POSTDEC0;
extern __sfr __at (0xfee) POSTINC0;
extern __sfr __at (0xfef) INDF0;
extern __sfr __at (0xff0) INTCON3;
typedef union {
struct {
unsigned INT1F:1;
unsigned INT2F:1;
unsigned :1;
unsigned INT1E:1;
unsigned INT2E:1;
unsigned :1;
unsigned INT1P:1;
unsigned INT2P:1;
};
 
struct {
unsigned INT1IF:1;
unsigned INT2IF:1;
unsigned :1;
unsigned INT1IE:1;
unsigned INT2IE:1;
unsigned :1;
unsigned INT1IP:1;
unsigned INT2IP:1;
};
} __INTCON3bits_t;
 
extern volatile __INTCON3bits_t __at (0xff0) INTCON3bits;
 
extern __sfr __at (0xff1) INTCON2;
typedef union {
struct {
unsigned RBIP:1;
unsigned :1;
unsigned T0IP:1;
unsigned :1;
unsigned INTEDG2:1;
unsigned INTEDG1:1;
unsigned INTEDG0:1;
unsigned RBPU:1;
};
} __INTCON2bits_t;
 
extern volatile __INTCON2bits_t __at (0xff1) INTCON2bits;
 
extern __sfr __at (0xff2) INTCON;
typedef union {
struct {
unsigned RBIF:1;
unsigned INT0F:1;
unsigned T0IF:1;
unsigned RBIE:1;
unsigned INT0E:1;
unsigned T0IE:1;
unsigned PEIE:1;
unsigned GIE:1;
};
} __INTCONbits_t;
 
extern volatile __INTCONbits_t __at (0xff2) INTCONbits;
 
extern __sfr __at (0xff3) PRODL;
extern __sfr __at (0xff4) PRODH;
extern __sfr __at (0xff5) TABLAT;
extern __sfr __at (0xff6) TBLPTRL;
extern __sfr __at (0xff7) TBLPTRH;
extern __sfr __at (0xff8) TBLPTRU;
extern __sfr __at (0xff9) PCL;
extern __sfr __at (0xffa) PCLATH;
extern __sfr __at (0xffb) PCLATU;
extern __sfr __at (0xffc) STKPTR;
typedef union {
struct {
unsigned STKPTR0:1;
unsigned STKPTR1:1;
unsigned STKPTR2:1;
unsigned STKPTR3:1;
unsigned STKPTR4:1;
unsigned :1;
unsigned STKUNF:1;
unsigned STKFUL:1;
};
} __STKPTRbits_t;
 
extern volatile __STKPTRbits_t __at (0xffc) STKPTRbits;
 
extern __sfr __at (0xffd) TOSL;
extern __sfr __at (0xffe) TOSH;
extern __sfr __at (0xfff) TOSU;
 
 
/* Configuration registers locations */
#define __CONFIG1H 0x300001
#define __CONFIG2L 0x300002
#define __CONFIG2H 0x300003
#define __CONFIG3H 0x300005
#define __CONFIG4L 0x300006
#define __CONFIG5L 0x300008
#define __CONFIG5H 0x300009
#define __CONFIG6L 0x30000A
#define __CONFIG6H 0x30000B
#define __CONFIG7L 0x30000C
#define __CONFIG7H 0x30000D
 
 
 
/* Oscillator 1H options */
#define _OSC_RC_OSC2_1H 0xFF /* RC-OSC2 as RA6 */
#define _OSC_HS_PLL_1H 0xFE /* HS-PLL Enabled */
#define _OSC_EC_OSC2_RA6_1H 0xFD /* EC-OSC2 as RA6 */
#define _OSC_EC_OSC2_Clock_Out_1H 0xFC /* EC-OSC2 as Clock_Out */
#define _OSC_RC_1H 0xFB /* RC */
#define _OSC_HS_1H 0xFA /* HS */
#define _OSC_XT_1H 0xF9 /* XT */
#define _OSC_LP_1H 0xF8 /* LP */
 
/* Osc. Switch Enable 1H options */
#define _OSCS_OFF_1H 0xFF /* Disabled */
#define _OSCS_ON_1H 0xDF /* Enabled */
 
/* Power Up Timer 2L options */
#define _PUT_OFF_2L 0xFF /* Disabled */
#define _PUT_ON_2L 0xFE /* Enabled */
 
/* Brown Out Detect 2L options */
#define _BODEN_ON_2L 0xFF /* Enabled */
#define _BODEN_OFF_2L 0xFD /* Disabled */
 
/* Brown Out Voltage 2L options */
#define _BODENV_2_0V_2L 0xFF /* 2.0V */
#define _BODENV_2_7V_2L 0xFB /* 2.7V */
#define _BODENV_4_2V_2L 0xF7 /* 4.2V */
#define _BODENV_4_5V_2L 0xF3 /* 4.5V */
 
/* Watchdog Timer 2H options */
#define _WDT_ON_2H 0xFF /* Enabled */
#define _WDT_OFF_2H 0xFE /* Disabled */
 
/* Watchdog Postscaler 2H options */
#define _WDTPS_1_128_2H 0xFF /* 1:128 */
#define _WDTPS_1_64_2H 0xFD /* 1:64 */
#define _WDTPS_1_32_2H 0xFB /* 1:32 */
#define _WDTPS_1_16_2H 0xF9 /* 1:16 */
#define _WDTPS_1_8_2H 0xF7 /* 1:8 */
#define _WDTPS_1_4_2H 0xF5 /* 1:4 */
#define _WDTPS_1_2_2H 0xF3 /* 1:2 */
#define _WDTPS_1_1_2H 0xF1 /* 1:1 */
 
/* CCP2 Mux 3H options */
#define _CCP2MUX_RC1_3H 0xFF /* RC1 */
#define _CCP2MUX_RB3_3H 0xFE /* RB3 */
 
/* Low Voltage Program 4L options */
#define _LVP_ON_4L 0xFF /* Enabled */
#define _LVP_OFF_4L 0xFB /* Disabled */
 
/* Background Debug 4L options */
#define _BACKBUG_OFF_4L 0xFF /* Disabled */
#define _BACKBUG_ON_4L 0x7F /* Enabled */
 
/* Stack Overflow Reset 4L options */
#define _STVR_ON_4L 0xFF /* Enabled */
#define _STVR_OFF_4L 0xFE /* Disabled */
 
/* Code Protect 00200-01FFF 5L options */
#define _CP_0_OFF_5L 0xFF /* Disabled */
#define _CP_0_ON_5L 0xFE /* Enabled */
 
/* Code Protect 02000-03FFF 5L options */
#define _CP_1_OFF_5L 0xFF /* Disabled */
#define _CP_1_ON_5L 0xFD /* Enabled */
 
/* Code Protect 04000-05FFF 5L options */
#define _CP_2_OFF_5L 0xFF /* Disabled */
#define _CP_2_ON_5L 0xFB /* Enabled */
 
/* Code Protect 06000-07FFF 5L options */
#define _CP_3_OFF_5L 0xFF /* Disabled */
#define _CP_3_ON_5L 0xF7 /* Enabled */
 
/* Data EE Read Protect 5H options */
#define _CPD_OFF_5H 0xFF /* Disabled */
#define _CPD_ON_5H 0x7F /* Enabled */
 
/* Code Protect Boot 5H options */
#define _CPB_OFF_5H 0xFF /* Disabled */
#define _CPB_ON_5H 0xBF /* Enabled */
 
/* Table Write Protect 00200-01FFF 6L options */
#define _WRT_0_OFF_6L 0xFF /* Disabled */
#define _WRT_0_ON_6L 0xFE /* Enabled */
 
/* Table Write Protect 02000-03FFF 6L options */
#define _WRT_1_OFF_6L 0xFF /* Disabled */
#define _WRT_1_ON_6L 0xFD /* Enabled */
 
/* Table Write Protect 04000-05FFF 6L options */
#define _WRT_2_OFF_6L 0xFF /* Disabled */
#define _WRT_2_ON_6L 0xFB /* Enabled */
 
/* Table Write Protect 06000-07FFF 6L options */
#define _WRT_3_OFF_6L 0xFF /* Disabled */
#define _WRT_3_ON_6L 0xF7 /* Enabled */
 
/* Data EE Write Protect 6H options */
#define _WRTD_OFF_6H 0xFF /* Disabled */
#define _WRTD_ON_6H 0x7F /* Enabled */
 
/* Table Write Protect Boot 6H options */
#define _WRTB_OFF_6H 0xFF /* Disabled */
#define _WRTB_ON_6H 0xBF /* Enabled */
 
/* Config. Write Protect 6H options */
#define _WRTC_OFF_6H 0xFF /* Disabled */
#define _WRTC_ON_6H 0xDF /* Enabled */
 
/* Table Read Protect 00200-01FFF 7L options */
#define _EBTR_0_OFF_7L 0xFF /* Disabled */
#define _EBTR_0_ON_7L 0xFE /* Enabled */
 
/* Table Read Protect 02000-03FFF 7L options */
#define _EBTR_1_OFF_7L 0xFF /* Disabled */
#define _EBTR_1_ON_7L 0xFD /* Enabled */
 
/* Table Read Protect 04000-05FFF 7L options */
#define _EBTR_2_OFF_7L 0xFF /* Disabled */
#define _EBTR_2_ON_7L 0xFB /* Enabled */
 
/* Table Read Protect 06000-07FFF 7L options */
#define _EBTR_3_OFF_7L 0xFF /* Disabled */
#define _EBTR_3_ON_7L 0xF7 /* Enabled */
 
/* Table Read Protect Boot 7H options */
#define _EBTRB_OFF_7H 0xFF /* Disabled */
#define _EBTRB_ON_7H 0xBF /* Enabled */
 
 
/* Device ID locations */
#define __IDLOC0 0x200000
#define __IDLOC1 0x200001
#define __IDLOC2 0x200002
#define __IDLOC3 0x200003
#define __IDLOC4 0x200004
#define __IDLOC5 0x200005
#define __IDLOC6 0x200006
#define __IDLOC7 0x200007
 
 
#endif
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/pblaze/kbd.h
0,0 → 1,169
/*
* kbd.h - Keyboarch (16 keys) peripheral functions header file for FITKit
*
* adopted for SDCC and picoBlaze port by Zbynek Krivka, 2010 <krivka @ fit.vutbr.cz>
*
*/
 
#ifndef __KBD_H__
#define __KBD_H__
 
#include "delay.h"
#include "port.h"
 
#define port_kb_low 60
#define port_kb_high 61
 
#define CHAR_SPACE 0x20
#define CHAR_0 0x30
#define CHAR_1 0x31
#define CHAR_2 0x32
#define CHAR_3 0x33
#define CHAR_4 0x34
#define CHAR_5 0x35
#define CHAR_6 0x36
#define CHAR_7 0x37
#define CHAR_8 0x38
#define CHAR_9 0x39
#define CHAR_A 0x41
#define CHAR_B 0x42
#define CHAR_C 0x43
#define CHAR_D 0x44
#define CHAR_STAR 0x2A
#define CHAR_HASH 0x23
 
#define ASM_CHAR_SPACE 20
#define ASM_CHAR_0 30
#define ASM_CHAR_1 31
#define ASM_CHAR_2 32
#define ASM_CHAR_3 33
#define ASM_CHAR_4 34
#define ASM_CHAR_5 35
#define ASM_CHAR_6 36
#define ASM_CHAR_7 37
#define ASM_CHAR_8 38
#define ASM_CHAR_9 39
#define ASM_CHAR_A 41
#define ASM_CHAR_B 42
#define ASM_CHAR_C 43
#define ASM_CHAR_D 44
#define ASM_CHAR_STAR 2A
#define ASM_CHAR_HASH 23
 
 
unsigned char readkey()
{
volatile unsigned char key = 0;
__asm
INPUT _key, port_kb_low
xch1:
SRA _key
JUMP NC, xch4
LOAD _key, ASM_CHAR_1
JUMP xchno
 
xch4:
SRA _key
JUMP NC, xch7
LOAD _key, ASM_CHAR_4
JUMP xchno
 
xch7:
SRA _key
JUMP NC, xchs
LOAD _key, ASM_CHAR_7
JUMP xchno
 
xchs:
SRA _key
JUMP NC, xch2
LOAD _key, ASM_CHAR_STAR
JUMP xchno
 
xch2:
SRA _key
JUMP NC, xch5
LOAD _key, ASM_CHAR_2
JUMP xchno
 
xch5:
SRA _key
JUMP NC, xch8
LOAD _key, ASM_CHAR_5
JUMP xchno
 
xch8:
SRA _key
JUMP NC, xch0
LOAD _key, ASM_CHAR_8
JUMP xchno
 
xch0:
SRA _key
JUMP NC, xch3
LOAD _key, ASM_CHAR_0
JUMP xchno
 
xch3:
INPUT _key, port_kb_high
SRA _key
JUMP NC, xch6
LOAD _key, ASM_CHAR_3
JUMP xchno
 
xch6:
SRA _key
JUMP NC, xch9
LOAD _key, ASM_CHAR_6
JUMP xchno
 
xch9:
SRA _key
JUMP NC, xchm
LOAD _key, ASM_CHAR_9
JUMP xchno
 
xchm:
SRA _key
JUMP NC, xcha
LOAD _key, ASM_CHAR_HASH
JUMP xchno
 
xcha:
SRA _key
JUMP NC, xchb
LOAD _key, ASM_CHAR_A
JUMP xchno
 
xchb:
SRA _key
JUMP NC, xchc
LOAD _key, ASM_CHAR_B
JUMP xchno
 
xchc:
SRA _key
JUMP NC, xchd
LOAD _key, ASM_CHAR_C
JUMP xchno
 
xchd:
SRA _key
JUMP NC, xchno
LOAD _key, ASM_CHAR_D
xchno:
__endasm;
return key;
}
 
 
 
 
 
 
 
 
#endif
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/pblaze/limits.h
0,0 → 1,51
/*-------------------------------------------------------------------------
limits.h - ANSI defines constants for sizes of integral types
Adopted for the picoBlaze port by Zbynek Krivka
[ krivka @ fit.vutbr.cz ] 2010
 
Written By - Sandeep Dutta . sandeep.dutta@usa.net (1999)
 
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 2, 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, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
In other words, you are welcome to use, share and improve this program.
You are forbidden to forbid anyone else to use, share and improve
what you give them. Help stamp out software-hoarding!
-------------------------------------------------------------------------*/
 
#ifndef __LIMITS_H
#define __LIMITS_H 1
 
#define CHAR_BIT 8 /* bits in a char */
#define CHAR_MAX 127
#define CHAR_MIN -128
#define SCHAR_MAX CHAR_MAX
#define SCHAR_MIN CHAR_MIN
#define UCHAR_MAX 0xff
#define UCHAR_MIN 0
#define INT_MIN -32768
#define INT_MAX 32767
#define SHRT_MAX INT_MAX
#define SHRT_MIN INT_MIN
#define UINT_MAX 0xffff
#define UINT_MIN 0
#define USHRT_MAX UINT_MAX
#define USHRT_MIN UINT_MIN
#define LONG_MIN -2147483648
#define LONG_MAX 2147483647
#define ULONG_MAX 0xffffffff
#define ULONG_MIN 0
 
#endif
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/pblaze/lcd.h
0,0 → 1,96
/*
* lcd.h - LCD peripheral functions header file for FITKit
*
* adopted for SDCC and picoBlaze port by Zbynek Krivka, 2010 <krivka @ fit.vutbr.cz>
*
*/
 
#ifndef __LCD_H__
#define __LCD_H__
 
#include "delay.h"
#include "port.h"
 
#define port_lcd_high 41
#define port_lcd_low 40
#define LCD_CLEAR_DISPLAY 01
#define LCD_wr(arg) __port_write(0x40, (arg)); __port_write(0x41, 01)
#define MIN_PAUSE 10
 
void LCD_clear(void);
void LCD_init(void);
void LCD_set_cursor(void);
void LCD_write(unsigned char ch);
 
void LCD_clear(void)
{
__asm
; LCD clear
LOAD s6, LCD_CLEAR_DISPLAY
OUTPUT s6, port_lcd_low
LOAD s6, 00
OUTPUT s6, port_lcd_high
__endasm;
delay(MIN_PAUSE);
}
 
void LCD_set_cursor()
{
__asm;
; LCD - set cursor at the line beginning
LOAD s6, 80
OUTPUT s6, port_lcd_low
LOAD s6, 00
OUTPUT s6, port_lcd_high
__endasm;
delay(MIN_PAUSE);
}
 
void LCD_init()
{
__asm
; LCD clear
LOAD s6, LCD_CLEAR_DISPLAY
OUTPUT s6, port_lcd_low
LOAD s6, 00
OUTPUT s6, port_lcd_high
__endasm;
delay(MIN_PAUSE);
__asm
; LCD function set - 8-bit carry, display consists of 2 parts, font 5x8
LOAD s6, 38
OUTPUT s6, port_lcd_low
LOAD s6, 00
OUTPUT s6, port_lcd_high
__endasm;
delay(MIN_PAUSE);
__asm
; LCD display - show the cursor, turn the display ON
LOAD s6, 0E
OUTPUT s6, port_lcd_low
LOAD s6, 00
OUTPUT s6, port_lcd_high
__endasm;
delay(MIN_PAUSE);
__asm
; LCD entry mode - increment cursor address automatically
LOAD s6, 06
OUTPUT s6, port_lcd_low
LOAD s6, 00
OUTPUT s6, port_lcd_high
__endasm;
LCD_set_cursor();
 
delay(MIN_PAUSE);
}
 
void LCD_write(unsigned char ch)
{
__port_write(0x40, ch);
__port_write(0x41, 01);
}
 
#endif
 
 
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/pblaze/port.h
0,0 → 1,39
#ifndef __PORT_H__
#define __PORT_H__
 
#define MIN_PAUSE 10
 
#include "delay.h"
/*
* port.h - port communication functions header file
*
* adopted for SDCC and picoBlaze port by Zbynek Krivka, 2010 <krivka @ fit.vutbr.cz>
*
*/
void __port_write(unsigned char, unsigned char);
unsigned char __port_read(volatile unsigned char);
 
void __port_write(unsigned char port, unsigned char arg)
{
unsigned volatile char p;
unsigned volatile char a;
p = port;
a = arg;
__asm
OUTPUT _a, _p
__endasm;
delay(MIN_PAUSE);
}
 
unsigned char __port_read(volatile unsigned char port)
{
volatile unsigned char d = 0;
volatile unsigned char p = port;
__asm
INPUT _d, _p
__endasm;
delay(MIN_PAUSE);
return d;
}
 
#endif
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/pblaze/ctype.h
0,0 → 1,74
/*-------------------------------------------------------------------------
ctype.h - ANSI functions forward declarations
Modified for pic16 port by Vangelis Rokas, 2004, vrokas@otenet.gr
Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998)
 
Revisions:
1.0 - June.1.2000 1.0 - Bela Torok / bela.torok@kssg.ch
order: function definitions -> macros
corretced macro: isalpha(c)
added macros: _tolower(c), _toupper(c), tolower(c), toupper(c) toascii(c)
 
 
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 2, 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, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
In other words, you are welcome to use, share and improve this program.
You are forbidden to forbid anyone else to use, share and improve
what you give them. Help stamp out software-hoarding!
-------------------------------------------------------------------------*/
 
/*
** $Id: ctype.h 3648 2005-01-22 18:02:16Z vrokas $
*/
 
 
#ifndef __CTYPE_H
#define __CTYPE_H 1
 
/* link the C libarary */
#pragma library c
 
#include <sdcc-lib.h>
 
extern char iscntrl (unsigned char ) ;
extern char isdigit (unsigned char ) ;
extern char isgraph (unsigned char ) ;
extern char islower (unsigned char ) ;
extern char isupper (unsigned char ) ;
extern char isprint (unsigned char ) ;
extern char ispunct (unsigned char ) ;
extern char isspace (unsigned char ) ;
extern char isxdigit (unsigned char ) ;
 
#define isalnum(c) (isalpha(c) || isdigit(c))
#define isalpha(c) (isupper(c) || islower(c))
 
/* ANSI versions of _tolower & _toupper
#define _tolower(c) ((c) - ('a' - 'A'))
#define _toupper(c) ((c) + ('a' - 'A'))
*/
 
// The _tolower & _toupper functions below can applied to any
// alpha characters regardless of the case (upper or lower)
#define _tolower(c) ((c) | ('a' - 'A'))
#define _toupper(c) ((c) & ~('a' - 'A'))
 
#define tolower(c) ((isupper(c)) ? _tolower(c) : (c))
#define toupper(c) ((islower(c)) ? _toupper(c) : (c))
#define toascii(c) ((c) & 0x7F)
 
#endif
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/pblaze/stdint.h
0,0 → 1,157
/*-------------------------------------------------------------------------
stdint.h - ISO C99 7.18 Integer types <stdint.h>
 
Written By - Maarten Brock, sourceforge.brock@dse.nl (2005)
 
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
 
This library 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
Lesser General Public License for more details.
 
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-------------------------------------------------------------------------*/
 
#ifndef _STDINT_H
#define _STDINT_H 1
 
/* Exact integral types. */
 
/* Signed. */
 
typedef signed char int8_t;
typedef short int int16_t;
typedef long int int32_t;
 
/* Unsigned. */
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned long int uint32_t;
 
 
/* Small types. */
 
/* Signed. */
typedef signed char int_least8_t;
typedef short int int_least16_t;
typedef long int int_least32_t;
 
/* Unsigned. */
typedef unsigned char uint_least8_t;
typedef unsigned short int uint_least16_t;
typedef unsigned long int uint_least32_t;
 
 
/* Fast types. */
 
/* Signed. */
typedef signed char int_fast8_t;
typedef int int_fast16_t;
typedef long int int_fast32_t;
 
/* Unsigned. */
typedef unsigned char uint_fast8_t;
typedef unsigned int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
 
 
/* Types for `void *' pointers. */
typedef long int intptr_t;
typedef unsigned long int uintptr_t;
 
 
/* Largest integral types. */
typedef long int intmax_t;
typedef unsigned long int uintmax_t;
 
 
/* Limits of integral types. */
 
/* Minimum of signed integral types. */
# define INT8_MIN (-128)
# define INT16_MIN (-32767-1)
# define INT32_MIN (-2147483647L-1)
/* Maximum of signed integral types. */
# define INT8_MAX (127)
# define INT16_MAX (32767)
# define INT32_MAX (2147483647L)
 
/* Maximum of unsigned integral types. */
# define UINT8_MAX (255)
# define UINT16_MAX (65535)
# define UINT32_MAX (4294967295UL)
 
/* Minimum of signed integral types having a minimum size. */
# define INT_LEAST8_MIN (-128)
# define INT_LEAST16_MIN (-32767-1)
# define INT_LEAST32_MIN (-2147483647L-1)
/* Maximum of signed integral types having a minimum size. */
# define INT_LEAST8_MAX (127)
# define INT_LEAST16_MAX (32767)
# define INT_LEAST32_MAX (2147483647L)
 
/* Maximum of unsigned integral types having a minimum size. */
# define UINT_LEAST8_MAX (255)
# define UINT_LEAST16_MAX (65535)
# define UINT_LEAST32_MAX (4294967295UL)
 
/* Minimum of fast signed integral types having a minimum size. */
# define INT_FAST8_MIN (-128)
# define INT_FAST16_MIN (-32767-1)
# define INT_FAST32_MIN (-2147483647L-1)
 
/* Maximum of fast signed integral types having a minimum size. */
# define INT_FAST8_MAX (127)
# define INT_FAST16_MAX (32767)
# define INT_FAST32_MAX (2147483647L)
 
/* Maximum of fast unsigned integral types having a minimum size. */
# define UINT_FAST8_MAX (255)
# define UINT_FAST16_MAX (65535)
# define UINT_FAST32_MAX (4294967295UL)
 
/* Values to test for integral types holding `void *' pointer. */
# define INTPTR_MIN (-2147483647L-1)
# define INTPTR_MAX (2147483647L)
# define UINTPTR_MAX (4294967295UL)
 
/* Minimum for largest signed integral type. */
# define INTMAX_MIN (-__INT32_C(-2147483647L)-1)
/* Maximum for largest signed integral type. */
# define INTMAX_MAX (__INT32_C(2147483647L))
 
/* Maximum for largest unsigned integral type. */
# define UINTMAX_MAX (__UINT32_C(4294967295UL))
 
 
/* Limits of other integer types. */
 
/* Limits of `ptrdiff_t' type. */
# define PTRDIFF_MIN (-2147483647L-1)
# define PTRDIFF_MAX (2147483647L)
 
/* Limit of `size_t' type. */
# define SIZE_MAX (65535)
 
/* Signed. */
# define INT8_C(c) c
# define INT16_C(c) c
# define INT32_C(c) c ## L
 
/* Unsigned. */
# define UINT8_C(c) c ## U
# define UINT16_C(c) c ## U
# define UINT32_C(c) c ## UL
 
/* Maximal type. */
# define INTMAX_C(c) c ## L
# define UINTMAX_C(c) c ## UL
 
 
#endif /* stdint.h */
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/include/pblaze/pblazedevices.txt
0,0 → 1,53
#
# Specification of devices supported by the PIC16 target of the
# Small Devices C Compiler (SDCC).
#
# Lines starting with a hash '#' are ignored.
# A new device specification must begin with a 'name' command.
# Numbers can be given in any way acceptable for scanf's %d,
# i.e., octal (0[0-7]*), decimal ([1-9][0-9]*), or hexadecimal
# (0[xX][0-9a-fA-F]+).
# Strings must not be quoted and may not contain whitespace!
#
# Valid commands are:
# name <name>
# Begin specification of device type <name>, e.g. 18f6720.
# Aliases 'p<name>' and 'pic<name>' will be recognized as well.
# using <name>
# Import specification from the named entry, which must be defined
# earlier. Later commands overrule imported ones.
# ramsize <size>
# This device has <size> bytes of RAM.
# split <offset>
# Addresses below <offset> refer to bank 0, addresses above <offset>
# refer to SFRs in bank 15 for references via the access bank.
# configrange <first> <last>
# Configuration registers occupy addresses <first> to <last> (both
# included).
# configword <address> <mask> <value>
# The config word at address <address> only implements the bits
# indicated via <mask> (all others will be forced to 0 by the
# compiler).
# Unless overridden in C code, use the given default <value>.
# idlocrange <first> <last>
# ID locations occupy addresses <first> to <last> (both included).
# idword <address> <value>
# Unless overridden in C code, use the given default <value>.
#
 
name picoBlaze3
ramsize 64
split 0x40
configrange 0x300001 0x30000d
configword 0x300001 0x27 0xff
configword 0x300002 0x0f 0xff
configword 0x300003 0x0f 0xff
configword 0x300005 0x01 0xff
configword 0x300006 0x85 0xff
configword 0x300008 0x0f 0xff
configword 0x300009 0xc0 0xff
configword 0x30000a 0x0f 0xff
configword 0x30000b 0xe0 0xff
configword 0x30000c 0x0f 0xff
configword 0x30000d 0x40 0xff
idlocrange 0x200000 0x200007
/pbcc/pbccv2-bin-win32-cygwin-2011-10-24/device/README
0,0 → 1,5
sdcc/device
-----------
 
This directory contains all device only files i.e. a basic C library,
headers, and set of examples.

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.