TM STM32F4xx Libraries  v1.0.0
Libraries for STM32F4xx devices from Tilen Majerle
TM_ILI9341_LTDC_Functions

Library Functions. More...

Functions

void TM_ILI9341_Init (void)
 Initializes ILI9341 LCD with LTDC peripheral It also initializes external SDRAM. More...
 
void TM_ILI9341_DrawPixel (uint16_t x, uint16_t y, uint32_t color)
 Draws single pixel to LCD. More...
 
void TM_ILI9341_Fill (uint32_t color)
 Fills entire LCD with color. More...
 
void TM_ILI9341_Rotate (TM_ILI9341_Orientation_t orientation)
 Rotates LCD to specific orientation. More...
 
void TM_ILI9341_Putc (uint16_t x, uint16_t y, char c, TM_FontDef_t *font, uint32_t foreground, uint32_t background)
 Puts single character to LCD. More...
 
void TM_ILI9341_Puts (uint16_t x, uint16_t y, char *str, TM_FontDef_t *font, uint32_t foreground, uint32_t background)
 Puts string to LCD. More...
 
void TM_ILI9341_GetStringSize (char *str, TM_FontDef_t *font, uint16_t *width, uint16_t *height)
 Gets width and height of box with text. More...
 
void TM_ILI9341_DrawLine (uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint32_t color)
 Draws line to LCD. More...
 
void TM_ILI9341_DrawRectangle (uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint32_t color)
 Draws rectangle on LCD. More...
 
void TM_ILI9341_DrawFilledRectangle (uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint32_t color)
 Draws filled rectangle on LCD. More...
 
void TM_ILI9341_DrawRoundedRectangle (uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t r, uint32_t color)
 Draws rounded rectangle on LCD. More...
 
void TM_ILI9341_DrawFilledRoundedRectangle (uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t r, uint32_t color)
 Draws filled rounded rectangle on LCD. More...
 
void TM_ILI9341_DrawCircle (int16_t x0, int16_t y0, int16_t r, uint32_t color)
 Draws circle on LCD. More...
 
void TM_ILI9341_DrawFilledCircle (int16_t x0, int16_t y0, int16_t r, uint32_t color)
 Draws filled circle on LCD. More...
 
void TM_ILI9341_SetLayer1 (void)
 Sets layer 2 to currently active layer. More...
 
void TM_ILI9341_SetLayer2 (void)
 Sets layer 2 to currently active layer. More...
 
void TM_ILI9341_SetLayer1Opacity (uint8_t opacity)
 Sets layer 1 opacity. More...
 
void TM_ILI9341_SetLayer2Opacity (uint8_t opacity)
 Sets layer 2 opacity. More...
 
void TM_ILI9341_ChangeLayers (void)
 This changes current active layer It sets transparency to 0 and 255 depends on which layer is selected. More...
 
void TM_ILI9341_Layer2To1 (void)
 Copies content of layer 2 to layer 1. More...
 
void TM_ILI9341_Layer1To2 (void)
 Copies content of layer 1 to layer 2. More...
 
void TM_ILI9341_DisplayOn (void)
 Enables display. More...
 
void TM_ILI9341_DisplayOff (void)
 Disables display. More...
 

Detailed Description

Library Functions.

Function Documentation

void TM_ILI9341_ChangeLayers ( void  )

This changes current active layer It sets transparency to 0 and 255 depends on which layer is selected.

Note
If current layer is Layer 1, then now will be Layer 2 and vice versa
Return values
None
void TM_ILI9341_DisplayOff ( void  )

Disables display.

Parameters
None
Return values
None
void TM_ILI9341_DisplayOn ( void  )

Enables display.

Note
After initialization, LCD is enabled and you don't need to call this function
Parameters
None
Return values
None
void TM_ILI9341_DrawCircle ( int16_t  x0,
int16_t  y0,
int16_t  r,
uint32_t  color 
)

Draws circle on LCD.

Parameters
x0X coordinate of center circle point
y0Y coordinate of center circle point
rCircle radius
colorCircle color
Return values
None
void TM_ILI9341_DrawFilledCircle ( int16_t  x0,
int16_t  y0,
int16_t  r,
uint32_t  color 
)

Draws filled circle on LCD.

Parameters
x0X coordinate of center circle point
y0Y coordinate of center circle point
rCircle radius
colorCircle color
Return values
None
void TM_ILI9341_DrawFilledRectangle ( uint16_t  x0,
uint16_t  y0,
uint16_t  x1,
uint16_t  y1,
uint32_t  color 
)

Draws filled rectangle on LCD.

Parameters
x0X coordinate of top left point
y0Y coordinate of top left point
x1X coordinate of bottom right point
y1Y coordinate of bottom right point
colorRectangle color
Return values
None
void TM_ILI9341_DrawFilledRoundedRectangle ( uint16_t  x0,
uint16_t  y0,
uint16_t  x1,
uint16_t  y1,
uint16_t  r,
uint32_t  color 
)

Draws filled rounded rectangle on LCD.

Parameters
x0X coordinate of top left point
y0Y coordinate of top left point
x1X coordinate of bottom right point
y1Y coordinate of bottom right point
rRadius for corners
colorRectangle color
Return values
None
void TM_ILI9341_DrawLine ( uint16_t  x0,
uint16_t  y0,
uint16_t  x1,
uint16_t  y1,
uint32_t  color 
)

Draws line to LCD.

Parameters
x0X coordinate of starting point
y0Y coordinate of starting point
x1X coordinate of ending point
y1Y coordinate of ending point
colorLine color
Return values
None
void TM_ILI9341_DrawPixel ( uint16_t  x,
uint16_t  y,
uint32_t  color 
)

Draws single pixel to LCD.

Parameters
xX position for pixel
yY position for pixel
colorColor of pixel
Return values
None
void TM_ILI9341_DrawRectangle ( uint16_t  x0,
uint16_t  y0,
uint16_t  x1,
uint16_t  y1,
uint32_t  color 
)

Draws rectangle on LCD.

Parameters
x0X coordinate of top left point
y0Y coordinate of top left point
x1X coordinate of bottom right point
y1Y coordinate of bottom right point
colorRectangle color
Return values
None
void TM_ILI9341_DrawRoundedRectangle ( uint16_t  x0,
uint16_t  y0,
uint16_t  x1,
uint16_t  y1,
uint16_t  r,
uint32_t  color 
)

Draws rounded rectangle on LCD.

Parameters
x0X coordinate of top left point
y0Y coordinate of top left point
x1X coordinate of bottom right point
y1Y coordinate of bottom right point
rRadius for corners
colorRectangle color
Return values
None
void TM_ILI9341_Fill ( uint32_t  color)

Fills entire LCD with color.

Parameters
colorColor to be used in fill
Return values
None
void TM_ILI9341_GetStringSize ( char *  str,
TM_FontDef_t font,
uint16_t *  width,
uint16_t *  height 
)

Gets width and height of box with text.

Parameters
*strPointer to first character
*fontPointer to TM_FontDef_t used font
*widthPointer to variable to store width
*heightPointer to variable to store height
Return values
None
void TM_ILI9341_Init ( void  )

Initializes ILI9341 LCD with LTDC peripheral It also initializes external SDRAM.

Parameters
None
Return values
None
void TM_ILI9341_Layer1To2 ( void  )

Copies content of layer 1 to layer 2.

Note
It will do a memory copy from layer 1 to layer 2
Return values
None
void TM_ILI9341_Layer2To1 ( void  )

Copies content of layer 2 to layer 1.

Note
It will do a memory copy from layer 2 to layer 1
Return values
None
void TM_ILI9341_Putc ( uint16_t  x,
uint16_t  y,
char  c,
TM_FontDef_t font,
uint32_t  foreground,
uint32_t  background 
)

Puts single character to LCD.

Parameters
xX position of top left corner
yY position of top left corner
cCharacter to be displayed
*fontPointer to TM_FontDef_t used font
foregroundColor for char
backgroundColor for char background
Return values
None
void TM_ILI9341_Puts ( uint16_t  x,
uint16_t  y,
char *  str,
TM_FontDef_t font,
uint32_t  foreground,
uint32_t  background 
)

Puts string to LCD.

Parameters
xX position of top left corner of first character in string
yY position of top left corner of first character in string
*strPointer to first character
*fontPointer to TM_FontDef_t used font
foregroundColor for string
backgroundColor for string background
Return values
None
void TM_ILI9341_Rotate ( TM_ILI9341_Orientation_t  orientation)

Rotates LCD to specific orientation.

Parameters
orientationLCD orientation. This parameter can be a value of TM_ILI9341_Orientation_t enumeration
Return values
None
void TM_ILI9341_SetLayer1 ( void  )

Sets layer 2 to currently active layer.

Parameters
None
Return values
None
void TM_ILI9341_SetLayer1Opacity ( uint8_t  opacity)

Sets layer 1 opacity.

Parameters
opacity0 to 255, 0 is no opacity, 255 is no transparency
Return values
None
void TM_ILI9341_SetLayer2 ( void  )

Sets layer 2 to currently active layer.

Parameters
None
Return values
None
void TM_ILI9341_SetLayer2Opacity ( uint8_t  opacity)

Sets layer 2 opacity.

Parameters
opacity0 to 255, 0 is no opacity, 255 is no transparency
Return values
None