EE445M RTOS
Taken at the University of Texas Spring 2015
Lcd_api

Data Structures

struct  tLCDIDDTiming
 
struct  tLCDRasterTiming
 

Macros

#define PAL_FROM_RGB(ui32RGBColor)
 
#define CYCLES_FROM_TIME_US(ui32ClockFreq, ui32Time_uS)
 
#define CYCLES_FROM_TIME_NS(ui32ClockFreq, ui32Time_nS)
 
#define RASTER_TIMING_SYNCS_OPPOSITE_PIXCLK   0x00000000
 
#define RASTER_TIMING_SYNCS_ON_RISING_PIXCLK   0x02000000
 
#define RASTER_TIMING_SYNCS_ON_FALLING_PIXCLK   0x03000000
 
#define RASTER_TIMING_ACTIVE_HIGH_OE   0x00000000
 
#define RASTER_TIMING_ACTIVE_LOW_OE   0x00800000
 
#define RASTER_TIMING_ACTIVE_HIGH_PIXCLK   0x00000000
 
#define RASTER_TIMING_ACTIVE_LOW_PIXCLK   0x00400000
 
#define RASTER_TIMING_ACTIVE_HIGH_HSYNC   0x00000000
 
#define RASTER_TIMING_ACTIVE_LOW_HSYNC   0x00200000
 
#define RASTER_TIMING_ACTIVE_HIGH_VSYNC   0x00000000
 
#define RASTER_TIMING_ACTIVE_LOW_VSYNC   0x00100000
 
#define LCD_MODE_LIDD   ((uint8_t)0x00)
 
#define LCD_MODE_RASTER   ((uint8_t)0x01)
 
#define LCD_MODE_AUTO_UFLOW_RESTART   ((uint8_t)0x02)
 
#define LIDD_CONFIG_SYNC_MPU68   0x00000000
 
#define LIDD_CONFIG_ASYNC_MPU68   0x00000001
 
#define LIDD_CONFIG_SYNC_MPU80   0x00000002
 
#define LIDD_CONFIG_ASYNC_MPU80   0x00000003
 
#define LIDD_CONFIG_ASYNC_HITACHI   0x00000004
 
#define LIDD_CONFIG_INVERT_ALE   0x00000008
 
#define LIDD_CONFIG_INVERT_RS_EN   0x00000010
 
#define LIDD_CONFIG_INVERT_WS_DIR   0x00000020
 
#define LIDD_CONFIG_INVERT_CS0   0x00000040
 
#define LIDD_CONFIG_INVERT_CS1   0x00000080
 
#define RASTER_FMT_ACTIVE_24BPP_PACKED   0x02000080
 
#define RASTER_FMT_ACTIVE_24BPP_UNPACKED   0x06000080
 
#define RASTER_FMT_ACTIVE_PALETTIZED_12BIT   0x00000080
 
#define RASTER_FMT_ACTIVE_PALETTIZED_16BIT   0x00800080
 
#define RASTER_FMT_PASSIVE_MONO_4PIX   0x00000002
 
#define RASTER_FMT_PASSIVE_MONO_8PIX   0x00000202
 
#define RASTER_FMT_PASSIVE_PALETTIZED   0x00000000
 
#define RASTER_FMT_PASSIVE_COLOR_12BIT   0x00000000
 
#define RASTER_FMT_PASSIVE_COLOR_16BIT   0x01000000
 
#define RASTER_ACTVID_DURING_BLANK   0x08000000
 
#define RASTER_NIBBLE_MODE_ENABLED   0x00400000
 
#define RASTER_LOAD_DATA_ONLY   0x00200000
 
#define RASTER_LOAD_PALETTE_ONLY   0x00100000
 
#define RASTER_READ_ORDER_REVERSED   0x00000100
 
#define LCD_INT_DMA_DONE   0x00000001
 
#define LCD_INT_RASTER_FRAME_DONE   0x00000002
 
#define LCD_INT_SYNC_LOST   0x00000004
 
#define LCD_INT_AC_BIAS_CNT   0x00000008
 
#define LCD_INT_UNDERFLOW   0x00000020
 
#define LCD_INT_PAL_LOAD   0x00000040
 
#define LCD_INT_EOF0   0x00000100
 
#define LCD_INT_EOF1   0x00000200
 
#define LCD_DMA_FIFORDY_8_WORDS   0x00000000
 
#define LCD_DMA_FIFORDY_16_WORDS   0x00000100
 
#define LCD_DMA_FIFORDY_32_WORDS   0x00000200
 
#define LCD_DMA_FIFORDY_64_WORDS   0x00000300
 
#define LCD_DMA_FIFORDY_128_WORDS   0x00000400
 
#define LCD_DMA_FIFORDY_256_WORDS   0x00000500
 
#define LCD_DMA_FIFORDY_512_WORDS   0x00000600
 
#define LCD_DMA_BURST_1   0x00000010
 
#define LCD_DMA_BURST_2   0x00000010
 
#define LCD_DMA_BURST_4   0x00000020
 
#define LCD_DMA_BURST_8   0x00000030
 
#define LCD_DMA_BURST_16   0x00000040
 
#define LCD_DMA_BYTE_ORDER_0123   0x00000000
 
#define LCD_DMA_BYTE_ORDER_1023   0x00000008
 
#define LCD_DMA_BYTE_ORDER_3210   0x00000002
 
#define LCD_DMA_BYTE_ORDER_2301   0x0000000A
 
#define LCD_DMA_PING_PONG   0x00000001
 
#define LCD_PALETTE_TYPE_1BPP   0x00000000
 
#define LCD_PALETTE_TYPE_2BPP   0x00001000
 
#define LCD_PALETTE_TYPE_4BPP   0x00002000
 
#define LCD_PALETTE_TYPE_8BPP   0x00003000
 
#define LCD_PALETTE_TYPE_DIRECT   0x00004000
 
#define LCD_PALETTE_SRC_24BIT   0x80000000
 
#define LCD_CLOCK_MAIN   0x00000008
 
#define LCD_CLOCK_DMA   0x00000004
 
#define LCD_CLOCK_LIDD   0x00000002
 
#define LCD_CLOCK_CORE   0x00000001
 
#define LCD_SUBPANEL_AT_TOP   0x20000000
 
#define LCD_SUBPANEL_AT_BOTTOM   0x00000000
 

Functions

uint32_t LCDModeSet (uint32_t ui32Base, uint8_t ui8Mode, uint32_t ui32PixClk, uint32_t ui32SysClk)
 
void LCDClockReset (uint32_t ui32Base, uint32_t ui32Clocks)
 
void LCDIDDConfigSet (uint32_t ui32Base, uint32_t ui32Config)
 
void LCDIDDTimingSet (uint32_t ui32Base, uint32_t ui32CS, const tLCDIDDTiming *pTiming)
 
void LCDIDDDMADisable (uint32_t ui32Base)
 
void LCDIDDCommandWrite (uint32_t ui32Base, uint32_t ui32CS, uint16_t ui16Cmd)
 
void LCDIDDDataWrite (uint32_t ui32Base, uint32_t ui32CS, uint16_t ui16Data)
 
void LCDIDDIndexedWrite (uint32_t ui32Base, uint32_t ui32CS, uint16_t ui16Addr, uint16_t ui16Data)
 
uint16_t LCDIDDStatusRead (uint32_t ui32Base, uint32_t ui32CS)
 
uint16_t LCDIDDDataRead (uint32_t ui32Base, uint32_t ui32CS)
 
uint16_t LCDIDDIndexedRead (uint32_t ui32Base, uint32_t ui32CS, uint16_t ui16Addr)
 
void LCDIDDDMAWrite (uint32_t ui32Base, uint32_t ui32CS, const uint32_t *pui32Data, uint32_t ui32Count)
 
void LCDRasterConfigSet (uint32_t ui32Base, uint32_t ui32Config, uint8_t ui8PalLoadDelay)
 
void LCDRasterTimingSet (uint32_t ui32Base, const tLCDRasterTiming *pTiming)
 
void LCDRasterACBiasIntCountSet (uint32_t ui32Base, uint8_t ui8Count)
 
void LCDRasterEnable (uint32_t ui32Base)
 
bool LCDRasterEnabled (uint32_t ui32Base)
 
void LCDRasterDisable (uint32_t ui32Base)
 
void LCDRasterSubPanelConfigSet (uint32_t ui32Base, uint32_t ui32Flags, uint32_t ui32BottomLines, uint32_t ui32DefaultPixel)
 
void LCDRasterSubPanelEnable (uint32_t ui32Base)
 
void LCDRasterSubPanelDisable (uint32_t ui32Base)
 
void LCDDMAConfigSet (uint32_t ui32Base, uint32_t ui32Config)
 
void LCDRasterPaletteSet (uint32_t ui32Base, uint32_t ui32Type, uint32_t *pui32Addr, const uint32_t *pui32SrcColors, uint32_t ui32Start, uint32_t ui32Count)
 
void LCDRasterFrameBufferSet (uint32_t ui32Base, uint8_t ui8Buffer, uint32_t *pui32Addr, uint32_t ui32NumBytes)
 
void LCDIntEnable (uint32_t ui32Base, uint32_t ui32IntFlags)
 
void LCDIntDisable (uint32_t ui32Base, uint32_t ui32IntFlags)
 
uint32_t LCDIntStatus (uint32_t ui32Base, bool bMasked)
 
void LCDIntClear (uint32_t ui32Base, uint32_t ui32IntFlags)
 
void LCDIntRegister (uint32_t ui32Base, void(*pfnHandler)(void))
 
void LCDIntUnregister (uint32_t ui32Base)
 

Detailed Description

Macro Definition Documentation

#define CYCLES_FROM_TIME_NS (   ui32ClockFreq,
  ui32Time_nS 
)
Value:
(((ui32Time_nS) == 0) ? 0 : \
((((((ui32ClockFreq) / 1000000) * ((ui32Time_nS) - 1)) / 1000)) + 1))

This macro can be used to convert from time in nanoseconds to periods of the supplied clock in Hertz as required when setting up the LIDD and raster timing structures. The calculation will round such that the number of cycles returned represents no longer a time than specified in the ui32Time_nS parameter. Values of ui32Time_nS less than or equal to 35791394 (35.79 milliseconds) are supported by the macro. Larger values will cause arithmetic overflow and yield incorrect values. It is further assumed that ui32ClockFreq is a non-zero multiple of 1000000 (1MHz).

Definition at line 100 of file lcd.h.

#define CYCLES_FROM_TIME_US (   ui32ClockFreq,
  ui32Time_uS 
)
Value:
(((ui32Time_uS) == 0) ? 0 : \
(((ui32ClockFreq) / 1000000) * ((((ui32Time_uS) * 1000) - 1) / 1000)) + 1)

This macro can be used to convert from time in microseconds to periods of the supplied clock in Hertz as required when setting up the LIDD and raster timing structures. The calculation will round such that the number of cycles returned represents no longer a time than specified in the ui32Time_uS parameter. Values of ui32Time_uS less than or equal to 4294967uS (4.29 seconds) are supported by the macro. Larger values will cause arithmetic overflow and yield incorrect values. It is further assumed that ui32ClockFreq is a non-zero multiple of 1000000 (1MHz).

Definition at line 84 of file lcd.h.

#define LCD_CLOCK_CORE   0x00000001

Definition at line 408 of file lcd.h.

Referenced by LCDClockReset().

#define LCD_CLOCK_DMA   0x00000004

Definition at line 406 of file lcd.h.

Referenced by LCDClockReset().

#define LCD_CLOCK_LIDD   0x00000002

Definition at line 407 of file lcd.h.

Referenced by LCDClockReset().

#define LCD_CLOCK_MAIN   0x00000008

Definition at line 405 of file lcd.h.

Referenced by LCDClockReset(), and LCDRasterEnable().

#define LCD_DMA_BURST_1   0x00000010

Definition at line 377 of file lcd.h.

#define LCD_DMA_BURST_16   0x00000040

Definition at line 381 of file lcd.h.

#define LCD_DMA_BURST_2   0x00000010

Definition at line 378 of file lcd.h.

#define LCD_DMA_BURST_4   0x00000020

Definition at line 379 of file lcd.h.

#define LCD_DMA_BURST_8   0x00000030

Definition at line 380 of file lcd.h.

#define LCD_DMA_BYTE_ORDER_0123   0x00000000

Definition at line 382 of file lcd.h.

#define LCD_DMA_BYTE_ORDER_1023   0x00000008

Definition at line 383 of file lcd.h.

#define LCD_DMA_BYTE_ORDER_2301   0x0000000A

Definition at line 385 of file lcd.h.

#define LCD_DMA_BYTE_ORDER_3210   0x00000002

Definition at line 384 of file lcd.h.

#define LCD_DMA_FIFORDY_128_WORDS   0x00000400

Definition at line 371 of file lcd.h.

#define LCD_DMA_FIFORDY_16_WORDS   0x00000100

Definition at line 365 of file lcd.h.

#define LCD_DMA_FIFORDY_256_WORDS   0x00000500

Definition at line 373 of file lcd.h.

#define LCD_DMA_FIFORDY_32_WORDS   0x00000200

Definition at line 367 of file lcd.h.

#define LCD_DMA_FIFORDY_512_WORDS   0x00000600

Definition at line 375 of file lcd.h.

#define LCD_DMA_FIFORDY_64_WORDS   0x00000300

Definition at line 369 of file lcd.h.

#define LCD_DMA_FIFORDY_8_WORDS   0x00000000

Definition at line 364 of file lcd.h.

#define LCD_DMA_PING_PONG   0x00000001

Definition at line 386 of file lcd.h.

#define LCD_INT_AC_BIAS_CNT   0x00000008

Definition at line 353 of file lcd.h.

Referenced by LCDIntClear(), LCDIntDisable(), and LCDIntEnable().

