//----------------------------------------------------------------------------------------------------
// ID Code      : Source.h No.0002
// Update Note  : 
//
//----------------------------------------------------------------------------------------------------

//----------------------------------------------------------------------------------------------------

#ifdef __SOURCE__
//--------------------------------------------------
// Function Prototypes
//--------------------------------------------------
bit CSourceHandler(void);
void CSourceInitialInputPort(void);
bit CSourceScanInputPort(void);
bit CSourceScanInputPortVGA(BYTE ucAnalogSource);
bit CSourceScanInputPortDVI(BYTE ucPar);

#else
//--------------------------------------------------
// Extern Function Prototypes
//--------------------------------------------------
extern bit CSourceHandler(void);
extern bit CSourceScanInputPortDVI(BYTE ucPar);
extern void CSourceInitialInputPort(void);

#endif
//--------------------------------------------------
// Macro of Input Port Select
//--------------------------------------------------
#define GET_INPUTPORT_SELECT(x)         ((bit)(ucInputPortInfo[x] & _BIT7))
#define SET_INPUTPORT_SELECT(x)         (ucInputPortInfo[x] |= _BIT7)
#define CLR_INPUTPORT_SELECT(x)         (ucInputPortInfo[x] &= ~_BIT7)


//--------------------------------------------------
// Macro of Input Port Signal Available
//--------------------------------------------------
/*#define GET_INPUTSIGNAL_AVAILABLE(x)    ((bit)(ucInputPortInfo[x] & _BIT6))
#define SET_INPUTSIGNAL_AVAILABLE(x)    (ucInputPortInfo[x] |= _BIT6)
#define CLR_INPUTSIGNAL_AVAILABLE(x)    (ucInputPortInfo[x] &= ~_BIT6)
*/

//--------------------------------------------------
// Macro of Input HS Selection
//--------------------------------------------------
#define GET_INPUT_HS_SELECTION(x)       ((bit)(ucInputPortInfo[x] & _BIT5))
#define SET_INPUT_HS_SELECTION(x)       (ucInputPortInfo[x] |= _BIT5)
#define CLR_INPUT_HS_SELECTION(x)       (ucInputPortInfo[x] &= ~_BIT5)


//--------------------------------------------------	//v003_interlace_check
// Macro of Interlace Mode Check
//--------------------------------------------------	
#define GET_INTERLACE_MODE(x)            	((bit)(ucInputPortInfo[x] & _BIT6))
#define SET_INTERLACE_MODE(x)            	(ucInputPortInfo[x] |= _BIT6)
#define CLR_INTERLACE_MODE(x)            	(ucInputPortInfo[x] &= ~_BIT6)


//--------------------------------------------------
// Macro of Getting Input Port Type
//--------------------------------------------------
#define GET_INPUTPORT_TYPE(x)           (ucInputPortInfo[x] & (_BIT0 | _BIT1 | _BIT2 | _BIT3))
#define SET_INPUTPORT_TYPE(x,y)         (ucInputPortInfo[x] = ((ucInputPortInfo[x] & ~(_BIT0 | _BIT1 | _BIT2 | _BIT3)) | y ))



