OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [hal/] [sh/] [hs7729pci/] [v2_0/] [src/] [ser16c550c.c] - Blame information for rev 249

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
//=============================================================================
2
//
3
//      ser16c550c.c
4
//
5
//      Simple driver for the 16c550c serial controllers on the HS7729PCI board
6
//
7
//=============================================================================
8
//####ECOSGPLCOPYRIGHTBEGIN####
9
// -------------------------------------------
10
// This file is part of eCos, the Embedded Configurable Operating System.
11
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
12
//
13
// eCos is free software; you can redistribute it and/or modify it under
14
// the terms of the GNU General Public License as published by the Free
15
// Software Foundation; either version 2 or (at your option) any later version.
16
//
17
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
18
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
19
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
20
// for more details.
21
//
22
// You should have received a copy of the GNU General Public License along
23
// with eCos; if not, write to the Free Software Foundation, Inc.,
24
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25
//
26
// As a special exception, if other files instantiate templates or use macros
27
// or inline functions from this file, or you compile this file and link it
28
// with other works to produce a work based on this file, this file does not
29
// by itself cause the resulting work to be covered by the GNU General Public
30
// License. However the source code for this file must still be made available
31
// in accordance with section (3) of the GNU General Public License.
32
//
33
// This exception does not invalidate any other reasons why a work based on
34
// this file might be covered by the GNU General Public License.
35
//
36
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
37
// at http://sources.redhat.com/ecos/ecos-license/
38
// -------------------------------------------
39
//####ECOSGPLCOPYRIGHTEND####
40
//=============================================================================
41
//#####DESCRIPTIONBEGIN####
42
//
43
// Author(s):   dmoseley
44
// Contributors:dmoseley, jskov
45
// Date:        2001-03-20
46
// Description: Simple driver for the 16c550c serial controller
47
//
48
//####DESCRIPTIONEND####
49
//
50
//=============================================================================
51
 
52
#include <pkgconf/hal.h>
53
#include <pkgconf/system.h>
54
#include CYGBLD_HAL_PLATFORM_H
55
 
56
#include <cyg/hal/hal_arch.h>           // SAVE/RESTORE GP macros
57
#include <cyg/hal/hal_io.h>             // IO macros
58
#include <cyg/hal/hal_if.h>             // interface API
59
#include <cyg/hal/hal_intr.h>           // HAL_ENABLE/MASK/UNMASK_INTERRUPTS
60
#include <cyg/hal/hal_misc.h>           // Helper functions
61
#include <cyg/hal/drv_api.h>            // CYG_ISR_HANDLED
62
 
63
//-----------------------------------------------------------------------------
64
// Define the serial registers. The Malta board is equipped with a 16550C
65
// serial chip.
66
#define HS7729PCI_SER_CLOCK           1846200
67
#define HS7729PCI_SER_16550_BASE_A    0xa80007f0
68
#define HS7729PCI_SER_16550_BASE_B    0xa80005f0
69
#define SER_16550_RBR 0x00   // receiver buffer register, read, dlab = 0
70
#define SER_16550_THR 0x00   // transmitter holding register, write, dlab = 0
71
#define SER_16550_DLL 0x00   // divisor latch (LS), read/write, dlab = 1
72
#define SER_16550_IER 0x02   // interrupt enable register, read/write, dlab = 0
73
#define SER_16550_DLM 0x02   // divisor latch (MS), read/write, dlab = 1
74
#define SER_16550_IIR 0x04   // interrupt identification reg, read, dlab = 0
75
#define SER_16550_FCR 0x04   // fifo control register, write, dlab = 0
76
#define SER_16550_AFR 0x04   // alternate function reg, read/write, dlab = 1
77
#define SER_16550_LCR 0x06   // line control register, read/write
78
#define SER_16550_MCR 0x08   // modem control register, read/write
79
#define SER_16550_LSR 0x0a   // line status register, read
80
#define SER_16550_MSR 0x0c   // modem status register, read
81
#define SER_16550_SCR 0x0e   // scratch pad register
82
 
83
// The interrupt enable register bits.
84
#define SIO_IER_ERDAI   0x01            // enable received data available irq
85
#define SIO_IER_ETHREI  0x02            // enable THR empty interrupt
86
#define SIO_IER_ELSI    0x04            // enable receiver line status irq
87
#define SIO_IER_EMSI    0x08            // enable modem status interrupt
88
 
89
// The interrupt identification register bits.
90
#define SIO_IIR_IP      0x01            // 0 if interrupt pending
91
#define SIO_IIR_ID_MASK 0x0e            // mask for interrupt ID bits
92
 
93
// The line status register bits.
94
#define SIO_LSR_DR      0x01            // data ready
95
#define SIO_LSR_OE      0x02            // overrun error
96
#define SIO_LSR_PE      0x04            // parity error
97
#define SIO_LSR_FE      0x08            // framing error
98
#define SIO_LSR_BI      0x10            // break interrupt
99
#define SIO_LSR_THRE    0x20            // transmitter holding register empty
100
#define SIO_LSR_TEMT    0x40            // transmitter register empty
101
#define SIO_LSR_ERR     0x80            // any error condition
102
 
103
// The modem status register bits.
104
#define SIO_MSR_DCTS  0x01              // delta clear to send
105
#define SIO_MSR_DDSR  0x02              // delta data set ready
106
#define SIO_MSR_TERI  0x04              // trailing edge ring indicator
107
#define SIO_MSR_DDCD  0x08              // delta data carrier detect
108
#define SIO_MSR_CTS   0x10              // clear to send
109
#define SIO_MSR_DSR   0x20              // data set ready
110
#define SIO_MSR_RI    0x40              // ring indicator
111
#define SIO_MSR_DCD   0x80              // data carrier detect
112
 
113
// The line control register bits.
114
#define SIO_LCR_WLS0   0x01             // word length select bit 0
115
#define SIO_LCR_WLS1   0x02             // word length select bit 1
116
#define SIO_LCR_STB    0x04             // number of stop bits
117
#define SIO_LCR_PEN    0x08             // parity enable
118
#define SIO_LCR_EPS    0x10             // even parity select
119
#define SIO_LCR_SP     0x20             // stick parity
120
#define SIO_LCR_SB     0x40             // set break
121
#define SIO_LCR_DLAB   0x80             // divisor latch access bit
122
 
123
// The FIFO control register
124
#define SIO_FCR_FCR0   0x01             // enable xmit and rcvr fifos
125
#define SIO_FCR_FCR1   0x02             // clear RCVR FIFO
126
#define SIO_FCR_FCR2   0x04             // clear XMIT FIFO
127
 
128
/////////////////////////////////////////
129
// Interrupt Enable Register
130
#define IER_RCV 0x01
131
#define IER_XMT 0x02
132
#define IER_LS  0x04
133
#define IER_MS  0x08
134
 
135
// Line Control Register
136
#define LCR_WL5 0x00    // Word length
137
#define LCR_WL6 0x01
138
#define LCR_WL7 0x02
139
#define LCR_WL8 0x03
140
#define LCR_SB1 0x00    // Number of stop bits
141
#define LCR_SB1_5 0x04  // 1.5 -> only valid with 5 bit words
142
#define LCR_SB2 0x04
143
#define LCR_PN  0x00    // Parity mode - none
144
#define LCR_PE  0x0C    // Parity mode - even
145
#define LCR_PO  0x08    // Parity mode - odd
146
#define LCR_PM  0x28    // Forced "mark" parity
147
#define LCR_PS  0x38    // Forced "space" parity
148
#define LCR_DL  0x80    // Enable baud rate latch
149
 
150
// Line Status Register
151
#define LSR_RSR 0x01
152
#define LSR_THE 0x20
153
 
154
// Modem Control Register
155
#define MCR_DTR 0x01
156
#define MCR_RTS 0x02
157
#define MCR_INT 0x08   // Enable interrupts
158
#define MCR_AFE 0x20
159
 
160
// Interrupt status register
161
#define ISR_None             0x01
162
#define ISR_Rx_Line_Status   0x06
163
#define ISR_Rx_Avail         0x04
164
#define ISR_Rx_Char_Timeout  0x0C
165
#define ISR_Tx_Empty         0x02
166
#define IRS_Modem_Status     0x00
167
 
168
// FIFO control register
169
#define FCR_ENABLE     0x01
170
#define FCR_CLEAR_RCVR 0x02
171
#define FCR_CLEAR_XMIT 0x04
172
 
