DMCP interface  03.15_020
Graphics functions

LCD graphics and buffer commands. More...

Modules

 Graphics defines
 

Functions

void lcd_clear_buf ()
 Clear LCD buffer.
 
void lcd_refresh ()
 Start lcd refresh - could be blocking or non-blocking based on current system default (only dirty lines are updated)
 
void lcd_refresh_dma ()
 Start non-blocking LCD refresh, LCD refresh continues in background (only dirty lines are updated)
 
void lcd_refresh_wait ()
 Issue LCD refresh and wait until done (only dirty lines are updated)
 
void lcd_forced_refresh ()
 Write immediately whole LCD buffer to LCD regardless of dirty flags.
 
void lcd_refresh_lines (int ln, int cnt)
 Write immediately lines [ln .. ln+cnt-1] to LCD.
 
void bitblt24 (uint32_t x, uint32_t dx, uint32_t y, uint32_t val, int blt_op, int fill)
 Blits dx bits from val at position x, y. More...
 
uint8_t * lcd_line_addr (int y)
 Returns pointer to line data (doesn't depend on LCD_INVERT_XAXIS)
 
void lcd_fill_rect (uint32_t x, uint32_t y, uint32_t dx, uint32_t dy, int val)
 Fills rectangular area of LCD. More...
 
void lcd_fill_ptrn (int x, int y, int dx, int dy, int ptrn1, int ptrn2)
 Fills rectangular area with prescribed pattern. More...
 
void lcd_fillLine (int ln, uint8_t val)
 Fill LCD line with value. More...
 
void lcd_fillLines (int ln, uint8_t val, int cnt)
 Fill LCD lines with value. More...
 
void lcd_set_buf_cleared (int val)
 Sets 'LCD buffer cleared' flag. More...
 
int lcd_get_buf_cleared ()
 Reads 'LCD buffer cleared' flag. More...
 
uint8_t reverse_byte (uint8_t x)
 Swaps bits in byte. More...
 

Detailed Description

LCD graphics and buffer commands.

LCD hardware doesn't provide any means to access once written graphics data. Therefore system has to provide graphics buffer to hold LCD data and tracks access to separate LCD lines to optimize LCD refresh operations.

Function Documentation

◆ bitblt24()

void bitblt24 ( uint32_t  x,
uint32_t  dx,
uint32_t  y,
uint32_t  val,
int  blt_op,
int  fill 
)

Blits dx bits from val at position x, y.

Parameters
xPosition x
dx(1-24) Width x
yPosition y
valValue to blit
blt_opBlit operation BLT_OR, BLT_ANDN or BLT_XOR
fillBLT_SET or BLT_NONE

Value of fill doesn't apply for BLT_XOR.

BLT_NONE doesn't affect any blit operation.

BLT_SET affects src value of blit operation:

  • for BLT_OR src = 0 over width of operation (i.e. dx)
  • for BLT_ANDN src = 1 over width of operation (i.e. dx)

◆ lcd_fill_ptrn()

void lcd_fill_ptrn ( int  x,
int  y,
int  dx,
int  dy,
int  ptrn1,
int  ptrn2 
)

Fills rectangular area with prescribed pattern.

Parameters
xPosition x
yPosition y
dxWidth x
dyWidth y
ptrn1Pattern for even lines
ptrn2Pattern for odd lines

◆ lcd_fill_rect()

void lcd_fill_rect ( uint32_t  x,
uint32_t  y,
uint32_t  dx,
uint32_t  dy,
int  val 
)

Fills rectangular area of LCD.

Parameters
xPosition x
yPosition y
dxWidth x
dyWidth y
valLCD_EMPTY_VALUE or LCD_SET_VALUE

◆ lcd_fillLine()

void lcd_fillLine ( int  ln,
uint8_t  val 
)

Fill LCD line with value.

Parameters
lnLine number
valData to fill

Written value isn't affected by LCD_INVERT_DATA flag.

◆ lcd_fillLines()

void lcd_fillLines ( int  ln,
uint8_t  val,
int  cnt 
)

Fill LCD lines with value.

Parameters
lnStarting line number
valData to fill
cntNumber of lines to fill

Written value isn't affected by LCD_INVERT_DATA flag.

◆ lcd_get_buf_cleared()

int lcd_get_buf_cleared ( )

Reads 'LCD buffer cleared' flag.

'LCD buffer cleared' flag is set by system every time the LCD buffer is cleared. User can clear this flag and detect later in code whether LCD screen was cleared from other part of program or system and thus optimize screen repaints.

◆ lcd_set_buf_cleared()

void lcd_set_buf_cleared ( int  val)

Sets 'LCD buffer cleared' flag.

Parameters
valValue to set

See lcd_get_buf_cleared() for details

◆ reverse_byte()

uint8_t reverse_byte ( uint8_t  x)

Swaps bits in byte.

Parameters
xData to swap
Returns
Swapped data