IgH EtherCAT Master  1.6.2
ectty.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
4  *
5  * This file is part of the IgH EtherCAT master userspace library.
6  *
7  * The IgH EtherCAT master userspace library is free software; you can
8  * redistribute it and/or modify it under the terms of the GNU Lesser General
9  * Public License as published by the Free Software Foundation; version 2.1
10  * of the License.
11  *
12  * The IgH EtherCAT master userspace library is distributed in the hope that
13  * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
14  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with the IgH EtherCAT master userspace library. If not, see
19  * <http://www.gnu.org/licenses/>.
20  *
21  ****************************************************************************/
22 
32 /****************************************************************************/
33 
34 #ifndef __ECTTY_H__
35 #define __ECTTY_H__
36 
37 #include <linux/termios.h>
38 
39 /*****************************************************************************
40  * Data types
41  ****************************************************************************/
42 
43 struct ec_tty;
44 typedef struct ec_tty ec_tty_t;
48 typedef struct {
49  int (*cflag_changed)(void *, tcflag_t);
54 
55 /*****************************************************************************
56  * Global functions
57  ****************************************************************************/
58 
67  const ec_tty_operations_t *ops,
68  void *cb_data
69  );
70 
71 /*****************************************************************************
72  * TTY interface methods
73  ****************************************************************************/
74 
77 void ectty_free(
78  ec_tty_t *tty
79  );
80 
88 unsigned int ectty_tx_data(
89  ec_tty_t *tty,
90  uint8_t *buffer,
91  size_t size
92  );
93 
96 void ectty_rx_data(
97  ec_tty_t *tty,
98  const uint8_t *buffer,
99  size_t size
100  );
101 
102 /****************************************************************************/
103 
106 #endif
struct ec_tty ec_tty_t
Definition: ectty.h:44
Operations on the virtual TTY interface.
Definition: ectty.h:48
ec_tty_t * ectty_create(const ec_tty_operations_t *ops, void *cb_data)
Create a virtual TTY interface.
void ectty_free(ec_tty_t *tty)
Releases a virtual TTY interface.
unsigned int ectty_tx_data(ec_tty_t *tty, uint8_t *buffer, size_t size)
Reads data to send from the TTY interface.
void ectty_rx_data(ec_tty_t *tty, const uint8_t *buffer, size_t size)
Pushes received data to the TTY interface.