173
#define CYG_DEV_SERIAL_BAUD_DIVISOR (HS7729PCI_SER_CLOCK/16/CYGNUM_HAL_VIRTUAL_VECTOR_CHANNELS_DEFAULT_BAUD)
174
 
175
//-----------------------------------------------------------------------------
176
 
177
#define UART_READ_UINT8(_a_, _d_)               \
178
    CYG_MACRO_START                             \
179
    cyg_uint16 t;                               \
180
    HAL_READ_UINT16((_a_), t);                  \
181
    (_d_) = (t >> 8) & 0xff;                    \
182
    CYG_MACRO_END
183
 
184
#define UART_WRITE_UINT8(_a_, _d_)              \
185
    CYG_MACRO_START                             \
186
    HAL_WRITE_UINT16((_a_), (_d_)<<8);          \
187
    CYG_MACRO_END
188
 
189
//-----------------------------------------------------------------------------
190
typedef struct {
191
    cyg_uint8* base;
192
    cyg_int32 msec_timeout;
193
    int isr_vector;
194
} channel_data_t;
195
 
196
static channel_data_t channels[2] = {
197
    { (cyg_uint8*)HS7729PCI_SER_16550_BASE_A, 1000, CYGNUM_HAL_INTERRUPT_UIO_IRQ3 },
198
    { (cyg_uint8*)HS7729PCI_SER_16550_BASE_B, 1000, CYGNUM_HAL_INTERRUPT_UIO_IRQ4 }
199
};
200
 
201
//-----------------------------------------------------------------------------
202
// Set the baud rate
203
 
204
static void
205
cyg_hal_plf_serial_set_baud(cyg_uint8* port, cyg_uint16 baud_divisor)
206
{
207
    cyg_uint8 _lcr;
208
 
209
    UART_READ_UINT8(port+SER_16550_LCR, _lcr);
210
    _lcr |= LCR_DL;
211
    UART_WRITE_UINT8(port+SER_16550_LCR, _lcr);
212
 
213
    UART_WRITE_UINT8(port+SER_16550_DLM, baud_divisor >> 8);
214
    UART_WRITE_UINT8(port+SER_16550_DLL, baud_divisor & 0xff);
215
 
216
    _lcr &= ~LCR_DL;
217
    UART_WRITE_UINT8(port+SER_16550_LCR, _lcr);
218
}
219
 
220
//-----------------------------------------------------------------------------
221
// The minimal init, get and put functions. All by polling.
222
 
223
void
224
cyg_hal_plf_serial_init_channel(void* __ch_data)
225
{
226
    cyg_uint8* port;
227
    cyg_uint8 _lcr;
228
 
229
    // Some of the diagnostic print code calls through here with no idea what the ch_data is.
230
    // Go ahead and assume it is channels[0].
231
    if (__ch_data == 0)
232
      __ch_data = (void*)&channels[0];
233
 
234
    port = ((channel_data_t*)__ch_data)->base;
235
 
236
    // Disable port interrupts while changing hardware
237
    UART_WRITE_UINT8(port+SER_16550_IER, 0);
238
 
239
    // Set databits, stopbits and parity.
240
    _lcr = LCR_WL8 | LCR_SB1 | LCR_PN;
241
    UART_WRITE_UINT8(port+SER_16550_LCR, _lcr);
242
 
243
    // Set baud rate.
244
    cyg_hal_plf_serial_set_baud(port, CYG_DEV_SERIAL_BAUD_DIVISOR);
245
 
246
    // Enable and clear FIFO
247
    UART_WRITE_UINT8(port+SER_16550_FCR, (FCR_ENABLE | FCR_CLEAR_RCVR | FCR_CLEAR_XMIT));
248
 
249
    // enable RTS to keep host side happy. Also allow interrupts
250
    UART_WRITE_UINT8( port+SER_16550_MCR, MCR_DTR | MCR_RTS | MCR_INT);
251
 
252
    // Don't allow interrupts.
253
    UART_WRITE_UINT8(port+SER_16550_IER, 0);
254
}
255
 
