Xenomai 3.3.2
Loading...
Searching...
No Matches
serial.h File Reference

Real-Time Driver Model for Xenomai, serial device profile header. More...

#include <linux/types.h>

Go to the source code of this file.

Data Structures

struct  rtser_config
 Serial device configuration. More...
 
struct  rtser_status
 Serial device status. More...
 
struct  rtser_event
 Additional information about serial device events. More...
 

Macros

#define RTSER_RTIOC_BREAK_CTL    _IOR(RTIOC_TYPE_SERIAL, 0x06, int)
 Set or clear break on UART output line.
 
RTSER_DEF_BAUD

Default baud rate

RTSER_xxx_PARITY

Number of parity bits

RTSER_xxx_BITS

Number of data bits

RTSER_xxx_STOPB

Number of stop bits

#define RTSER_1_STOPB   0x00
 valid only in combination with 5 data bits
 
#define RTSER_1_5_STOPB   0x01
 valid only in combination with 5 data bits
 
#define RTSER_2_STOPB   0x01
 valid only in combination with 5 data bits
 
#define RTSER_DEF_STOPB   RTSER_1_STOPB
 valid only in combination with 5 data bits
 
RTSER_xxx_HAND

Handshake mechanisms

RTSER_RS485_xxx

RS485 mode with automatic RTS handling

RTSER_FIFO_xxx

Reception FIFO interrupt threshold

RTSER_TIMEOUT_xxx

Special timeout values, see also RTDM_TIMEOUT_xxx

RTSER_xxx_TIMESTAMP_HISTORY

Timestamp history control

RTSER_EVENT_xxx

Events bits

RTSER_SET_xxx

Configuration mask bits

RTSER_LSR_xxx

Line status bits

RTSER_MSR_xxx

Modem status bits

RTSER_MCR_xxx

Modem control bits

Sub-Classes of RTDM_CLASS_SERIAL
IOCTLs

Serial device IOCTLs

#define RTSER_RTIOC_GET_CONFIG    _IOR(RTIOC_TYPE_SERIAL, 0x00, struct rtser_config)
 Get serial device configuration.
 
#define RTSER_RTIOC_SET_CONFIG    _IOW(RTIOC_TYPE_SERIAL, 0x01, struct rtser_config)
 Set serial device configuration.
 
#define RTSER_RTIOC_GET_STATUS    _IOR(RTIOC_TYPE_SERIAL, 0x02, struct rtser_status)
 Get serial device status.
 
#define RTSER_RTIOC_GET_CONTROL    _IOR(RTIOC_TYPE_SERIAL, 0x03, int)
 Get serial device's modem contol register.
 
#define RTSER_RTIOC_SET_CONTROL    _IOW(RTIOC_TYPE_SERIAL, 0x04, int)
 Set serial device's modem contol register.
 
#define RTSER_RTIOC_WAIT_EVENT    _IOR(RTIOC_TYPE_SERIAL, 0x05, struct rtser_event)
 Wait on serial device events according to previously set mask.
 

RTSER_BREAK_xxx

Break control

#define RTSER_BREAK_CLR   0x00
 Serial device configuration.
 
#define RTSER_BREAK_SET   0x01
 Serial device configuration.
 
#define RTIOC_TYPE_SERIAL   RTDM_CLASS_SERIAL
 Serial device configuration.
 
typedef struct rtser_config rtser_config_t
 Serial device configuration.
 
typedef struct rtser_status rtser_status_t
 Serial device status.
 
typedef struct rtser_event rtser_event_t
 Additional information about serial device events.
 

Detailed Description

Real-Time Driver Model for Xenomai, serial device profile header.

Note
Copyright (C) 2005-2007 Jan Kiszka jan.k.nosp@m.iszk.nosp@m.a@web.nosp@m..de

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

Macro Definition Documentation

◆ RTSER_RTIOC_BREAK_CTL

#define RTSER_RTIOC_BREAK_CTL    _IOR(RTIOC_TYPE_SERIAL, 0x06, int)

Set or clear break on UART output line.

Parameters
[in]argRTSER_BREAK_SET or RTSER_BREAK_CLR (int)
Returns
0 on success, otherwise negative error code
Tags
task-unrestricted
Note
A set break condition may also be cleared on UART line reconfiguration.

◆ RTSER_RTIOC_GET_CONFIG

#define RTSER_RTIOC_GET_CONFIG    _IOR(RTIOC_TYPE_SERIAL, 0x00, struct rtser_config)

Get serial device configuration.

Parameters
[out]argPointer to configuration buffer (struct rtser_config)
Returns
0 on success, otherwise negative error code
Tags
task-unrestricted

◆ RTSER_RTIOC_GET_CONTROL

#define RTSER_RTIOC_GET_CONTROL    _IOR(RTIOC_TYPE_SERIAL, 0x03, int)

Get serial device's modem contol register.

Parameters
[out]argPointer to variable receiving the content (int, see RTSER_MCR_xxx)
Returns
0 on success, otherwise negative error code
Tags
task-unrestricted

◆ RTSER_RTIOC_GET_STATUS

#define RTSER_RTIOC_GET_STATUS    _IOR(RTIOC_TYPE_SERIAL, 0x02, struct rtser_status)

Get serial device status.

Parameters
[out]argPointer to status buffer (struct rtser_status)
Returns
0 on success, otherwise negative error code
Tags
task-unrestricted
Note
The error states RTSER_LSR_OVERRUN_ERR, RTSER_LSR_PARITY_ERR, RTSER_LSR_FRAMING_ERR, and RTSER_SOFT_OVERRUN_ERR that may have occured during previous read accesses to the device will be saved for being reported via this IOCTL. Upon return from RTSER_RTIOC_GET_STATUS, the saved state will be cleared.

◆ RTSER_RTIOC_SET_CONFIG

#define RTSER_RTIOC_SET_CONFIG    _IOW(RTIOC_TYPE_SERIAL, 0x01, struct rtser_config)

Set serial device configuration.

Parameters
[in]argPointer to configuration buffer (struct rtser_config)
Returns
0 on success, otherwise:
  • -EPERM is returned if the caller's context is invalid, see note below.
  • -ENOMEM is returned if a new history buffer for timestamps cannot be allocated.
Tags
task-unrestricted
Note
If rtser_config contains a valid timestamp_history and the addressed device has been opened in non-real-time context, this IOCTL must be issued in non-real-time context as well. Otherwise, this command will fail.
Examples
cross-link.c.

◆ RTSER_RTIOC_SET_CONTROL

#define RTSER_RTIOC_SET_CONTROL    _IOW(RTIOC_TYPE_SERIAL, 0x04, int)

Set serial device's modem contol register.

Parameters
[in]argNew control register content (int, see RTSER_MCR_xxx)
Returns
0 on success, otherwise negative error code
Tags
task-unrestricted

◆ RTSER_RTIOC_WAIT_EVENT

#define RTSER_RTIOC_WAIT_EVENT    _IOR(RTIOC_TYPE_SERIAL, 0x05, struct rtser_event)

Wait on serial device events according to previously set mask.

Parameters
[out]argPointer to event information buffer (struct rtser_event)
Returns
0 on success, otherwise:
  • -EBUSY is returned if another task is already waiting on events of this device.
  • -EBADF is returned if the file descriptor is invalid or the device has just been closed.
Tags
mode-unrestricted
Examples
cross-link.c.