spandsp  1.99.0
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. */
37  int data_bits;
38  /*! \brief The type of parity. */
39  int parity;
40  /*! \brief The number of stop bits per character. */
41  int stop_bits;
42  /*! \brief Total number of bits per character, including the parity and stop bits. */
44  /*! \brief A pointer to the callback routine used to get characters to be transmitted. */
46  /*! \brief An opaque pointer passed when calling get_byte. */
47  void *user_data;
48  /*! \brief The minimum number of stop bits to send before character transmission begins. */
50 
51  /*! \brief A current, partially transmitted, character. */
53  /*! \brief The current bit position within a partially transmitted character. */
54  int bitpos;
55  /*! \brief Parity bit. */
57 };
58 
59 /*!
60  Asynchronous data receive descriptor. This defines the state of a single
61  working instance of an asynchronous serial to byte converter, for use
62  in FSK modems.
63 */
65 {
66  /*! \brief The number of data bits per character. */
67  int data_bits;
68  /*! \brief The type of parity. */
69  int parity;
70  /*! \brief The number of stop bits per character. */
71  int stop_bits;
72  /*! \brief True if V.14 rate adaption processing should be performed. */
73  bool use_v14;
74  /*! \brief A pointer to the callback routine used to handle received characters. */
76  /*! \brief An opaque pointer passed when calling put_byte. */
77  void *user_data;
78 
79  /*! \brief A current, partially complete, character. */
81  /*! \brief The current bit position within a partially complete character. */
82  int bitpos;
83  /*! \brief Parity bit. */
85 
86  /*! A count of the number of parity errors seen. */
88  /*! A count of the number of character framing errors seen. */
90 };
91 
92 #endif
93 /*- End of file ------------------------------------------------------------*/
void * user_data
An opaque pointer passed when calling get_byte.
Definition: private/async.h:47
void * user_data
An opaque pointer passed when calling put_byte.
Definition: private/async.h:77
int bitpos
The current bit position within a partially transmitted character.
Definition: private/async.h:54
int stop_bits
The number of stop bits per character.
Definition: private/async.h:71
int framing_errors
Definition: private/async.h:89
int parity_bit
Parity bit.
Definition: private/async.h:84
int parity
The type of parity.
Definition: private/async.h:39
int bitpos
The current bit position within a partially complete character.
Definition: private/async.h:82
int32_t byte_in_progress
A current, partially complete, character.
Definition: private/async.h:80
void(* put_byte_func_t)(void *user_data, int byte)
Definition: async.h:101
int parity
The type of parity.
Definition: private/async.h:69
int data_bits
The number of data bits per character.
Definition: private/async.h:67
Definition: private/async.h:64
put_byte_func_t put_byte
A pointer to the callback routine used to handle received characters.
Definition: private/async.h:75
bool use_v14
True if V.14 rate adaption processing should be performed.
Definition: private/async.h:73
Definition: private/async.h:34
int parity_errors
Definition: private/async.h:87
int32_t byte_in_progress
A current, partially transmitted, character.
Definition: private/async.h:52
int parity_bit
Parity bit.
Definition: private/async.h:56
int data_bits
The number of data bits per character.
Definition: private/async.h:37
int presend_bits
The minimum number of stop bits to send before character transmission begins.
Definition: private/async.h:49
get_byte_func_t get_byte
A pointer to the callback routine used to get characters to be transmitted.
Definition: private/async.h:45
int(* get_byte_func_t)(void *user_data)
Definition: async.h:104
int total_bits
Total number of bits per character, including the parity and stop bits.
Definition: private/async.h:43
int stop_bits
The number of stop bits per character.
Definition: private/async.h:41