spandsp 3.0.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 int16_t data_bits;
38 /*! \brief The type of parity. */
39 int16_t parity;
40 /*! \brief Total number of bits per frame, including any parity bit. */
42 /*! \brief Total number of bits per frame, including any parity bit and the stop bits. */
43 int16_t total_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 with its optional parity bit attached. */
53 /*! \brief The current bit position within a partially transmitted character. */
54 int16_t bitpos;
55};
56
57/*!
58 Asynchronous data receive descriptor. This defines the state of a single
59 working instance of an asynchronous serial to byte converter, for use
60 in FSK modems.
61*/
63{
64 /*! \brief The number of data bits per character. */
65 int16_t data_bits;
66 /*! \brief The type of parity. */
67 int16_t parity;
68 /*! \brief Total number of bits per frame, including any parity bit. */
70 /*! \brief True if V.14 rate adaption processing should be performed. */
71 bool use_v14;
72 /*! \brief A pointer to the callback routine used to handle received characters. */
74 /*! \brief An opaque pointer passed when calling put_byte. */
75 void *user_data;
76
77 /*! \brief A current, partially complete, character. */
79 /*! \brief The current bit position within a partially complete character. */
80 int16_t bitpos;
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 ------------------------------------------------------------*/
void(* span_put_byte_func_t)(void *user_data, int byte)
Definition async.h:115
int(* span_get_byte_func_t)(void *user_data)
Definition async.h:119
Definition private/async.h:63
int16_t data_bits
The number of data bits per character.
Definition private/async.h:65
int parity_errors
Definition private/async.h:83
int framing_errors
Definition private/async.h:85
uint16_t frame_in_progress
A current, partially complete, character.
Definition private/async.h:78
bool use_v14
True if V.14 rate adaption processing should be performed.
Definition private/async.h:71
span_put_byte_func_t put_byte
A pointer to the callback routine used to handle received characters.
Definition private/async.h:73
int16_t parity
The type of parity.
Definition private/async.h:67
int16_t bitpos
The current bit position within a partially complete character.
Definition private/async.h:80
int16_t total_data_bits
Total number of bits per frame, including any parity bit.
Definition private/async.h:69
void * user_data
An opaque pointer passed when calling put_byte.
Definition private/async.h:75
Definition private/async.h:35
int16_t total_data_bits
Total number of bits per frame, including any parity bit.
Definition private/async.h:41
void * user_data
An opaque pointer passed when calling get_byte.
Definition private/async.h:47
uint16_t frame_in_progress
A current, partially transmitted, character with its optional parity bit attached.
Definition private/async.h:52
int16_t total_bits
Total number of bits per frame, including any parity bit and the stop bits.
Definition private/async.h:43
int16_t 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
int16_t parity
The type of parity.
Definition private/async.h:39
span_get_byte_func_t get_byte
A pointer to the callback routine used to get characters to be transmitted.
Definition private/async.h:45
int16_t bitpos
The current bit position within a partially transmitted character.
Definition private/async.h:54