⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 debug-pxa250.c

📁 PXA250上的XBOOT
💻 C
字号:
/*  * $Id: debug-pxa250.c,v 1.2 2003/06/04 10:11:38 telka Exp $ * * Copyright (C) 2001, 2002 ETC s.r.o. * * 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 * of the License, 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, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * Written by Marcel Telka <marcel@telka.sk>, 2001, 2002. * */#include "board.h"#if CPU == PXA250#include <_windows.h>#include <nkintr.h>#include <pxa2x0/uart.h>#include <pxa2x0/gpio.h>#include "debug.h"#define	NONE	0#define	FFUART	1#define	BTUART	2#define	STUART	3/* select debug port */#define	DEBUG_PORT	BTUART/* Pointer to UART registers */#if DEBUG_PORT == FFUART#	define	UART_pointer	FFUART_pointer#endif#if DEBUG_PORT == BTUART#	define	UART_pointer	BTUART_pointer#endif#if DEBUG_PORT == STUART#	define	UART_pointer	STUART_pointer#endif/* wait for transmit all data in tx FIFO through debug serial port */voidOEMFlushDebugSerial( void ){#if DEBUG_PORT != NONE	/* TODO */#endif /* DEBUG_PORT != NONE */}voidOEMInitDebugSerial( void ){#if DEBUG_PORT != NONE#if DEBUG_PORT == FFUART	GPDR1 = GPIO1_GP39;	GAFR1_L = GAFR1_L_AF34( ALT_FN_1_IN ) | GAFR1_L_AF39( ALT_FN_2_OUT );#endif /* DEBUG_PORT == FFUART */#if DEBUG_PORT == BTUART	GPDR1 = GPIO1_GP43;	GAFR1_L = GAFR1_L_AF42( ALT_FN_1_IN ) | GAFR1_L_AF43( ALT_FN_2_OUT );#endif /* DEBUG_PORT == BTUART */#if DEBUG_PORT == STUART	GPDR1 = GPIO1_GP47;	GAFR1_L = GAFR1_L_AF46( ALT_FN_2_IN ) | GAFR1_L_AF47( ALT_FN_1_OUT );#endif /* DEBUG_PORT == STUART */	LCR = LCR_DLAB;	DLL = 0x08;	LCR = LCR_WLS(3);	IER = IER_UUE;	FCR = FCR_TRFIFOE;#endif /* DEBUG_PORT != NONE */}voidOEMDeinitDebugSerial( void ){#if (DEBUG_PORT != NONE)	/* TODO */#endif /* (DEBUG_PORT != NONE) */}voidOEMWriteDebugByte( BYTE ch ){#if (DEBUG_PORT != NONE)	while (!(LSR & LSR_TDRQ)) ;	THR = ch;#endif /* (DEBUG_PORT != NONE) */}intOEMReadDebugByte( void ){#if (DEBUG_PORT != NONE)	if (LSR & (LSR_FIFOE | LSR_BI | LSR_FE | LSR_PE | LSR_OE) )		return OEM_DEBUG_COM_ERROR;	if (LSR & LSR_DR)		return RBR;	return OEM_DEBUG_READ_NODATA;#else /* (DEBUG_PORT != NONE) */	return OEM_DEBUG_READ_NODATA;#endif /* (DEBUG_PORT != NONE) */}#endif /* CPU == PXA250 */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -