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

📄 uart_ext.c

📁 基于vxworks操作系统的电话语音平台系统
💻 C
字号:
/************************************************************************/
/*                                                              		*/
/*                                                              		*/
/* (C) Copyright Bangyan Information Technology Ltd, 2000/9.            */
/*  All right reserved                                          		*/
/*                                                              		*/
/* Author: Zhuguosheng 	                                  				*/
/*                                                              		*/
/* Description:                                                 		*/
/*     Driver Set - SCC UART initiating specific routines.            	*/
/*                                                              		*/
/* Routines                                                     		*/
/*                                                                      */
/************************************************************************/


#include "PUB\PUB_INCL.H"
#include "DRVS\DRV860\PUB\NETCOMM.H"       /* global defines */
#include "DRVS\DRV860\PUB\D860_PUB.H"
#include "DRVS\DRV860\PUB\MPC860.H"       /* IMMR definitions and declarations */
#include "DRVS\DRV860\PUB\MASKS860.h"      /* Global masks header file */
#include "DRVS\DRV860\UART\SCC_UART.H"

extern UC LedSwitchOnOrOff( UC action, UC led );

extern SI uart_tx(SI scc_num, VOID *buf, SI length);
extern VOID uart_interrupt(UI scc_num);


BOOL DrvUartInitiate( VOID )
{
	UART_SPECIFIC  uart_spec;

	scc_init( GLB_SCC_1, 16, 16 );

	uart_spec.max_frame_length 	= 256;
	uart_spec.parity			= PARITY_NO;
	uart_spec.data				= 0x08;
	uart_spec.stop				= 1;
	uart_spec.baud				= 1;

	uart_spec.number_of_cc		= 0;
	/*	uart_spec.cc[CC_MAX]		= ; */
	/*	No CC byte in my application.*/

	uart_init( GLB_SCC_1, (UART_SPECIFIC*)&uart_spec );

	scc_start(GLB_SCC_1);

	return TRUE;
}


BOOL DrvUartSendMsu(SI scc_num, VOID *buf, SI length)
{
	uart_tx(GLB_SCC_1, buf, length);
}

VOID DrvUartRecvMsu(VOID *buf, SI length)
{
	LedSwitchOnOrOff( 1, 3 );
}

VOID UartPollingEvtHdl(VOID)
{
	uart_interrupt(GLB_SCC_1);
}

⌨️ 快捷键说明

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