02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

F<br />

Generic Drivers<br />

CONSOLE_TTY<br />

This macro defines the channel number of the console. In configAll.h, the<br />

default defined as 0. To override the default, first undefine then define<br />

CONSOLE_TTY in config.h.<br />

F.3 Multi-Mode Serial (SIO) Drivers<br />

The generic multi-mode serial drivers reside in the directory target/src/drv/sio.<br />

These drivers are called SIO drivers to distinguish them from the older serial<br />

drivers that only have a single interrupt mode of operation.<br />

SIO drivers provide an interface for setting hardware options, such as the number<br />

of stop bits, data bits, parity, and so on. In addition, these drivers provide an<br />

interface for polled communication that can provide external mode debugging<br />

(such as ROM-monitor style debugging) over a serial line. Currently only<br />

asynchronous-mode SIO drivers are supported.<br />

Every SIO device is controlled by an SIO_CHAN structure. This structure contains<br />

a single member, a pointer to an SIO_DRV_FUNCS structure. These structures are<br />

defined in target/h/sioLib.h as:<br />

typedef struct sio_chan /* a serial channel */<br />

{<br />

SIO_DRV_FUNCS * pDrvFuncs;<br />

/* device data */<br />

} SIO_CHAN;<br />

F<br />

typedef struct sio_drv_funcs SIO_DRV_FUNCS;<br />

struct sio_drv_funcs /* driver functions */<br />

{<br />

int (*ioctl)<br />

(<br />

SIO_CHAN * pSioChan,<br />

int<br />

cmd,<br />

void *<br />

arg<br />

);<br />

int (*txStartup)<br />

(<br />

SIO_CHAN *<br />

);<br />

pSioChan<br />

int (*callbackInstall)<br />

(<br />

249

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!