256
void
257
cyg_hal_plf_serial_putc(void* __ch_data, cyg_uint8 __ch)
258
{
259
    cyg_uint8* port;
260
    cyg_uint8 _lsr;
261
 
262
    // Some of the diagnostic print code calls through here with no idea what the ch_data is.
263
    // Go ahead and assume it is channels[0].
264
    if (__ch_data == 0)
265
      __ch_data = (void*)&channels[0];
266
 
267
    port = ((channel_data_t*)__ch_data)->base;
268
 
269
    CYGARC_HAL_SAVE_GP();
270
 
271
    do {
272
        UART_READ_UINT8(port+SER_16550_LSR, _lsr);
273
    } while ((_lsr & SIO_LSR_THRE) == 0);
274
 
275
    // Now, the transmit buffer is empty
276
    UART_WRITE_UINT8(port+SER_16550_THR, __ch);
277
 
278
    // Hang around until the character has been safely sent.
279
    do {
280
        UART_READ_UINT8(port+SER_16550_LSR, _lsr);
281
    } while ((_lsr & SIO_LSR_THRE) == 0);
282
 
283
    CYGARC_HAL_RESTORE_GP();
284
}
285
 
286
static cyg_bool
287
cyg_hal_plf_serial_getc_nonblock(void* __ch_data, cyg_uint8* ch)
288
{
289
    cyg_uint8* port;
290
    cyg_uint8 _lsr;
291
 
292
    // Some of the diagnostic print code calls through here with no idea what the ch_data is.
293
    // Go ahead and assume it is channels[0].
294
    if (__ch_data == 0)
295
      __ch_data = (void*)&channels[0];
296
 
297
    port = ((channel_data_t*)__ch_data)->base;
298
 
299
    UART_READ_UINT8(port+SER_16550_LSR, _lsr);
300
    if ((_lsr & SIO_LSR_DR) == 0)
301
        return false;
302
 
303
    UART_READ_UINT8(port+SER_16550_RBR, *ch);
304
 
305
    return true;
306
}
307
 
308
cyg_uint8
309
cyg_hal_plf_serial_getc(void* __ch_data)
310
{
311
    cyg_uint8 ch;
312
    CYGARC_HAL_SAVE_GP();
313
 
314
    // Some of the diagnostic print code calls through here with no idea what the ch_data is.
315
    // Go ahead and assume it is channels[0].
316
    if (__ch_data == 0)
317
      __ch_data = (void*)&channels[0];
318
 
319
    while(!cyg_hal_plf_serial_getc_nonblock(__ch_data, &ch));
320
 
321
    CYGARC_HAL_RESTORE_GP();
322
    return ch;
323
}
324
 
325
static void
326
cyg_hal_plf_serial_write(void* __ch_data, const cyg_uint8* __buf,
327
                         cyg_uint32 __len)
328
{
329
    CYGARC_HAL_SAVE_GP();
330
 
331
    // Some of the diagnostic print code calls through here with no idea what the ch_data is.
332
    // Go ahead and assume it is channels[0].
333
    if (__ch_data == 0)
334
      __ch_data = (void*)&channels[0];
335
 
336
    while(__len-- > 0)
337
        cyg_hal_plf_serial_putc(__ch_data, *__buf++);
338
 
339
    CYGARC_HAL_RESTORE_GP();
340
}
341
 
342
static void
343
cyg_hal_plf_serial_read(void* __ch_data, cyg_uint8* __buf, cyg_uint32 __len)
344
{
345
    CYGARC_HAL_SAVE_GP();
346
 
347
    // Some of the diagnostic print code calls through here with no idea what the ch_data is.
348
    // Go ahead and assume it is channels[0].
349
    if (__ch_data == 0)
350
      __ch_data = (void*)&channels[0];
351
 
352
    while(__len-- > 0)
353
        *__buf++ = cyg_hal_plf_serial_getc(__ch_data);
354
 
355
    CYGARC_HAL_RESTORE_GP();
356
}
357
 
358
 
