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

📄 dp_api_query_functions.c

📁 Lido PXA270平台开发板的最新BSP,包括源代码
💻 C
📖 第 1 页 / 共 5 页
字号:

DP_UINT_16	DP_GetBlinking				(	DP_UINT_16							ui16PlaneHandle,
											DP_PBOOL							pbAlternateSource,
											DP_PUINT_8							pui8BlinkRate		)
{
#if defined DP_ERROR_CHECKING
DP_UINT_16				ui16ReturnValue = DP_STANDARD_CODE_NO_ERROR;
#else
DP_UINT_16				ui16ReturnValue = DP_ERR_NO_ERROR_CHECKING;
#endif

DP_UINT_32		ui32FieldAsRead;

	#if defined DP_SIMULATION_MODE
	printf		("\n DP_GetBlinking \n");
	#endif

	#if defined DP_ERROR_CHECKING
	if ( !DP_bIsPipelineInitialised )
		ui16ReturnValue = DP_ERR_NOT_INITIALISED;
	else if ( ui16PlaneHandle > DP_NO_OF_STREAMS )
		ui16ReturnValue = DP_ERR_UNKNOWN_PLANE;
	/* else if.... (other tests here)															*/


	if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
	{

	#endif

		/* Establish the blink rate																*/
		ui32FieldAsRead = DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][DP_STREAM_SPECIFIC_FIELD_BLINKING_RATE],
										&ui16ReturnValue );

		#if defined DP_ERROR_CHECKING
		if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
		{
		#endif

			*pui8BlinkRate = (DP_UINT_8) ui32FieldAsRead;

			if ( pui8BlinkRate != 0 )
			{

				/* Establish the current blinking mode												*/
				ui32FieldAsRead = DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][ DP_STREAM_SPECIFIC_FIELD_BLINKING_SOURCE_ALTERNATE ],
												&ui16ReturnValue );

				#if defined DP_ERROR_CHECKING	
				if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
				{
				#endif
			
					*pbAlternateSource = (DP_BOOL) (ui32FieldAsRead & 0x01);

				#if defined DP_ERROR_CHECKING
				}
				#endif

			}

		#if defined DP_ERROR_CHECKING
		}
		#endif

	#if defined DP_ERROR_CHECKING
	
	}

	#endif

return ui16ReturnValue;
}


/***********************************************************************************************
 *
 * Function Name  : DP_GetBackgroundColour
 * Inputs         : psBackgroundColour	-	A pointer to an unpopulated 'DP_RGBColour' structure
 *											which the function will fill with the individual
 *											Red, Green and Blue components of the current
 *											background colour.
 *					
 * Outputs        : psBackgroundColour	-	See above.
 * Returns        : DP_UINT_16			-	Returns one of the defined display pipeline error
 *											codes, according to the success of the function and
 *											whether the compiler directive DP_ERROR_CHECKING
 *											is enabled. See API specification for more details
 *											on error types.
 *
 * Description    : This function is used to retrieve the current background colour.
 *
 ***********************************************************************************************/

DP_UINT_16	DP_GetBackgroundColour		(	DP_pRGBColour						psBackgroundColour	)
{
#if defined DP_ERROR_CHECKING
DP_UINT_16				ui16ReturnValue = DP_STANDARD_CODE_NO_ERROR;
#else
DP_UINT_16				ui16ReturnValue = DP_ERR_NO_ERROR_CHECKING;
#endif

DP_UINT_32		ui32FieldAsRead;

	#if defined DP_SIMULATION_MODE
	printf		("\n DP_GetBackgroundColour \n");
	#endif

	#if defined DP_ERROR_CHECKING
	if ( !DP_bIsPipelineInitialised )
		ui16ReturnValue = DP_ERR_NOT_INITIALISED;

	/* else if.... (other tests here)															*/


	if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
	{

	#endif

		/* Read the field value																	*/
		ui32FieldAsRead = DP_GetField ( (DP_FieldTarget *) &DP_asGlobalFieldTargets [DP_GLOBAL_FIELD_BACKGROUND_COLOUR],
										&ui16ReturnValue );

		#if defined DP_ERROR_CHECKING
		
		if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
		{
		#endif

			psBackgroundColour->ui8Red	= (DP_UINT_8) (( ui32FieldAsRead & 0x00FF0000 ) >> 16);
			psBackgroundColour->ui8Green = (DP_UINT_8) (( ui32FieldAsRead & 0x0000FF00 ) >> 8);
			psBackgroundColour->ui8Blue	= (DP_UINT_8)  ( ui32FieldAsRead & 0x000000FF );

		#if defined DP_ERROR_CHECKING
		}
		#endif

	#if defined DP_ERROR_CHECKING
	
	}

	#endif

return ui16ReturnValue;
}


