Mercurial > hg > audiostuff
comparison spandsp-0.0.6pre17/src/spandsp/private/async.h @ 4:26cd8f1ef0b1
import spandsp-0.0.6pre17
| author | Peter Meerwald <pmeerw@cosy.sbg.ac.at> |
|---|---|
| date | Fri, 25 Jun 2010 15:50:58 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 3:c6c5a16ce2f2 | 4:26cd8f1ef0b1 |
|---|---|
| 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 * $Id: async.h,v 1.1 2008/11/30 10:17:31 steveu Exp $ | |
| 26 */ | |
| 27 | |
| 28 #if !defined(_SPANDSP_PRIVATE_ASYNC_H_) | |
| 29 #define _SPANDSP_PRIVATE_ASYNC_H_ | |
| 30 | |
| 31 /*! | |
| 32 Asynchronous data transmit descriptor. This defines the state of a single | |
| 33 working instance of a byte to asynchronous serial converter, for use | |
| 34 in FSK modems. | |
| 35 */ | |
| 36 struct async_tx_state_s | |
| 37 { | |
| 38 /*! \brief The number of data bits per character. */ | |
| 39 int data_bits; | |
| 40 /*! \brief The type of parity. */ | |
| 41 int parity; | |
| 42 /*! \brief The number of stop bits per character. */ | |
| 43 int stop_bits; | |
| 44 /*! \brief A pointer to the callback routine used to get characters to be transmitted. */ | |
| 45 get_byte_func_t get_byte; | |
| 46 /*! \brief An opaque pointer passed when calling get_byte. */ | |
| 47 void *user_data; | |
| 48 | |
| 49 /*! \brief A current, partially transmitted, character. */ | |
| 50 int byte_in_progress; | |
| 51 /*! \brief The current bit position within a partially transmitted character. */ | |
| 52 int bitpos; | |
| 53 /*! \brief Parity bit. */ | |
| 54 int parity_bit; | |
| 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 */ | |
| 62 struct async_rx_state_s | |
| 63 { | |
| 64 /*! \brief The number of data bits per character. */ | |
| 65 int data_bits; | |
| 66 /*! \brief The type of parity. */ | |
| 67 int parity; | |
| 68 /*! \brief The number of stop bits per character. */ | |
| 69 int stop_bits; | |
| 70 /*! \brief TRUE if V.14 rate adaption processing should be performed. */ | |
| 71 int use_v14; | |
| 72 /*! \brief A pointer to the callback routine used to handle received characters. */ | |
| 73 put_byte_func_t put_byte; | |
| 74 /*! \brief An opaque pointer passed when calling put_byte. */ | |
| 75 void *user_data; | |
| 76 | |
| 77 /*! \brief A current, partially complete, character. */ | |
| 78 int byte_in_progress; | |
| 79 /*! \brief The current bit position within a partially complete character. */ | |
| 80 int bitpos; | |
| 81 /*! \brief Parity bit. */ | |
| 82 int parity_bit; | |
| 83 | |
| 84 /*! A count of the number of parity errors seen. */ | |
| 85 int parity_errors; | |
| 86 /*! A count of the number of character framing errors seen. */ | |
| 87 int framing_errors; | |
| 88 }; | |
| 89 | |
| 90 #endif | |
| 91 /*- End of file ------------------------------------------------------------*/ |
