📄 sa1100sio.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/sa1100Sio.html - generated by refgen from sa1100Sio.c --> <title> sa1100Sio </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual : Libraries</i></a></p></blockquote><h1>sa1100Sio</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>sa1100Sio</strong> - Digital Semiconductor SA-1100 UART tty driver </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./sa1100Sio.html#sa1100DevInit">sa1100DevInit</a></i>( )</b> - initialise an SA1100 channel<br><b><i><a href="./sa1100Sio.html#sa1100Int">sa1100Int</a></i>( )</b> - handle an interrupt<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This is the device driver for the Digital Semiconductor SA-1100 UARTs.This chip contains 5 serial ports, but only ports 1 and 3 are usable asUARTs, the others support Universal Serial Bus (USB), SDLC, IrDAInfrared Communications Port (ICP) and Multimedia Communications Port(MCP)/Synchronous Serial Port (SSP).<p>The UARTs are identical in design. They contain a universalasynchronous receiver/transmitter, and a baud-rate generator, The UARTscontain an 8-entry, 8-bit FIFO to buffer outgoing data and a 12-entry11-bit FIFO to buffer incoming data. If a framing, overrun or parityerror occurs during reception, the appropriate error bits are stored inthe receive FIFO along with the received data. The only mode ofoperation supported is with the FIFOs enabled.<p>The UART design does not support modem control input or output signalse.g. DTR, RI, RTS, DCD, CTS and DSR.<p>An interrupt is generated when a framing, parity or receiver overrunerror is present within the bottom four entries of the receive FIFO,when the transmit FIFO is half-empty or receive FIFO is one- totwo-thirds full, when a begin and end of break is detected on thereceiver, and when the receive FIFO is partially full and the receiveris idle for three or more frame periods.<p>Only asynchronous serial operation is supported by the UARTs whichsupports 7 or 8 bit word lengths with or without parity and with one ortwo stop bits. The only serial word format supported by the driver is 8data bits, 1 stop bit, no parity, The default baud rate is determinedby the BSP by filling in the <b>SA1100_CHAN</b> structure before calling<b><i><a href="./sa1100Sio.html#sa1100DevInit">sa1100DevInit</a></i>( )</b>.<p>The UART supports baud rates from 56.24 to 230.4 kbps.<p></blockquote><h4>DATA STRUCTURES</h4><blockquote><p>An <b>SA1100_CHAN</b> data structure is used to describe each channel, thisstructure is described in <b>h/drv/sio/sa1100Sio.h</b>.<p></blockquote><h4>CALLBACKS</h4><blockquote><p>Servicing a "transmitter ready" interrupt involves making a callback toa higher level library in order to get a character to transmit. Bydefault, this driver installs dummy callback routines which do nothing.A higher layer library that wants to use this driver (e.g. <b><a href="./ttyDrv.html#top">ttyDrv</a></b>)will install its own callback routine using the <b>SIO_INSTALL_CALLBACK</b>ioctl command. Likewise, a receiver interrupt handler makes a callbackto pass the character to the higher layer library.<p></blockquote><h4>MODES</h4><blockquote><p>This driver supports both polled and interrupt modes.<p></blockquote><h4>USAGE</h4><blockquote><p>The driver is typically only called by the BSP. The directly callableroutines in this modules are <b><i><a href="./sa1100Sio.html#sa1100DevInit">sa1100DevInit</a></i>( )</b>, and <b><i><a href="./sa1100Sio.html#sa1100Int">sa1100Int</a></i>( )</b>.<p>The BSP's <b><i><a href="./sysLib.html#sysHwInit">sysHwInit</a></i>( )</b> routine typically calls <b><i><a href="./sysLib.html#sysSerialHwInit">sysSerialHwInit</a></i>( )</b>, whichinitialises the hardware-specific fields in the <b>SA1100_CHAN</b> structure(e.g. register I/O addresses etc) before calling <b><i><a href="./sa1100Sio.html#sa1100DevInit">sa1100DevInit</a></i>( )</b> whichresets the device and installs the driver function pointers. Afterthis the UART will be enabled and ready to generate interrupts, butthose interrupts will be disabled in the interrupt controller.<p>The following example shows the first parts of the initialisation:<p><pre>#include "drv/sio/sa1100Sio.h"LOCAL SA1100_CHAN sa1100Chan[N_SA1100_UART_CHANS];void sysSerialHwInit (void) { int i; for (i = 0; i < N_SA1100_UART_CHANNELS; i++) { sa1100Chan[i].regs = devParas[i].baseAdrs; sa1100Chan[i].baudRate = CONSOLE_BAUD_RATE; sa1100Chan[i].xtal = UART_XTAL_FREQ; sa1100Chan[i].level = devParas[i].intLevel; /* set up GPIO pins and UART pin reassignment */ ... /* * Initialise driver functions, getTxChar, putRcvChar * and channelMode and initialise UART */ sa1100DevInit(&sa1100Chan[i]); } }</pre>The BSP's <b><i><a href="../bsp/ads360/sysLib.html#sysHwInit2" >sysHwInit2</a></i>( )</b> routine typically calls <b><i><a href="./sysLib.html#sysSerialHwInit2">sysSerialHwInit2</a></i>( )</b>,which connects the chips interrupts via <b><i><a href="./intArchLib.html#intConnect">intConnect</a></i>( )</b> and enables thoseinterrupts, as shown in the following example:<p><pre>void sysSerialHwInit2 (void) { int i; for (i = 0; i < N_SA1100_UART_CHANNELS; i++) { /* connect and enable interrupts */ (void)intConnect (INUM_TO_IVEC(devParas[i].vector), sa1100Int, (int) &sa1100Chan[i]); intEnable (devParas[i].intLevel); } }</pre></blockquote><h4>BSP</h4><blockquote><p>By convention all the BSP-specific serial initialisation is performedin a file called <b>sysSerial.c</b>, which is #include'ed by <b>sysLib.c</b>.<b>sysSerial.c</b> implements at least four functions, <b><i><a href="./sysLib.html#sysSerialHwInit">sysSerialHwInit</a></i>( )</b><b><i><a href="./sysLib.html#sysSerialHwInit2">sysSerialHwInit2</a></i>( )</b>, <b><i><a href="./sysLib.html#sysSerialChanGet">sysSerialChanGet</a></i>( )</b>, and <b><i><a href="./sysLib.html#sysSerialReset">sysSerialReset</a></i>( )</b>. The firsttwo have been described above, the others work as follows:<p>sysSerialChanGet is called by usrRoot to get the serial channeldescriptor associated with a serial channel number. The routine takes asingle parameter which is a channel number ranging between zero and<b>NUM_TTY</b>. It returns a pointer to the corresponding channel descriptor,<b>SIO_CHAN</b> *, which is just the address of the <b>SA1100_CHAN</b> structure.<p>sysSerialReset is called from <b><i><a href="./sysLib.html#sysToMonitor">sysToMonitor</a></i>( )</b> and should reset theserial devices to an inactive state (prevent them from generating anyinterrupts).<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><p><b>drv/sio/sa1100Sio.h</b> <b>sioLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./sa1100Sio.html#top">sa1100Sio</a></b>, <i>Digital StrongARM SA-1100 Portable Communications Microcontroller, Data </i>Sheet, <i>Digital Semiconductor StrongARM SA-1100 Microprocessor Evaluation Platform, </i>User's Guide<hr><a name="sa1100DevInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>sa1100DevInit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>sa1100DevInit</i>( )</strong> - initialise an SA1100 channel</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void sa1100DevInit ( SA1100_CHAN * pChan /* ptr to SA1100_CHAN describing this channel */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initialises some <b>SIO_CHAN</b> function pointers and then resetsthe chip to a quiescent state. Before this routine is called, the BSPmust already have initialised all the device addresses, etc. in the<b>SA1100_CHAN</b> structure.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./sa1100Sio.html#top">sa1100Sio</a></b><hr><a name="sa1100Int"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>sa1100Int</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>sa1100Int</i>( )</strong> - handle an interrupt</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void sa1100Int ( SA1100_CHAN * pChan /* ptr to SA1100_CHAN describing this channel */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine handles interrupts from the UART.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./sa1100Sio.html#top">sa1100Sio</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -