/* * Copyright (C) 2012 Spreadtrum Communications Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * 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. */ #include "hardware.h" .macro addruart,rp, rv, tmp ldr \rp, =LL_DEBUG_UART_PHYS ldr \rv, =LL_DEBUG_UART_BASE .endm .macro senduart,rd,rx and \rd,\rd,#0xFF str \rd, [\rx, #0x00] .endm .macro waituart,rd,rx @ wait for TX_READY 1: ldr \rd, [\rx, #0x0C] mov \rd,\rd,lsr #8 and \rd,\rd,#0xFF teq \rd, #0x00 bne 1b .endm .macro busyuart,rd,rx @ wait for TX_READY 2: ldr \rd, [\rx, #0x0C] mov \rd,\rd,lsr #8 and \rd,\rd,#0xFF teq \rd, #0x00 bne 2b .endm