URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [libgloss/] [m68hc11/] [sci-inout.S] - Rev 816
Compare with Previous | Blame | View Log
/* M68HC11/M68HC12 serial line operations* Copyright (C) 1999, 2001, 2003, 2004 Stephane Carrez (stcarrez@nerim.fr)** The authors hereby grant permission to use, copy, modify, distribute,* and license this software and its documentation for any purpose, provided* that existing copyright notices are retained in all copies and that this* notice is included verbatim in any distributions. No written agreement,* license, or royalty fee is required for any of the authorized uses.* Modifications to this software may be copyrighted by their authors* and need not follow the licensing terms described here, provided that* the new terms are clearly indicated on the first page of each file where* they apply.*/#ifdef __HAVE_SHORT_INT__.mode mshort#else.mode mlong#endif#if defined(__USE_RTC__).macro ret#if defined(mc68hc12)rtc#elsejmp __return_32#endif.endm#else.macro retrts.endm#endif#ifdef mc68hc12SC0CR1 = 0xC2SC0CR2 = 0xC3SC0SR1 = 0xC4SC0DRL = 0xC7SC0BD = 0xC0.sect .data.globl _m68hc12_ports_m68hc12_ports: .word 0.sect .text.globl outbyte;;;;;; int outbyte(char c);;;;;;; B : Character to send;;;outbyte:bsr _sci_initL1:ldaa SC0SR1,xbge L1stab SC0DRL,xldab SC0CR2,xorab #0x8stab SC0CR2,xret.sect .text.globl inbyte;;;;;; char inbyte(void);;;;inbyte:bsr _sci_initldaa SC0SR1,xbita #0x20beq inbyteldab SC0CR2,xret.globl _sci_init.sect .text_sci_init:ldx _m68hc12_portsbeq do_initdexrtsdo_init:ldx #0x1stx _m68hc12_portsdexldd #26std SC0BD,xldaa #0staa SC0CR1,xldaa #0xCstaa SC0CR2,xrts#elseBAUD = 0x2bSCCR1= 0x2cSCCR2= 0x2dSCSR = 0x2eSCDR = 0x2f.sect .data.globl _m68hc11_ports_m68hc11_ports: .word 0.sect .text.globl outbyte;;;;;; int outbyte(char c);;;;;;; B : Character to send;;;outbyte:bsr _sci_initL1:ldaa SCSR,xbge L1stab SCDR,xldab SCCR2,xorab #0x8stab SCCR2,xret.sect .text.globl inbyte;;;;;; char inbyte(void);;;;inbyte:bsr _sci_initldaa SCSR,xbita #0x20beq inbyteldab SCDR,xret.globl _sci_init.sect .text_sci_init:ldx _m68hc11_portsbeq do_initrtsdo_init:ldx #0x1000stx _m68hc11_portsldaa #0x30staa BAUD,xclrastaa SCCR1,xldaa #0xCstaa SCCR2,xrts#endif