#define LCD_INT_DMA_DONE   0x00000001

Definition at line 349 of file lcd.h.

Referenced by LCDIntClear(), LCDIntDisable(), and LCDIntEnable().

#define LCD_INT_EOF0   0x00000100

Definition at line 356 of file lcd.h.

Referenced by LCDIntClear(), LCDIntDisable(), and LCDIntEnable().

#define LCD_INT_EOF1   0x00000200

Definition at line 357 of file lcd.h.

Referenced by LCDIntClear(), LCDIntDisable(), and LCDIntEnable().

#define LCD_INT_PAL_LOAD   0x00000040

Definition at line 355 of file lcd.h.

Referenced by LCDIntClear(), LCDIntDisable(), and LCDIntEnable().

#define LCD_INT_RASTER_FRAME_DONE   0x00000002

Definition at line 350 of file lcd.h.

Referenced by LCDIntClear(), LCDIntDisable(), and LCDIntEnable().

#define LCD_INT_SYNC_LOST   0x00000004

Definition at line 352 of file lcd.h.

Referenced by LCDIntClear(), LCDIntDisable(), and LCDIntEnable().

#define LCD_INT_UNDERFLOW   0x00000020

Definition at line 354 of file lcd.h.

Referenced by LCDIntClear(), LCDIntDisable(), and LCDIntEnable().

#define LCD_MODE_AUTO_UFLOW_RESTART   ((uint8_t)0x02)

Definition at line 282 of file lcd.h.

Referenced by LCDModeSet().

#define LCD_MODE_LIDD   ((uint8_t)0x00)

Definition at line 280 of file lcd.h.

Referenced by LCDModeSet().

#define LCD_MODE_RASTER   ((uint8_t)0x01)

Definition at line 281 of file lcd.h.

Referenced by LCDModeSet().

#define LCD_PALETTE_SRC_24BIT   0x80000000

Definition at line 398 of file lcd.h.

Referenced by LCDRasterPaletteSet().

#define LCD_PALETTE_TYPE_1BPP   0x00000000

Definition at line 393 of file lcd.h.

Referenced by LCDRasterPaletteSet().

#define LCD_PALETTE_TYPE_2BPP   0x00001000

Definition at line 394 of file lcd.h.

Referenced by LCDRasterPaletteSet().

#define LCD_PALETTE_TYPE_4BPP   0x00002000

Definition at line 395 of file lcd.h.

Referenced by LCDRasterPaletteSet().

#define LCD_PALETTE_TYPE_8BPP   0x00003000

Definition at line 396 of file lcd.h.

Referenced by LCDRasterPaletteSet().

#define LCD_PALETTE_TYPE_DIRECT   0x00004000

Definition at line 397 of file lcd.h.

Referenced by LCDRasterPaletteSet().

#define LCD_SUBPANEL_AT_BOTTOM   0x00000000

Definition at line 416 of file lcd.h.

Referenced by LCDRasterSubPanelConfigSet().

#define LCD_SUBPANEL_AT_TOP   0x20000000

Definition at line 415 of file lcd.h.

Referenced by LCDRasterSubPanelConfigSet().

#define LIDD_CONFIG_ASYNC_HITACHI   0x00000004

Definition at line 294 of file lcd.h.

Referenced by LCDIDDConfigSet().

#define LIDD_CONFIG_ASYNC_MPU68   0x00000001

Definition at line 291 of file lcd.h.

Referenced by LCDIDDConfigSet().

#define LIDD_CONFIG_ASYNC_MPU80   0x00000003

Definition at line 293 of file lcd.h.

Referenced by LCDIDDConfigSet().

#define LIDD_CONFIG_INVERT_ALE   0x00000008

Definition at line 296 of file lcd.h.

Referenced by LCDIDDConfigSet().

#define LIDD_CONFIG_INVERT_CS0   0x00000040

Definition at line 301 of file lcd.h.

Referenced by LCDIDDConfigSet().

#define LIDD_CONFIG_INVERT_CS1   0x00000080

Definition at line 302 of file lcd.h.

Referenced by LCDIDDConfigSet().

#define LIDD_CONFIG_INVERT_RS_EN   0x00000010

Definition at line 297 of file lcd.h.

Referenced by LCDIDDConfigSet().

#define LIDD_CONFIG_INVERT_WS_DIR   0x00000020

Definition at line 299 of file lcd.h.

Referenced by LCDIDDConfigSet().

#define LIDD_CONFIG_SYNC_MPU68   0x00000000

Definition at line 290 of file lcd.h.

Referenced by LCDIDDConfigSet().

#define LIDD_CONFIG_SYNC_MPU80   0x00000002

Definition at line 292 of file lcd.h.

Referenced by LCDIDDConfigSet().

#define PAL_FROM_RGB (   ui32RGBColor)
Value:
(((ui32RGBColor & 0xF0) >> 4) | \
((ui32RGBColor & 0xF000) >> 8) | \
((ui32RGBColor & 0xF00000) >> 12))

This macro can be used to convert a 24-bit RGB color value as used by the TivaWare Graphics Library into a 12-bit LCD controller color palette entry.

Definition at line 68 of file lcd.h.

Referenced by LCDRasterPaletteSet().

#define RASTER_ACTVID_DURING_BLANK   0x08000000

Definition at line 332 of file lcd.h.

Referenced by LCDRasterConfigSet().

#define RASTER_FMT_ACTIVE_24BPP_PACKED   0x02000080

Definition at line 314 of file lcd.h.

Referenced by LCDRasterConfigSet().

#define RASTER_FMT_ACTIVE_24BPP_UNPACKED   0x06000080

Definition at line 316 of file lcd.h.

Referenced by LCDRasterConfigSet().

#define RASTER_FMT_ACTIVE_PALETTIZED_12BIT   0x00000080

Definition at line 318 of file lcd.h.

Referenced by LCDRasterConfigSet().

#define RASTER_FMT_ACTIVE_PALETTIZED_16BIT   0x00800080

Definition at line 320 of file lcd.h.

Referenced by LCDRasterConfigSet().

#define RASTER_FMT_PASSIVE_COLOR_12BIT   0x00000000

Definition at line 328 of file lcd.h.

Referenced by LCDRasterConfigSet().

#define RASTER_FMT_PASSIVE_COLOR_16BIT   0x01000000

Definition at line 330 of file lcd.h.

Referenced by LCDRasterConfigSet().

#define RASTER_FMT_PASSIVE_MONO_4PIX   0x00000002

Definition at line 322 of file lcd.h.

Referenced by LCDRasterConfigSet().

#define RASTER_FMT_PASSIVE_MONO_8PIX   0x00000202

Definition at line 324 of file lcd.h.

Referenced by LCDRasterConfigSet().

#define RASTER_FMT_PASSIVE_PALETTIZED   0x00000000

Definition at line 326 of file lcd.h.

Referenced by LCDRasterConfigSet().

#define RASTER_LOAD_DATA_ONLY   0x00200000

Definition at line 336 of file lcd.h.

Referenced by LCDRasterConfigSet().

#define RASTER_LOAD_PALETTE_ONLY   0x00100000

Definition at line 337 of file lcd.h.

Referenced by LCDRasterConfigSet().

#define RASTER_NIBBLE_MODE_ENABLED   0x00400000

Definition at line 334 of file lcd.h.

Referenced by LCDRasterConfigSet().

#define RASTER_READ_ORDER_REVERSED   0x00000100

Definition at line 339 of file lcd.h.

Referenced by LCDRasterConfigSet().

#define RASTER_TIMING_ACTIVE_HIGH_HSYNC   0x00000000

Definition at line 186 of file lcd.h.

#define RASTER_TIMING_ACTIVE_HIGH_OE   0x00000000

Definition at line 178 of file lcd.h.

#define RASTER_TIMING_ACTIVE_HIGH_PIXCLK   0x00000000

Definition at line 182 of file lcd.h.

#define RASTER_TIMING_ACTIVE_HIGH_VSYNC   0x00000000

Definition at line 190 of file lcd.h.

#define RASTER_TIMING_ACTIVE_LOW_HSYNC   0x00200000

Definition at line 188 of file lcd.h.

Referenced by LCDRasterTimingSet().

#define RASTER_TIMING_ACTIVE_LOW_OE   0x00800000

Definition at line 180 of file lcd.h.

Referenced by LCDRasterTimingSet().

#define RASTER_TIMING_ACTIVE_LOW_PIXCLK   0x00400000

Definition at line 184 of file lcd.h.

Referenced by LCDRasterTimingSet().

#define RASTER_TIMING_ACTIVE_LOW_VSYNC   0x00100000

Definition at line 192 of file lcd.h.

Referenced by LCDRasterTimingSet().

#define RASTER_TIMING_SYNCS_ON_FALLING_PIXCLK   0x03000000

Definition at line 176 of file lcd.h.

Referenced by LCDRasterTimingSet().

#define RASTER_TIMING_SYNCS_ON_RISING_PIXCLK   0x02000000

Definition at line 174 of file lcd.h.

Referenced by LCDRasterTimingSet().

#define RASTER_TIMING_SYNCS_OPPOSITE_PIXCLK   0x00000000

Definition at line 172 of file lcd.h.

Referenced by LCDRasterTimingSet().

Function Documentation

void LCDClockReset ( uint32_t  ui32Base,
uint32_t  ui32Clocks 
)

Resets one or more of the LCD controller clock domains.

Parameters
ui32Basespecifies the LCD controller module base address.
ui32Clocksdefines the subset of clock domains to be reset.

This function allows sub-modules of the LCD controller to be reset under software control. The ui32Clocks parameter is the logical OR of the following clocks:

  • LCD_CLOCK_MAIN causes the entire LCD controller module to be reset.
  • LCD_CLOCK_DMA causes the DMA controller submodule to be reset.
  • LCD_CLOCK_LIDD causes the LIDD submodule to be reset.
  • LCD_CLOCK_CORE causes the core module, including the raster logic to be reset.

In all cases, LCD controller register values are preserved across these resets.

Returns
None.

Definition at line 181 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_CLOCK_CORE, LCD_CLOCK_DMA, LCD_CLOCK_LIDD, LCD_CLOCK_MAIN, and SysCtlDelay().

Referenced by LCDRasterEnable().

182 {
183  //
184  // Sanity check parameters.
185  //
186  ASSERT(ui32Base == LCD0_BASE);
187  ASSERT(!(ui32Clocks & ~(LCD_CLOCK_MAIN | LCD_CLOCK_LIDD | LCD_CLOCK_DMA |
188  LCD_CLOCK_CORE)));
189 
190  //
191  // Reset the required LCD controller sub-module(s).
192  //
193  HWREG(LCD0_BASE + 0x70) = ui32Clocks;
194 
195  //
196  // Wait a while.
197  //
198  SysCtlDelay(10);
199 
200  //
201  // Remove software reset.
202  //
203  HWREG(LCD0_BASE + 0x70) = 0x00000000;
204 
205  //
206  // Wait a while.
207  //
208  SysCtlDelay(10);
209 }
#define LCD_CLOCK_CORE
Definition: lcd.h:408
#define LCD_CLOCK_LIDD
Definition: lcd.h:407
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
void SysCtlDelay(uint32_t ui32Count)
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_CLOCK_DMA
Definition: lcd.h:406
#define LCD_CLOCK_MAIN
Definition: lcd.h:405

Here is the call graph for this function:

Here is the caller graph for this function:

void LCDDMAConfigSet ( uint32_t  ui32Base,
uint32_t  ui32Config 
)

Configures the LCD controller's internal DMA engine.

Parameters
ui32Baseis the base address of the controller.
ui32Configprovides flags defining the desired DMA parameters.

This function is used to configure the DMA engine within the LCD controller. This engine is responsible for performing bulk data transfers to the display when in LIDD mode or for transferring palette and pixel data from SRAM to the display panel when in raster mode.

The ui32Config parameter is a logical OR of various flags. It must contain one value from each of the following groups.

The first group of flags set the number of words that have to be in the FIFO before it signals that it is ready:

  • LCD_DMA_FIFORDY_8_WORDS
  • LCD_DMA_FIFORDY_16_WORDS
  • LCD_DMA_FIFORDY_32_WORDS
  • LCD_DMA_FIFORDY_64_WORDS
  • LCD_DMA_FIFORDY_128_WORDS
  • LCD_DMA_FIFORDY_256_WORDS
  • LCD_DMA_FIFORDY_512_WORDS

The second group of flags set the number of 32-bit words in each DMA burst transfer:

  • LCD_DMA_BURST_1
  • LCD_DMA_BURST_2
  • LCD_DMA_BURST_4
  • LCD_DMA_BURST_8
  • LCD_DMA_BURST_16

The final group of flags set internal byte lane controls and allow byte swapping within the DMA engine. The label represents the output byte order for an input 32-bit word ordered ``0123''.

  • LCD_DMA_BYTE_ORDER_0123
  • LCD_DMA_BYTE_ORDER_1023
  • LCD_DMA_BYTE_ORDER_3210
  • LCD_DMA_BYTE_ORDER_2301

Additionally, LCD_DMA_PING_PONG may be specified. This flag configures the controller to operate in double-buffered mode. When data is scanned out from the first frame buffer, the DMA engine immediately moves to the second frame buffer and scans from there before moving back to the first. If this flag is clear, the DMA engine uses a single frame buffer, restarting the scan from the beginning of the buffer each time it completes a frame.

Note
DMA burst size LCD_DMA_BURST_16 should be set when using frame buffers in external, EPI-connected memory. Using a smaller burst size in this case is likely to result in occasional FIFO underflows and associated display glitches.
Returns
None.

Definition at line 1293 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_DMACTL_BIGDEND, LCD_DMACTL_BURSTSZ_M, LCD_DMACTL_BYTESWAP, LCD_DMACTL_FIFORDY_M, LCD_DMACTL_FMODE, and LCD_O_DMACTL.