359
cyg_bool
360
cyg_hal_plf_serial_getc_timeout(void* __ch_data, cyg_uint8* ch)
361
{
362
    int delay_count;
363
    channel_data_t* chan;
364
    cyg_bool res;
365
    CYGARC_HAL_SAVE_GP();
366
 
367
    // Some of the diagnostic print code calls through here with no idea what the ch_data is.
368
    // Go ahead and assume it is channels[0].
369
    if (__ch_data == 0)
370
      __ch_data = (void*)&channels[0];
371
 
372
    chan = (channel_data_t*)__ch_data;
373
 
374
    delay_count = chan->msec_timeout * 10; // delay in .1 ms steps
375
 
376
    for(;;) {
377
        res = cyg_hal_plf_serial_getc_nonblock(__ch_data, ch);
378
        if (res || 0 == delay_count--)
379
            break;
380
        CYGACC_CALL_IF_DELAY_US(100);
381
    }
382
 
383
    CYGARC_HAL_RESTORE_GP();
384
    return res;
385
}
386
 
387
static int
388
cyg_hal_plf_serial_control(void *__ch_data, __comm_control_cmd_t __func, ...)
389
{
390
    static int irq_state = 0;
391
    channel_data_t* chan;
392
    cyg_uint8 ier;
393
    int ret = 0;
394
    CYGARC_HAL_SAVE_GP();
395
 
396
    // Some of the diagnostic print code calls through here with no idea what the ch_data is.
397
    // Go ahead and assume it is channels[0].
398
    if (__ch_data == 0)
399
      __ch_data = (void*)&channels[0];
400
 
401
    chan = (channel_data_t*)__ch_data;
402
 
403
    switch (__func) {
404
    case __COMMCTL_IRQ_ENABLE:
405
        irq_state = 1;
406
 
407
        UART_READ_UINT8(chan->base + SER_16550_IER, ier);
408
        ier |= SIO_IER_ERDAI;
409
        UART_WRITE_UINT8(chan->base + SER_16550_IER, ier);
410
 
411
        HAL_INTERRUPT_SET_LEVEL(chan->isr_vector, 1);
412
        HAL_INTERRUPT_UNMASK(chan->isr_vector);
413
        break;
414
    case __COMMCTL_IRQ_DISABLE:
415
        ret = irq_state;
416
        irq_state = 0;
417
 
418
        UART_READ_UINT8(chan->base + SER_16550_IER, ier);
419
        ier &= ~SIO_IER_ERDAI;
420
        UART_WRITE_UINT8(chan->base + SER_16550_IER, ier);
421
 
422
        HAL_INTERRUPT_MASK(chan->isr_vector);
423
        break;
424
    case __COMMCTL_DBG_ISR_VECTOR:
425
        ret = chan->isr_vector;
426
        break;
427
    case __COMMCTL_SET_TIMEOUT:
428
    {
429
        va_list ap;
430
 
431
        va_start(ap, __func);
432
 
433
        ret = chan->msec_timeout;
434
        chan->msec_timeout = va_arg(ap, cyg_uint32);
435
 
436
        va_end(ap);
437
    }
438
    break;
439
    case __COMMCTL_SETBAUD:
440
    {
441
        cyg_uint32 baud_rate;
442
        cyg_uint16 baud_divisor;
443
        cyg_uint8* port = chan->base;
444
        va_list ap;
445
 
446
        va_start(ap, __func);
447
        baud_rate = va_arg(ap, cyg_uint32);
448
        va_end(ap);
449
 
450
        baud_divisor = (HS7729PCI_SER_CLOCK / 16 / baud_rate);
451
 
452
        // Disable port interrupts while changing hardware
453
        UART_READ_UINT8(port+SER_16550_IER, ier);
454
        UART_WRITE_UINT8(port+SER_16550_IER, 0);
455
 
456
        // Set baud rate.
457
        cyg_hal_plf_serial_set_baud(port, baud_divisor);
458
 
459
        // Reenable interrupts if necessary
460
        UART_WRITE_UINT8(port+SER_16550_IER, ier);
461
    }
462
    break;
463
 
464
    case __COMMCTL_GETBAUD:
465
        break;
466
    default:
467
        break;
468
    }
469
    CYGARC_HAL_RESTORE_GP();
470
    return ret;
471
}
472
 
473
static int
474
cyg_hal_plf_serial_isr(void *__ch_data, int* __ctrlc,
475
                       CYG_ADDRWORD __vector, CYG_ADDRWORD __data)
