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

📄 vloss.c

📁 dvr
💻 C
字号:

#include "types.h"

#include <stdio.h>

#include "vloss.h"
#include "gio.h"
#include "md.h"

#ifdef TW2804
#include "tw2804.h"
#endif

//===============================================================================
//
//===============================================================================
void video_loss_enable_interrupt(void)
{
#ifdef TW2804
	xdata u8 int_mask;
	
	int_mask = tw2804_read(MD_2804_REG_IRQENA);
	tw2804_write(MD_2804_REG_IRQENA, int_mask | 0xF0);
#endif	
}

//===============================================================================
//
//===============================================================================
u8 video_loss_detect(void)
{
#ifdef TW2804
	static xdata u8 cur_vid_loss = 0;
	
	if(INT_2804 == HIGH) // could be MD interrupt or video loss interrupt
	{
		cur_vid_loss = tw2804_read(MD_2804_REG_DET_NVMD) & 0xF0;
		if(cur_vid_loss!=0)
		{
			tw2804_write(MD_2804_REG_IRQCLR, 0xF0);
			
		}
#ifdef DEBUG_2804_VIDLOSS
		printf("\n\rVID_LOSS:%02x", (u16)cur_vid_loss);
#endif
	}
	return cur_vid_loss;
#endif

}
	

⌨️ 快捷键说明

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