📄 txc_envoy_spi3_api.c
字号:
/*--------------------------------------------------------------------------
******* ****
* ***** ** * * * * * * ***** **** * *
* * * * * ** * * * * * * * * * *
* * * * * * * * **** * * * * * ******
* ***** ****** * * * * * ** * * * * * *
* * * * * * ** * * ** ** * * * * * *
* * * * * * * **** * * * * **** * *
Proprietary and Confidential
This program is made available only to customers and prospective customers
of TranSwitch Corporation under license and may be used only with TranSwitch
semi-conductor products.
Copyright(c) 2004 TranSwitch Inc.
--------------------------------------------------------------------------
******* ** ** ** ** ******** ** **
******* *** ** ** ** ********** ** **
** ** * ** ** ** ** ** ** **
***** ** * ** ** ** ** ** * *
***** ** * ** ** ** ** ** **
** ** * ** ** ** ** ** **
******* ** *** **** ********** **
******* ** ** ** ******** **
--------------------------------------------------------------------------
TranSwitch Envoy-CE2/CE4
Device Driver
--------------------------------------------------------------------------
Workfile: txc_envoy_spi3_api.c
Description: Configuration functions of the The SPI-3 Interface
--------------------------------------------------------------------------
Revision History
--------------------------------------------------------------------------
Rev # Date Author Description
----- ------- ------------ ----------------------
0.5.0 6/03/04 F. Giannella Initial release (beta)
*--------------------------------------------------------------------------*/
/****************************************************************************
** Include Files **
****************************************************************************/
#include "txc_envoy_api.h"
#include "txc_envoy_spi3_support.h"
/****************************************************************************
** Static Functions **
****************************************************************************/
/****************************************************************************
** Static/Global Variables **
****************************************************************************/
/****************************************************************************
** Code **
****************************************************************************/
/************************************************************************************/
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
/************************************************************************************
FUNCTION: TXC_IfSPI3_InputIfaceSet
DESCRIPTION: This function sets the generic configuration of the SPI-3
Input interface control parameters.
INPUTS: handle: Instance of the Envoy device to configure
interfaceId: SPI-3 Bus Interface identifier
spi3InputIfaceDataPtr: a pointer to type TXC_IfSPI3_INPUT_STRUCT
RETURNS: TXC_NO_ERR or an appropriate specific error code.
REVISION HISTORY:
Rev # Date Author Description
----- ------- ------------ ----------------------
0.5.0 6/03/04 F. Giannella Initial release (beta)
*--------------------------------------------------------------------------*/
TXC_U16BIT TXC_IfSPI3_InputIfaceSet (TXC_U16BIT handle, TXC_U8BIT interfaceId,
TXC_IfSPI3_INPUT_STRUCT *spi3InputIfaceDataPtr)
{
TXC_U16BIT error;
/* check for input parameters */
error = ENVOY_SetSpi3InputIfaceValid (handle, interfaceId, spi3InputIfaceDataPtr);
/* process the data if no error */
if (error == TXC_NO_ERR)
{
#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE
/* error = ENVOY_SetSpi3InputIfaceVirtual (handle, spi3InputIfaceDataPtr); */
#else
error = ENVOY_SetSpi3InputIfaceReal (handle, spi3InputIfaceDataPtr);
#endif
}
/* return the error code */
return error;
}
/************************************************************************************/
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
/************************************************************************************
FUNCTION: TXC_IfSPI3_InputIfaceGet
DESCRIPTION: This function gets the generic configuration of the SPI-3
Input interface control parameters.
INPUTS: handle: Instance of the Envoy device to configure
interfaceId: SPI-3 Bus Interface identifier
spi3InputIfaceDataPtr: a pointer to type TXC_IfSPI3_INPUT_STRUCT
RETURNS: TXC_NO_ERR or an appropriate specific error code.
REVISION HISTORY:
Rev # Date Author Description
----- ------- ------------ ----------------------
0.5.0 6/03/04 F. Giannella Initial release (beta)
*--------------------------------------------------------------------------*/
TXC_U16BIT TXC_IfSPI3_InputIfaceGet (TXC_U16BIT handle, TXC_U8BIT interfaceId,
TXC_IfSPI3_INPUT_STRUCT *spi3InputIfaceDataPtr)
{
TXC_U16BIT error;
/* check for input parameters */
error = ENVOY_GetSpi3InputIfaceValid (handle, interfaceId);
/* process the data if no error */
if (error == TXC_NO_ERR)
{
#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE
/* error = ENVOY_GetSpi3InputIfaceVirtual (handle, spi3InputIfaceDataPtr); */
#else
error = ENVOY_GetSpi3InputIfaceReal (handle, spi3InputIfaceDataPtr);
#endif
}
/* return the error code */
return error;
}
/************************************************************************************/
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
/************************************************************************************
FUNCTION: TXC_IfSPI3_OutputIfaceSet
DESCRIPTION: This function sets the generic configuration of the SPI-3
Output interface control parameters.
INPUTS: handle: Instance of the Envoy device to configure
interfaceId: SPI-3 Bus Interface identifier
spi3OutputIfaceDataPtr: a pointer to type TXC_IfSPI3_OUTPUT_STRUCT
RETURNS: TXC_NO_ERR or an appropriate specific error code.
REVISION HISTORY:
Rev # Date Author Description
----- ------- ------------ ----------------------
0.5.0 6/03/04 F. Giannella Initial release (beta)
*--------------------------------------------------------------------------*/
TXC_U16BIT TXC_IfSPI3_OutputIfaceSet (TXC_U16BIT handle, TXC_U8BIT interfaceId,
TXC_IfSPI3_OUTPUT_STRUCT *spi3OutputIfaceDataPtr)
{
TXC_U16BIT error;
/* check for input parameters */
error = ENVOY_SetSpi3OutputIfaceValid (handle, interfaceId, spi3OutputIfaceDataPtr);
/* process the data if no error */
if (error == TXC_NO_ERR)
{
#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE
/* error = ENVOY_SetSpi3OutputIfaceVirtual (handle, spi3OutputIfaceDataPtr); */
#else
error = ENVOY_SetSpi3OutputIfaceReal (handle, spi3OutputIfaceDataPtr);
#endif
}
/* return the error code */
return error;
}
/************************************************************************************/
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
/************************************************************************************
FUNCTION: TXC_IfSPI3_OutputIfaceGet
DESCRIPTION: This function gets the generic configuration of the SPI-3
Output interface control parameters.
INPUTS: handle: Instance of the Envoy device to configure
interfaceId: SPI-3 Bus Interface identifier
spi3OutputIfaceDataPtr: a pointer to type TXC_IfSPI3_OUTPUT_STRUCT
RETURNS: TXC_NO_ERR or an appropriate specific error code.
REVISION HISTORY:
Rev Date Author Description
----- ------- ------------ -----------------
0.0.5 5/17/04 F. Giannella initial code
*--------------------------------------------------------------------------*/
TXC_U16BIT TXC_IfSPI3_OutputIfaceGet (TXC_U16BIT handle, TXC_U8BIT interfaceId,
TXC_IfSPI3_OUTPUT_STRUCT *spi3OutputIfaceDataPtr)
{
TXC_U16BIT error;
/* check for input parameters */
error = ENVOY_GetSpi3OutputIfaceValid (handle, interfaceId);
/* process the data if no error */
if (error == TXC_NO_ERR)
{
#ifdef TXC_ENVOY_VIRTUAL_DEVICE_MODE
/* error = ENVOY_GetSpi3OutputIfaceVirtual (handle, spi3OutputIfaceDataPtr); */
#else
error = ENVOY_GetSpi3OutputIfaceReal (handle, spi3OutputIfaceDataPtr);
#endif
}
/* return the error code */
return error;
}
/************************************************************************************/
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
/************************************************************************************
FUNCTION: TXC_IfSPI3_PortCtrlSet
DESCRIPTION: This function configures the SPI-3 port enable status per device and
per port granularity.
INPUTS: handle: Instance of the Envoy device to configure
interfaceId: SPI-3 Bus Interface identifier
port: the logical SPI-3 port ID to access
spi3PortCtrlPtr: a pointer to type TXC_IfSPI3_PORT_CTRL_STRUCT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -