xti.c
资源名称:str711USB.rar [点击查看]
上传用户:yyyd609
上传日期:2022-07-18
资源大小:183k
文件大小:2k
源码类别:
微处理器开发
开发平台:
C/C++
- /******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
- * File Name : xti.c
- * Author : MCD Application Team
- * Date First Issued : 06/08/2003
- * Description : This file provides all the XTI software functions
- ********************************************************************************
- * History:
- * 01/01/2004 : V1.2
- * 14/07/2004 : V1.3
- *******************************************************************************/
- #include "xti.h"
- /*******************************************************************************
- * Function Name : XTI_Init
- * Description : Initialize the XTI
- * Input : None.
- * Output : None.
- * Return : None.
- *******************************************************************************/
- void XTI_Init(void)
- {
- XTI->SR=0x00;
- XTI->MRH=0x00;
- XTI->MRL=0x00;
- XTI->TRH=0x00;
- XTI->TRL=0x00;
- XTI->PRH=0x00;
- XTI->PRL=0x00;
- XTI->CTRL=0x00;
- XTI->CTRL=0x00;
- }
- /*******************************************************************************
- * Function Name : XTI_LineModeConfig
- * Description : Configure the trigger edge.
- * Input 1 : Lines to be configured.
- * Input 2 : The trigger edge can be FallingEdge or RisingEdge.
- * Output : None
- * Return : None
- *******************************************************************************/
- void XTI_LineModeConfig(u16 Lines, XTITriggerEdge_TypeDef TriggerEdge)
- {
- if(TriggerEdge == XTI_FallingEdge)
- {
- XTI->TRL &= ~Lines;
- XTI->TRH &= ~(Lines>>8)&0x00FF;
- }
- else
- {
- XTI->TRL |= Lines;
- XTI->TRH |= (Lines>>8)&0x00FF;
- }
- }
- /*******************************************************************************
- * Function Name : XTI_LineConfig
- * Description : Enable and disable lines interrupts
- * Input 1 : Lines to be configured.
- * Input 2 : NewState can be ENABLE or DISABLE.
- * Output : None
- * Return : None
- *******************************************************************************/
- void XTI_LineConfig(u16 Lines, FunctionalState NewState)
- {
- if(NewState)
- {
- XTI->MRL |= Lines;
- XTI->MRH |= (Lines>>8)&0x00FF;
- }
- else
- {
- XTI->MRL &= ~Lines;
- XTI->MRL &= ~(Lines>>8)&0x00FF;
- }
- }
- /******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/