1294 {
1295  //
1296  // Sanity check parameters.
1297  //
1298  ASSERT(ui32Base == LCD0_BASE);
1299  ASSERT(!(ui32Config & ~(LCD_DMACTL_FIFORDY_M | LCD_DMACTL_BURSTSZ_M |
1301  LCD_DMACTL_FMODE)));
1302 
1303  //
1304  // Write the DMA control register.
1305  //
1306  HWREG(ui32Base + LCD_O_DMACTL) = ui32Config;
1307 }
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_O_DMACTL
Definition: hw_lcd.h:66
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_DMACTL_BIGDEND
Definition: hw_lcd.h:372
#define LCD_DMACTL_BURSTSZ_M
Definition: hw_lcd.h:363
#define LCD_DMACTL_FMODE
Definition: hw_lcd.h:373
#define LCD_DMACTL_BYTESWAP
Definition: hw_lcd.h:369
#define LCD_DMACTL_FIFORDY_M
Definition: hw_lcd.h:355
void LCDIDDCommandWrite ( uint32_t  ui32Base,
uint32_t  ui32CS,
uint16_t  ui16Cmd 
)

Writes a command to the display when the LCD controller is in LIDD mode.

Parameters
ui32Basespecifies the LCD controller module base address.
ui32CSspecifies the chip select to use. Valid values are 0 and 1.
ui16Cmdis the 16-bit command word to write.

This function writes a 16-bit command word to the display when the LCD controller is in LIDD mode. A command write occurs with the ALE signal active.

This function must not be called if the LIDD interface is currently configured to expect DMA transactions. If DMA was previously used to write to the panel, LCDIDDDMADisable() must be called before this function can be used.

Note
CS1 is not available when operating in Sync MPU68 or Sync MPU80 modes.
Returns
None.

Definition at line 401 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_O_LIDDCS0ADDR, and LCD_O_LIDDCS1ADDR.

402 {
403  uint32_t ui32Reg;
404 
405  //
406  // Sanity check parameters.
407  //
408  ASSERT(ui32Base == LCD0_BASE);
409  ASSERT((ui32CS == 0) || (ui32CS == 1));
410 
411  //
412  // Determine the register to write based on the CS value supplied.
413  //
414  ui32Reg = ui32CS ? LCD_O_LIDDCS1ADDR : LCD_O_LIDDCS0ADDR;
415 
416  //
417  // Write the command/address to the register.
418  //
419  HWREG(ui32Base + ui32Reg) = ui16Cmd;
420 }
#define LCD_O_LIDDCS0ADDR
Definition: hw_lcd.h:52
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_O_LIDDCS1ADDR
Definition: hw_lcd.h:56
#define LCD0_BASE
Definition: hw_memmap.h:144
void LCDIDDConfigSet ( uint32_t  ui32Base,
uint32_t  ui32Config 
)

Sets the LCD controller communication parameters when in LIDD mode.

Parameters
ui32Basespecifies the LCD controller module base address.
ui32Configdefines the display interface configuration.

This function is used when the LCD controller is configured in LIDD mode and specifies the configuration of the interface between the controller and the display panel. The ui32Config parameter is comprised of one of the following modes:

  • LIDD_CONFIG_SYNC_MPU68 selects Sync MPU68 mode. LCDCP = EN, LCDLP = DIR, LCDFP = ALE, LCDAC = CS0, LCDMCLK = MCLK.
  • LIDD_CONFIG_ASYNC_MPU68 selects Async MPU68 mode. LCDCP = EN, LCDLP = DIR, LCDFP = ALE, LCDAC = CS0, LCDMCLK = CS1.
  • LIDD_CONFIG_SYNC_MPU80 selects Sync MPU80 mode. LCDCP = RS, LCDLP = WS, LCDFP = ALE, LCDAC = CS0, LCDMCLK = MCLK.
  • LIDD_CONFIG_ASYNC_MPU80 selects Async MPU80 mode. LCDCP = RS, LCDLP = WS, LCDFP = ALE, LCDAC = CS0, LCDMCLK = CS1.
  • LIDD_CONFIG_ASYNC_HITACHI selects Hitachi (async) mode. LCDCP = N/C, LCDLP = DIR, LCDFP = ALE, LCDAC = E0, LCDMCLK = E1.

Additional flags may be ORed into ui32Config to control the polarities of various control signals:

  • LIDD_CONFIG_INVERT_ALE - Address Latch Enable (ALE) polarity control. By default, ALE is active low. If this flag is set, it becomes active high.
  • LIDD_CONFIG_INVERT_RS_EN - Read Strobe/Enable polarity control. By default, RS is active low and Enable is active high. If this flag is set, RS becomes active high and Enable active low.
  • LIDD_CONFIG_INVERT_WS_DIR - Write Strobe/Direction polarity control. By default, WS is active low and Direction write low/read high. If this flag is set, WS becomes active high and Direction becomes write high/read low.
  • LIDD_CONFIG_INVERT_CS0 - Chip Select 0/Enable 0 polarity control. By default, CS0 and E0 are active high. If this flag is set, they become active low.
  • LIDD_CONFIG_INVERT_CS1 - Chip Select 1/Enable 1 polarity control. By default, CS1 and E1 are active high. If this flag is set, they become active low.
Returns
None.

Definition at line 258 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_O_LIDDCTL, LIDD_CONFIG_ASYNC_HITACHI, LIDD_CONFIG_ASYNC_MPU68, LIDD_CONFIG_ASYNC_MPU80, LIDD_CONFIG_INVERT_ALE, LIDD_CONFIG_INVERT_CS0, LIDD_CONFIG_INVERT_CS1, LIDD_CONFIG_INVERT_RS_EN, LIDD_CONFIG_INVERT_WS_DIR, LIDD_CONFIG_SYNC_MPU68, and LIDD_CONFIG_SYNC_MPU80.

259 {
260  //
261  // Sanity check parameters.
262  //
263  ASSERT(ui32Base == LCD0_BASE);
271 
272  //
273  // Write the LIDD Control Register.
274  //
275  HWREG(ui32Base + LCD_O_LIDDCTL) = ui32Config;
276 }
#define LIDD_CONFIG_INVERT_WS_DIR
Definition: lcd.h:299
#define HWREG(x)
Definition: hw_types.h:48
#define LIDD_CONFIG_SYNC_MPU68
Definition: lcd.h:290
#define ASSERT(expr)
Definition: debug.h:67
#define LIDD_CONFIG_SYNC_MPU80
Definition: lcd.h:292
#define LIDD_CONFIG_INVERT_RS_EN
Definition: lcd.h:297
#define LIDD_CONFIG_INVERT_ALE
Definition: lcd.h:296
#define LIDD_CONFIG_ASYNC_HITACHI
Definition: lcd.h:294
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LIDD_CONFIG_ASYNC_MPU80
Definition: lcd.h:293
#define LIDD_CONFIG_INVERT_CS1
Definition: lcd.h:302
#define LIDD_CONFIG_INVERT_CS0
Definition: lcd.h:301
#define LIDD_CONFIG_ASYNC_MPU68
Definition: lcd.h:291
#define LCD_O_LIDDCTL
Definition: hw_lcd.h:50
uint16_t LCDIDDDataRead ( uint32_t  ui32Base,
uint32_t  ui32CS 
)

Reads a data word from the display when the LCD controller is in LIDD mode.

Parameters
ui32Basespecifies the LCD controller module base address.
ui32CSspecifies the chip select to use. Valid values are 0 and 1.

This function reads the 16-bit data word from the display when the LCD controller is in LIDD mode. A data read occurs with the ALE signal inactive.

This function must not be called if the LIDD interface is currently configured to expect DMA transactions. If DMA was previously used to write to the panel, LCDIDDDMADisable() must be called before this function can be used.

Note
CS1 is not available when operating in Sync MPU68 or Sync MPU80 modes.
Returns
Returns the status word read from the display panel.

Definition at line 603 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_O_LIDDCS0DATA, and LCD_O_LIDDCS1DATA.

604 {
605  uint32_t ui32Reg;
606 
607  //
608  // Sanity check parameters.
609  //
610  ASSERT(ui32Base == LCD0_BASE);
611  ASSERT((ui32CS == 0) || (ui32CS == 1));
612 
613  //
614  // Determine the register to read based on the CS value supplied.
615  //
616  ui32Reg = ui32CS ? LCD_O_LIDDCS1DATA : LCD_O_LIDDCS0DATA;
617 
618  //
619  // Read the relevant data register.
620  //
621  return((uint16_t)HWREG(ui32Base + ui32Reg));
622 }
#define HWREG(x)
Definition: hw_types.h:48
#define LCD_O_LIDDCS1DATA
Definition: hw_lcd.h:58
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_O_LIDDCS0DATA
Definition: hw_lcd.h:53
#define LCD0_BASE
Definition: hw_memmap.h:144
void LCDIDDDataWrite ( uint32_t  ui32Base,
uint32_t  ui32CS,
uint16_t  ui16Data 
)

Writes a data value to the display when the LCD controller is in LIDD mode.

Parameters
ui32Basespecifies the LCD controller module base address.
ui32CSspecifies the chip select to use. Valid values are 0 and 1.
ui16Datais the 16-bit data word to write.

This function writes a 16-bit data word to the display when the LCD controller is in LIDD mode. A data write occurs with the ALE signal inactive.

This function must not be called if the LIDD interface is currently configured to expect DMA transactions. If DMA was previously used to write to the panel, LCDIDDDMADisable() must be called before this function can be used.

Note
CS1 is not available when operating in Sync MPU68 or Sync MPU80 modes.
Returns
None.

Definition at line 446 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_O_LIDDCS0DATA, and LCD_O_LIDDCS1DATA.

447 {
448  uint32_t ui32Reg;
449 
450  //
451  // Sanity check parameters.
452  //
453  ASSERT(ui32Base == LCD0_BASE);
454  ASSERT((ui32CS == 0) || (ui32CS == 1));
455 
456  //
457  // Determine the register to write based on the CS value supplied.
458  //
459  ui32Reg = ui32CS ? LCD_O_LIDDCS1DATA : LCD_O_LIDDCS0DATA;
460 
461  //
462  // Write the data value to the register.
463  //
464  HWREG(ui32Base + ui32Reg) = ui16Data;
465 }
#define HWREG(x)
Definition: hw_types.h:48
#define LCD_O_LIDDCS1DATA
Definition: hw_lcd.h:58
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_O_LIDDCS0DATA
Definition: hw_lcd.h:53
#define LCD0_BASE
Definition: hw_memmap.h:144
void LCDIDDDMADisable ( uint32_t  ui32Base)

Disables internal DMA operation when the LCD controller is in LIDD mode.

Parameters
ui32Basespecifies the LCD controller module base address.

When the LCD controller is operating in LCD Interface Display Driver mode, this function must be called after completion of a DMA transaction and before calling LCDIDDCommandWrite(), LCDIDDDataWrite(), LCDIDDStatusRead(), LCDIDDIndexedWrite(), LCDIDDIndexedRead() or LCDIDDDataRead() to disable DMA mode and allow CPU-initiated transactions to the display.

Note
LIDD DMA mode is enabled automatically when LCDIDDDMAWrite() is called.
Returns
None.

Definition at line 364 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_LIDDCTL_DMAEN, and LCD_O_LIDDCTL.

365 {
366  //
367  // Sanity check parameters.
368  //
369  ASSERT(ui32Base == LCD0_BASE);
370 
371  //
372  // Disable DMA.
373  //
374  HWREG(ui32Base + LCD_O_LIDDCTL) &= ~LCD_LIDDCTL_DMAEN;
375 }
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_LIDDCTL_DMAEN
Definition: hw_lcd.h:112
#define LCD_O_LIDDCTL
Definition: hw_lcd.h:50
void LCDIDDDMAWrite ( uint32_t  ui32Base,
uint32_t  ui32CS,
const uint32_t *  pui32Data,
uint32_t  ui32Count 
)

Writes a block of data to the display using DMA when the LCD controller is in LIDD mode.

Parameters
ui32Basespecifies the LCD controller module base address.
ui32CSspecifies the chip select to use. Valid values are 0 and 1.
pui32Datais the address of the first 16-bit word to write. This address must be aligned on a 32-bit word boundary.
ui32Countis the number of 16-bit words to write. This value must be a multiple of 2.

This function writes a block of 16-bit data words to the display using DMA. It is only valid when the LCD controller is in LIDD mode. Completion of the DMA transfer is signaled by the LCD_INT_DMA_DONE interrupt.

This function enables DMA mode prior to starting the transfer. The caller is responsible for ensuring that any earlier DMA transfer has completed before initiating another transfer.

During the time that DMA is enabled, none of the other LCD LIDD data transfer functions may be called. When the DMA transfer is complete and the application wishes to use the CPU to communicate with the display, LCDIDDDMADisable() must be called to disable DMA access prior to calling LCDIDDCommandWrite(), LCDIDDDataWrite(), LCDIDDStatusRead(), LCDIDDIndexedWrite(), LCDIDDIndexedRead() or LCDIDDDataRead().

Note
CS1 is not available when operating in Sync MPU68 or Sync MPU80 modes.
Returns
None.

Definition at line 721 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_LIDDCTL_DMACS, LCD_LIDDCTL_DMAEN, LCD_O_DMABAFB0, LCD_O_DMACAFB0, and LCD_O_LIDDCTL.

723 {
724  //
725  // Sanity check parameters.
726  //
727  ASSERT(ui32Base == LCD0_BASE);
728  ASSERT((ui32CS == 0) || (ui32CS == 1));
729  ASSERT(!((uint32_t)pui32Data & 3));
730  ASSERT(!(ui32Count & 1));
731 
732  //
733  // Make sure DMA is disabled so that enabling it triggers this new
734  // transfer.
735  //
736  HWREG(ui32Base + LCD_O_LIDDCTL) &= ~LCD_LIDDCTL_DMAEN;
737 
738  //
739  // Set up the transfer. Note that the ceiling register must contain the
740  // address of the last word which contains data we want transfered and NOT
741  // the first location after the data we want written.
742  //
743  HWREG(ui32Base + LCD_O_DMABAFB0) = (uint32_t)pui32Data;
744  HWREG(ui32Base + LCD_O_DMACAFB0) = ((uint32_t)pui32Data +
745  (ui32Count * 2) - 4);
746 
747  //
748  // Tell the controller which CS to use for the DMA transaction.
749  //
750  if(!ui32CS)
751  {
752  //
753  // Use CS0.
754  //
755  HWREG(ui32Base + LCD_O_LIDDCTL) &= ~LCD_LIDDCTL_DMACS;
756  }
757  else
758  {
759  //
760  // Use CS1.
761  //
762  HWREG(ui32Base + LCD_O_LIDDCTL) |= LCD_LIDDCTL_DMACS;
763  }
764 
765  //
766  // Enable the DMA engine and start the transaction.
767  //
768  HWREG(ui32Base + LCD_O_LIDDCTL) |= LCD_LIDDCTL_DMAEN;
769 }
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_O_DMACAFB0
Definition: hw_lcd.h:69
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_LIDDCTL_DMAEN
Definition: hw_lcd.h:112
#define LCD_LIDDCTL_DMACS
Definition: hw_lcd.h:110
#define LCD_O_DMABAFB0
Definition: hw_lcd.h:67
#define LCD_O_LIDDCTL
Definition: hw_lcd.h:50
uint16_t LCDIDDIndexedRead ( uint32_t  ui32Base,
uint32_t  ui32CS,
uint16_t  ui16Addr 
)

Reads a given display register when the LCD controller is in LIDD mode.

Parameters
ui32Basespecifies the LCD controller module base address.
ui32CSspecifies the chip select to use. Valid values are 0 and 1.
ui16Addris the address of the display register to read.

This function reads a 16-bit word from a register in the display when the LCD controller is in LIDD mode and configured to use either the Motorola (LIDD_CONFIG_SYNC_MPU68 or LIDD_CONFIG_ASYNC_MPU68) or Intel (LIDD_CONFIG_SYNC_MPU80 or LIDD_CONFIG_ASYNC_MPU80) modes that employ an external address latch.

When configured in Hitachi mode (LIDD_CONFIG_ASYNC_HITACHI), this function should not be used. In this case, the functions LCDIDDStatusRead() and LCDIDDDataRead() may be used to read status and data bytes from the panel.

This function must not be called if the LIDD interface is currently configured to expect DMA transactions. If DMA was previously used to write to the panel, LCDIDDDMADisable() must be called before this function can be used.

Note
CS1 is not available when operating in Sync MPU68 or Sync MPU80 modes.
Returns
None.

Definition at line 655 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_O_LIDDCS0ADDR, LCD_O_LIDDCS0DATA, LCD_O_LIDDCS1ADDR, and LCD_O_LIDDCS1DATA.

656 {
657  uint32_t ui32Addr;
658 
659  //
660  // Sanity check parameters.
661  //
662  ASSERT(ui32Base == LCD0_BASE);
663  ASSERT((ui32CS == 0) || (ui32CS == 1));
664 
665  //
666  // Determine the address register to write.
667  //
668  ui32Addr = ui32CS ? LCD_O_LIDDCS1ADDR : LCD_O_LIDDCS0ADDR;
669 
670  //
671  // Write the address.
672  //
673  HWREG(ui32Base + ui32Addr) = ui16Addr;
674 
675  //
676  // Determine the data register to read.
677  //
678  ui32Addr = ui32CS ? LCD_O_LIDDCS1DATA : LCD_O_LIDDCS0DATA;
679 
680  //
681  // Return the data read.
682  //
683  return((uint16_t)HWREG(ui32Base + ui32Addr));
684 }
#define LCD_O_LIDDCS0ADDR
Definition: hw_lcd.h:52
#define HWREG(x)
Definition: hw_types.h:48
#define LCD_O_LIDDCS1DATA
Definition: hw_lcd.h:58
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_O_LIDDCS0DATA
Definition: hw_lcd.h:53
#define LCD_O_LIDDCS1ADDR
Definition: hw_lcd.h:56
#define LCD0_BASE
Definition: hw_memmap.h:144
void LCDIDDIndexedWrite ( uint32_t  ui32Base,
uint32_t  ui32CS,
uint16_t  ui16Addr,
uint16_t  ui16Data 
)

Writes data to a given display register when the LCD controller is in LIDD mode.

Parameters
ui32Basespecifies the LCD controller module base address.
ui32CSspecifies the chip select to use. Valid values are 0 and 1.
ui16Addris the address of the display register to write.
ui16Datais the data to write.

This function writes a 16-bit data word to a register in the display when the LCD controller is in LIDD mode and configured to use either the Motorola (LIDD_CONFIG_SYNC_MPU68 or LIDD_CONFIG_ASYNC_MPU68) or Intel (LIDD_CONFIG_SYNC_MPU80 or LIDD_CONFIG_ASYNC_MPU80) modes that employ an external address latch.

When configured in Hitachi mode (LIDD_CONFIG_ASYNC_HITACHI), this function should not be used. In this case the functions LCDIDDCommandWrite() and LCDIDDDataWrite() may be used to transfer command and data bytes to the panel.

This function must not be called if the LIDD interface is currently configured to expect DMA transactions. If DMA was previously used to write to the panel, LCDIDDDMADisable() must be called before this function can be used.

Note
CS1 is not available when operating in Sync MPU68 or Sync MPU80 modes.
Returns
None.

Definition at line 500 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_O_LIDDCS0ADDR, LCD_O_LIDDCS0DATA, LCD_O_LIDDCS1ADDR, and LCD_O_LIDDCS1DATA.

502 {
503  uint32_t ui32Addr;
504 
505  //
506  // Sanity check parameters.
507  //
508  ASSERT(ui32Base == LCD0_BASE);
509  ASSERT((ui32CS == 0) || (ui32CS == 1));
510 
511  //
512  // Determine the address register to write.
513  //
514  ui32Addr = ui32CS ? LCD_O_LIDDCS1ADDR : LCD_O_LIDDCS0ADDR;
515 
516  //
517  // Write the address.
518  //
519  HWREG(ui32Base + ui32Addr) = ui16Addr;
520 
521  //
522  // Determine the data register to write.
523  //
524  ui32Addr = ui32CS ? LCD_O_LIDDCS1DATA : LCD_O_LIDDCS0DATA;
525 
526  //
527  // Write the data.
528  //
529  HWREG(ui32Base + ui32Addr) = ui16Data;
530 }
#define LCD_O_LIDDCS0ADDR
Definition: hw_lcd.h:52
#define HWREG(x)
Definition: hw_types.h:48
#define LCD_O_LIDDCS1DATA
Definition: hw_lcd.h:58
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_O_LIDDCS0DATA
Definition: hw_lcd.h:53
#define LCD_O_LIDDCS1ADDR
Definition: hw_lcd.h:56
#define LCD0_BASE
Definition: hw_memmap.h:144
uint16_t LCDIDDStatusRead ( uint32_t  ui32Base,
uint32_t  ui32CS 
)

Reads a status word from the display when the LCD controller is in LIDD mode.

Parameters
ui32Basespecifies the LCD controller module base address.
ui32CSspecifies the chip select to use. Valid values are 0 and 1.

This function reads the 16-bit status word from the display when the LCD controller is in LIDD mode. A status read occurs with the ALE signal active. If the interface is configured in Hitachi mode (LIDD_CONFIG_ASYNC_HITACHI), this operation corresponds to a command mode read.

This function must not be called if the LIDD interface is currently configured to expect DMA transactions. If DMA was previously used to write to the panel, LCDIDDDMADisable() must be called before this function can be used.

Note
CS1 is not available when operating in Sync MPU68 or Sync MPU80 modes.
Returns
Returns the status word read from the display panel.

Definition at line 558 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_O_LIDDCS0ADDR, and LCD_O_LIDDCS1ADDR.

559 {
560  uint32_t ui32Reg;
561 
562  //
563  // Sanity check parameters.
564  //
565  ASSERT(ui32Base == LCD0_BASE);
566  ASSERT((ui32CS == 0) || (ui32CS == 1));
567 
568  //
569  // Determine the register to read based on the CS value supplied.
570  //
571  ui32Reg = ui32CS ? LCD_O_LIDDCS1ADDR : LCD_O_LIDDCS0ADDR;
572 
573  //
574  // Read the relevant status register.
575  //
576  return((uint16_t)HWREG(ui32Base + ui32Reg));
577 }
#define LCD_O_LIDDCS0ADDR
Definition: hw_lcd.h:52
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_O_LIDDCS1ADDR
Definition: hw_lcd.h:56
#define LCD0_BASE
Definition: hw_memmap.h:144
void LCDIDDTimingSet ( uint32_t  ui32Base,
uint32_t  ui32CS,
const tLCDIDDTiming pTiming 
)

Sets the LCD controller interface timing when in LIDD mode.

Parameters
ui32Basespecifies the LCD controller module base address.
ui32CSspecifies the chip select whose timings are to be set.
pTimingpoints to a structure containing the desired timing parameters.

This function is used in LIDD mode to set the setup, strobe and hold times for the various interface control signals. Independent timings are stored for each of the two supported chip selects offered by the LCD controller.

For a definition of the timing parameters required, see the definition of tLCDIDDTiming.

Note
CS1 is not available when operating in Sync MPU68 or Sync MPU80 modes.
Returns
None

Definition at line 301 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_LIDDCS0CFG_GAP_S, LCD_LIDDCS0CFG_RDDUR_S, LCD_LIDDCS0CFG_RDHOLD_S, LCD_LIDDCS0CFG_RDSU_S, LCD_LIDDCS0CFG_WRDUR_S, LCD_LIDDCS0CFG_WRHOLD_S, LCD_LIDDCS0CFG_WRSU_S, LCD_O_LIDDCS0CFG, LCD_O_LIDDCS1CFG, tLCDIDDTiming::ui8DelayCycles, tLCDIDDTiming::ui8RSDuration, tLCDIDDTiming::ui8RSHold, tLCDIDDTiming::ui8RSSetup, tLCDIDDTiming::ui8WSDuration, tLCDIDDTiming::ui8WSHold, and tLCDIDDTiming::ui8WSSetup.

303 {
304  uint32_t ui32Val;
305 
306  //
307  // Sanity check parameters.
308  //
309  ASSERT(ui32Base == LCD0_BASE);
310  ASSERT((ui32CS == 0) || (ui32CS == 1));
311  ASSERT(pTiming);
312  ASSERT(pTiming->ui8WSSetup < 32);
313  ASSERT(pTiming->ui8WSDuration && (pTiming->ui8WSDuration < 64));
314  ASSERT(pTiming->ui8WSHold && (pTiming->ui8WSHold < 16));
315  ASSERT(pTiming->ui8RSSetup < 32);
316  ASSERT(pTiming->ui8RSDuration && (pTiming->ui8RSDuration < 64));
317  ASSERT(pTiming->ui8RSHold && (pTiming->ui8RSHold < 16));
318  ASSERT(pTiming->ui8DelayCycles && (pTiming->ui8DelayCycles < 5));
319 
320  //
321  // Convert the timings provided into a value ready for the register.
322  //
323  ui32Val =
324  (((uint32_t)(pTiming->ui8WSSetup) << LCD_LIDDCS0CFG_WRSU_S) |
325  ((uint32_t)(pTiming->ui8WSDuration) << LCD_LIDDCS0CFG_WRDUR_S) |
326  ((uint32_t)(pTiming->ui8WSHold) << LCD_LIDDCS0CFG_WRHOLD_S) |
327  ((uint32_t)(pTiming->ui8RSSetup) << LCD_LIDDCS0CFG_RDSU_S) |
328  ((uint32_t)(pTiming->ui8RSDuration) << LCD_LIDDCS0CFG_RDDUR_S) |
329  ((uint32_t)(pTiming->ui8RSHold) << LCD_LIDDCS0CFG_RDHOLD_S) |
330  ((uint32_t)(pTiming->ui8DelayCycles - 1) << LCD_LIDDCS0CFG_GAP_S));
331 
332  //
333  // Write the appropriate LCD LIDD CS configuration register.
334  //
335  if(!ui32CS)
336  {
337  HWREG(ui32Base + LCD_O_LIDDCS0CFG) = ui32Val;
338  }
339  else
340  {
341  HWREG(ui32Base + LCD_O_LIDDCS1CFG) = ui32Val;
342  }
343 }
uint8_t ui8RSSetup
Definition: lcd.h:141
uint8_t ui8WSSetup
Definition: lcd.h:118
uint8_t ui8RSHold
Definition: lcd.h:156
uint8_t ui8WSDuration
Definition: lcd.h:125
#define HWREG(x)
Definition: hw_types.h:48
uint8_t ui8WSHold
Definition: lcd.h:133
#define LCD_O_LIDDCS1CFG
Definition: hw_lcd.h:55
#define ASSERT(expr)
Definition: debug.h:67
uint8_t ui8DelayCycles
Definition: lcd.h:164
#define LCD_LIDDCS0CFG_GAP_S
Definition: hw_lcd.h:161
#define LCD_LIDDCS0CFG_RDHOLD_S
Definition: hw_lcd.h:160
#define LCD_LIDDCS0CFG_WRSU_S
Definition: hw_lcd.h:155
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_O_LIDDCS0CFG
Definition: hw_lcd.h:51
#define LCD_LIDDCS0CFG_WRDUR_S
Definition: hw_lcd.h:156
#define LCD_LIDDCS0CFG_RDSU_S
Definition: hw_lcd.h:158
#define LCD_LIDDCS0CFG_WRHOLD_S
Definition: hw_lcd.h:157
#define LCD_LIDDCS0CFG_RDDUR_S
Definition: hw_lcd.h:159
uint8_t ui8RSDuration
Definition: lcd.h:148
void LCDIntClear ( uint32_t  ui32Base,
uint32_t  ui32IntFlags 
)

Clears LCD controller interrupt sources.

Parameters
ui32Baseis the base address of the controller.
ui32IntFlagsis a bit mask of the interrupt sources to be cleared.

The specified LCD controller interrupt sources are cleared so that they no longer assert. This function must be called in the interrupt handler to keep the interrupt from being triggered again immediately upon exit.

The ui32IntFlags parameter is the logical OR of any of the following:

  • LCD_INT_DMA_DONE - indicates that a LIDD DMA transfer is complete.
  • LCD_INT_RASTER_FRAME_DONE - indicates that a raster-mode frame is complete.
  • LCD_INT_SYNC_LOST - indicates that frame synchronization was lost.
  • LCD_INT_AC_BIAS_CNT - indicates that that AC bias transition counter has decremented to zero and is is valid for passive matrix panels only. The counter, set by a call to LCDRasterACBiasIntCountSet(), is reloaded but remains disabled until this interrupt is cleared.
  • LCD_INT_UNDERFLOW - indicates that a data underflow occurred. The internal FIFO was empty when the output logic attempted to read data to send to the display.
  • LCD_INT_PAL_LOAD - indicates that the color palette has been loaded.
  • LCD_INT_EOF0 - indicates that the raw End-of-Frame 0 has been signaled.
  • LCD_INT_EOF2 - indicates that the raw End-of-Frame 1 has been signaled.
Note
Because there is a write buffer in the Cortex-M processor, it may take several clock cycles before the interrupt source is actually cleared. Therefore, it is recommended that the interrupt source be cleared early in the interrupt handler (as opposed to the very last action) to avoid returning from the interrupt handler before the interrupt source is actually cleared. Failure to do so may result in the interrupt handler being immediately reentered (because the interrupt controller still sees the interrupt source asserted).
Returns
None.

Definition at line 1709 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_INT_AC_BIAS_CNT, LCD_INT_DMA_DONE, LCD_INT_EOF0, LCD_INT_EOF1, LCD_INT_PAL_LOAD, LCD_INT_RASTER_FRAME_DONE, LCD_INT_SYNC_LOST, LCD_INT_UNDERFLOW, and LCD_O_MISCLR.

1710 {
1711  ASSERT(ui32Base == LCD0_BASE);
1712  ASSERT(!(ui32IntFlags & ~(LCD_INT_DMA_DONE | LCD_INT_SYNC_LOST |
1716 
1717  //
1718  // Clear the requested interrupts.
1719  //
1720  HWREG(ui32Base + LCD_O_MISCLR) = ui32IntFlags;
1721 }
#define LCD_INT_PAL_LOAD
Definition: lcd.h:355
#define LCD_INT_UNDERFLOW
Definition: lcd.h:354
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_INT_EOF1
Definition: lcd.h:357
#define LCD_INT_AC_BIAS_CNT
Definition: lcd.h:353
#define LCD_O_MISCLR
Definition: hw_lcd.h:79
#define LCD_INT_DMA_DONE
Definition: lcd.h:349
#define LCD_INT_RASTER_FRAME_DONE
Definition: lcd.h:350
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_INT_EOF0
Definition: lcd.h:356
#define LCD_INT_SYNC_LOST
Definition: lcd.h:352
void LCDIntDisable ( uint32_t  ui32Base,
uint32_t  ui32IntFlags 
)

Disables individual LCD controller interrupt sources.

Parameters
ui32Baseis the base address of the controller.
ui32IntFlagsis the bit mask of the interrupt sources to be disabled.

This function disables the indicated LCD controller interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.

The ui32IntFlags parameter is the logical OR of any of the following:

  • LCD_INT_DMA_DONE - indicates that a LIDD DMA transfer is complete.
  • LCD_INT_RASTER_FRAME_DONE - indicates that a raster-mode frame is complete.
  • LCD_INT_SYNC_LOST - indicates that frame synchronization was lost.
  • LCD_INT_AC_BIAS_CNT - indicates that that AC bias transition counter has decremented to zero and is is valid for passive matrix panels only. The counter, set by a call to LCDRasterACBiasIntCountSet(), is reloaded but remains disabled until this interrupt is cleared.
  • LCD_INT_UNDERFLOW - indicates that a data underflow occurred. The internal FIFO was empty when the output logic attempted to read data to send to the display.
  • LCD_INT_PAL_LOAD - indicates that the color palette has been loaded.
  • LCD_INT_EOF0 - indicates that the raw End-of-Frame 0 has been signaled.
  • LCD_INT_EOF2 - indicates that the raw End-of-Frame 1 has been signaled.
Returns
None.

Definition at line 1594 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_INT_AC_BIAS_CNT, LCD_INT_DMA_DONE, LCD_INT_EOF0, LCD_INT_EOF1, LCD_INT_PAL_LOAD, LCD_INT_RASTER_FRAME_DONE, LCD_INT_SYNC_LOST, LCD_INT_UNDERFLOW, and LCD_O_IENC.

1595 {
1596  ASSERT(ui32Base == LCD0_BASE);
1597  ASSERT(!(ui32IntFlags & ~(LCD_INT_DMA_DONE | LCD_INT_SYNC_LOST |
1601 
1602  //
1603  // Disable the interrupt sources by clearing the appropriate bits in the
1604  // mask register.
1605  //
1606  HWREG(ui32Base + LCD_O_IENC) = ui32IntFlags;
1607 }
#define LCD_INT_PAL_LOAD
Definition: lcd.h:355
#define LCD_INT_UNDERFLOW
Definition: lcd.h:354
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_INT_EOF1
Definition: lcd.h:357
#define LCD_INT_AC_BIAS_CNT
Definition: lcd.h:353
#define LCD_INT_DMA_DONE
Definition: lcd.h:349
#define LCD_INT_RASTER_FRAME_DONE
Definition: lcd.h:350
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_INT_EOF0
Definition: lcd.h:356
#define LCD_O_IENC
Definition: hw_lcd.h:81
#define LCD_INT_SYNC_LOST
Definition: lcd.h:352
void LCDIntEnable ( uint32_t  ui32Base,
uint32_t  ui32IntFlags 
)

Enables individual LCD controller interrupt sources.

Parameters
ui32Baseis the base address of the controller.
ui32IntFlagsis the bit mask of the interrupt sources to be enabled.

This function enables the indicated LCD controller interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.

The ui32IntFlags parameter is the logical OR of any of the following:

  • LCD_INT_DMA_DONE - indicates that a LIDD DMA transfer is complete.
  • LCD_INT_RASTER_FRAME_DONE - indicates that a raster-mode frame is complete.
  • LCD_INT_SYNC_LOST - indicates that frame synchronization was lost.
  • LCD_INT_AC_BIAS_CNT - indicates that that AC bias transition counter has decremented to zero and is is valid for passive matrix panels only. The counter, set by a call to LCDRasterACBiasIntCountSet(), is reloaded but remains disabled until this interrupt is cleared.
  • LCD_INT_UNDERFLOW - indicates that a data underflow occurred. The internal FIFO was empty when the output logic attempted to read data to send to the display.
  • LCD_INT_PAL_LOAD - indicates that the color palette has been loaded.
  • LCD_INT_EOF0 - indicates that the raw End-of-Frame 0 has been signaled.
  • LCD_INT_EOF2 - indicates that the raw End-of-Frame 1 has been signaled.
Returns
None.

Definition at line 1544 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_INT_AC_BIAS_CNT, LCD_INT_DMA_DONE, LCD_INT_EOF0, LCD_INT_EOF1, LCD_INT_PAL_LOAD, LCD_INT_RASTER_FRAME_DONE, LCD_INT_SYNC_LOST, LCD_INT_UNDERFLOW, and LCD_O_IM.

1545 {
1546  ASSERT(ui32Base == LCD0_BASE);
1547  ASSERT(!(ui32IntFlags & ~(LCD_INT_DMA_DONE | LCD_INT_SYNC_LOST |
1551 
1552  //
1553  // Enable the interrupt sources by setting the appropriate bits in the
1554  // mask register.
1555  //
1556  HWREG(ui32Base + LCD_O_IM) = ui32IntFlags;
1557 }
#define LCD_INT_PAL_LOAD
Definition: lcd.h:355
#define LCD_INT_UNDERFLOW
Definition: lcd.h:354
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_INT_EOF1
Definition: lcd.h:357
#define LCD_INT_AC_BIAS_CNT
Definition: lcd.h:353
#define LCD_INT_DMA_DONE
Definition: lcd.h:349
#define LCD_INT_RASTER_FRAME_DONE
Definition: lcd.h:350
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_O_IM
Definition: hw_lcd.h:80
#define LCD_INT_EOF0
Definition: lcd.h:356
#define LCD_INT_SYNC_LOST
Definition: lcd.h:352
void LCDIntRegister ( uint32_t  ui32Base,
void(*)(void)  pfnHandler 
)

Registers an interrupt handler for the LCD controller module.

Parameters
ui32Basespecifies the LCD controller module base address.
pfnHandleris a pointer to the function to be called when the LCD controller interrupt occurs.

This function registers the handler to be called when the LCD controller module interrupt occurs.

Note
This function need not be called if the appropriate interrupt vector is statically linked into the vector table in the application startup code.
See also
IntRegister() for important information about registering interrupt handlers.
Returns
None.

Definition at line 1744 of file lcd.c.

References ASSERT, INT_LCD0_TM4C129, IntEnable(), IntRegister(), and LCD0_BASE.

1745 {
1746  //
1747  // Check the arguments.
1748  //
1749  ASSERT(ui32Base == LCD0_BASE);
1750  ASSERT(pfnHandler);
1751 
1752  //
1753  // Register the interrupt handler.
1754  //
1755  IntRegister(INT_LCD0_TM4C129, pfnHandler);
1756 
1757  //
1758  // Enable the interrupt in the interrupt controller.
1759  //
1761 }
#define INT_LCD0_TM4C129
Definition: hw_ints.h:271
#define ASSERT(expr)
Definition: debug.h:67
#define LCD0_BASE
Definition: hw_memmap.h:144
void IntRegister(uint32_t ui32Interrupt, void(*pfnHandler)(void))
Definition: interrupt.c:309
void IntEnable(uint32_t ui32Interrupt)
Definition: interrupt.c:610

Here is the call graph for this function:

uint32_t LCDIntStatus ( uint32_t  ui32Base,
bool  bMasked 
)

Gets the current LCD controller interrupt status.

Parameters
ui32Baseis the base address of the controller.
bMaskedis false if the raw interrupt status is required and true if the masked interrupt status is required.

This function returns the interrupt status for the LCD controller. Either the raw interrupt status or the status of interrupts that are allowed to reflect to the processor can be returned.

Returns
Returns the current interrupt status as the logical OR of any of the following:
  • LCD_INT_DMA_DONE - indicates that a LIDD DMA transfer is complete.
  • LCD_INT_RASTER_FRAME_DONE - indicates that a raster-mode frame is complete.
  • LCD_INT_SYNC_LOST - indicates that frame synchronization was lost.
  • LCD_INT_AC_BIAS_CNT - indicates that that AC bias transition counter has decremented to zero and is is valid for passive matrix panels only. The counter, set by a call to LCDRasterACBiasIntCountSet(), is reloaded but remains disabled until this interrupt is cleared.
  • LCD_INT_UNDERFLOW - indicates that a data underflow occurred. The internal FIFO was empty when the output logic attempted to read data to send to the display.
  • LCD_INT_PAL_LOAD - indicates that the color palette has been loaded.
  • LCD_INT_EOF0 - indicates that the raw End-of-Frame 0 has been signaled.
  • LCD_INT_EOF2 - indicates that the raw End-of-Frame 1 has been signaled.

Definition at line 1643 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_O_MISCLR, and LCD_O_RISSET.

1644 {
1645  ASSERT(ui32Base == LCD0_BASE);
1646 
1647  //
1648  // Were we asked for the masked or raw interrupt status?
1649  //
1650  if(bMasked)
1651  {
1652  //
1653  // Return the masked interrupt status.
1654  //
1655  return(HWREG(ui32Base + LCD_O_MISCLR));
1656  }
1657  else
1658  {
1659  //
1660  // Return the raw interrupts status.
1661  //
1662  return(HWREG(ui32Base + LCD_O_RISSET));
1663  }
1664 }
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_O_MISCLR
Definition: hw_lcd.h:79
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_O_RISSET
Definition: hw_lcd.h:77
void LCDIntUnregister ( uint32_t  ui32Base)

Unregisters the interrupt handler for the LCD controller module.

Parameters
ui32Basespecifies the LCD controller module base address.

This function unregisters the interrupt handler and disables the global LCD controller interrupt in the interrupt controller.

Note
This function need not be called if the appropriate interrupt vector is statically linked into the vector table in the application startup code.
See also
IntRegister() for important information about registering interrupt handlers.
Returns
None.

Definition at line 1782 of file lcd.c.

References ASSERT, INT_LCD0_TM4C129, IntDisable(), IntUnregister(), and LCD0_BASE.

1783 {
1784  //
1785  // Check the arguments.
1786  //
1787  ASSERT(ui32Base == LCD0_BASE);
1788 
1789  //
1790  // Disable the interrupt in the interrupt controller.
1791  //
1793 
1794  //
1795  // Unregister the interrupt handler.
1796  //
1798 }
#define INT_LCD0_TM4C129
Definition: hw_ints.h:271
#define ASSERT(expr)
Definition: debug.h:67
#define LCD0_BASE
Definition: hw_memmap.h:144
void IntUnregister(uint32_t ui32Interrupt)
Definition: interrupt.c:381
void IntDisable(uint32_t ui32Interrupt)
Definition: interrupt.c:684

Here is the call graph for this function:

uint32_t LCDModeSet ( uint32_t  ui32Base,
uint8_t  ui8Mode,
uint32_t  ui32PixClk,
uint32_t  ui32SysClk 
)

Configures the basic operating mode and clock rate for the LCD controller.

Parameters
ui32Basespecifies the LCD controller module base address.
ui8Modespecifies the basic operating mode to be used.
ui32PixClkspecifies the desired LCD controller pixel or master clock rate in Hz.
ui32SysClkspecifies the current system clock rate in Hz.

This function sets the basic operating mode of the LCD controller and also its master clock. The ui8Mode parameter may be set to either LCD_MODE_LIDD or LCD_MODE_RASTER. LCD_MODE_LIDD is used to select LCD Interface Display Driver mode for character panels connected via an asynchronous interface (CS, WE, OE, ALE, data) and LCD_MODE_RASTER is used to communicate with panels via a synchronous video interface using data and sync signals. Additionally, LCD_MODE_AUTO_UFLOW_RESTART may be ORed with either of these modes to indicate that the hardware should restart automatically if a data underflow occurs.

The ui32PixClk parameter specifies the desired master clock for the the LCD controller. In LIDD mode, this value controls the MCLK used in communication with the display and valid values are between ui32SysClk and ui32SysClk/255. In raster mode, ui32PixClk specifies the pixel clock rate for the raster interface and valid values are between ui32SysClk/2 and ui32SysClk/255. The actual clock rate set may differ slightly from the desired rate due to the fact that only integer dividers are supported. The rate set will, however, be no higher than the requested value.

The ui32SysClk parameter provides the current system clock rate and is used to allow the LCD controller clock rate divisor to be correctly set to give the desired ui32PixClk rate.

Returns
Returns the actual LCD controller pixel clock or MCLK rate set.

Definition at line 110 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_CLKEN_CORE, LCD_CLKEN_DMA, LCD_CLKEN_LIDD, LCD_CTL_CLKDIV_S, LCD_MODE_AUTO_UFLOW_RESTART, LCD_MODE_LIDD, LCD_MODE_RASTER, LCD_O_CLKEN, and LCD_O_CTL.

112 {
113  uint32_t ui32Div;
114 
115  //
116  // Sanity check parameters.
117  //
118  ASSERT(ui32Base == LCD0_BASE);
119  ASSERT((ui8Mode & ~(LCD_MODE_RASTER | LCD_MODE_LIDD |
121 
122  //
123  // Enable clocks to the LCD controller submodules.
124  //
125  HWREG(ui32Base + LCD_O_CLKEN) = (LCD_CLKEN_DMA | LCD_CLKEN_CORE |
127 
128  //
129  // Determine the clock divider to use to get as close as possible to the
130  // desired pixel clock. Note that we set the division up so that we
131  // round the divisor up and ensure that the clock used is never faster
132  // than the requested rate.
133  //
134  ui32Div = (ui32SysClk + (ui32PixClk - 1)) / ui32PixClk;
135 
136  //
137  // Check that the calculated value is valid.
138  //
139  ASSERT(ui32Div);
140  ASSERT(ui32Div < 256);
141  ASSERT(!((ui8Mode & LCD_MODE_RASTER) && (ui32Div < 2)));
142 
143  //
144  // Write the LCDCTL register to set the mode.
145  //
146  HWREG(ui32Base + LCD_O_CTL) = (uint32_t)ui8Mode |
147  (ui32Div << LCD_CTL_CLKDIV_S);
148 
149  //
150  // Return the selected clock rate. Finding ui32Div set to 0 should not
151  // happen unless someone passed pathological arguments and builds without
152  // the ASSERTS, but we guard against it just in case.
153  //
154  return(ui32Div ? (ui32SysClk / ui32Div) : ui32SysClk);
155 }
#define LCD_CLKEN_LIDD
Definition: hw_lcd.h:556
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_MODE_AUTO_UFLOW_RESTART
Definition: lcd.h:282
#define LCD_CLKEN_CORE
Definition: hw_lcd.h:557
#define LCD_MODE_LIDD
Definition: lcd.h:280
#define LCD_CLKEN_DMA
Definition: hw_lcd.h:555
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_MODE_RASTER
Definition: lcd.h:281
#define LCD_O_CLKEN
Definition: hw_lcd.h:82
#define LCD_O_CTL
Definition: hw_lcd.h:49
#define LCD_CTL_CLKDIV_S
Definition: hw_lcd.h:103
void LCDRasterACBiasIntCountSet ( uint32_t  ui32Base,
uint8_t  ui8Count 
)

Sets the number of AC bias pin transitions per interrupt.

Parameters
ui32Baseis the base address of the controller.
ui8Countis the number of AC bias pin transitions to count before the AC bias count interrupt is asserted. Valid values are from 0 to 15.

This function is used to set the number of AC bias transitions between each AC bias count interrupt (LCD_INT_AC_BIAS_CNT). If ui8Count is 0, no AC bias count interrupt is generated.

Returns
None.

Definition at line 974 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_O_RASTRTIM2, LCD_RASTRTIM2_ACBI_M, and LCD_RASTRTIM2_ACBI_S.

975 {
976  uint32_t ui32Val;
977 
978  //
979  // Sanity check parameters.
980  //
981  ASSERT(ui32Base == LCD0_BASE);
982  ASSERT(ui8Count < 16);
983 
984  //
985  // Get the existing raster timing 2 register value and mask in the new
986  // AC Bias interrupt count.
987  //
988  ui32Val = HWREG(ui32Base + LCD_O_RASTRTIM2);
989  ui32Val &= ~LCD_RASTRTIM2_ACBI_M;
990  ui32Val |= ((ui8Count << LCD_RASTRTIM2_ACBI_S) & LCD_RASTRTIM2_ACBI_M);
991 
992  //
993  // Write the new value back to the register.
994  //
995  HWREG(ui32Base + LCD_O_RASTRTIM2) = ui32Val;
996 }
#define HWREG(x)
Definition: hw_types.h:48
#define LCD_O_RASTRTIM2
Definition: hw_lcd.h:63
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_RASTRTIM2_ACBI_M
Definition: hw_lcd.h:313
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_RASTRTIM2_ACBI_S
Definition: hw_lcd.h:322
void LCDRasterConfigSet ( uint32_t  ui32Base,
uint32_t  ui32Config,
uint8_t  ui8PalLoadDelay 
)

Sets the LCD controller interface timing when in raster mode.

Parameters
ui32Basespecifies the LCD controller module base address.
ui32Configspecifies properties of the raster interface and the attached display panel.
ui8PalLoadDelayspecifies the number of system clocks to wait between each 16 halfword (16-bit) burst when loading the palette from SRAM into the internal palette RAM of the controller.

This function configures the basic operating mode of the raster interface and specifies the type of panel that the controller is to drive.

The ui32Config parameter must be defined as one of the following to select the required target panel type and output pixel format:

  • RASTER_FMT_ACTIVE_24BPP_PACKED selects an active matrix display and uses a packed 24-bit per pixel packet frame buffer where 4 pixels are described within 3 consecutive 32-bit words.
  • RASTER_FMT_ACTIVE_24BPP_UNPACKED selects an active matrix display and uses an unpacked 24-bit per pixel packet frame buffer where each 32-bit word contains a single pixel and 8 bits of padding.
  • RASTER_FMT_ACTIVE_16BPP selects an active matrix display and uses a 16-bit per pixel frame buffer with 2 pixels in each 32-bit word.
  • RASTER_FMT_ACTIVE_PALETTIZED_12BIT selects an active matrix display and uses a 1, 2, 4 or 8bpp frame buffer with palette lookup. Output color data is described in 12-bit format using bits 11:0 of the data bus. The frame buffer pixel format is defined by the value passed in the ui32Type parameter to LCDRasterPaletteSet().
  • RASTER_FMT_ACTIVE_PALETTIZED_16BIT selects an active matrix display and uses a 1, 2, 4 or 8bpp frame buffer with palette lookup. Output color data is described in 16-bit 5:6:5 format. The frame buffer pixel format is defined by the value passed in the ui32Type parameter to LCDRasterPaletteSet().
  • RASTER_FMT_PASSIVE_MONO_4PIX selects a monochrome, passive matrix display that outputs 4 pixels on each pixel clock.
  • RASTER_FMT_PASSIVE_MONO_8PIX selects a monochrome, passive matrix display that outputs 8 pixels on each pixel clock.
  • RASTER_FMT_PASSIVE_COLOR_12BIT selects a passive matrix display and uses a 12bpp frame buffer. The palette is bypassed and 12-bit pixel data is sent to the grayscaler for the display.
  • RASTER_FMT_PASSIVE_COLOR_16BIT selects a passive matrix display and uses a 16bpp frame buffer with pixels in 5:6:5 format. Only the 4 most significant bits of each color component are sent to the grayscaler for the display.

Additionally, the following flags may be ORed into ui32Config:

  • RASTER_ACTVID_DURING_BLANK sets Actvid to toggle during vertical blanking.
  • RASTER_NIBBLE_MODE_ENABLED enables nibble mode. This parameter works with RASTER_READ_ORDER_REVERSED to determine how 1, 2 and 4bpp pixels are extracted from words read from the frame buffer. If specified, words read from the frame buffer are byte swapped prior to individual pixels being parsed from them.
  • RASTER_LOAD_DATA_ONLY tells the controller to read only pixel data from the frame buffer and to use the last palette read. No palette load is performed.
  • RASTER_LOAD_PALETTE_ONLY tells the controller to read only the palette data from the frame buffer.
  • RASTER_READ_ORDER_REVERSED when using 1, 2, 4 and 8bpp frame buffers, this option reverses the order in which frame buffer words are parsed. When this option is specified, the leftmost pixel in a word is taken from the most significant bits. When absent, the leftmost pixel is parsed from the least significant bits.

If the LCD controller's raster engine is enabled when this function is called, it is disabled as a result of the call.

Returns
None.

Definition at line 846 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_O_RASTRCTL, LCD_RASTRCTL_REQDLY_S, RASTER_ACTVID_DURING_BLANK, RASTER_FMT_ACTIVE_24BPP_PACKED, RASTER_FMT_ACTIVE_24BPP_UNPACKED, RASTER_FMT_ACTIVE_PALETTIZED_12BIT, RASTER_FMT_ACTIVE_PALETTIZED_16BIT, RASTER_FMT_PASSIVE_COLOR_12BIT, RASTER_FMT_PASSIVE_COLOR_16BIT, RASTER_FMT_PASSIVE_MONO_4PIX, RASTER_FMT_PASSIVE_MONO_8PIX, RASTER_FMT_PASSIVE_PALETTIZED, RASTER_LOAD_DATA_ONLY, RASTER_LOAD_PALETTE_ONLY, RASTER_NIBBLE_MODE_ENABLED, and RASTER_READ_ORDER_REVERSED.

848 {
849  //
850  // Sanity check parameters.
851  //
852  ASSERT(ui32Base == LCD0_BASE);
853  ASSERT(!(ui32Config & ~(RASTER_FMT_ACTIVE_24BPP_PACKED |
867 
868  //
869  // Write the raster control register.
870  //
871  HWREG(ui32Base + LCD_O_RASTRCTL) = (ui32Config |
872  ((uint32_t)ui8PalLoadDelay <<
874 }
#define RASTER_FMT_PASSIVE_MONO_4PIX
Definition: lcd.h:322
#define RASTER_LOAD_PALETTE_ONLY
Definition: lcd.h:337
#define RASTER_FMT_ACTIVE_PALETTIZED_12BIT
Definition: lcd.h:318
#define HWREG(x)
Definition: hw_types.h:48
#define RASTER_FMT_PASSIVE_COLOR_12BIT
Definition: lcd.h:328
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_O_RASTRCTL
Definition: hw_lcd.h:60
#define RASTER_READ_ORDER_REVERSED
Definition: lcd.h:339
#define RASTER_FMT_ACTIVE_24BPP_PACKED
Definition: lcd.h:314
#define LCD_RASTRCTL_REQDLY_S
Definition: hw_lcd.h:262
#define RASTER_LOAD_DATA_ONLY
Definition: lcd.h:336
#define RASTER_FMT_PASSIVE_PALETTIZED
Definition: lcd.h:326
#define LCD0_BASE
Definition: hw_memmap.h:144
#define RASTER_FMT_PASSIVE_MONO_8PIX
Definition: lcd.h:324
#define RASTER_NIBBLE_MODE_ENABLED
Definition: lcd.h:334
#define RASTER_FMT_ACTIVE_PALETTIZED_16BIT
Definition: lcd.h:320
#define RASTER_FMT_ACTIVE_24BPP_UNPACKED
Definition: lcd.h:316
#define RASTER_ACTVID_DURING_BLANK
Definition: lcd.h:332
#define RASTER_FMT_PASSIVE_COLOR_16BIT
Definition: lcd.h:330
void LCDRasterDisable ( uint32_t  ui32Base)

Disables the raster output.

Parameters
ui32Baseis the base address of the controller.

This function disables the LCD controller raster output and stops driving the attached display.

Note
Once disabled, the raster engine continues to scan data until the end of the current frame. If the display is to be re-enabled, wait until after the final LCD_INT_RASTER_FRAME_DONE has been received, indicating that the raster engine has stopped.
Returns
None.

Definition at line 1079 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_O_RASTRCTL, and LCD_RASTRCTL_LCDEN.

1080 {
1081  //
1082  // Sanity check parameters.
1083  //
1084  ASSERT(ui32Base == LCD0_BASE);
1085 
1086  //
1087  // Disable the raster engine.
1088  //
1089  HWREG(ui32Base + LCD_O_RASTRCTL) &= ~LCD_RASTRCTL_LCDEN;
1090 }
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_O_RASTRCTL
Definition: hw_lcd.h:60
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_RASTRCTL_LCDEN
Definition: hw_lcd.h:260
void LCDRasterEnable ( uint32_t  ui32Base)

Enables the raster output.

Parameters
ui32Baseis the base address of the controller.

This function enables the LCD controller raster output and starts displaying the content of the current frame buffer on the attached panel. Prior to enabling the raster output, LCDModeSet(), LCDRasterConfigSet(), LCDDMAConfigSet(), LCDRasterTimingSet(), LCDRasterPaletteSet() and LCDRasterFrameBufferSet() must have been called.

Returns
None.

Definition at line 1014 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_CLOCK_MAIN, LCD_O_RASTRCTL, LCD_RASTRCTL_LCDEN, and LCDClockReset().

1015 {
1016  //
1017  // Sanity check parameters.
1018  //
1019  ASSERT(ui32Base == LCD0_BASE);
1020 
1021  //
1022  // Reset the module prior to starting the raster. This is required to
1023  // ensure correct operation of the raster engine.
1024  //
1025  LCDClockReset(ui32Base, LCD_CLOCK_MAIN);
1026 
1027  //
1028  // Enable the raster engine.
1029  //
1030  HWREG(ui32Base + LCD_O_RASTRCTL) |= LCD_RASTRCTL_LCDEN;
1031 }
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_O_RASTRCTL
Definition: hw_lcd.h:60
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_RASTRCTL_LCDEN
Definition: hw_lcd.h:260
void LCDClockReset(uint32_t ui32Base, uint32_t ui32Clocks)
Definition: lcd.c:181
#define LCD_CLOCK_MAIN
Definition: lcd.h:405

Here is the call graph for this function:

bool LCDRasterEnabled ( uint32_t  ui32Base)

Determines whether or not the raster output is currently enabled.

Parameters
ui32Baseis the base address of the controller.

This function may be used to query whether or not the raster output is currently enabled.

Returns
Returns true if the raster is enabled or false if it is disabled.

Definition at line 1047 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_O_RASTRCTL, and LCD_RASTRCTL_LCDEN.

1048 {
1049  //
1050  // Sanity check parameters.
1051  //
1052  ASSERT(ui32Base == LCD0_BASE);
1053 
1054  //
1055  // Return the current raster engine status.
1056  //
1057  return((HWREG(ui32Base + LCD_O_RASTRCTL) & LCD_RASTRCTL_LCDEN) ?
1058  true : false);
1059 }
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_O_RASTRCTL
Definition: hw_lcd.h:60
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_RASTRCTL_LCDEN
Definition: hw_lcd.h:260
void LCDRasterFrameBufferSet ( uint32_t  ui32Base,
uint8_t  ui8Buffer,
uint32_t *  pui32Addr,
uint32_t  ui32NumBytes 
)

Sets the LCD controller frame buffer start address and size in raster mode.

Parameters
ui32Baseis the base address of the controller.
ui8Bufferspecifies which frame buffer to configure. Valid values are 0 and 1.
pui32Addrpoints to the first byte of the frame buffer. This pointer must be aligned on a 32-bit (word) boundary.
ui32NumBytesspecifies the size of the frame buffer in bytes. This value must be a multiple of 4.

This function is used to configure the position and size of one of the two supported frame buffers while in raster mode. The second frame buffer (configured when ui8Buffer is set to 1) is only used if the controller is set to operate in ping-pong mode (by specifying the LCD_DMA_PING_PONG configuration flag on a call to LCDDMAConfigSet()).

The format of the frame buffer depends on the image type in use and the current raster configuration settings. If RASTER_LOAD_DATA_ONLY was specified in a previous call to LCDRasterConfigSet(), the frame buffer contains only packed pixel data in the required bit depth and format. In other cases, the frame buffer comprises a palette of either 8 or 128 32-bit words followed by the packed pixel data. The palette size is 8 words (16 16-bit entries) for all pixel formats other than 8bpp which uses a palette of 128 words (256 16-bit entries). Note that the 8 word palette is still present even for 12, 16 and 24-bit formats, which do not use the lookup table.

The frame buffer size, specified using the ui32NumBytes parameter, must be the palette size (if any) plus the size of the image bitmap required for the currently configured display resolution.

ui32NumBytes = (Palette Size) + ((Width * Height) * BPP) / 8)

If RASTER_LOAD_DATA_ONLY is not specified, frame buffers passed to this function must be initialized using a call to LCDRasterPaletteSet() prior to enabling the raster output. If this is not done, the pixel format identifier and color table required by the hardware is not present and the results are unpredictable.

Returns
None.

Definition at line 1476 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_O_DMABAFB0, LCD_O_DMABAFB1, LCD_O_DMACAFB0, and LCD_O_DMACAFB1.

1478 {
1479  //
1480  // Sanity check parameters.
1481  //
1482  ASSERT(ui32Base == LCD0_BASE);
1483  ASSERT(!((uint32_t)pui32Addr & 3));
1484  ASSERT(!(ui32NumBytes & 3));
1485  ASSERT(ui8Buffer < 2);
1486 
1487  //
1488  // Are we setting the values for frame buffer 0?
1489  //
1490  if(!ui8Buffer)
1491  {
1492  //
1493  // Yes - set the registers for frame buffer 0.
1494  //
1495  HWREG(ui32Base + LCD_O_DMABAFB0) = (uint32_t)pui32Addr;
1496  HWREG(ui32Base + LCD_O_DMACAFB0) = (uint32_t)pui32Addr +
1497  ui32NumBytes - 4;
1498  }
1499  else
1500  {
1501  //
1502  // No - set the registers for frame buffer 1.
1503  //
1504  HWREG(ui32Base + LCD_O_DMABAFB1) = (uint32_t)pui32Addr;
1505  HWREG(ui32Base + LCD_O_DMACAFB1) = (uint32_t)pui32Addr +
1506  ui32NumBytes - 4;
1507  }
1508 }
#define HWREG(x)
Definition: hw_types.h:48
#define LCD_O_DMABAFB1
Definition: hw_lcd.h:71
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_O_DMACAFB1
Definition: hw_lcd.h:73
#define LCD_O_DMACAFB0
Definition: hw_lcd.h:69
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_O_DMABAFB0
Definition: hw_lcd.h:67
void LCDRasterPaletteSet ( uint32_t  ui32Base,
uint32_t  ui32Type,
uint32_t *  pui32Addr,
const uint32_t *  pui32SrcColors,
uint32_t  ui32Start,
uint32_t  ui32Count 
)

Initializes the color palette in a frame buffer.

Parameters
ui32Baseis the base address of the controller.
ui32Typespecifies the type of pixel data to be held in the frame buffer and also the format of the source color values passed.
pui32Addrpoints to the start of the frame buffer into which the palette information is to be written.
pui32SrcColorspoints to the first color value that is to be written into the frame buffer palette.
ui32Startspecifies the index of the first color in the palette to update.
ui32Countspecifies the number of source colors to be copied into the frame buffer palette.

This function is used to initialize the color palette stored at the beginning of a frame buffer. It writes the relevant pixel type into the first entry of the frame buffer and copies the requested number of colors from a source buffer into the palette starting at the required index, optionally converting them from 24-bit color format into the 12-bit format used by the LCD controller.

ui32Type must be set to one of the following values to indicate the type of frame buffer for which the palette is being initialized:

  • LCD_PALETTE_TYPE_1BPP indicates a 1 bit per pixel (monochrome) frame buffer. This format requires a 2 entry palette.
  • LCD_PALETTE_TYPE_2BPP indicates a 2 bit per pixel frame buffer. This format requires a 4 entry palette.
  • LCD_PALETTE_TYPE_4BPP indicates a 4 bit per pixel frame buffer. This format requires a 4 entry palette.
  • LCD_PALETTE_TYPE_8BPP indicates an 8 bit per pixel frame buffer. This format requires a 256 entry palette.
  • LCD_PALETTE_TYPE_DIRECT indicates a direct color (12, 16 or 24 bit per pixel). The color palette is not used in these modes, but the frame buffer type must still be initialized to ensure that the hardware uses the correct pixel type. When this value is used, the format of the pixels in the frame buffer is defined by the ui32Config parameter previously passed to LCDRasterConfigSet().

Optionally, the LCD_PALETTE_SRC_24BIT flag may be ORed into ui32Type to indicate that the supplied colors in the pui32SrcColors array are in the 24-bit format as used by the TivaWare Graphics Library with one color stored in each 32-bit word. In this case, the colors read from the source array are converted to the 12-bit format used by the LCD controller before being written into the frame buffer palette.

If LCD_PALETTE_SRC_24BIT is not present, it is assumed that the pui32SrcColors array contains 12-bit colors in the format required by the LCD controller with 2 colors stored in each 32-bit word. In this case, the values are copied directly into the frame buffer palette without any reformatting.

Returns
None.

Definition at line 1367 of file lcd.c.

References ASSERT, LCD0_BASE, LCD_PALETTE_SRC_24BIT, LCD_PALETTE_TYPE_1BPP, LCD_PALETTE_TYPE_2BPP, LCD_PALETTE_TYPE_4BPP, LCD_PALETTE_TYPE_8BPP, LCD_PALETTE_TYPE_DIRECT, and PAL_FROM_RGB.

1370 {
1371  uint16_t *pui16Pal;
1372  uint16_t *pui16Src;
1373  uint32_t ui32Loop;
1374 
1375  //
1376  // Sanity check parameters.
1377  //
1378  ASSERT(ui32Base == LCD0_BASE);
1379  ASSERT(ui32Start < 256);
1380  ASSERT((ui32Start + ui32Count) <= 256);
1381  ASSERT(pui32Addr);
1382  ASSERT((pui32SrcColors) || (ui32Count == 0));
1386 
1387  //
1388  // Get a pointer to the start of the palette.
1389  //
1390  pui16Pal = (uint16_t *)pui32Addr;
1391 
1392  //
1393  // Are we converting the palette color format?
1394  //
1395  if(ui32Type & LCD_PALETTE_SRC_24BIT)
1396  {
1397  //
1398  // Yes - loop through each of the supplied 24-bit colors converting
1399  // and storing each.
1400  //
1401  ui32Loop = 0;
1402  while(ui32Count)
1403  {
1404  pui16Pal[ui32Start + ui32Loop] =
1405  PAL_FROM_RGB(pui32SrcColors[ui32Loop]);
1406  ui32Loop++;
1407  ui32Count--;
1408  }
1409  }
1410  else
1411  {
1412  //
1413  // No - loop through the supplied 12-bit colors storing each.
1414  //
1415 
1416  pui16Src = (uint16_t *)pui32SrcColors;
1417  while(ui32Count)
1418  {
1419  pui16Pal[ui32Start] = pui16Src[ui32Start];
1420  ui32Start++;
1421  ui32Count--;
1422  }
1423  }
1424 
1425  //
1426  // Write the pixel type into the first palette entry.
1427  //
1428  pui16Pal[0] &= ~(LCD_PALETTE_TYPE_8BPP | LCD_PALETTE_TYPE_DIRECT);
1429  pui16Pal[0] |= (ui32Type & ~LCD_PALETTE_SRC_24BIT);
1430 }
#define LCD_PALETTE_TYPE_8BPP
Definition: lcd.h:396
#define LCD_PALETTE_TYPE_2BPP
Definition: lcd.h:394
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_PALETTE_SRC_24BIT
Definition: lcd.h:398
#define LCD_PALETTE_TYPE_4BPP
Definition: lcd.h:395
#define LCD_PALETTE_TYPE_DIRECT
Definition: lcd.h:397
#define LCD0_BASE
Definition: hw_memmap.h:144
#define PAL_FROM_RGB(ui32RGBColor)
Definition: lcd.h:68
#define LCD_PALETTE_TYPE_1BPP
Definition: lcd.h:393
void LCDRasterSubPanelConfigSet ( uint32_t  ui32Base,
uint32_t  ui32Flags,
uint32_t  ui32BottomLines,
uint32_t  ui32DefaultPixel 
)

Sets the position and size of the subpanel on the raster display.

Parameters
ui32Baseis the base address of the controller.
ui32Flagsmay be either LCD_SUBPANEL_AT_TOP to show frame buffer image data in the top portion of the display and default color in the bottom portion, or LCD_SUBPANEL_AT_BOTTOM to show image data at the bottom of the display and default color at the top.
ui32BottomLinesdefines the number of lines comprising the bottom portion of the display. If LCD_SUBPANEL_AT_TOP is set in ui32Flags, these lines contain the default pixel color when the subpanel is enabled, otherwise they contain image data.
ui32DefaultPixelis the 24-bit RGB color to show in the portion of the display not configured to show image data.

The LCD controller provides a feature that allows a portion of the display to be filled with a default color rather than image data from the frame buffer. This feature reduces SRAM bandwidth requirements because no data is fetched for lines containing the default color. This feature is only available when the LCD controller is in raster mode and configured to drive an active matrix display.

The subpanel area containing image data from the frame buffer may be positioned either at the top or bottom of the display as controlled by the value of ui32Flags. The height of the bottom portion of the display is defined by ui32BottomLines.

When a subpanel is configured, the application must also reconfigure the frame buffer to ensure that it contains the correct number of lines for the subpanel size in use. This configuration can be achieved by calling LCDRasterFrameBufferSet() with the ui32NumBytes parameter set appropriately to describe the required number of active video lines in the subpanel area.

The subpanel display mode is not enabled using this function. To enable the subpanel once it has been configured, call LCDRasterSubPanelEnable().

Returns
None.

Definition at line 1134 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_O_RASTRSUBP1, LCD_O_RASTRSUBP2, LCD_RASTRSUBP1_DPDLSB_S, LCD_RASTRSUBP1_LPPT_M, LCD_RASTRSUBP1_LPPT_S, LCD_RASTRSUBP1_SPEN, LCD_RASTRSUBP2_DPDMSB_M, LCD_SUBPANEL_AT_BOTTOM, and LCD_SUBPANEL_AT_TOP.

1136 {
1137  //
1138  // Sanity check parameters.
1139  //
1140  ASSERT(ui32Base == LCD0_BASE);
1141  ASSERT((ui32Flags == LCD_SUBPANEL_AT_TOP) ||
1142  (ui32Flags == LCD_SUBPANEL_AT_BOTTOM));
1143  ASSERT(ui32BottomLines && (ui32BottomLines <= 2048));
1144 
1145  //
1146  // Adjust the line count into the 0-2047 range.
1147  //
1148  ui32BottomLines--;
1149 
1150  //
1151  // Set the first subpanel configuration register, taking care to leave the
1152  // subpanel enabled if it already was.
1153  //
1154  HWREG(ui32Base + LCD_O_RASTRSUBP1) = (HWREG(ui32Base + LCD_O_RASTRSUBP1) &
1155  LCD_RASTRSUBP1_SPEN) | ui32Flags |
1156  ((ui32DefaultPixel & 0xFFFF) <<
1158  ((ui32BottomLines <<
1161 
1162  //
1163  // Set the second subpanel configuration register.
1164  //
1165  HWREG(ui32Base + LCD_O_RASTRSUBP2) =
1166  ((ui32DefaultPixel >> 16) & LCD_RASTRSUBP2_DPDMSB_M) |
1167  (((ui32BottomLines >> LCD_RASTRSUBP1_LPPT_S) & 1) << 8);
1168 }
#define HWREG(x)
Definition: hw_types.h:48
#define LCD_RASTRSUBP1_SPEN
Definition: hw_lcd.h:333
#define ASSERT(expr)
Definition: debug.h:67
#define LCD_RASTRSUBP1_LPPT_S
Definition: hw_lcd.h:337
#define LCD_RASTRSUBP1_DPDLSB_S
Definition: hw_lcd.h:338
#define LCD_RASTRSUBP2_DPDMSB_M
Definition: hw_lcd.h:347
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_SUBPANEL_AT_TOP
Definition: lcd.h:415
#define LCD_O_RASTRSUBP1
Definition: hw_lcd.h:64
#define LCD_SUBPANEL_AT_BOTTOM
Definition: lcd.h:416
#define LCD_RASTRSUBP1_LPPT_M
Definition: hw_lcd.h:335
#define LCD_O_RASTRSUBP2
Definition: hw_lcd.h:65
void LCDRasterSubPanelDisable ( uint32_t  ui32Base)

Disables subpanel display mode.

Parameters
ui32Baseis the base address of the controller.

This function disables subpanel display mode and reverts to showing the entire frame buffer image on the display. After the subpanel is disabled, the frame buffer size must be reconfigured to match the full dimensions of the display area by calling LCDRasterFrameBufferSet() with an appropriate value for the ui32NumBytes parameter.

Returns
None.

Definition at line 1219 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_O_RASTRSUBP1, and LCD_RASTRSUBP1_SPEN.

1220 {
1221  //
1222  // Sanity check parameters.
1223  //
1224  ASSERT(ui32Base == LCD0_BASE);
1225 
1226  //
1227  // Disable the subpanel.
1228  //
1229  HWREG(ui32Base + LCD_O_RASTRSUBP1) &= ~LCD_RASTRSUBP1_SPEN;
1230 }
#define HWREG(x)
Definition: hw_types.h:48
#define LCD_RASTRSUBP1_SPEN
Definition: hw_lcd.h:333
#define ASSERT(expr)
Definition: debug.h:67
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_O_RASTRSUBP1
Definition: hw_lcd.h:64
void LCDRasterSubPanelEnable ( uint32_t  ui32Base)

Enables subpanel display mode.

Parameters
ui32Baseis the base address of the controller.

This function enables subpanel display mode and displays a default color rather than image data in the number of lines and at the position specified by a previous call to LCDRasterSubPanelConfigSet(). Prior to calling LCDRasterSubPanelEnable(), the frame buffer should have been reconfigured to match the desired subpanel size using a call to LCDRasterFrameBufferSet().

Subpanel display is only possible when the LCD controller is in raster mode and is configured to drive an active matrix display.

Returns
None.

Definition at line 1190 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_O_RASTRSUBP1, and LCD_RASTRSUBP1_SPEN.

1191 {
1192  //
1193  // Sanity check parameters.
1194  //
1195  ASSERT(ui32Base == LCD0_BASE);
1196 
1197  //
1198  // Enable the subpanel.
1199  //
1201 }
#define HWREG(x)
Definition: hw_types.h:48
#define LCD_RASTRSUBP1_SPEN
Definition: hw_lcd.h:333
#define ASSERT(expr)
Definition: debug.h:67
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_O_RASTRSUBP1
Definition: hw_lcd.h:64
void LCDRasterTimingSet ( uint32_t  ui32Base,
const tLCDRasterTiming pTiming 
)

Sets the LCD controller interface timing when in raster mode.

Parameters
ui32Basespecifies the LCD controller module base address.
pTimingpoints to a structure containing the desired timing parameters.

This function is used in raster mode to set the panel size and sync timing parameters.

For a definition of the timing parameters required, see the definition of tLCDRasterTiming.

Returns
None

Definition at line 894 of file lcd.c.

References ASSERT, HWREG, LCD0_BASE, LCD_O_RASTRTIM0, LCD_O_RASTRTIM1, LCD_O_RASTRTIM2, LCD_RASTRTIM0_HBP_S, LCD_RASTRTIM0_HFP_S, LCD_RASTRTIM0_HSW_S, LCD_RASTRTIM0_MSBPPL_S, LCD_RASTRTIM0_PPL_S, LCD_RASTRTIM1_LPP_S, LCD_RASTRTIM1_VBP_S, LCD_RASTRTIM1_VFP_S, LCD_RASTRTIM1_VSW_S, LCD_RASTRTIM2_ACBF_S, LCD_RASTRTIM2_ACBI_M, LCD_RASTRTIM2_HSW_S, LCD_RASTRTIM2_MSBHBP_S, LCD_RASTRTIM2_MSBHFP_S, LCD_RASTRTIM2_MSBLPP_S, RASTER_TIMING_ACTIVE_LOW_HSYNC, RASTER_TIMING_ACTIVE_LOW_OE, RASTER_TIMING_ACTIVE_LOW_PIXCLK, RASTER_TIMING_ACTIVE_LOW_VSYNC, RASTER_TIMING_SYNCS_ON_FALLING_PIXCLK, RASTER_TIMING_SYNCS_ON_RISING_PIXCLK, RASTER_TIMING_SYNCS_OPPOSITE_PIXCLK, tLCDRasterTiming::ui16HBackPorch, tLCDRasterTiming::ui16HFrontPorch, tLCDRasterTiming::ui16HSyncWidth, tLCDRasterTiming::ui16PanelHeight, tLCDRasterTiming::ui16PanelWidth, tLCDRasterTiming::ui32Flags, tLCDRasterTiming::ui8ACBiasLineCount, tLCDRasterTiming::ui8VBackPorch, tLCDRasterTiming::ui8VFrontPorch, and tLCDRasterTiming::ui8VSyncWidth.

895 {
896  uint32_t ui32T0, ui32T1, ui32T2;
897 
898  //
899  // Sanity check parameters.
900  //
901  ASSERT(ui32Base == LCD0_BASE);
902  ASSERT(pTiming);
910  ASSERT(pTiming->ui16PanelWidth && (pTiming->ui16PanelWidth <= 2048) &&
911  ((pTiming->ui16PanelWidth % 16) == 0));
912  ASSERT(pTiming->ui16PanelHeight && (pTiming->ui16PanelHeight <= 2048));
913  ASSERT(pTiming->ui16HFrontPorch && (pTiming->ui16HFrontPorch <= 1024));
914  ASSERT(pTiming->ui16HBackPorch && (pTiming->ui16HBackPorch <= 1024));
915  ASSERT(pTiming->ui16HSyncWidth && (pTiming->ui16HSyncWidth <= 1024));
916  ASSERT(pTiming->ui8VSyncWidth && (pTiming->ui8VSyncWidth <= 64));
917 
918  //
919  // Construct the values we need for the three raster timing registers.
920  //
921  ui32T0 = ((uint32_t)((pTiming->ui16HBackPorch - 1) & 0xFF) <<
923  ((uint32_t)((pTiming->ui16HFrontPorch - 1) & 0xFF) <<
925  ((uint32_t)((pTiming->ui16HSyncWidth - 1) & 0x3F) <<
927  (((uint32_t)((pTiming->ui16PanelWidth - 1) & 0x3F0) >> 4) <<
929  (((uint32_t)((pTiming->ui16PanelWidth - 1) & 0x400) >> 10) <<
931  ui32T1 = ((uint32_t)pTiming->ui8VBackPorch << LCD_RASTRTIM1_VBP_S) |
932  ((uint32_t)pTiming->ui8VFrontPorch << LCD_RASTRTIM1_VFP_S) |
933  ((uint32_t)((pTiming->ui8VSyncWidth - 1) & 0x3F) <<
935  ((uint32_t)(pTiming->ui16PanelHeight - 1) & 0x3FF) <<
937  ui32T2 = pTiming->ui32Flags |
938  ((((pTiming->ui16HSyncWidth - 1) & 0x3C0) >> 6) <<
940  ((((pTiming->ui16PanelHeight - 1) & 0x400) >> 10) <<
942  ((((pTiming->ui16HBackPorch - 1) & 0x300) >> 8) <<
944  ((((pTiming->ui16HFrontPorch - 1) & 0x300) >> 8) <<
947 
948  //
949  // Write the timing registers, taking care to preserve any existing value
950  // in the AC Bias interrupt field of RASTRTIM2.
951  //
952  HWREG(ui32Base + LCD_O_RASTRTIM0) = ui32T0;
953  HWREG(ui32Base + LCD_O_RASTRTIM1) = ui32T1;
954  HWREG(ui32Base + LCD_O_RASTRTIM2) = (HWREG(ui32Base + LCD_O_RASTRTIM2) &
955  LCD_RASTRTIM2_ACBI_M) | ui32T2;
956 }
#define LCD_RASTRTIM2_MSBHBP_S
Definition: hw_lcd.h:324
#define LCD_RASTRTIM1_VBP_S
Definition: hw_lcd.h:292
#define LCD_RASTRTIM0_MSBPPL_S
Definition: hw_lcd.h:280
#define LCD_O_RASTRTIM1
Definition: hw_lcd.h:62
uint8_t ui8VBackPorch
Definition: lcd.h:249
#define LCD_RASTRTIM2_MSBHFP_S
Definition: hw_lcd.h:325
#define RASTER_TIMING_SYNCS_OPPOSITE_PIXCLK
Definition: lcd.h:172
#define HWREG(x)
Definition: hw_types.h:48
#define RASTER_TIMING_ACTIVE_LOW_PIXCLK
Definition: lcd.h:184
#define LCD_RASTRTIM1_VSW_S
Definition: hw_lcd.h:294
#define LCD_O_RASTRTIM2
Definition: hw_lcd.h:63
uint8_t ui8ACBiasLineCount
Definition: lcd.h:270
#define ASSERT(expr)
Definition: debug.h:67
uint8_t ui8VFrontPorch
Definition: lcd.h:242
#define RASTER_TIMING_ACTIVE_LOW_VSYNC
Definition: lcd.h:192
uint16_t ui16HFrontPorch
Definition: lcd.h:224
#define LCD_RASTRTIM1_VFP_S
Definition: hw_lcd.h:293
uint32_t ui32Flags
Definition: lcd.h:206
#define RASTER_TIMING_ACTIVE_LOW_OE
Definition: lcd.h:180
uint16_t ui16PanelWidth
Definition: lcd.h:212
#define RASTER_TIMING_SYNCS_ON_FALLING_PIXCLK
Definition: lcd.h:176
#define LCD_RASTRTIM1_LPP_S
Definition: hw_lcd.h:295
#define RASTER_TIMING_ACTIVE_LOW_HSYNC
Definition: lcd.h:188
uint8_t ui8VSyncWidth
Definition: lcd.h:262
#define LCD_RASTRTIM2_ACBI_M
Definition: hw_lcd.h:313
#define LCD0_BASE
Definition: hw_memmap.h:144
#define LCD_RASTRTIM2_ACBF_S
Definition: hw_lcd.h:323
#define LCD_RASTRTIM2_HSW_S
Definition: hw_lcd.h:320
#define LCD_RASTRTIM0_HFP_S
Definition: hw_lcd.h:277
#define LCD_O_RASTRTIM0
Definition: hw_lcd.h:61
#define LCD_RASTRTIM0_HSW_S
Definition: hw_lcd.h:278
uint16_t ui16HSyncWidth
Definition: lcd.h:236
uint16_t ui16PanelHeight
Definition: lcd.h:218
#define LCD_RASTRTIM2_MSBLPP_S
Definition: hw_lcd.h:321
#define RASTER_TIMING_SYNCS_ON_RISING_PIXCLK
Definition: lcd.h:174
#define LCD_RASTRTIM0_PPL_S
Definition: hw_lcd.h:279
#define LCD_RASTRTIM0_HBP_S
Definition: hw_lcd.h:276
uint16_t ui16HBackPorch
Definition: lcd.h:230