/***********************************************************************************************
 *
 * Function Name  : DP_GetBorderColour
 * Inputs         : psBorderColour		-	A pointer to an unpopulated 'DP_RGBColour' structure
 *											which the function will fill with the individual
 *											Red, Green and Blue components of the current
 *											background's border colour.
 *					
 * Outputs        : psBorderColour		-	See above.
 * Returns        : DP_UINT_16			-	Returns one of the defined display pipeline error
 *											codes, according to the success of the function and
 *											whether the compiler directive DP_ERROR_CHECKING
 *											is enabled. See API specification for more details
 *											on error types.
 *
 * Description    : This function is used to retrieve the current background border colour.
 *
 ***********************************************************************************************/

DP_UINT_16	DP_GetBorderColour			(	DP_pRGBColour						psBorderColour		)
{
#if defined DP_ERROR_CHECKING
DP_UINT_16				ui16ReturnValue = DP_STANDARD_CODE_NO_ERROR;
#else
DP_UINT_16				ui16ReturnValue = DP_ERR_NO_ERROR_CHECKING;
#endif

DP_UINT_32		ui32FieldAsRead;

	#if defined DP_SIMULATION_MODE
	printf		("\n DP_GetBorderColour \n");
	#endif

	#if defined DP_ERROR_CHECKING
	if ( !DP_bIsPipelineInitialised )
		ui16ReturnValue = DP_ERR_NOT_INITIALISED;

	/* else if.... (other tests here)															*/


	if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
	{

	#endif

		/* Read the field value																	*/
		ui32FieldAsRead = DP_GetField ( (DP_FieldTarget *) &DP_asGlobalFieldTargets [DP_GLOBAL_FIELD_BORDER_COLOUR],
										&ui16ReturnValue );

		#if defined DP_ERROR_CHECKING
		
		if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
		{
		#endif

			psBorderColour->ui8Red	= (DP_UINT_8) (( ui32FieldAsRead & 0x00FF0000 ) >> 16);
			psBorderColour->ui8Green = (DP_UINT_8) (( ui32FieldAsRead & 0x0000FF00 ) >> 8);
			psBorderColour->ui8Blue	= (DP_UINT_8)  ( ui32FieldAsRead & 0x000000FF );

		#if defined DP_ERROR_CHECKING
		}
		#endif

	#if defined DP_ERROR_CHECKING
	
	}

	#endif

return ui16ReturnValue;
}


/***********************************************************************************************
 *
 * Function Name  : DP_GetColourKeyMode
 * Inputs         : ui16PlaneHandle		-	The handle by which the plane to be used is 
 *											identified.
 *					
 *					pbColourKeyEnable	-	A pointer to a flag which the function will use to
 *											indicate whether colour keying is currently enabled
 *											for the specified plane. Following successful
 *											operation of the function, if the flag is set to
 *											'DP_TRUE', then colour keying is currently enabled.
 *											If the flag is set to 'DP_FALSE', then colour keying
 *											is currently disabled.
 *					
 *					pbKeyAgainstThisPlane-	If, following successful operation of the function,
 *											the 'pbColourKeyEnable' flag is set to 'DP_TRUE',
 *											the function will use the flag pointed to by this
 *											parameter to indicate whether colour keying is
 *											being applied based on the specified plane's colour
 *											key, or on that of the plane behind it in the draw
 *											order. If the flag is set to 'DP_TRUE', then colour
 *											keying is being conducted according the current
 *											plane's colour key. If the flag is set to 'DP_FALSE'
 *											, then colour keying is being conducted according to
 *											the plane behind the specified plane in the draw
 *											order.
 *											
 *					psColourKey			-	If, following successful operation of the function,
 *											the 'pbColourKeyEnable' flag is set to 'DP_TRUE',
 *											the function will fill the 'DP_RGBColour' structure
 *											pointed to by this parameter with the individual
 *											Red, Green and Blue colour components of the plane's
 *											colour key (not that of the plane behind it in the
 *											draw order, regardless of the returned value of
 *											'pbKeyAgainstThisPlane').
 *
 *					psColourKeyMask		-	If, following successful operation of the function,
 *											the 'pbColourKeyEnable' flag is set to 'DP_TRUE',
 *											the function will fill the 'DP_RGBColour' structure
 *											pointed to by this parameter with the mask
 *											information being used to filter during colour
 *											keying. Any bits which are set to '0' are being
 *											excluded from current colour key operations for the
 *											specified plane.
 *
 * Outputs        : pbColourKeyEnable	-	See above.
 *
 *					pbKeyAgainstThisPlane-	See above.
 *
 *					psColourKey			-	See above.
 *
 *					psColourKeyMask		-	See above.
 *
 * Returns        : DP_UINT_16			-	Returns one of the defined display pipeline error
 *											codes, according to the success of the function and
 *											whether the compiler directive DP_ERROR_CHECKING
 *											is enabled. See API specification for more details
 *											on error types.
 *
 * Description    : This function is used to retrieve the colour keying information relating to
 *					the specified plane.
 *
 ***********************************************************************************************/

