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

📄 scart.c

📁 M3355的源代码
💻 C
字号:
/******************************************************************************
Copyright	(c)	2002 ALi Corporation.	All	Rights Reserved.
 
File name:		SCART.c
 
Purpose:
SCART TV Control
 
Public functions/variables:
 
Private	functions/variables:
 
History:
Date					by								Reason
==========	============	===================================================
2002/11/21	Edmund Huang	Created.
 
******************************************************************************/
#include <platform.h>

#if (_SCART==SCART_Enable)
#include <gpio.h>
#include <pe.h>
#include <itron.h>



/*--------------------------------------------------------------------
	Function name	: TurnOnScartTV()
	Purpose	: Turn on/off SCART TV
	Input	 : BOOL on, on=TRUE, turn on RGB; on=FALSE, turn off RGB
	Output : none
	Return : none
	Reference	: SCART TV specs.
	Example	:
	Remark :
 --------------------------------------------------------------------*/
void SetScartRGB(BOOL on)
{

    if (on == TRUE)
    {
        SET_GPIO_W(SCART_RGB);
        SET_GPIO_LOW(SCART_RGB);

        PRINTF("Set SCART_RGB low\n");
    }
    else
    {
        SET_GPIO_W(SCART_RGB);
        SET_GPIO_HI(SCART_RGB);

        PRINTF("Set SCART_RGB high");
    }

}

/*--------------------------------------------------------------------
	Function name	: SetScartVideoStatus()
	Purpose	: Set SCART video status as 4:3 or 16:9
	Input	 :
		int status; status==0, 4:3 mode; status==1, 16:9 mode.
	Output : none
	Return : none
	Reference	: SCART TV spec.
	Example	:
	Remark :
 --------------------------------------------------------------------*/
void SetScartVideoStatus(int status)
{

    if (status == 0)
    { // Support 4:3
        SET_GPIO_W(SCART_SW);
        SET_GPIO_LOW(SCART_SW);
        PRINTF("Set SCART_TV high\n");
    }
    else
    {// Support 16:9
        SET_GPIO_W(SCART_SW);
        SET_GPIO_HI(SCART_SW);
        PRINTF("Set SCART_TV low\n");
    }

    SET_GPIO_W(SCART_TV);
    SET_GPIO_LOW(SCART_TV);
    PRINTF("Set SCART_SW high\n");

}

/*--------------------------------------------------------------------
	Function name	: SetSCARTMode()
	Purpose	: Set SCART mode
	Input	 : SCART_MODE mode
	Output : none
	Return : none
	Reference	: SCART TV specs.
	Example	:
	Remark :
 --------------------------------------------------------------------*/
void SetSCARTScreenMode(SCART_SCREEN_MODE mode)
{
    PRINTF("SetSCARTScreenMode():: mode = %d\n", mode);

    if (mode == SCART_4_3)
    {
        SetScartVideoStatus(0);
    }
    else
    {
        SetScartVideoStatus(1);
    }
}

/*--------------------------------------------------------------------
	Function name	: SetSCARTMode()
	Purpose	: Set SCART mode
	Input	 : SCART_MODE mode
	Output : none
	Return : none
	Reference	: SCART TV specs.
	Example	:
	Remark :
 --------------------------------------------------------------------*/
void SetSCARTTVMode(SCART_TV_MODE mode)
{
    PRINTF("SetSCARTTVMode():: mode = %d\n", mode);

    if (mode == SCART_CVBS)
    {
        SetScartRGB(FALSE);
    }
    else
    {
        SetScartRGB(TRUE);
    }
}

#define PRINTF(...)
#endif

⌨️ 快捷键说明

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