EU1KY AA
LCD.h File Reference
#include <stdint.h>

Go to the source code of this file.

Macros

#define LCD_RGB(r, g, b)
 Convert 24-bit RGB color to 888 format with macro. More...
 

Typedefs

typedef uint32_t LCDColor
 LCD color type. More...
 

Enumerations

enum  {
  LCD_BLACK = LCD_RGB(0, 0, 0), LCD_GRAY = LCD_RGB(127, 127, 127), LCD_RED = LCD_RGB(255, 0, 0), LCD_GREEN = LCD_RGB(0, 255, 0),
  LCD_BLUE = LCD_RGB(0, 0, 255), LCD_YELLOW = LCD_RGB(255, 255, 0), LCD_PURPLE = LCD_RGB(255, 0, 255), LCD_CYAN = LCD_RGB(0, 255, 255),
  LCD_WHITE = LCD_RGB(255, 255, 255)
}
 Some useful color definitions. More...
 

Functions

struct __attribute__ ((packed))
 LCD point descriptor. More...
 
void LCD_Init (void)
 Initialize hardware, turn on and fill display with black. More...
 
LCDPoint LCD_MakePoint (int x, int y)
 Make LCDPoint from x and y coordinates. More...
 
LCDColor LCD_MakeRGB (uint8_t r, uint8_t g, uint8_t b)
 
void LCD_SetPixel (LCDPoint p, LCDColor color)
 Sets pixel at given point to given color. More...
 
void LCD_FillRect (LCDPoint p1, LCDPoint p2, LCDColor color)
 Fill rectangle with given corner points with given color. More...
 
void LCD_FillAll (LCDColor c)
 Fill the entire display with given color. More...
 
void LCD_Rectangle (LCDPoint a, LCDPoint b, LCDColor c)
 Draw lines forming a rectangle with given corner points with given color. More...
 
void LCD_Circle (LCDPoint center, uint16_t r, LCDColor color)
 
void LCD_FillCircle (LCDPoint center, uint16_t r, LCDColor color)
 
void LCD_DrawArc (int32_t x, int32_t y, int32_t radius, float astartdeg, float aenddeg, LCDColor color)
 Draw arc using start and end in degrees (0 .. 360) More...
 
void LCD_VLine (LCDPoint p1, uint16_t lenght, LCDColor color)
 
void LCD_HLine (LCDPoint p1, uint16_t lenght, LCDColor color)
 
void LCD_Line (LCDPoint p1, LCDPoint p2, LCDColor c)
 Draw line between given points with given color. More...
 
void LCD_TurnOn (void)
 Turn on LCD and backlight. More...
 
void LCD_TurnOff (void)
 
void LCD_BacklightOn (void)
 Turn on LCD backlight. More...
 
void LCD_BacklightOff (void)
 Turn off LCD backlight. More...
 
void LCD_InvertPixel (LCDPoint p)
 Invert color of display pixel. More...
 
void LCD_InvertRect (LCDPoint p1, LCDPoint p2)
 
LCDColor LCD_ReadPixel (LCDPoint p)
 
uint16_t LCD_GetWidth (void)
 
uint16_t LCD_GetHeight (void)
 
void LCD_WaitForRedraw (void)
 
uint32_t LCD_IsOff (void)
 
void LCD_DrawBitmap (LCDPoint origin, const uint8_t *bmpData, uint32_t bmpDataSize)
 
void LCD_ShowActiveLayerOnly (void)
 
uint8_t * LCD_Push (void)
 Store LCD contents to the stack in SDRAM memory. More...
 
void LCD_Pop (void)
 Restore last saved LCD contents from the stack in SDRAM memory. More...
 

Variables

 LCDPoint
 

Macro Definition Documentation

#define LCD_RGB (   r,
  g,
 
)
Value:
((LCDColor) ( 0xFF000000ul | \
(( ((uint32_t)(r)) & 0xFF) << 16) | \
(( ((uint32_t)(g)) & 0xFF) << 8) | \
( ((uint32_t)(b)) & 0xFF) \
))
uint32_t LCDColor
LCD color type.
Definition: LCD.h:26

Convert 24-bit RGB color to 888 format with macro.

Typedef Documentation

typedef uint32_t LCDColor

LCD color type.

Enumeration Type Documentation

anonymous enum

Some useful color definitions.

Enumerator
LCD_BLACK 
LCD_GRAY 
LCD_RED 
LCD_GREEN 
LCD_BLUE 
LCD_YELLOW 
LCD_PURPLE 
LCD_CYAN 
LCD_WHITE 

Function Documentation

struct __attribute__ ( (packed)  )

LCD point descriptor.

void LCD_BacklightOff ( void  )

Turn off LCD backlight.

void LCD_BacklightOn ( void  )

Turn on LCD backlight.

void LCD_Circle ( LCDPoint  center,
uint16_t  r,
LCDColor  color 
)
void LCD_DrawArc ( int32_t  x,
int32_t  y,
int32_t  radius,
float  astartdeg,
float  aenddeg,
LCDColor  color 
)

Draw arc using start and end in degrees (0 .. 360)

void LCD_DrawBitmap ( LCDPoint  origin,
const uint8_t *  bmpData,
uint32_t  bmpDataSize 
)
void LCD_FillAll ( LCDColor  c)

Fill the entire display with given color.

void LCD_FillCircle ( LCDPoint  center,
uint16_t  r,
LCDColor  color 
)
void LCD_FillRect ( LCDPoint  p1,
LCDPoint  p2,
LCDColor  color 
)

Fill rectangle with given corner points with given color.

uint16_t LCD_GetHeight ( void  )
uint16_t LCD_GetWidth ( void  )
void LCD_HLine ( LCDPoint  p1,
uint16_t  lenght,
LCDColor  color 
)
void LCD_Init ( void  )

Initialize hardware, turn on and fill display with black.

void LCD_InvertPixel ( LCDPoint  p)

Invert color of display pixel.

void LCD_InvertRect ( LCDPoint  p1,
LCDPoint  p2 
)
uint32_t LCD_IsOff ( void  )
void LCD_Line ( LCDPoint  p1,
LCDPoint  p2,
LCDColor  c 
)

Draw line between given points with given color.

LCDPoint LCD_MakePoint ( int  x,
int  y 
)

Make LCDPoint from x and y coordinates.

LCDColor LCD_MakeRGB ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)

Make LCDColor from R, G and B components with function. See also LCD_RGB macro that does the same at compile time.

void LCD_Pop ( void  )

Restore last saved LCD contents from the stack in SDRAM memory.

uint8_t* LCD_Push ( void  )

Store LCD contents to the stack in SDRAM memory.

Returns
A pointer to the memory area where the image has been stored to
LCDColor LCD_ReadPixel ( LCDPoint  p)
void LCD_Rectangle ( LCDPoint  a,
LCDPoint  b,
LCDColor  c 
)

Draw lines forming a rectangle with given corner points with given color.

void LCD_SetPixel ( LCDPoint  p,
LCDColor  color 
)

Sets pixel at given point to given color.

void LCD_ShowActiveLayerOnly ( void  )
void LCD_TurnOff ( void  )

Turn off backlight and switch LCD to power saving mode (but draving to its memory remains available)

void LCD_TurnOn ( void  )

Turn on LCD and backlight.

void LCD_VLine ( LCDPoint  p1,
uint16_t  lenght,
LCDColor  color 
)
void LCD_WaitForRedraw ( void  )

Variable Documentation

LCDPoint