⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mcfuart.h

📁 RTEMS (Real-Time Executive for Multiprocessor Systems) is a free open source real-time operating sys
💻 H
字号:
/* * Generic UART Serial driver for Motorola Coldfire processors definitions * * Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russian Fed. * Author: Victor V. Vengerov <vvv@oktet.ru> * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * * http://www.rtems.com/license/LICENSE. * * @(#) $Id: mcfuart.h,v 1.1.4.1 2003/09/04 18:45:44 joel Exp $ * */#ifndef __MCFUART_H__#define __MCFUART_H__#include <termios.h>#include "bsp.h"#include "mcf5206e.h"/* * The MCF5206e System Clock Frequency; 54MHz default */#ifndef SYSTEM_CLOCK_FREQUENCY#define SYSTEM_CLOCK_FREQUENCY BSP_SYSTEM_FREQUENCY#endif/*  * The following structure is a descriptor of single UART channel. * It contains the initialization information about channel and * current operating values */typedef struct mcfuart {   rtems_unsigned32          chn;      /* UART channel number */   rtems_unsigned8           intvec;   /* UART interrupt vector number, or                                          0 if polled I/O */   void                     *tty;      /* termios channel descriptor */      volatile const char      *tx_buf;    /* Transmit buffer from termios */   volatile rtems_unsigned32 tx_buf_len;/* Transmit buffer length */   volatile rtems_unsigned32 tx_ptr;    /* Index of next char to transmit*/   rtems_isr_entry           old_handler;/* Saved interrupt handler */      tcflag_t                  c_iflag;  /* termios input mode flags */   rtems_boolean             parerr_mark_flag; /* Parity error processing                                                  state */} mcfuart;/* mcfuart_init -- *     This function verifies the input parameters and perform initialization *     of the Motorola Coldfire on-chip UART descriptor structure. * */rtems_status_codemcfuart_init(mcfuart *uart, void *tty, rtems_unsigned8 intvec,             rtems_unsigned32 chn);/* mcfuart_reset -- *     This function perform the hardware initialization of Motorola *     Coldfire processor on-chip UART controller using parameters *     filled by the mcfuart_init function. */rtems_status_codemcfuart_reset(mcfuart *uart);/* mcfuart_disable -- *     This function disable the operations on Motorola Coldfire UART *     controller */rtems_status_codemcfuart_disable(mcfuart *uart);/* mcfuart_set_attributes -- *     This function parse the termios attributes structure and perform *     the appropriate settings in hardware. */intmcfuart_set_attributes(mcfuart *mcf, const struct termios *t);/* mcfuart_poll_read -- *     This function tried to read character from MCF UART and perform *     error handling. */intmcfuart_poll_read(mcfuart *uart);/* mcfuart_interrupt_write -- *     This function initiate transmitting of the buffer in interrupt mode. */intmcfuart_interrupt_write(mcfuart *uart, const char *buf, int len);/* mcfuart_poll_write -- *     This function transmit buffer byte-by-byte in polling mode. */intmcfuart_poll_write(mcfuart *uart, const char *buf, int len);/* mcfuart_stop_remote_tx -- *     This function stop data flow from remote device. */intmcfuart_stop_remote_tx(mcfuart *uart);/* mcfuart_start_remote_tx -- *     This function resume data flow from remote device. */intmcfuart_start_remote_tx(mcfuart *uart);#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -