Debian Codegraph @

drivers/dahdi/voicebus/GpakApi.h

raw symbols SCIP
1 /*
2 * Copyright (c) 2005 , Adaptive Digital Technologies, Inc.
3 *
4 * File Name: GpakApi.h
5 *
6 * Description:
7 * This file contains the function prototypes and data types for the user
8 * API functions that communicate with DSPs executing G.PAK software. The
9 * file is used by application software in the host processor connected to
10 * C55X G.PAK DSPs via a Host Port Interface.
11 *
12 * Version: 1.0
13 *
14 * Revision History:
15 * 06/15/05 - Initial release.
16 * 11/15/2006 - 24 TDM-TDM Channels EC release
17 */
18
19 #ifndef _GPAKAPI_H /* prevent multiple inclusion */
20 #define _GPAKAPI_H
21 #include "gpakErrs.h"
22 #include "gpakenum.h"
23
24 // Bit masks to select which algorithm's parameters to update: Or-together the
25 // desired masks into the UpdateBits function parameter.
26 #define DTMF_UPDATE_MASK 0x0010 // update DTMF params, MinLevel, SNRFlag and Freq
27 #define DTMF_TWIST_UPDATE_MASK 0x0020 // update DTMF TWIST system params
28 #define DTMF_VALID_MASK 0x0080 // update DTMF ValidMask params
29
30 #define DSP_DEBUG_BUFF_SIZE 42 // units of 16-bit words
31
32 /* Definition of an Asynchronous Event Data Structure */
33 typedef union
34 {
35 struct
36 {
37 GpakToneCodes_t ToneCode; // detected tone code
38 unsigned short int ToneDuration; // tone duration
39 GpakTdmDirection Direction; // detected on A r B side
40 short int DebugToneStatus;// reserved for debug info
41 } toneEvent;
42
43 } GpakAsyncEventData_t;
44
45 /* Definition of an Echo Canceller Parameters information structure. */
46 typedef struct GpakEcanParms
47 {
48 short int EcanTapLength; // Echo Can Num Taps (tail length)
49 short int EcanNlpType; // Echo Can NLP Type
50 short int EcanAdaptEnable; // Echo Can Adapt Enable flag
51 short int EcanG165DetEnable; // Echo Can G165 Detect Enable flag
52 short int EcanDblTalkThresh; // Echo Can Double Talk threshold
53 short int EcanMaxDoubleTalkThres; // Maximum double-talk threshold
54 short int EcanNlpThreshold; // Echo Can NLP threshold
55 short int EcanNlpConv; // Dynamic NLP control, NLP limit when EC about to converged
56 short int EcanNlpUnConv;// Dynamic NLP control, NLP limit when EC not converged yet
57 short int EcanNlpMaxSuppress; // suppression level for NLP_SUPP mode
58 short int EcanCngThreshold; // Echo Can CNG Noise threshold
59 short int EcanAdaptLimit; // Echo Can Max Adapts per frame
60 short int EcanCrossCorrLimit; // Echo Can Cross Correlation limit
61 short int EcanNumFirSegments; // Echo Can Num FIR Segments
62 short int EcanFirSegmentLen; // Echo Can FIR Segment Length
63 short int EcanTandemOperationEnable; //Enable tandem operation
64 short int EcanMixedFourWireMode; // Handle possible 4-wire (echo-free) lines
65 short int EcanReconvergenceCheckEnable; // Handle possible 4-wire (echo-free) lines
66 short int EcanSaturationLevel; /* Far end input level above which significant saturation/nonlinearity may be expected. */
67 short int EcanNLPSaturationThreshold; /* NLP threshold under conditions of possible saturation */
68 } GpakEcanParms_t;
69
70 /* Definition of a Channel Configuration information structure. */
71 typedef struct GpakChannelConfig
72 {
73 GpakSerialPort_t PcmInPortA; // A side PCM Input Serial Port Id
74 unsigned short int PcmInSlotA; // A side PCM Input Time Slot
75 GpakSerialPort_t PcmOutPortA; // A side PCM Output Serial Port Id
76 unsigned short int PcmOutSlotA; // A side PCM Output Time Slot
77 GpakSerialPort_t PcmInPortB; // B side PCM Input Serial Port Id
78 unsigned short int PcmInSlotB; // B side PCM Input Time Slot
79 GpakSerialPort_t PcmOutPortB; // B side PCM Output Serial Port Id
80 unsigned short int PcmOutSlotB; // B side PCM Output Time Slot
81 GpakToneTypes ToneTypesA; // A side Tone Detect Types
82 GpakToneTypes ToneTypesB; // B side Tone Detect Types
83 GpakActivation EcanEnableA; // Echo Cancel A Enabled
84 GpakActivation EcanEnableB; // Echo Cancel B Enabled
85 GpakEcanParms_t EcanParametersA; // Echo Cancel parameters
86 GpakEcanParms_t EcanParametersB; // Echo Cancel parameters
87 GpakCompandModes SoftwareCompand; // software companding
88 GpakRate_t FrameRate; // Gpak Frame Rate
89 GpakActivation MuteToneA; // A side mute DTMF Enabled
90 GpakActivation MuteToneB; // B side mute DTMF Enabled
91 GpakActivation FaxCngDetA; // A side FaxCng Tone Detector Enabled
92 GpakActivation FaxCngDetB; // B side FaxCng Tone Detector Enabled
93 unsigned short int ChannelId_tobe_Debug; /* Channel Id of the channel that we'd like to debug */
94 /* (0 to MaxChannels-1), only used for tdmToTdmDebug */
95
96 } GpakChannelConfig_t;
97
98
99 /* Definition of a Serial Port Configuration Structure */
100 typedef struct GpakPortConfig
101 {
102 GpakSlotCfg_t SlotsSelect1; // port 1 Slot selection
103 unsigned short int FirstBlockNum1; // port 1 first group Block Number
104 unsigned short int FirstSlotMask1; // port 1 first group Slot Mask
105 unsigned short int SecBlockNum1; // port 1 second group Block Number
106 unsigned short int SecSlotMask1; // port 1 second group Slot Mask
107
108 GpakSerWordSize_t SerialWordSize1; // port 1 serial word size
109 GpakCompandModes CompandingMode1; // port 1 companding mode
110 GpakSerFrameSyncPol_t TxFrameSyncPolarity1; // port 1 Tx Frame Sync Polarity
111 GpakSerFrameSyncPol_t RxFrameSyncPolarity1; // port 1 Rx Frame Sync Polarity
112 GpakSerClockPol_t TxClockPolarity1; // port 1 Tx Clock Polarity
113 GpakSerClockPol_t RxClockPolarity1; // port 1 Rx Clock Polarity
114 GpakSerDataDelay_t TxDataDelay1; // port 1 Tx data delay
115 GpakSerDataDelay_t RxDataDelay1; // port 1 Rx data delay
116 GpakActivation DxDelay1; // port 1 DX Delay
117
118 unsigned short int ThirdSlotMask1; // port 1 3rd group Slot Mask
119 unsigned short int FouthSlotMask1; // port 1 4th group Slot Mask
120 unsigned short int FifthSlotMask1; // port 1 5th group Slot Mask
121 unsigned short int SixthSlotMask1; // port 1 6th group Slot Mask
122 unsigned short int SevenSlotMask1; // port 1 7th group Slot Mask
123 unsigned short int EightSlotMask1; // port 1 8th group Slot Mask
124
125
126 GpakSlotCfg_t SlotsSelect2; // port 2 Slot selection
127 unsigned short int FirstBlockNum2; // port 2 first group Block Number
128 unsigned short int FirstSlotMask2; // port 2 first group Slot Mask
129 unsigned short int SecBlockNum2; // port 2 second group Block Number
130 unsigned short int SecSlotMask2; // port 2 second group Slot Mask
131 GpakSerWordSize_t SerialWordSize2; // port 2 serial word size
132 GpakCompandModes CompandingMode2; // port 2 companding mode
133 GpakSerFrameSyncPol_t TxFrameSyncPolarity2; // port 2 Tx Frame Sync Polarity
134 GpakSerFrameSyncPol_t RxFrameSyncPolarity2; // port 2 Rx Frame Sync Polarity
135 GpakSerClockPol_t TxClockPolarity2; // port 2 Tx Clock Polarity
136 GpakSerClockPol_t RxClockPolarity2; // port 2 Rx Clock Polarity
137 GpakSerDataDelay_t TxDataDelay2; // port 2 Tx data delay
138 GpakSerDataDelay_t RxDataDelay2; // port 2 Rx data delay
139 GpakActivation DxDelay2; // port 2 DX Delay
140
141 unsigned short int ThirdSlotMask2; // port 2 3rd group Slot Mask
142 unsigned short int FouthSlotMask2; // port 2 4th group Slot Mask
143 unsigned short int FifthSlotMask2; // port 2 5th group Slot Mask
144 unsigned short int SixthSlotMask2; // port 2 6th group Slot Mask
145 unsigned short int SevenSlotMask2; // port 2 7th group Slot Mask
146 unsigned short int EightSlotMask2; // port 2 8th group Slot Mask
147
148 GpakSlotCfg_t SlotsSelect3; // port 3 Slot selection
149 unsigned short int FirstBlockNum3; // port 3 first group Block Number
150 unsigned short int FirstSlotMask3; // port 3 first group Slot Mask
151 unsigned short int SecBlockNum3; // port 3 second group Block Number
152 unsigned short int SecSlotMask3; // port 3 second group Slot Mask
153 GpakSerWordSize_t SerialWordSize3; // port 3 serial word size
154 GpakCompandModes CompandingMode3; // port 3 companding mode
155 GpakSerFrameSyncPol_t TxFrameSyncPolarity3; // port 3 Tx Frame Sync Polarity
156 GpakSerFrameSyncPol_t RxFrameSyncPolarity3; // port 3 Rx Frame Sync Polarity
157 GpakSerClockPol_t TxClockPolarity3; // port 3 Tx Clock Polarity
158 GpakSerClockPol_t RxClockPolarity3; // port 3 Rx Clock Polarity
159 GpakSerDataDelay_t TxDataDelay3; // port 3 Tx data delay
160 GpakSerDataDelay_t RxDataDelay3; // port 3 Rx data delay
161 GpakActivation DxDelay3; // port 3 DX Delay
162
163 unsigned short int ThirdSlotMask3; // port 3 3rd group Slot Mask
164 unsigned short int FouthSlotMask3; // port 3 4th group Slot Mask
165 unsigned short int FifthSlotMask3; // port 3 5th group Slot Mask
166 unsigned short int SixthSlotMask3; // port 3 6th group Slot Mask
167 unsigned short int SevenSlotMask3; // port 3 7th group Slot Mask
168 unsigned short int EightSlotMask3; // port 3 8th group Slot Mask
169
170 } GpakPortConfig_t;
171
172 /* Definition of a Tone Generation Parameter Structure */
173 /*
174 typedef struct
175 {
176 GpakToneGenType_t ToneType; // Tone Type
177 unsigned short int Frequency[4]; // Frequency (Hz)
178 short int Level[4]; // Frequency's Level (1 dBm)
179 unsigned short int OnTime[4]; // On Times (msecs)
180 unsigned short int OffTime[4]; // Off Times (msecs)
181 } GpakToneGenParms_t;
182 */
183 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
184
185 /* gpakConfigureChannel return status. */
186 typedef enum
187 {
188 CcsSuccess = 0, /* Channel Configured successfully */
189 CcsParmError = 1, /* Channel Config Parameter error */
190 CcsInvalidChannel = 2, /* invalid channel */
191 CcsInvalidDsp = 3, /* invalid DSP */
192 CcsDspCommFailure = 4 /* failed to communicate with DSP */
193 } gpakConfigChanStatus_t;
194
195 /*
196 * gpakConfigureChannel - Configure a DSP's Channel.
197 *
198 * FUNCTION
199 * This function configures a DSP's Channel.
200 *
201 * RETURNS
202 * Status code indicating success or a specific error.
203 *
204 */
205 extern gpakConfigChanStatus_t gpakConfigureChannel(
206 unsigned short int DspId, // DSP identifier
207 unsigned short int ChannelId, // channel identifier
208 GpakChanType ChannelType, // channel type
209 GpakChannelConfig_t *pChanConfig, // pointer to channel config info
210 GPAK_ChannelConfigStat_t *pStatus // pointer to Channel Config Status
211 );
212
213
214 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
215
216 /* gpakTearDownChannel return status. */
217 typedef enum
218 {
219 TdsSuccess = 0, /* Channel Tear Down successful */
220 TdsError = 1, /* Channel Tear Down error */
221 TdsInvalidChannel = 2, /* invalid channel */
222 TdsInvalidDsp = 3, /* invalid DSP */
223 TdsDspCommFailure = 4 /* failed to communicate with DSP */
224 } gpakTearDownStatus_t;
225
226 /*
227 * gpakTearDownChannel - Tear Down a DSP's Channel.
228 *
229 * FUNCTION
230 * This function tears down a DSP's Channel.
231 *
232 * RETURNS
233 * Status code indicating success or a specific error.
234 *
235 */
236
237 extern gpakTearDownStatus_t gpakTearDownChannel(
238 unsigned short int DspId, // DSP identifier
239 unsigned short int ChannelId, // channel identifier
240 GPAK_TearDownChanStat_t *pStatus // pointer to Tear Down Status
241 );
242
243 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
244
245 /* gpakAlgControl return status. */
246 typedef enum
247 {
248 AcSuccess = 0, /* control successful */
249 AcInvalidChannel = 1, /* invalid channel identifier */
250 AcInvalidDsp = 2, /* invalid DSP */
251 AcParmError = 3, /* invalid control parameter */
252 AcDspCommFailure = 4 /* failed to communicate with DSP */
253 } gpakAlgControlStat_t;
254
255 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
256 * gpakAlgControl - Control an Algorithm.
257 *
258 * FUNCTION
259 * This function controls an Algorithm
260 *
261 * RETURNS
262 * Status code indicating success or a specific error.
263 *
264 */
265 extern gpakAlgControlStat_t gpakAlgControl(
266 unsigned short int DspId, // DSP identifier
267 unsigned short int ChannelId, // channel identifier
268 GpakAlgCtrl_t ControlCode, // algorithm control code
269 GPAK_AlgControlStat_t *pStatus // pointer to return status
270 );
271
272
273 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
274
275 /* gpakConfigurePorts return status. */
276 typedef enum
277 {
278 CpsSuccess = 0, /* Serial Ports configured successfully */
279 CpsParmError = 1, /* Configure Ports Parameter error */
280 CpsInvalidDsp = 2, /* invalid DSP */
281 CpsDspCommFailure = 3 /* failed to communicate with DSP */
282 } gpakConfigPortStatus_t;
283
284 /*
285 * gpakConfigurePorts - Configure a DSP's serial ports.
286 *
287 * FUNCTION
288 * This function configures a DSP's serial ports.
289 *
290 * RETURNS
291 * Status code indicating success or a specific error.
292 *
293 */
294 extern gpakConfigPortStatus_t gpakConfigurePorts(
295 unsigned short int DspId, // DSP identifier
296 const GpakPortConfig_t *pPortConfig, // pointer to Port Config info
297 GPAK_PortConfigStat_t *pStatus // pointer to Port Config Status
298 );
299
300 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
301
302 /* gpakDownloadDsp return status. */
303 typedef enum
304 {
305 GdlSuccess = 0, /* DSP download successful */
306 GdlFileReadError = 1, /* error reading Download file */
307 GdlInvalidFile = 2, /* invalid Download file content */
308 GdlInvalidDsp = 3 /* invalid DSP */
309 } gpakDownloadStatus_t;
310
311 /*
312 * gpakDownloadDsp - Download a DSP's Program and initialized Data memory.
313 *
314 * FUNCTION
315 * This function reads a DSP's Program and Data memory image from the
316 * specified file and writes the image to the DSP's memory.
317 *
318 * RETURNS
319 * Status code indicating success or a specific error.
320 *
321 */
322 extern gpakDownloadStatus_t gpakDownloadDsp(
323 unsigned short int DspId, // DSP identifier
324 GPAK_FILE_ID FileId // G.PAK download file identifier
325 );
326
327 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
328
329 /* gpakReadEventFIFOMessage return status */
330 typedef enum
331 {
332 RefEventAvail = 0, /* an event was successfully read from the fifo */
333 RefNoEventAvail = 1, /* no event was in the fifo */
334 RefInvalidDsp = 2, /* invalid DSP identifier */
335 RefInvalidEvent = 3, /* invalid event */
336 RefDspCommFailure = 4 /* error communicating with DSP */
337 } gpakReadEventFIFOMessageStat_t;
338
339 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
340 * gpakReadEventFIFOMessage - read from the event fifo
341 *
342 * FUNCTION
343 * This function reads a single event from the event fifo if one is available
344 *
345 * RETURNS
346 * Status code indicating success or a specific error.
347 *
348 * Note: This function should be called in a loop until the return status
349 * indicates that the fifo is empty.
350 */
351 extern gpakReadEventFIFOMessageStat_t gpakReadEventFIFOMessage(
352 unsigned short int DspId, // DSP identifier
353 unsigned short int *pChannelId, // pointer to channel identifier
354 GpakAsyncEventCode_t *pEventCode, // pointer to Event Code
355 GpakAsyncEventData_t *pEventData // pointer to Event Data Struct
356 );
357
358
359 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
360
361 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
362
363 /* gpakPingDsp return status values */
364 typedef enum
365 {
366 PngSuccess = 0, /* DSP responded successfully */
367 PngInvalidDsp = 1, /* invalid DSP identifier */
368 PngDspCommFailure = 2 /* error communicating with DSP */
369 } gpakPingDspStat_t;
370
371 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
372 * gpakPingDsp - ping the DSP to see if it's alive
373 *
374 * FUNCTION
375 * This function checks if the DSP is still communicating with the host
376 *
377 * RETURNS
378 * Status code indicating success or a specific error.
379 */
380 extern gpakPingDspStat_t gpakPingDsp(
381 unsigned short int DspId, // DSP identifier
382 unsigned short int *pDspSwVersion // DSP software version
383 );
384
385 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
386
387 /* gpakSerialTxFixedValue return status values */
388 typedef enum
389 {
390 TfvSuccess = 0, /* operation successful */
391 TfvInvalidChannel = 1, /* invalid channel identifier */
392 TfvInvalidDsp = 2, /* invalid DSP identifier */
393 TfvDspCommFailure = 3 /* failed to communicate with DSP */
394 } gpakSerialTxFixedValueStat_t;
395
396 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
397 * gpakSerialTxFixedValue - transmit a fixed value on a timeslot
398 *
399 * FUNCTION
400 * This function controls transmission of a fixed value out onto a serial
401 * port's timeslot.
402 *
403 * RETURNS
404 * Status code indicating success or a specific error.
405 */
406 extern gpakSerialTxFixedValueStat_t gpakSerialTxFixedValue(
407 unsigned short int DspId, // DSP identifier
408 unsigned short int ChannelId, // channel identifier
409 GpakSerialPort_t PcmOutPort, // PCM Output Serial Port Id
410 unsigned short int PcmOutSlot, // PCM Output Time Slot
411 unsigned short int Value, // 16-bit value
412 GpakActivation State // activation state
413 );
414
415 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
416
417 /* gpakControlTdmLoopBack return status values */
418 typedef enum
419 {
420 ClbSuccess = 0, /* operation successful */
421 ClbSerPortInactive = 1, /* serial port is inactive */
422 ClbInvalidDsp = 2, /* invalid DSP identifier */
423 ClbDspCommFailure = 3 /* failed to communicate with DSP */
424 } gpakControlTdmLoopBackStat_t;
425
426 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
427 * gpakControlTdmLoopBack - control a serial port's loopback state
428 *
429 * FUNCTION
430 * This function enables/disables the tdm input to output looback mode on a
431 * serial port
432 *
433 * RETURNS
434 * Status code indicating success or a specific error.
435 */
436
437 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
438 gpakControlTdmLoopBackStat_t gpakControlTdmLoopBack(
439 unsigned short int DspId, // DSP identifier
440 GpakSerialPort_t SerialPort, // Serial Port Id
441 GpakActivation LoopBackState // Loopback State
442 );
443
444 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
445
446 /* gpakReadCpuUsage return status values */
447 typedef enum
448 {
449 RcuSuccess = 0, /* operation successful */
450 RcuInvalidDsp = 1, /* invalid DSP identifier */
451 RcuDspCommFailure = 2 /* communication failure */
452 } gpakReadCpuUsageStat_t;
453
454 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
455 * gpakReadCpuUsage - read the cpu usage statistics
456 *
457 * FUNCTION
458 * This function reads cpu utilization from the DSP.
459 *
460 * RETURNS
461 * Status code indicating success or a specific error.
462 */
463 extern gpakReadCpuUsageStat_t gpakReadCpuUsage(
464 unsigned short int DspId, // DSP identifier
465 unsigned short int *pPeakUsage, // pointer to peak usage variable
466 unsigned short int *pPrev1SecPeakUsage // peak usage over previous 1 second
467 );
468
469 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
470
471 /* gpakResetCpuUsageStats return status values */
472 typedef enum
473 {
474 RstcSuccess = 0, /* operation successful */
475 RstcInvalidDsp = 1, /* invalid DSP identifier */
476 RstcDspCommFailure = 2 /* communication failure */
477 } gpakResetCpuUsageStat_t;
478 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
479 * gpakResetCpuUsageStats - reset the cpu usage statistics
480 *
481 * FUNCTION
482 * This function resets the cpu utilization statistics
483 *
484 * RETURNS
485 * Status code indicating success or a specific error.
486 */
487 extern gpakResetCpuUsageStat_t gpakResetCpuUsageStats(
488 unsigned short int DspId // DSP identifier
489 );
490
491
492 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
493
494 /* gpakReadFramingStats return status values */
495 typedef enum
496 {
497 RfsSuccess = 0, /* operation successful */
498 RfsInvalidDsp = 1, /* invalid DSP identifier */
499 RfsDspCommFailure = 2 /* communication failure */
500 } gpakReadFramingStatsStatus_t;
501
502 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
503 * gpakReadFramingStats
504 *
505 * FUNCTION
506 * This function reads a DSP's framing interrupt statistics
507 *
508 * RETURNS
509 * Status code indicating success or a specific error.
510 */
511 extern gpakReadFramingStatsStatus_t gpakReadFramingStats(
512 unsigned short int DspId, // DSP identifier
513 unsigned short int *pFramingError1Count, // port 1 Framing error count
514 unsigned short int *pFramingError2Count, // port 2 Framing error count
515 unsigned short int *pFramingError3Count, // port 3 Framing error count
516 unsigned short int *pDmaStopErrorCount, // DMA-stoppage error count
517 unsigned short int *pDmaSlipStatsBuffer // DMA slips count
518 );
519
520 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
521
522 /* gpakResetFramingStats return values */
523 typedef enum
524 {
525 RstfSuccess = 0, /* operation successful */
526 RstfInvalidDsp = 1, /* invalid DSP identifier */
527 RstfDspCommFailure = 2 /* communication failure */
528 } gpakResetFramingStatsStatus_t;
529
530 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
531 * gpakResetFramingStats - reset a DSP's framing interrupt statistics
532 *
533 * FUNCTION
534 * This function resets a DSP's framing interrupt statistics
535 *
536 * RETURNS
537 * Status code indicating success or a specific error.
538 */
539 extern gpakResetFramingStatsStatus_t gpakResetFramingStats(
540 unsigned short int DspId // DSP identifier
541 );
542
543
544 typedef enum
545 {
546 RmmSuccess =0,
547 RmmInvalidDsp = 1,
548 RmmSizeTooBig = 2,
549 RmmFailure = 3,
550 RmmInvalidAddress = 4
551
552 } gpakReadDSPMemoryStat_t;
553 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
554 * gpakResetFramingStats - read a section of DSP memory
555 * to get access DSP registers, since 0x00--0x60 not HPI-accessable
556 *
557 * FUNCTION
558 * This function resets a DSP's framing interrupt statistics
559 *
560 * RETURNS
561 * Status code indicating success or a specific error.
562 */
563
564 extern gpakReadDSPMemoryStat_t gpakReadDSPMemoryMap(
565 unsigned short int DspId, // Dsp Identifier
566 unsigned short int *pDest, // Buffer on host to hold DSP memory map
567 DSP_ADDRESS BufrBaseAddress, // DSP memory users want to read out
568 unsigned short int MemoryLength_Word16 // Length of memory section read out, unit is 16-bit word
569 );
570
571 typedef enum
572 {
573 GPIOSuccess =0,
574 GPIOInvalidDsp = 1,
575 GPIODspCommFailure = 2
576 }gpakAccessGPIOStat_t;
577
578 extern gpakAccessGPIOStat_t gpakAccessGPIO(
579 unsigned short int DspId, // DSP identifier
580 GpakGPIOCotrol_t gpakControlGPIO,// select oeration, changeDIR/write/read
581 unsigned short int *pGPIOValue // pointer for the read/write value or DIR mask
582 );
583
584 /* gpakWriteSystemParms return status. */
585 typedef enum
586 {
587 WspSuccess = 0, /* System Parameters written successfully */
588 WspParmError = 1, /* Write System Parms's Parameter error */
589 WspInvalidDsp = 2, /* invalid DSP */
590 WspDspCommFailure = 3 /* failed to communicate with DSP */
591 } gpakWriteSysParmsStatus_t;
592
593 /* Definition of a System Parameters information structure. */
594 typedef struct
595 {
596 /* DTMF Parameters */
597 short int MinSigLevel; /* 0 = Disabled, Min Sig Power Level for detection */
598 short int SNRFlag; /* 0 = Disabled, relax SNR tolerances */
599 short int FreqDeviation; /* 0 = Disabled, X Percent Deviation times 10 (e.g. 1.7% is entered as 17) */
600 short int DtmfFwdTwist; /* 0 to 8 db */
601 short int DtmfRevTwist; /* 0 to 8 db */
602
603 short int DtmfValidityMask; /* This flag allows users to relax the trailing conditions of the tone */
604
605 } GpakSystemParms_t;
606 /* gpakReadSystemParms return status. */
607 typedef enum
608 {
609 RspSuccess = 0, /* System Parameters read successfully */
610 RspInvalidDsp = 1, /* invalid DSP */
611 RspDspCommFailure = 2 /* failed to communicate with DSP */
612 } gpakReadSysParmsStatus_t;
613
614 extern gpakReadSysParmsStatus_t gpakReadSystemParms(
615 unsigned short int DspId, // DSP identifier
616 GpakSystemParms_t *pSysParms /* pointer to System Parms info var */
617 );
618
619 extern gpakWriteSysParmsStatus_t gpakWriteSystemParms(
620 unsigned short int DspId, // DSP identifier
621 GpakSystemParms_t *pSysParms, /* pointer to System Parms info var */
622 unsigned short int UpdateBits, /* input: flags indicating which parms to update */
623 GPAK_SysParmsStat_t *pStatus /* pointer to Write System Parms Status */
624 );
625
626 #endif // end multiple inclusion
627