⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ac48drlo.c

📁 Audiocodes old vision DSP driver
💻 C
📖 第 1 页 / 共 4 页
字号:
/*               	Wait / don't wait for the AC48 to be                */
/*                  ready to deal with a new Command,                   */
/*                  which uses the 'AC48xxTransmitPacket'               */
/*                  function.                                           */
/*                                                                      */
/* Output  :    int:                                                    */
/*                  ( 0) "AC_OK" for successful operation.              */
/*                  (-1) "PACKET-FULL" detection in                     */
/*                          "DONT_WAIT_PACKET_EMPTY" mode.              */
/*                          AC48 is not ready to transmit a new packet  */
/*                          (suitable mode for polling).                */
/*                  ( 2) "STATUS_ERROR" detected by the AC48.           */
/*======================================================================*/
int Ac48xxDecoderDelayCommand(int DeviceIndex, TDecoderDelay DecoderDelay, 
                              TWaitMode WaitMode)
{
	TDecoderDelayCommand DecoderDelayCommand;
	DecoderDelayCommand.Header.ConstAA = 0xAA;
	DecoderDelayCommand.Header.Const_0_0_8 = 0;
	DecoderDelayCommand.Header.InitCommandOpCode = DECODER_DELAY_COMMAND_OP_CODE;
	DecoderDelayCommand.Header.InitCommandLength = sizeof(TDecoderDelayCommand);

    DecoderDelayCommand.Type  = DecoderDelay.Type;
    DecoderDelayCommand.Delay = DecoderDelay.Delay;
	DecoderDelayCommand.Const_0_2_4=0;
	DecoderDelayCommand.Const_0_2_8=0;
	return Ac48xxTransmitPacket(DeviceIndex, (char*)&DecoderDelayCommand, 
												DEBUG_OFF, WaitMode);
}

/*======================================================================*/
/* Name    :        Ac48xxRunCommand                                    */
/*======================================================================*/
/* Purpose :    This function is called from the initialization mode,   */
/*              just after initialization of the device is completed.   */
/*              It enters the device in run mode, idle state, by        */
/*              sending Run Command to the AC48 device.                 */
/*                                                                      */
/* Inputs  :    int DeviceIndex:                                        */
/*                  An integer, performing the device index.            */
/*              TWaitMode WaitMode:                                     */
/*               	Wait / don't wait for the AC48 to be                */
/*                  ready to deal with a new Command,                   */
/*                  which uses the 'AC48xxTransmitPacket'               */
/*                  function.                                           */
/*                                                                      */
/* Output  :    int:                                                    */
/*                  ( 0) "AC_OK" for successful operation.              */
/*                  (-1) "PACKET-FULL" detection in                     */
/*                          "DONT_WAIT_PACKET_EMPTY" mode.              */
/*                          AC48 is not ready to transmit a new packet  */
/*                          (suitable mode for polling).                */
/*                  ( 2) "STATUS_ERROR" detected by the AC48.           */
/*======================================================================*/
int Ac48xxRunCommand(int DeviceIndex, TWaitMode WaitMode)
{
	int i;
	TRunCommand RunCommand;
	RunCommand.Header.ConstAA=0xAA;
	RunCommand.Header.Const_0_0_8=0;
	RunCommand.Header.InitCommandOpCode = RUN_COMMAND_OP_CODE;
	RunCommand.Header.InitCommandLength = sizeof(TRunCommand);
				/* same as: char OutPacket[]={0xAA, 0x00, 0x01, 0x04}; */
	for(i=0; i<NUMBER_OF_CHANNELS; i++)
		Ac48xxClearSequenceArrays(DeviceIndex, i);
	return Ac48xxTransmitPacket(DeviceIndex, (char*)&RunCommand,
												DEBUG_OFF, WaitMode);
}

/****************************************************/
/*          Ac4814 Additional Init Mode  Commands:  */
/****************************************************/

#if AC48_SIGNALING_MODE == AC48_EXTENDED_SIGNALING_MODE

/*======================================================================*/
/* Name    :        Ac48xxExtendedSignalingCommand                      */
/*======================================================================*/
/* Purpose :    This function is called from the initialization mode.   */
/*              It determines the Signaling type by sending Extended    */
/*              Signaling Command to the AC48 device.                   */
/*                                                                      */
/* Inputs  :    int DeviceIndex:                                        */
/*                  An integer, performing the device index.            */
/*              TExtendedSignaling ExtendedSignaling:                   */
/*                  specifies Basic/Extended Signaling mode.            */
/*              TWaitMode WaitMode:                                     */
/*               	Wait / don't wait for the AC48 to be                */
/*                  ready to deal with a new Command,                   */
/*                  which uses the 'AC48xxTransmitPacket'               */
/*                  function.                                           */
/* Output  :    int:                                                    */
/*                  ( 0) "AC_OK" for successful operation.              */
/*                  (-1) "PACKET-FULL" detection in                     */
/*                          "DONT_WAIT_PACKET_EMPTY" mode.              */
/*                          AC48 is not ready to transmit a new packet  */
/*                          (suitable mode for polling).                */
/*                  ( 2) "STATUS_ERROR" detected by the AC48.           */
/*======================================================================*/
#if AC48_DEVICE != AC4830X_DEVICE
int Ac48xxExtendedSignalingCommand(int DeviceIndex, 
                                   TExtendedSignaling ExtendedSignaling, 
                                   TWaitMode WaitMode)
{
    TExtendedSignalingCommand ExtendedSignalingCommand;
	ExtendedSignalingCommand.Header.ConstAA=0xAA;
	ExtendedSignalingCommand.Header.Const_0_0_8=0;
	ExtendedSignalingCommand.Header.InitCommandOpCode = EXTENDED_SIGNALING_COMMAND_OP_CODE;
	ExtendedSignalingCommand.Header.InitCommandLength = sizeof(TExtendedSignalingCommand);

    ExtendedSignalingCommand.ExtendedSignaling = ExtendedSignaling;
    ExtendedSignalingCommand.Const_0_2_1=0;
    ExtendedSignalingCommand.Const_0_2_8=0;
	return Ac48xxTransmitPacket(DeviceIndex, 
                                        (char*)&ExtendedSignalingCommand,
										DEBUG_OFF, WaitMode);
}
#endif /* AC48_DEVICE */ 

