40 #ifndef __DRIVERLIB_LCD_H__
41 #define __DRIVERLIB_LCD_H__
68 #define PAL_FROM_RGB(ui32RGBColor) (((ui32RGBColor & 0xF0) >> 4) | \
69 ((ui32RGBColor & 0xF000) >> 8) | \
70 ((ui32RGBColor & 0xF00000) >> 12))
84 #define CYCLES_FROM_TIME_US(ui32ClockFreq, ui32Time_uS) \
85 (((ui32Time_uS) == 0) ? 0 : \
86 (((ui32ClockFreq) / 1000000) * ((((ui32Time_uS) * 1000) - 1) / 1000)) + 1)
100 #define CYCLES_FROM_TIME_NS(ui32ClockFreq, ui32Time_nS) \
101 (((ui32Time_nS) == 0) ? 0 : \
102 ((((((ui32ClockFreq) / 1000000) * ((ui32Time_nS) - 1)) / 1000)) + 1))
172 #define RASTER_TIMING_SYNCS_OPPOSITE_PIXCLK \
174 #define RASTER_TIMING_SYNCS_ON_RISING_PIXCLK \
176 #define RASTER_TIMING_SYNCS_ON_FALLING_PIXCLK \
178 #define RASTER_TIMING_ACTIVE_HIGH_OE \
180 #define RASTER_TIMING_ACTIVE_LOW_OE \
182 #define RASTER_TIMING_ACTIVE_HIGH_PIXCLK \
184 #define RASTER_TIMING_ACTIVE_LOW_PIXCLK \
186 #define RASTER_TIMING_ACTIVE_HIGH_HSYNC \
188 #define RASTER_TIMING_ACTIVE_LOW_HSYNC \
190 #define RASTER_TIMING_ACTIVE_HIGH_VSYNC \
192 #define RASTER_TIMING_ACTIVE_LOW_VSYNC \
280 #define LCD_MODE_LIDD ((uint8_t)0x00)
281 #define LCD_MODE_RASTER ((uint8_t)0x01)
282 #define LCD_MODE_AUTO_UFLOW_RESTART \
290 #define LIDD_CONFIG_SYNC_MPU68 0x00000000
291 #define LIDD_CONFIG_ASYNC_MPU68 0x00000001
292 #define LIDD_CONFIG_SYNC_MPU80 0x00000002
293 #define LIDD_CONFIG_ASYNC_MPU80 0x00000003
294 #define LIDD_CONFIG_ASYNC_HITACHI \
296 #define LIDD_CONFIG_INVERT_ALE 0x00000008
297 #define LIDD_CONFIG_INVERT_RS_EN \
299 #define LIDD_CONFIG_INVERT_WS_DIR \
301 #define LIDD_CONFIG_INVERT_CS0 0x00000040
302 #define LIDD_CONFIG_INVERT_CS1 0x00000080
314 #define RASTER_FMT_ACTIVE_24BPP_PACKED \
316 #define RASTER_FMT_ACTIVE_24BPP_UNPACKED \
318 #define RASTER_FMT_ACTIVE_PALETTIZED_12BIT \
320 #define RASTER_FMT_ACTIVE_PALETTIZED_16BIT \
322 #define RASTER_FMT_PASSIVE_MONO_4PIX \
324 #define RASTER_FMT_PASSIVE_MONO_8PIX \
326 #define RASTER_FMT_PASSIVE_PALETTIZED \
328 #define RASTER_FMT_PASSIVE_COLOR_12BIT \
330 #define RASTER_FMT_PASSIVE_COLOR_16BIT \
332 #define RASTER_ACTVID_DURING_BLANK \
334 #define RASTER_NIBBLE_MODE_ENABLED \
336 #define RASTER_LOAD_DATA_ONLY 0x00200000
337 #define RASTER_LOAD_PALETTE_ONLY \
339 #define RASTER_READ_ORDER_REVERSED \
349 #define LCD_INT_DMA_DONE 0x00000001
350 #define LCD_INT_RASTER_FRAME_DONE \
352 #define LCD_INT_SYNC_LOST 0x00000004
353 #define LCD_INT_AC_BIAS_CNT 0x00000008
354 #define LCD_INT_UNDERFLOW 0x00000020
355 #define LCD_INT_PAL_LOAD 0x00000040
356 #define LCD_INT_EOF0 0x00000100
357 #define LCD_INT_EOF1 0x00000200
364 #define LCD_DMA_FIFORDY_8_WORDS 0x00000000
365 #define LCD_DMA_FIFORDY_16_WORDS \
367 #define LCD_DMA_FIFORDY_32_WORDS \
369 #define LCD_DMA_FIFORDY_64_WORDS \
371 #define LCD_DMA_FIFORDY_128_WORDS \
373 #define LCD_DMA_FIFORDY_256_WORDS \
375 #define LCD_DMA_FIFORDY_512_WORDS \
377 #define LCD_DMA_BURST_1 0x00000010
378 #define LCD_DMA_BURST_2 0x00000010
379 #define LCD_DMA_BURST_4 0x00000020
380 #define LCD_DMA_BURST_8 0x00000030
381 #define LCD_DMA_BURST_16 0x00000040
382 #define LCD_DMA_BYTE_ORDER_0123 0x00000000
383 #define LCD_DMA_BYTE_ORDER_1023 0x00000008
384 #define LCD_DMA_BYTE_ORDER_3210 0x00000002
385 #define LCD_DMA_BYTE_ORDER_2301 0x0000000A
386 #define LCD_DMA_PING_PONG 0x00000001
393 #define LCD_PALETTE_TYPE_1BPP 0x00000000
394 #define LCD_PALETTE_TYPE_2BPP 0x00001000
395 #define LCD_PALETTE_TYPE_4BPP 0x00002000
396 #define LCD_PALETTE_TYPE_8BPP 0x00003000
397 #define LCD_PALETTE_TYPE_DIRECT 0x00004000
398 #define LCD_PALETTE_SRC_24BIT 0x80000000
405 #define LCD_CLOCK_MAIN 0x00000008
406 #define LCD_CLOCK_DMA 0x00000004
407 #define LCD_CLOCK_LIDD 0x00000002
408 #define LCD_CLOCK_CORE 0x00000001
415 #define LCD_SUBPANEL_AT_TOP 0x20000000
416 #define LCD_SUBPANEL_AT_BOTTOM 0x00000000
430 extern uint32_t
LCDModeSet(uint32_t ui32Base, uint8_t ui8Mode,
431 uint32_t ui32PixClk, uint32_t ui32SysClk);
432 extern void LCDClockReset(uint32_t ui32Base, uint32_t ui32Clocks);
442 uint16_t ui16Addr, uint16_t ui16Data);
444 extern uint16_t
LCDIDDDataRead(uint32_t ui32Base, uint32_t ui32CS);
448 const uint32_t *pui32Data, uint32_t ui32Count);
450 uint8_t ui8PalLoadDelay);
458 uint32_t ui32BottomLines,
459 uint32_t ui32DefaultPixel);
464 uint32_t *pui32PalAddr,
465 const uint32_t *pui32SrcColors,
470 uint32_t ui32NumBytes);
471 extern void LCDIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags);
472 extern void LCDIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags);
473 extern uint32_t
LCDIntStatus(uint32_t ui32Base,
bool bMasked);
474 extern void LCDIntClear(uint32_t ui32Base, uint32_t ui32IntFlags);
475 extern void LCDIntRegister(uint32_t ui32Base,
void (*pfnHandler)(
void));
487 #endif // __DRIVERLIB_LCD_H__
void LCDRasterSubPanelDisable(uint32_t ui32Base)
void LCDIDDDataWrite(uint32_t ui32Base, uint32_t ui32CS, uint16_t ui16Data)
void LCDIDDDMADisable(uint32_t ui32Base)
void LCDRasterPaletteSet(uint32_t ui32Base, uint32_t ui32Type, uint32_t *pui32PalAddr, const uint32_t *pui32SrcColors, uint32_t ui32Start, uint32_t ui32Count)
uint32_t LCDModeSet(uint32_t ui32Base, uint8_t ui8Mode, uint32_t ui32PixClk, uint32_t ui32SysClk)
void LCDIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
void LCDIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
void LCDRasterFrameBufferSet(uint32_t ui32Base, uint8_t ui8Buffer, uint32_t *pui32Addr, uint32_t ui32NumBytes)
void LCDRasterSubPanelEnable(uint32_t ui32Base)
void LCDIDDDMAWrite(uint32_t ui32Base, uint32_t ui32CS, const uint32_t *pui32Data, uint32_t ui32Count)
void LCDIDDTimingSet(uint32_t ui32Base, uint32_t ui32CS, const tLCDIDDTiming *pTiming)
uint16_t LCDIDDIndexedRead(uint32_t ui32Base, uint32_t ui32CS, uint16_t ui16Addr)
void LCDRasterSubPanelConfigSet(uint32_t ui32Base, uint32_t ui32Flags, uint32_t ui32BottomLines, uint32_t ui32DefaultPixel)
uint8_t ui8ACBiasLineCount
void LCDIDDIndexedWrite(uint32_t ui32Base, uint32_t ui32CS, uint16_t ui16Addr, uint16_t ui16Data)
void LCDIntRegister(uint32_t ui32Base, void(*pfnHandler)(void))
void LCDIDDConfigSet(uint32_t ui32Base, uint32_t ui32Config)
uint16_t LCDIDDStatusRead(uint32_t ui32Base, uint32_t ui32CS)
void LCDRasterDisable(uint32_t ui32Base)
void LCDIntUnregister(uint32_t ui32Base)
void LCDIntClear(uint32_t ui32Base, uint32_t ui32IntFlags)
void LCDClockReset(uint32_t ui32Base, uint32_t ui32Clocks)
uint32_t LCDIntStatus(uint32_t ui32Base, bool bMasked)
void LCDRasterTimingSet(uint32_t ui32Base, const tLCDRasterTiming *pTiming)
void LCDDMAConfigSet(uint32_t ui32Base, uint32_t ui32Config)
bool LCDRasterEnabled(uint32_t ui32Base)
uint16_t LCDIDDDataRead(uint32_t ui32Base, uint32_t ui32CS)
void LCDRasterConfigSet(uint32_t ui32Base, uint32_t ui32Config, uint8_t ui8PalLoadDelay)
void LCDRasterACBiasIntCountSet(uint32_t ui32Base, uint8_t ui8Count)
void LCDIDDCommandWrite(uint32_t ui32Base, uint32_t ui32CS, uint16_t ui16Cmd)
void LCDRasterEnable(uint32_t ui32Base)