RTEMS
7.0-rc1
Loading...
Searching...
No Matches
bsps
m68k
include
mcf5206
mcfuart.h
1
/* SPDX-License-Identifier: GPL-2.0+-with-RTEMS-exception */
2
3
/*
4
* Generic UART Serial driver for Motorola Coldfire processors definitions
5
*
6
* Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russian Fed.
7
* Author: Victor V. Vengerov <vvv@oktet.ru>
8
*
9
* The license and distribution terms for this file may be
10
* found in the file LICENSE in this distribution or at
11
* http://www.rtems.org/license/LICENSE.
12
*/
13
14
#ifndef __MCFUART_H__
15
#define __MCFUART_H__
16
17
#include <termios.h>
18
#include "bsp.h"
19
#include "mcf5206e.h"
20
21
/*
22
* The MCF5206e System Clock Frequency; 54MHz default
23
*/
24
#ifndef SYSTEM_CLOCK_FREQUENCY
25
#define SYSTEM_CLOCK_FREQUENCY BSP_SYSTEM_FREQUENCY
26
#endif
27
28
/*
29
* The following structure is a descriptor of single UART channel.
30
* It contains the initialization information about channel and
31
* current operating values
32
*/
33
typedef
struct
mcfuart
{
34
uint32_t chn;
/* UART channel number */
35
uint8_t intvec;
/* UART interrupt vector number, or
36
0 if polled I/O */
37
void
*tty;
/* termios channel descriptor */
38
39
volatile
const
char
*tx_buf;
/* Transmit buffer from termios */
40
volatile
uint32_t tx_buf_len;
/* Transmit buffer length */
41
volatile
uint32_t tx_ptr;
/* Index of next char to transmit*/
42
rtems_isr_entry
old_handler;
/* Saved interrupt handler */
43
44
tcflag_t c_iflag;
/* termios input mode flags */
45
bool
parerr_mark_flag;
/* Parity error processing
46
state */
47
}
mcfuart
;
48
49
/* mcfuart_init --
50
* This function verifies the input parameters and perform initialization
51
* of the Motorola Coldfire on-chip UART descriptor structure.
52
*
53
*/
54
rtems_status_code
55
mcfuart_init(
mcfuart
*uart,
void
*tty, uint8_t intvec,
56
uint32_t chn);
57
58
/* mcfuart_reset --
59
* This function perform the hardware initialization of Motorola
60
* Coldfire processor on-chip UART controller using parameters
61
* filled by the mcfuart_init function.
62
*/
63
rtems_status_code
64
mcfuart_reset(
mcfuart
*uart);
65
66
/* mcfuart_disable --
67
* This function disable the operations on Motorola Coldfire UART
68
* controller
69
*/
70
rtems_status_code
71
mcfuart_disable(
mcfuart
*uart);
72
73
/* mcfuart_set_attributes --
74
* This function parse the termios attributes structure and perform
75
* the appropriate settings in hardware.
76
*/
77
int
78
mcfuart_set_attributes(
mcfuart
*mcf,
const
struct
termios *t);
79
80
/* mcfuart_poll_read --
81
* This function tried to read character from MCF UART and perform
82
* error handling.
83
*/
84
int
85
mcfuart_poll_read(
mcfuart
*uart);
86
87
/* mcfuart_interrupt_write --
88
* This function initiate transmitting of the buffer in interrupt mode.
89
*/
90
ssize_t
91
mcfuart_interrupt_write(
mcfuart
*uart,
const
char
*buf,
size_t
len);
92
93
/* mcfuart_poll_write --
94
* This function transmit buffer byte-by-byte in polling mode.
95
*/
96
ssize_t
97
mcfuart_poll_write(
mcfuart
*uart,
const
char
*buf,
size_t
len);
98
99
/* mcfuart_stop_remote_tx --
100
* This function stop data flow from remote device.
101
*/
102
int
103
mcfuart_stop_remote_tx(
mcfuart
*uart);
104
105
/* mcfuart_start_remote_tx --
106
* This function resume data flow from remote device.
107
*/
108
int
109
mcfuart_start_remote_tx(
mcfuart
*uart);
110
111
#endif
rtems_isr_entry
ISR_Handler_entry rtems_isr_entry
Interrupt service routines installed by rtems_interrupt_catch() shall have this type.
Definition:
intr.h:134
rtems_status_code
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition:
status.h:85
mcfuart
Definition:
mcfuart.h:33
Generated by
1.9.6