Вы находитесь на странице: 1из 2

Processor UART

The following sections provide an overview of the main components and features of the
Universal Asynchronous Receiver/Transmitter (UART) peripheral. It is an alternative to the FIF!
stores upto "# $ytes including % aditional $its of error status per $yte for thr receiver FIF. The
UART performs serial&to&parallel conversions on data received from a peripheral
device and parallel&to&serial conversion on data received from the '(U.
A )aud Rate represents the num$er of $its that are actually $eing sent over the media! not
the amount of data that is actually moved from one *T+(Receiver) device to the other. The )aud
count includes the overhead $its ,tart! ,top and (arity that are generated $y the sending UART and
removed $y the receiving UART. This means that seven&$it words of data actually ta-e ". $its to $e
completely transmitted.
TI /A( %0%. to UART Rs 1%1 connection are e2plained in this chaptor.
It re3uirs following headdrd files
". ul-4$ase4types.h
1. ul-4proc4uart.h
%. ul-4io.h
5. ul-.error.h
$ase address .256.1....
1. ulk_proc_uart_init
Syntax : int ul-4proc4uart4init(uint7 port! int $audrate)
initialia8es the the UART
Input Argument : 1. uint7 port! 1. int $audrate
". port num$er to initiali8e the UART. +2 9 "! 1! %! 5 are accepting
1. $aud rate 6#..! "61..! %75..! 0:#..! ""01.. only
Return value: inteager type
. & ,uccess
" & Failure
2. ulk_proc_uart_getc
Syntax : uint7 ul-4proc4uart4getc(uint7 port)
get a charactor from the UART! entered fron -ey$oard
Input Argument : uint7 port
Return alue : Always Return .
!. uint" ulk_proc_uart_putc
Syntax : uint7 ul-4proc4uart4putc(uint7 port! uint7 val)
(ut a character to the UART ta-en from the ;ey$oard
Input Arguments : uint7 port! uint7 val
1. port num$er to initiali8e the UART. +2 9 "! 1! %! 5 are accepting
1. inteager type data varia$le name
Return alue :
. < ,uccess
" < Failure
5. ulk_proc_uart_gets
Syntax : uint7 ul-4proc4uart4gets(uint7 port! uint7 =$uff4p)
reading a string from UART or reading a charactor repeadely using >ul-4proc4uart4getc?
function repeatedly.
Input Argument : uint7 port! uint7 =$uff4p
1. port num$er to initiali8e the UART. +2 9 "! 1! %! 5 are accepting
1. a piinter varia$le which accepts a string
Return alue : Always return .
0. ulk_proc_uart_puts
Syntax : uint7 ul-4proc4uart4puts(uint7 port! uint7 =$uff4p)
put a string to the UART or dumping a character $uffer using the >ul-4uart4putc? function
repeatedly.
Input Argument : uint7 port! uint7 =$uff4p
1. port num$er to initiali8e the UART. +2 9 "! 1! %! 5 are accepting
1. pointer that holds the string which is $eing transmitted.
Return alue :
. < ,U''+,,
" < FAI@UR+
#. _serial_set$rg
Syntax : int 4serial4set$rg (const int port! int $audrate! int val)
The purpose of this function is to re initiali8e the UART interface with different $aud rate.
Input Argument : const int port ! int $audrate ! int val
". port num$er
1. $aud rate same or different
%.
Return alue :
. & ,U''+,,
" & FAI@UR+

Вам также может понравиться