476
{
477
    int res = 0;
478
    cyg_uint8 _iir, c;
479
    channel_data_t* chan;
480
    CYGARC_HAL_SAVE_GP();
481
 
482
    // Some of the diagnostic print code calls through here with no idea what the ch_data is.
483
    // Go ahead and assume it is channels[0].
484
    if (__ch_data == 0)
485
      __ch_data = (void*)&channels[0];
486
 
487
    chan = (channel_data_t*)__ch_data;
488
 
489
    HAL_INTERRUPT_ACKNOWLEDGE(chan->isr_vector);
490
 
491
    UART_READ_UINT8(chan->base + SER_16550_IIR, _iir);
492
    _iir &= SIO_IIR_ID_MASK;
493
 
494
    *__ctrlc = 0;
495
    if ((_iir == ISR_Rx_Avail) || (_iir == ISR_Rx_Char_Timeout)) {
496
 
497
        UART_READ_UINT8(chan->base + SER_16550_RBR, c);
498
 
499
        if( cyg_hal_is_break( &c , 1 ) )
500
            *__ctrlc = 1;
501
 
502
        res = CYG_ISR_HANDLED;
503
    }
504
 
505
    CYGARC_HAL_RESTORE_GP();
506
    return res;
507
}
508
 
509
void
510
cyg_hal_plf_serial_init(void)
511
{
512
    hal_virtual_comm_table_t* comm;
513
    int cur = CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT);
514
 
515
    // Disable interrupts.
516
    HAL_INTERRUPT_MASK(channels[0].isr_vector);
517
    HAL_INTERRUPT_MASK(channels[1].isr_vector);
518
 
519
    // Init channels
520
    cyg_hal_plf_serial_init_channel((void*)&channels[0]);
521
    cyg_hal_plf_serial_init_channel((void*)&channels[1]);
522
 
523
    // Setup procs in the vector table
524
 
525
    // Set channel 0
526
    CYGACC_CALL_IF_SET_CONSOLE_COMM(0);
527
    comm = CYGACC_CALL_IF_CONSOLE_PROCS();
528
    CYGACC_COMM_IF_CH_DATA_SET(*comm, &channels[0]);
529
    CYGACC_COMM_IF_WRITE_SET(*comm, cyg_hal_plf_serial_write);
530
    CYGACC_COMM_IF_READ_SET(*comm, cyg_hal_plf_serial_read);
531
    CYGACC_COMM_IF_PUTC_SET(*comm, cyg_hal_plf_serial_putc);
532
    CYGACC_COMM_IF_GETC_SET(*comm, cyg_hal_plf_serial_getc);
533
    CYGACC_COMM_IF_CONTROL_SET(*comm, cyg_hal_plf_serial_control);
534
    CYGACC_COMM_IF_DBG_ISR_SET(*comm, cyg_hal_plf_serial_isr);
535
    CYGACC_COMM_IF_GETC_TIMEOUT_SET(*comm, cyg_hal_plf_serial_getc_timeout);
536
 
537
    // Set channel 1
538
    CYGACC_CALL_IF_SET_CONSOLE_COMM(1);
539
    comm = CYGACC_CALL_IF_CONSOLE_PROCS();
540
    CYGACC_COMM_IF_CH_DATA_SET(*comm, &channels[1]);
541
    CYGACC_COMM_IF_WRITE_SET(*comm, cyg_hal_plf_serial_write);
542
    CYGACC_COMM_IF_READ_SET(*comm, cyg_hal_plf_serial_read);
543
    CYGACC_COMM_IF_PUTC_SET(*comm, cyg_hal_plf_serial_putc);
544
    CYGACC_COMM_IF_GETC_SET(*comm, cyg_hal_plf_serial_getc);
545
    CYGACC_COMM_IF_CONTROL_SET(*comm, cyg_hal_plf_serial_control);
546
    CYGACC_COMM_IF_DBG_ISR_SET(*comm, cyg_hal_plf_serial_isr);
547
    CYGACC_COMM_IF_GETC_TIMEOUT_SET(*comm, cyg_hal_plf_serial_getc_timeout);
548
 
549
    // Restore original console
550
    CYGACC_CALL_IF_SET_CONSOLE_COMM(cur);
551
}
552
 
553
//-----------------------------------------------------------------------------
554
// end of ser16c550c.c

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.