1 /* Default putchar() and getchar() to the serial port
3 Written By - Jesus Calvino-Fraga (October/2006)
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 __sfr __at (0x87) SIO_PCON;
24 __sfr __at (0x89) SIO_TMOD;
25 __sfr __at (0x8D) SIO_TH1;
26 __sfr __at (0x8B) SIO_TL1;
27 __sfr __at (0x98) SIO_SCON;
28 __sfr __at (0x99) SIO_SBUF;
29 __sbit __at (0x8E) SIO_TR1;
32 __sbit __at (0x98) SIO_RI;
33 __sbit __at (0x99) SIO_TI;
34 __sbit __at (0x9A) SIO_RB8;
35 __sbit __at (0x9B) SIO_TB8;
36 __sbit __at (0x9C) SIO_REN;
37 __sbit __at (0x9D) SIO_SM2;
38 __sbit __at (0x9E) SIO_SM1;
39 __sbit __at (0x9F) SIO_SM0;
41 void inituart (unsigned char t1_reload)
44 SIO_TMOD=(SIO_TMOD&0x0f)|0x20;
46 SIO_TH1=SIO_TL1=t1_reload;
53 if((!SIO_SM0)&&(!SIO_SM1)) inituart(0xff);
69 if((!SIO_SM0)&&(!SIO_SM1)) inituart(0xff);