spandsp 0.0.6
private/async.h
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * private/async.h - Asynchronous serial bit stream encoding and decoding
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2003 Steve Underwood
9 *
10 * All rights reserved.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 2.1,
14 * as published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26#if !defined(_SPANDSP_PRIVATE_ASYNC_H_)
27#define _SPANDSP_PRIVATE_ASYNC_H_
28
29/*!
30 Asynchronous data transmit descriptor. This defines the state of a single
31 working instance of a byte to asynchronous serial converter, for use
32 in FSK modems.
33*/
35{
36 /*! \brief The number of data bits per character. */
38 /*! \brief The type of parity. */
39 int parity;
40 /*! \brief The number of stop bits per character. */
42 /*! \brief A pointer to the callback routine used to get characters to be transmitted. */
44 /*! \brief An opaque pointer passed when calling get_byte. */
45 void *user_data;
46
47 /*! \brief A current, partially transmitted, character. */
48 unsigned int byte_in_progress;
49 /*! \brief The current bit position within a partially transmitted character. */
50 int bitpos;
51 /*! \brief Parity bit. */
53};
54
55/*!
56 Asynchronous data receive descriptor. This defines the state of a single
57 working instance of an asynchronous serial to byte converter, for use
58 in FSK modems.
59*/
61{
62 /*! \brief The number of data bits per character. */
64 /*! \brief The type of parity. */
65 int parity;
66 /*! \brief The number of stop bits per character. */
68 /*! \brief TRUE if V.14 rate adaption processing should be performed. */
70 /*! \brief A pointer to the callback routine used to handle received characters. */
72 /*! \brief An opaque pointer passed when calling put_byte. */
73 void *user_data;
74
75 /*! \brief A current, partially complete, character. */
76 unsigned int byte_in_progress;
77 /*! \brief The current bit position within a partially complete character. */
78 int bitpos;
79 /*! \brief Parity bit. */
81
82 /*! A count of the number of parity errors seen. */
84 /*! A count of the number of character framing errors seen. */
86};
87
88#endif
89/*- End of file ------------------------------------------------------------*/
int(* get_byte_func_t)(void *user_data)
Definition async.h:102
void(* put_byte_func_t)(void *user_data, int byte)
Definition async.h:99
Definition private/async.h:61
int parity
The type of parity.
Definition private/async.h:65
int parity_errors
Definition private/async.h:83
unsigned int byte_in_progress
A current, partially complete, character.
Definition private/async.h:76
int framing_errors
Definition private/async.h:85
int data_bits
The number of data bits per character.
Definition private/async.h:63
int bitpos
The current bit position within a partially complete character.
Definition private/async.h:78
int stop_bits
The number of stop bits per character.
Definition private/async.h:67
int use_v14
TRUE if V.14 rate adaption processing should be performed.
Definition private/async.h:69
int parity_bit
Parity bit.
Definition private/async.h:80
put_byte_func_t put_byte
A pointer to the callback routine used to handle received characters.
Definition private/async.h:71
void * user_data
An opaque pointer passed when calling put_byte.
Definition private/async.h:73
Definition private/async.h:35
int parity
The type of parity.
Definition private/async.h:39
void * user_data
An opaque pointer passed when calling get_byte.
Definition private/async.h:45
int stop_bits
The number of stop bits per character.
Definition private/async.h:41
int data_bits
The number of data bits per character.
Definition private/async.h:37
int bitpos
The current bit position within a partially transmitted character.
Definition private/async.h:50
get_byte_func_t get_byte
A pointer to the callback routine used to get characters to be transmitted.
Definition private/async.h:43
int parity_bit
Parity bit.
Definition private/async.h:52
unsigned int byte_in_progress
A current, partially transmitted, character.
Definition private/async.h:48