📄 sma_lcd_driver.c
字号:
/***********************************************************************
* $Workfile: SMA_lcd_driver.c $
* $Revision: 1.0 $
* $Author: WellsK $
* $Date: Aug 28 2002 13:29:24 $
*
* Project: Common LCD driver interface
*
* Description:
* See the header file for information on this package.
*
* Revision History:
* $Log: //smaicnt2/pvcs/VM/CHIPS/archives/SOC/Source/Universal Drivers/LCD/SMA_lcd_driver.c-arc $
*
* Rev 1.0 Aug 28 2002 13:29:24 WellsK
* Initial revision.
*
*
* SHARP MICROELECTRONICS OF THE AMERICAS MAKES NO REPRESENTATION
* OR WARRANTIES WITH RESPECT TO THE PERFORMANCE OF THIS SOFTWARE,
* AND SPECIFICALLY DISCLAIMS ANY RESPONSIBILITY FOR ANY DAMAGES,
* SPECIAL OR CONSEQUENTIAL, CONNECTED WITH THE USE OF THIS SOFTWARE.
*
* SHARP MICROELECTRONICS OF THE AMERICAS PROVIDES THIS SOFTWARE SOLELY
* FOR THE PURPOSE OF SOFTWARE DEVELOPMENT INCORPORATING THE USE OF A
* SHARP MICROCONTROLLER OR SYSTEM-ON-CHIP PRODUCT. USE OF THIS SOURCE
* FILE IMPLIES ACCEPTANCE OF THESE CONDITIONS.
*
* COPYRIGHT (C) 2002 SHARP MICROELECTRONICS OF THE AMERICAS, INC.
* CAMAS, WA
**********************************************************************/
#include "SMA_lcd_driver.h"
#include "LH7A400_lcd_private.h"
//**********************************************************************
// Global data
//**********************************************************************
// Specific panel enumeration (set on call to initialization function)
lcd_configuration_type *panel_data;
/***********************************************************************
*
* Function: lcd_initialize
*
* Purpose:
* Initializes the LCD controller for a specific panel type.
*
* Processing:
* See function. (Calls an indrect initialization function).
*
* Parameters:
* panel_sel : Enumeration of panel type fo configure
* fb_addr : Frame buffer address
*
* Outputs:
* None
*
* Returns:
* Nothing
*
* Notes:
* None
*
**********************************************************************/
void lcd_initialize (lcd_configuration_type *panel_sel, void *fb_addr)
{
// Set panel id
panel_data = panel_sel;
// Call indirect function
panel_sel->init (fb_addr);
}
/***********************************************************************
*
* Function: lcd_set_backlight_intens
*
* Purpose:
* Sets the backlight intensity.
*
* Processing:
* The passed value must be a value between 0 and max_intens. The
* value of max_intens may be different for different panel types.
* On panel types where max_intens = 1, the value of '1' will simply
* turn the backlight on. '0' will always turn the backlight off.
*
* Parameters:
* intens: Backlight intensity value
*
* Outputs:
* None
*
* Returns:
* Nothing
*
* Notes:
* None
*
**********************************************************************/
void lcd_set_backlight_intens (UNS_16 intens)
{
panel_data->backintens (intens);
}
/***********************************************************************
*
* Function:lcd_disable_enablelcd_disable
*
* Purpose:
* Disable or enable the LCD controller.
*
* Processing:
* See function.
*
* Parameters:
* off_on
*
* Outputs:
* None
*
* Returns:
* Nothing
*
* Notes:
* None
*
**********************************************************************/
void lcd_disable_enable (UNS_16 off_on)
{
panel_data->disenab (off_on);
}
/***********************************************************************
*
* Function: lcd_set_framebuffer
*
* Purpose:
* Set or reset the frame buffer location.
*
* Processing:
* See function.
*
* Parameters:
* fb_addr : Frame buffer address
*
* Outputs:
* None
*
* Returns:
* Nothing
*
* Notes:
* None
*
**********************************************************************/
void lcd_set_framebuffer (void *fb_addr)
{
panel_data->setfb (fb_addr);
}
/***********************************************************************
*
* Function: lcd_set_palette
*
* Purpose:
* Configure the palette.
*
* Processing:
* See function.
*
* Parameters:
* fb_addr : Frame buffer address
*
* Outputs:
* None
*
* Returns:
* Nothing
*
* Notes:
* None
*
**********************************************************************/
void lcd_set_palette (UNS_16 *palette)
{
panel_data->setpal (palette);
}
/***********************************************************************
*
* Function: lcd_get_xsize
*
* Purpose:
* Return the horizontal pixel resolution of the selected display.
*
* Processing:
* See function.
*
* Parameters:
* None
*
* Outputs:
* None
*
* Returns:
* The horizontal size (in pixels) of the display.
*
* Notes:
* None
*
**********************************************************************/
INT_16 lcd_get_xsize (void)
{
return panel_data->xsize;
}
/***********************************************************************
*
* Function: lcd_get_ysize
*
* Purpose:
* Return the vertical pixel resolution of the selected display.
*
* Processing:
* See function.
*
* Parameters:
* None
*
* Outputs:
* None
*
* Returns:
* The vertical size (in pixels) of the display.
*
* Notes:
* None
*
**********************************************************************/
INT_16 lcd_get_ysize (void)
{
return panel_data->ysize;
}
/***********************************************************************
*
* Function: lcd_get_bpp
*
* Purpose:
* Return the bits per pixel (colors) of the selected display.
*
* Processing:
* See function.
*
* Parameters:
* None
*
* Outputs:
* None
*
* Returns:
* The color depth (in bits per pixel) of the display.
*
* Notes:
* None
*
**********************************************************************/
INT_16 lcd_get_bpp (void)
{
return panel_data->bpp;
}
/***********************************************************************
*
* Function: lcd_get_max_intens
*
* Purpose:
* Get maximum backlight intensity.
*
* Processing:
* See function.
*
* Parameters:
* None
*
* Outputs:
* None
*
* Returns:
* The color depth (in bits per pixel) of the display.
*
* Notes:
* None
*
**********************************************************************/
INT_16 lcd_get_max_intens (void)
{
return panel_data->max_intens;
}
/***********************************************************************
*
* Function: lcd_update_pixel_clock
*
* Purpose:
* Update pixel clock rate.
*
* Processing:
* See function.
*
* Parameters:
* None
*
* Outputs:
* None
*
* Returns:
* Nothing
*
* Notes:
* This function should be called on a clock rate change (bus speed).
*
**********************************************************************/
void lcd_update_pixel_clock (void)
{
panel_data->uppixclk (panel_data->opt_clk);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -