source: rtems/c/src/lib/libcpu/m68k/mcf5206/include/mcfuart.h @ 57e9580f

4.104.114.84.95
Last change on this file since 57e9580f was 57e9580f, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 4, 2003 at 6:53:02 PM

2003-09-04 Joel Sherrill <joel@…>

  • clock/ckinit.c, console/mcfuart.c, include/mcf5206e.h, include/mcfmbus.h, include/mcfuart.h, mbus/mcfmbus.c, timer/timer.c, timer/timerisr.S: URL for license changed.
  • Property mode set to 100644
File size: 3.2 KB
Line 
1/*
2 * Generic UART Serial driver for Motorola Coldfire processors definitions
3 *
4 * Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russian Fed.
5 * Author: Victor V. Vengerov <vvv@oktet.ru>
6 *
7 * The license and distribution terms for this file may be
8 * found in the file LICENSE in this distribution or at
9 *
10 * http://www.rtems.com/license/LICENSE.
11 *
12 * @(#) $Id$
13 *
14 */
15
16#ifndef __MCFUART_H__
17#define __MCFUART_H__
18
19#include <termios.h>
20#include "bsp.h"
21#include "mcf5206e.h"
22
23/*
24 * The MCF5206e System Clock Frequency; 54MHz default
25 */
26#ifndef SYSTEM_CLOCK_FREQUENCY
27#define SYSTEM_CLOCK_FREQUENCY BSP_SYSTEM_FREQUENCY
28#endif
29
30/*
31 * The following structure is a descriptor of single UART channel.
32 * It contains the initialization information about channel and
33 * current operating values
34 */
35typedef struct mcfuart {
36   rtems_unsigned32          chn;      /* UART channel number */
37   rtems_unsigned8           intvec;   /* UART interrupt vector number, or
38                                          0 if polled I/O */
39   void                     *tty;      /* termios channel descriptor */
40   
41   volatile const char      *tx_buf;    /* Transmit buffer from termios */
42   volatile rtems_unsigned32 tx_buf_len;/* Transmit buffer length */
43   volatile rtems_unsigned32 tx_ptr;    /* Index of next char to transmit*/
44   rtems_isr_entry           old_handler;/* Saved interrupt handler */
45   
46   tcflag_t                  c_iflag;  /* termios input mode flags */
47   rtems_boolean             parerr_mark_flag; /* Parity error processing
48                                                  state */
49} mcfuart;
50
51/* mcfuart_init --
52 *     This function verifies the input parameters and perform initialization
53 *     of the Motorola Coldfire on-chip UART descriptor structure.
54 *
55 */
56rtems_status_code
57mcfuart_init(mcfuart *uart, void *tty, rtems_unsigned8 intvec,
58             rtems_unsigned32 chn);
59
60/* mcfuart_reset --
61 *     This function perform the hardware initialization of Motorola
62 *     Coldfire processor on-chip UART controller using parameters
63 *     filled by the mcfuart_init function.
64 */
65rtems_status_code
66mcfuart_reset(mcfuart *uart);
67
68/* mcfuart_disable --
69 *     This function disable the operations on Motorola Coldfire UART
70 *     controller
71 */
72rtems_status_code
73mcfuart_disable(mcfuart *uart);
74
75/* mcfuart_set_attributes --
76 *     This function parse the termios attributes structure and perform
77 *     the appropriate settings in hardware.
78 */
79int
80mcfuart_set_attributes(mcfuart *mcf, const struct termios *t);
81
82/* mcfuart_poll_read --
83 *     This function tried to read character from MCF UART and perform
84 *     error handling.
85 */
86int
87mcfuart_poll_read(mcfuart *uart);
88
89/* mcfuart_interrupt_write --
90 *     This function initiate transmitting of the buffer in interrupt mode.
91 */
92int
93mcfuart_interrupt_write(mcfuart *uart, const char *buf, int len);
94
95/* mcfuart_poll_write --
96 *     This function transmit buffer byte-by-byte in polling mode.
97 */
98int
99mcfuart_poll_write(mcfuart *uart, const char *buf, int len);
100
101/* mcfuart_stop_remote_tx --
102 *     This function stop data flow from remote device.
103 */
104int
105mcfuart_stop_remote_tx(mcfuart *uart);
106
107/* mcfuart_start_remote_tx --
108 *     This function resume data flow from remote device.
109 */
110int
111mcfuart_start_remote_tx(mcfuart *uart);
112
113#endif
Note: See TracBrowser for help on using the repository browser.