2998|2

484

帖子

12

TA的资源

纯净的硅(高级)

楼主
 

TivaWare2.0对于图形文字一些新的处理方法 [复制链接]

本帖最后由 平湖秋月 于 2014-1-7 13:52 编辑

TivaWare2.0 在其驱动库中,对于图形文字的处理采用接口驱动模式(LIDD)和光栅模式,为了搞清楚这些变化和到底这样做有什么好处,请坛友各抒己见,以便大家能共同提高,这里我点把火!!!
下面是一个用光栅模式的图形例程

TivaWare2.0新的有关图形文字的程序设计方法.docx

119.5 KB, 下载次数: 16

 
点赞 关注

回复
举报

484

帖子

12

TA的资源

纯净的硅(高级)

沙发
 
本帖最后由 平湖秋月 于 2014-1-2 16:08 编辑

The following example shows how to use the LCD Controller API
to configure an 800x480 resolution raster panel and start it displaying
from an 8bpp frame buffer. Note that raster timing configuration
varies from display to display. Consult your display’s datasheet and
modify tLCDRasterTiming values as required for your display.
//*****************************************************************************
//
// Define the frame buffer dimensions and format.
//
//*****************************************************************************
#define SCREEN_WIDTH 800
#define SCREEN_HEIGHT 480
#define SCREEN_BPP 8
//*****************************************************************************
//
// Define labels containing the size of the image bitmap and palette.
//
//*****************************************************************************
#define SIZE_IMAGE ((SCREEN_WIDTH * SCREEN_HEIGHT * SCREEN_BPP) / 8)
#define SIZE_PALETTE ((SCREEN_BPP == 8) ? (256 * 2) : (16 * 2))
//*****************************************************************************
//
// Position the frame buffer at an appropriate point in memory, most likely in
// EPI-connected SDRAM at 0x10000000. The frame buffer will be (SIZE_IMAGE +
// SIZE_PALETTE) bytes long.
//
//*****************************************************************************
uint32_t *g_pui32DisplayBuffer = (uint32_t *)LCD_FRAME_BUFFER_ADDR;
//*****************************************************************************
//
// Calculate pointers to the frame buffer palette and the first byte of the
// actual image bitmap.
//
//*****************************************************************************
uint16_t *g_pui16Palette = (uint16_t *)LCD_FRAME_BUFFER_ADDR;
uint8_t *g_pBitmap = (uint8_t *)(LCD_FRAME_BUFFER_ADDR + SIZE_PALETTE);
//*****************************************************************************
//
// Initialize our source color palette. These colors are defined in RGB888
// format as used by the TivaWare Graphics Library.
//
//*****************************************************************************
const uint32_t g_pulSrcPalette[256] =
{
   ClrBlack,
   ClrWhite,
   ClrRed,
   ClrLightGreen,
   ClrBlue,
   ClrYellow,
   ClrMagenta,
   ClrCyan,
   ClrOrange,
//
// and so on...
//
};
//*****************************************************************************
//
// Labels defining the desired pixel clock, PLL VCO frequency and system clock.
// Note that the system clock must be an integer multiple of the pixel clock.
//
//*****************************************************************************
#define PIXEL_CLOCK_FREQ 30000000
#define SYSTEM_VCO_FREQ SYSCTL_CFG_VCO_480
#define SYSTEM_CLOCK_FREQ 120000000
//*****************************************************************************
//
// The timings and signal polarities for the various raster interface signals.
// Timing parameters are defined in terms of pixel clocks (for horizontal
// timings) and lines (for vertical timings).
//
//*****************************************************************************
tLCDRasterTiming g_sRasterTimings =
{
(RASTER_TIMING_ACTIVE_HIGH_PIXCLK |
RASTER_TIMING_SYNCS_ON_RISING_PIXCLK),
SCREEN_WIDTH, SCREEN_HEIGHT,
2, 30, 8,
10, 10, 8,
0
};
//*****************************************************************************
//
// The interrupt handler for the LCD controller. This function merely
// counts the interrupts received.
//
//*****************************************************************************
void
LCDIntHandler(void)
{
uint32_t ui32Status;
//
// Get the current interrupt status and clear any active interrupts.
//
ui32Status = LCDIntStatus(LCD0_BASE, true);
LCDIntClear(LCD0_BASE, ui32Status);
//
// Handle any interrupts as required by the application. In normal
// operation, no action is required at interrupt time to keep the raster
// scan running.
//
}
//*****************************************************************************
//
// Initialize the LCD controller to drive the display in raster mode and
// enable the raster engine.
//
//*****************************************************************************
void
InitDisplay(uint32_t ui32SysClkHz, uint32_t ui32PixClock,
tLCDRasterTiming *psTimings)
{
uint32_t ui32Loop;
//
// Enable the LCD controller peripheral.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_LCD0);
//
// Wait to ensure that the LCD controller is enabled.
//
SysCtlDelay(2);
//
// Configure the LCD controller for raster operation with a pixel clock
// as close to the requested pixel clock as possible.
//
ui32PixClock = LCDModeSet(LCD0_BASE, (LCD_MODE_RASTER |
LCD_MODE_AUTO_UFLOW_RESTART),
ui32PixClock, ui32SysClkHz);
//
// Set the output format for the raster interface.
//
LCDRasterConfigSet(LCD0_BASE, RASTER_FMT_ACTIVE_PALETTIZED_16BIT, 0);
//
// Program the raster engine timings according to the display requirements.
//
LCDRasterTimingSet(LCD0_BASE, psTimings);
//
// Configure LCD DMA-related parameters.
//
LCDDMAConfigSet(LCD0_BASE, LCD_DMA_BURST_4);
//
// Set up the frame buffer.
//
LCDRasterFrameBufferSet(LCD0_BASE, 0, g_pui32DisplayBuffer,
SIZE_PALETTE + SIZE_IMAGE);
//
// Write the palette to the frame buffer.
//
LCDRasterPaletteSet(LCD0_BASE,
LCD_PALETTE_SRC_24BIT | LCD_PALETTE_TYPE_8BPP,
(uint32_t *)g_pui16Palette, g_pulSrcPalette, 0,
(SIZE_PALETTE / 2));
//
// Fill the frame buffer with black (pixel value 0 corresponds to black
// in the palette we just set).
//
for(ui32Loop = 0; ui32Loop < (SIZE_IMAGE / sizeof(uint32_t)); ui32Loop++)
{
g_pui32DisplayBuffer[ui32Loop] = 0;
}
//
// Enable the LCD interrupts.
//
LCDIntEnable(LCD0_BASE, (LCD_INT_DMA_DONE | LCD_INT_RASTER_FRAME_DONE |
LCD_INT_SYNC_LOST | LCD_INT_AC_BIAS_CNT | LCD_INT_UNDERFLOW |
LCD_INT_PAL_LOAD | LCD_INT_EOF0 | LCD_INT_EOF1));
IntEnable(INT_LCD0);
//
// Enable the raster output.
//
LCDRasterEnable(LCD0_BASE);
}
//*****************************************************************************
//
// This example demonstrates the use of the LCD Controller in raster mode.
//
//*****************************************************************************
int
main(void)
{
uint32_t ui32SysClock;
//
// Set the system clock to run from the PLL at 120 MHz.
//
ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN |
SYSCTL_USE_PLL |
SYSTEM_VCO_FREQ), SYSTEM_CLOCK_FREQ);
//
// Configure the device pins.
//
PinoutSet();
//
// Enable interrupts in the CPU.
//
IntMasterEnable();
//
// Initialize the display controller and start the raster engine.
//
InitDisplay(ui32SysClock, PIXEL_CLOCK_FREQ, &g_sRasterTimings);
while(1)
{
//
// Other application code...
//
}
}


点评

光栅显示模式,说得专业点,就是点阵显示模式  详情 回复 发表于 2014-1-2 16:18
 
 

回复

484

帖子

12

TA的资源

纯净的硅(高级)

板凳
 

解读

本帖最后由 平湖秋月 于 2014-1-7 13:53 编辑
平湖秋月 发表于 2014-1-2 16:04
The following example shows how to use the LCD Controller API
to configure an 800x480 resolution r ...

光栅显示模式,说得专业点,就是点阵显示模式,
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/9 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表