This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: BREAK handling in serial driver (SA1110)
- To: Andreas Bürgel <ab at genologic dot de>
- Subject: Re: [ECOS] BREAK handling in serial driver (SA1110)
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Tue, 16 Oct 2001 14:56:31 +0100
- Cc: ecos-discuss at sources dot redhat dot com
- Organization: Red Hat UK Ltd.
- References: <3BCC2DB7.7B9A58CF@genologic.de>
Andreas Bürgel wrote:
>
> Hi folks,
>
> I'm wondering how to get the line status information of the serial
> driver to application level. Our application needs to know when a BREAK
> signal arrived, so where is the magic function that delivers a
> cyg_serial_line_status_t struct?
The sa11x0 driver doesn't support any of that stuff. It would need to be
added. Use the driver in devs/serial/generic/16x5x as a guide. It includes:
#ifdef CYGOPT_IO_SERIAL_SUPPORT_LINE_STATUS
case ISR_LS:
{
cyg_serial_line_status_t stat;
cyg_uint8 _lsr;
HAL_READ_UINT8(base+REG_lsr, _lsr);
// this might look expensive, but it is rarely the case
that
// more than one of these is set
stat.value = 1;
if ( _lsr & LSR_OE ) {
stat.which = CYGNUM_SERIAL_STATUS_OVERRUNERR;
(chan->callbacks->indicate_status)(chan, &stat );
}
if ( _lsr & LSR_PE ) {
stat.which = CYGNUM_SERIAL_STATUS_PARITYERR;
(chan->callbacks->indicate_status)(chan, &stat );
}
if ( _lsr & LSR_FE ) {
stat.which = CYGNUM_SERIAL_STATUS_FRAMEERR;
(chan->callbacks->indicate_status)(chan, &stat );
}
if ( _lsr & LSR_BI ) {
stat.which = CYGNUM_SERIAL_STATUS_BREAK;
(chan->callbacks->indicate_status)(chan, &stat );
}
and indicate_status calls into serial_indicate_status in
io/serial/current/src/common/serial.c
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine