~ubuntu-branches/ubuntu/intrepid/iaxmodem/intrepid

« back to all changes in this revision

Viewing changes to lib/spandsp/src/spandsp/async.h

  • Committer: Bazaar Package Importer
  • Author(s): Julien BLACHE
  • Date: 2008-02-12 15:29:42 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20080212152942-28cxxstfy8iujm0p
Tags: 1.1.0~dfsg-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 * along with this program; if not, write to the Free Software
23
23
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24
24
 *
25
 
 * $Id: async.h,v 1.10 2007/07/29 17:56:41 steveu Exp $
 
25
 * $Id: async.h,v 1.12 2007/12/13 11:31:32 steveu Exp $
26
26
 */
27
27
 
28
28
/*! \file */
49
49
#if !defined(_SPANDSP_ASYNC_H_)
50
50
#define _SPANDSP_ASYNC_H_
51
51
 
52
 
/* Special "bit" values for the put and get bit functions */
 
52
/*! Special "bit" values for the put and get bit functions */
53
53
enum
54
54
{
55
55
    /*! \brief The carrier signal has dropped. */
129
129
    int byte_in_progress;
130
130
    /*! \brief The current bit position within a partially transmitted character. */
131
131
    int bitpos;
 
132
    /*! \brief Parity bit. */
132
133
    int parity_bit;
133
134
} async_tx_state_t;
134
135
 
156
157
    int byte_in_progress;
157
158
    /*! \brief The current bit position within a partially complete character. */
158
159
    int bitpos;
 
160
    /*! \brief Parity bit. */
159
161
    int parity_bit;
160
162
 
 
163
    /*! A count of the number of parity errors seen. */
161
164
    int parity_errors;
 
165
    /*! A count of the number of character framing errors seen. */
162
166
    int framing_errors;
163
167
} async_rx_state_t;
164
168
 
175
179
    \param stop_bits The number of stop bits.
176
180
    \param use_v14 TRUE if V.14 rate adaption processing should be used.
177
181
    \param get_byte The callback routine used to get the data to be transmitted.
178
 
    \param user_data An opaque pointer. */
179
 
void async_tx_init(async_tx_state_t *s,
180
 
                   int data_bits,
181
 
                   int parity_bits,
182
 
                   int stop_bits,
183
 
                   int use_v14,
184
 
                   get_byte_func_t get_byte,
185
 
                   void *user_data);
 
182
    \param user_data An opaque pointer.
 
183
    \return A pointer to the initialised context, or NULL if there was a problem. */
 
184
async_tx_state_t *async_tx_init(async_tx_state_t *s,
 
185
                                int data_bits,
 
186
                                int parity_bits,
 
187
                                int stop_bits,
 
188
                                int use_v14,
 
189
                                get_byte_func_t get_byte,
 
190
                                void *user_data);
186
191
 
187
192
/*! Get the next bit of a transmitted serial bit stream.
188
193
    \brief Get the next bit of a transmitted serial bit stream.
198
203
    \param stop_bits The number of stop bits.
199
204
    \param use_v14 TRUE if V.14 rate adaption processing should be used.
200
205
    \param put_byte The callback routine used to put the received data.
201
 
    \param user_data An opaque pointer. */
202
 
void async_rx_init(async_rx_state_t *s,
203
 
                   int data_bits,
204
 
                   int parity_bits,
205
 
                   int stop_bits,
206
 
                   int use_v14,
207
 
                   put_byte_func_t put_byte,
208
 
                   void *user_data);
 
206
    \param user_data An opaque pointer.
 
207
    \return A pointer to the initialised context, or NULL if there was a problem. */
 
208
async_rx_state_t *async_rx_init(async_rx_state_t *s,
 
209
                                int data_bits,
 
210
                                int parity_bits,
 
211
                                int stop_bits,
 
212
                                int use_v14,
 
213
                                put_byte_func_t put_byte,
 
214
                                void *user_data);
209
215
 
210
216
/*! Accept a bit from a received serial bit stream
211
217
    \brief Accept a bit from a received serial bit stream