/*======================================================================*/
/* Name    :        Ac48xxUserDefinedTonesCommand                       */
/*======================================================================*/
/* Purpose :    Assigns Tone Pairs Parameters to all channels in the    */
/*              device by sending AC48 USER DEFINED TONE PAIRS command. */
/*                                                                      */
/* Inputs  :    int DeviceIndex:                                        */
/*                  An integer, performing the device index.            */
/*                                                                      */
/*              TTonePairs *TonePairs: 	                                */
/*                  Array of all Tone Pairs structure.                  */
/*              TWaitMode WaitMode:                                     */
/*               	Wait / don't wait for the AC48 to be                */
/*                  ready to deal with a new Command,                   */
/*                  which uses the 'AC48xxTransmitPacket'               */
/*                  function.                                           */
/*                                                                      */
/* Output  :    int:                                                    */
/*                  ( 0) "AC_OK" for successful operation.              */
/*                  (-1) "PACKET-FULL" detection in                     */
/*                          "DONT_WAIT_PACKET_EMPTY" mode.              */
/*                          AC48 is not ready to transmit a new packet  */
/*                          (suitable mode for polling).                */
/*                  ( 2) "STATUS_ERROR" detected by the AC48.           */
/*======================================================================*/
int Ac48xxUserDefinedTonesCommand(int DeviceIndex, 
                                  TUserDefinedTones UserDefinedTones, 
                                  TWaitMode WaitMode)
{
	TUserDefinedTonesCommand UserDefinedTonesCommand;
	UserDefinedTonesCommand.Header.ConstAA=0xAA;
	UserDefinedTonesCommand.Header.Const_0_0_8=0;
	UserDefinedTonesCommand.Header.InitCommandOpCode = USER_DFINED_TONES_COMMAND_OP_CODE;
	UserDefinedTonesCommand.Header.InitCommandLength = sizeof(TUserDefinedTonesCommand);

    UserDefinedTonesCommand.UserDefinedTones = UserDefinedTones;
    return Ac48xxTransmitPacket(DeviceIndex, 
                                (char*)&UserDefinedTonesCommand, 
                                DEBUG_OFF, WaitMode);
}
/*======================================================================*/
/* Name    :        Ac48xxCallProgressCommand                           */
/*======================================================================*/
/* Purpose :    This function is called from the initialization mode.   */
/*              It determines the Call Progress data transferred by     */
/*              sending TCallProgress structure to the AC48             */
/*                                                                      */
/* Inputs  :    int DeviceIndex:                                        */
/*                  An integer, performing the device index.            */
/*              TCallProgress CallProgress:                             */
/*                  this structure contains all the Extended signaling  */
/*                  data, needed.                                       */
/*              TWaitMode WaitMode:                                     */
/*               	Wait / don't wait for the AC48 to be                */
/*                  ready to deal with a new Command,                   */
/*                  which uses the 'AC48xxTransmitPacket'               */
/*                  function.                                           */
/* Output  :    int:                                                    */
/*                  ( 0) "AC_OK" for successful operation.              */
/*                  (-1) "PACKET-FULL" detection in                     */
/*                          "DONT_WAIT_PACKET_EMPTY" mode.              */
/*                          AC48 is not ready to transmit a new packet  */
/*                          (suitable mode for polling).                */
/*                  ( 2) "STATUS_ERROR" detected by the AC48.           */
/*======================================================================*/
int Ac48xxCallProgressCommand(int DeviceIndex,TCallProgress CallProgress, 
                              TWaitMode WaitMode)
{
	TCallProgressCommand CallProgressCommand;
	CallProgressCommand.Header.ConstAA=0xAA;
	CallProgressCommand.Header.Const_0_0_8=0;
	CallProgressCommand.Header.InitCommandOpCode = CALL_PROGRESS_COMMAND_OP_CODE;
	CallProgressCommand.Header.InitCommandLength = sizeof(TCallProgressCommand);

    CallProgressCommand.CallProgress = CallProgress;
    return Ac48xxTransmitPacket(DeviceIndex, (char*)&CallProgressCommand, 
								                    DEBUG_OFF, WaitMode);
}
#endif /* AC48_SIGNALING_MODE */

/******************************************/
/*          Idle (run) Mode Commands      */
/******************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -