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

📄 dp_api_query_functions.c

📁 Lido PXA270平台开发板的最新BSP,包括源代码
💻 C
📖 第 1 页 / 共 5 页
字号:
 *					
 *					pbPaletteEnabled	-	A pointer to a flag which the function will use to
 *											indicate whether the specified plane is currently
 *											using a colour look up table (palette). Following
 *											successful operation of the function, if the flag is
 *											set to 'DP_TRUE', then the colour look up table
 *											currently being used. if the flag is set to
 *											'DP_FALSE', then the colour look up table is not 
 *											currently being used.
 *					
 * Outputs        : pbPaletteEnabled	-	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 establish whether the specified plane is currently
 *					using a colour look up table (palette), or whether the pixel information is
 *					being interpreted as 'absolute' colour information.
 *
 ***********************************************************************************************/

DP_UINT_16	DP_GetPaletteEnable			(	DP_UINT_16							ui16PlaneHandle,
											DP_PBOOL							pbPaletteEnabled		)
{
#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_GetPaletteEnable \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_PALETTE_ENABLED],
										&ui16ReturnValue );

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

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

		#if defined DP_ERROR_CHECKING
		}
		#endif

	#if defined DP_ERROR_CHECKING
	
	}

	#endif

return ui16ReturnValue;
}



















/***********************************************************************************************
 *
 * Function Name  : DP_WritePaletteData
 * Inputs         : ui16PlaneHandle		-	The handle (a sixteen bit number) by which the plane
 *											to be used is identified.
 *					
 *					ui8PaletteEntryNumber-	The position within the colour look up table for
 *											new data is being provided. The first position is
 *											entry number zero.
 *					
 *					sNewPaletteData		-	A populated DP_RGBColour structure, specifying the
 *											individual Red, Green and Blue colour components of
 *											the new colour look up table entry.
 *
 *					bWaitForVSYNC		-	Selects whether the new colour look up table entry
 *											should be written immediately, or whether the 
 *											function should poll continually for the VSYNC
 *											signal prior to writing the new information. Set to
 *											'DP_TRUE' if the function should poll for VSYNC, or
 *											to 'DP_FALSE' if the new data should be written
 *											immediately to hardware.
 * Outputs        : None.
 * 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 allows the user to overwrite a single entry in the colour
 *					look up table (palette) for the specified plane.
 *
 ***********************************************************************************************/

DP_UINT_16	DP_ReadPaletteData			(	DP_UINT_16							ui16PlaneHandle,
											DP_UINT_8							ui8PaletteEntryNumber,
											DP_PUINT_32							ui32NewPaletteData
										  )
{
#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_16		ui16CommandResult;
DP_BOOL			bPaletteEnabled;


	if ( DP_GetPaletteEnable ( ui16PlaneHandle, &bPaletteEnabled ) != DP_STANDARD_CODE_NO_ERROR)
		ui16ReturnValue = DP_ERR_EXCEEDS_CAPABILITIES;
	else if ( DP_auiPaletteLUTReferences [ ui16PlaneHandle ] == -1 )
		ui16ReturnValue = DP_ERR_EXCEEDS_CAPABILITIES;
	else
	{

		#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
			ui16CommandResult	=	DP_CommandSequence ((DP_CommandSequenceOperations) DP_COMMAND_SEQUENCE_OPERATIONS_SINGLE_COMMAND_INSTANT, 
															(DP_FieldTarget *) &DP_asGlobalFieldTargets [DP_GLOBAL_FIELD_PALETTE_FOR_PLANE_NUMBER],
															DP_auiPaletteLUTReferences [ ui16PlaneHandle ] );





			#if defined DP_ERROR_CHECKING
			if ( ui16CommandResult == DP_STANDARD_CODE_NO_ERROR )
			{
			#else
			if (( ui16CommandResult > DP_CRITICAL_ERROR_END_MARKER ) || ( ui16CommandResult == DP_STANDARD_CODE_NO_ERROR ))
			{
			#endif

				ui16ReturnValue	=	DP_CommandSequence ((DP_CommandSequenceOperations) DP_COMMAND_SEQUENCE_OPERATIONS_SINGLE_COMMAND_INSTANT, 
														(DP_FieldTarget *) &DP_asGlobalFieldTargets [DP_GLOBAL_FIELD_PALETTE_ENTRY_NUMBER],
														ui8PaletteEntryNumber );

			}

			#if defined DP_ERROR_CHECKING
			if ( ui16CommandResult == DP_STANDARD_CODE_NO_ERROR )
			{
			#else
			if (( ui16CommandResult > DP_CRITICAL_ERROR_END_MARKER ) || ( ui16CommandResult == DP_STANDARD_CODE_NO_ERROR ))
			{
			#endif

			*ui32NewPaletteData = DP_GetField ( (DP_FieldTarget *) &DP_asGlobalFieldTargets [DP_GLOBAL_FIELD_WRITE_DATA_TO_PALETTE],
										&ui16ReturnValue );
			}

				
		#if defined DP_ERROR_CHECKING
		}
		#endif

	}

	#if defined DP_ERROR_CHECKING
	if ( ui16CommandResult != DP_STANDARD_CODE_NO_ERROR )
	{
	#else
	if (( ui16CommandResult < DP_CRITICAL_ERROR_END_MARKER ) && ( ui16CommandResult != DP_STANDARD_CODE_NO_ERROR ))
	{
	#endif
		ui16ReturnValue = ui16CommandResult;
	}


return ui16ReturnValue;
}


















/***********************************************************************************************
 *
 * Function Name  : DP_GetAlphaBlendMode
 * Inputs         : ui16PlaneHandle		-	The handle by which the plane to be used is 
 *											identified.
 *
 *					peAlphaMode			-	A pointer to an instance of the 
 *											'DP_AlphaBlendModes' enumerated type which the 
 *											function will set to the current Alpha blend mode of 
 *											the specified plane. See API specification for 
 *											details on enumerated types.
 *					
 *					pui8GlobalBlendValue-	A pointer to a 'DP_UINT_8' which the function will
 *											fill with the current global Alpha blend value, 
 *											but only if the current Alpha blend mode is global.
 *					
 * Outputs        : peAlphaMode			-	See above.
 *
 *					pui8GlobalBlendValue-	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 establish the current Alpha blend mode and, if the
 *					current mode is global, the global blend value.
 *
 ***********************************************************************************************/

DP_UINT_16	DP_GetAlphaBlendMode		(	DP_UINT_16							ui16PlaneHandle,
											DP_AlphaBlendModes *				peAlphaMode,
											DP_PUINT_8							pui8GlobalBlendValue	)
{
#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;
DP_UINT_16		ui16i;

	#if defined DP_SIMULATION_MODE
	printf		("\n DP_GetAlphaBlendMode \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_ALPHA_BLEND_MODE ],
										&ui16ReturnValue );

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

		#endif
		
			/* Find out if the field value corresponds to any of the enumerated types			*/
			for ( ui16i = 0; ui16i == DP_ALPHA_BLEND_MODE_NUMBER_OF_MODES; ui16i++ )
			{
				if ( ui32FieldAsRead == DP_aui8AlphaBlendModeVals [ ui16i ] )
					break;
			}

			if ( ui16i != DP_ALPHA_BLEND_MODE_NUMBER_OF_MODES )
			{
				*peAlphaMode = (DP_AlphaBlendModes) ui16i;

				if ( ui16i != DP_ALPHA_BLEND_MODE_NO_ALPHA )
				{
					/* Establish the Global Alpha Blend Value */
					ui32FieldAsRead = DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][ DP_STREAM_SPECIFIC_FIELD_ALPHA_BLEND_MASTER_VALUE ],
													&ui16ReturnValue );

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

						*pui8GlobalBlendValue = (DP_UINT_8) ui32FieldAsRead;

					#if defined DP_ERROR_CHECKING
					}
					#endif	

				}
				else
					*pui8GlobalBlendValue = 0x00;

			}

			#if defined DP_ERROR_CHECKING

			else
			{
				ui16ReturnValue = DP_ERR_UNKNOWN_MODE;
			}

		}

		#endif

	#if defined DP_ERROR_CHECKING
	
	}

	#endif

return ui16ReturnValue;
}


/***********************************************************************************************
 *
 * Function Name  : DP_GetBlinking
 * Inputs         : ui16PlaneHandle		-	The handle (a sixteen bit number) by which the plane
 *											to be used is identified.
 *					
 *					pbAlternateSource	-	If the 'pui8BlinkRate' parameter is set to a non-
 *											zero value by the function, the variable pointed to
 *											by this parameter will also be set to indicate the
 *											current blinking mode :
 *												'DP_TRUE' blinking is using source buffer
 *											alternating.
 *												'DP_FALSE' blinking is turning the plane on
 *											and off.
 *					
 *					pui8BlinkRate		-	If the 'pbBlinkingOn' flag is set to 'DP_TRUE' by
 *											the function, then the pui8BlinkRate parameter, a
 *											pointer to a 'DP_UINT_8' is filled with the blink
 *											rate by the parameter. The blink rate is measured as
 *											the number of frames between the transition between
 *											source buffers.
 *					
 * Outputs        : pbAlternateSource	-	See above.
 *
 *					pui8BlinkRate		-	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 establish the rate at which blinking is occuring,
 *					and the current blinking mode.
 *
 ***********************************************************************************************/

⌨️ 快捷键说明

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