DP_UINT_16	DP_GetColourKeyMode			(	DP_UINT_16							ui16PlaneHandle,
											DP_PBOOL							pbColourKeyEnable,
											DP_PBOOL							pbKeyAgainstThisPlane,
											DP_PUINT_32							pui32ColourKey,
											DP_PUINT_32							pui32ColourKeyMask		)
{
#if defined DP_ERROR_CHECKING
DP_UINT_16				ui16ReturnValue = DP_STANDARD_CODE_NO_ERROR;
#else
DP_UINT_16				ui16ReturnValue = DP_ERR_NO_ERROR_CHECKING;
#endif

DP_UINT_32		ui32FieldAsRead;

	#if defined DP_SIMULATION_MODE
	printf		("\n DP_GetColourKeyMode \n");
	#endif

	#if defined DP_ERROR_CHECKING
	if ( !DP_bIsPipelineInitialised )
		ui16ReturnValue = DP_ERR_NOT_INITIALISED;
	else if ( ui16PlaneHandle > DP_NO_OF_STREAMS )
		ui16ReturnValue = DP_ERR_UNKNOWN_PLANE;
	/* else if.... (other tests here)															*/


	if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
	{

	#endif

		/* Read the field value																	*/
		ui32FieldAsRead = DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][ DP_STREAM_SPECIFIC_FIELD_COLOUR_KEY_ENABLED ],
										&ui16ReturnValue );

		#if defined DP_ERROR_CHECKING
		if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
		{
		#endif

			*pbColourKeyEnable = (DP_BOOL) (ui32FieldAsRead & 0x01);

			if ( pbColourKeyEnable )
			{
				/* Establish whether keying is against this plane								*/
				ui32FieldAsRead = DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][ DP_STREAM_SPECIFIC_FIELD_COLOUR_KEY_AGAINST_THIS_PLANE ],
												&ui16ReturnValue );


				#if defined DP_ERROR_CHECKING
				if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
				{
				#endif
			
					*pbKeyAgainstThisPlane = (DP_BOOL) (ui32FieldAsRead & 0x01);

					/* Establish the colour key being used										*/
					ui32FieldAsRead = DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][ DP_STREAM_SPECIFIC_FIELD_COLOUR_KEY_COLOUR ],
													&ui16ReturnValue );

					#if defined DP_ERROR_CHECKING
					if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
					{
					#endif

						*pui32ColourKey = ui32FieldAsRead;

						/* Establish the colour key mask being used								*/
						ui32FieldAsRead = DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][ DP_STREAM_SPECIFIC_FIELD_COLOUR_KEY_MASK ],
														&ui16ReturnValue );

						#if defined DP_ERROR_CHECKING
						if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
						{
						#endif

							*pui32ColourKeyMask = ui32FieldAsRead;

						#if defined DP_ERROR_CHECKING
						}
						#endif

					#if defined DP_ERROR_CHECKING
					}
					#endif

				#if defined DP_ERROR_CHECKING
				}
				#endif

			} /* If colour key enabled */

		#if defined DP_ERROR_CHECKING
		}
		#endif

	#if defined DP_ERROR_CHECKING
	
	}

	#endif

return ui16ReturnValue;
}


/***********************************************************************************************
 *
 * Function Name  : DP_GetColourSpaceConversion
 * Inputs         : ui16PlaneHandle		-	The handle by which the plane to be used is 

⌨️ 快捷键说明

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