From f6e3ed2764a9ec525e3f0c2838740d036b6a270c Mon Sep 17 00:00:00 2001 From: tecodev Date: Thu, 7 Apr 2005 17:19:42 +0000 Subject: [PATCH] * device/include/pic16/usart.h: added compatibility defines for devices with more than one USART * device/include/pic16/pic18f[68][567]20.h: activated above defines git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3725 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 6 ++++++ device/include/pic16/pic18f6520.h | 3 +++ device/include/pic16/pic18f6620.h | 3 +++ device/include/pic16/pic18f6720.h | 3 +++ device/include/pic16/pic18f8520.h | 3 +++ device/include/pic16/pic18f8620.h | 3 +++ device/include/pic16/pic18f8720.h | 3 +++ device/include/pic16/usart.h | 19 +++++++++++++++++++ 8 files changed, 43 insertions(+) diff --git a/ChangeLog b/ChangeLog index 44212d0c..9cac5f0b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-04-07 Raphael Neider + + * device/include/pic16/usart.h: added compatibility defines for + devices with more than one USART + * device/include/pic16/pic18f[68][567]20.h: activated above defines + 2005-04-07 Maarten Brock * device/lib/Makefile.in: updated for port specific include diff --git a/device/include/pic16/pic18f6520.h b/device/include/pic16/pic18f6520.h index 7888498e..2d87a288 100644 --- a/device/include/pic16/pic18f6520.h +++ b/device/include/pic16/pic18f6520.h @@ -1391,4 +1391,7 @@ extern __sfr __at 0xfff TOSU; #define __IDLOC7 0x200007 +/* added for USART compatibility with smaller devices */ +#define __MULTIPLE_USARTS 1 + #endif diff --git a/device/include/pic16/pic18f6620.h b/device/include/pic16/pic18f6620.h index b5190021..8747f30f 100644 --- a/device/include/pic16/pic18f6620.h +++ b/device/include/pic16/pic18f6620.h @@ -1368,4 +1368,7 @@ extern __sfr __at 0xfff TOSU; #define __IDLOC7 0x200007 +/* added for USART compatibility with smaller devices */ +#define __MULTIPLE_USARTS 1 + #endif diff --git a/device/include/pic16/pic18f6720.h b/device/include/pic16/pic18f6720.h index 5a1fddc6..d8f24d61 100644 --- a/device/include/pic16/pic18f6720.h +++ b/device/include/pic16/pic18f6720.h @@ -1416,4 +1416,7 @@ extern __sfr __at 0xfff TOSU; #define __IDLOC7 0x200007 +/* added for USART compatibility with smaller devices */ +#define __MULTIPLE_USARTS 1 + #endif diff --git a/device/include/pic16/pic18f8520.h b/device/include/pic16/pic18f8520.h index ce5eaeb0..f1f02273 100644 --- a/device/include/pic16/pic18f8520.h +++ b/device/include/pic16/pic18f8520.h @@ -1493,4 +1493,7 @@ extern __sfr __at 0xfff TOSU; #define __IDLOC7 0x200007 +/* added for USART compatibility with smaller devices */ +#define __MULTIPLE_USARTS 1 + #endif diff --git a/device/include/pic16/pic18f8620.h b/device/include/pic16/pic18f8620.h index 7598db07..5da917c8 100644 --- a/device/include/pic16/pic18f8620.h +++ b/device/include/pic16/pic18f8620.h @@ -1491,4 +1491,7 @@ extern __sfr __at 0xfff TOSU; #define __IDLOC7 0x200007 +/* added for USART compatibility with smaller devices */ +#define __MULTIPLE_USARTS 1 + #endif diff --git a/device/include/pic16/pic18f8720.h b/device/include/pic16/pic18f8720.h index fc5e82f0..91cbf38e 100644 --- a/device/include/pic16/pic18f8720.h +++ b/device/include/pic16/pic18f8720.h @@ -1539,4 +1539,7 @@ extern __sfr __at 0xfff TOSU; #define __IDLOC7 0x200007 +/* added for USART compatibility with smaller devices */ +#define __MULTIPLE_USARTS 1 + #endif diff --git a/device/include/pic16/usart.h b/device/include/pic16/usart.h index 0b119f37..3c62927f 100644 --- a/device/include/pic16/usart.h +++ b/device/include/pic16/usart.h @@ -46,6 +46,25 @@ #define USART_SYNCH_MODE 0xff #define USART_ASYNCH_MODE 0xfe +#if defined(__MULTIPLE_USARTS) && __MULTIPLE_USARTS > 0 +/* added for USART compatibility with smaller devices */ +#define RCREG RCREG1 +#define TXREG TXREG1 +#define RCSTA RCSTA1 +#define TXSTA TXSTA1 +#define RCSTAbits RCSTA1bits +#define TXSTAbits TXSTA1bits +#define SPBRG SPBRG1 + +/* and now for use in inline assembly */ +#define _RCREG _RCREG1 +#define _TXREG _TXREG1 +#define _RCSTA _RCSTA1 +#define _TXSTA _TXSTA1 +#define _RCSTAbits _RCSTA1bits +#define _TXSTAbits _TXSTA1bits +#define _SPBRG _SPBRG1 +#endif /* status bits */ union USART -- 2.39.5