TM STM32Fxxx HAL Libraries  v1.0.0
Libraries for STM32Fxxx (F0, F4 and F7 series) devices based on HAL drivers from ST from Tilen Majerle
TM_DMA2D_GRAPHIC_Functions

Library Functions. More...

Functions

void TM_DMA2DGRAPHIC_Init (void)
 Initializes and prepare DMA2D for working. More...
 
void TM_DMA2DGRAPHIC_SetLayer (uint8_t layer_number)
 Sets layer for DMA2D working memory. More...
 
void TM_DMA2DGRAPHIC_SetOrientation (uint8_t orientation)
 Sets orientation for DMA2D peripheral. More...
 
void TM_DMA2DGRAPHIC_Fill (uint32_t color)
 Fills entire LCD memory layer with custom color. More...
 
void TM_DMA2DGRAPHIC_DrawPixel (uint16_t x, uint16_t y, uint32_t color)
 Draws single pixel on currently active layer. More...
 
uint32_t TM_DMA2DGRAPHIC_GetPixel (uint16_t x, uint16_t y)
 Gets single pixel on currently active layer. More...
 
void TM_DMA2DGRAPHIC_DrawVerticalLine (int16_t x, int16_t y, uint16_t length, uint32_t color)
 Draws vertical line on currently active layer. More...
 
void TM_DMA2DGRAPHIC_DrawHorizontalLine (int16_t x, int16_t y, uint16_t length, uint32_t color)
 Draws horizontal line on currently active layer. More...
 
void TM_DMA2DGRAPHIC_DrawLine (int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint32_t color)
 Draws line on currently active layer. More...
 
void TM_DMA2DGRAPHIC_DrawPolyLine (TM_DMA2DRAPHIC_Poly_t *Coordinates, uint16_t count, uint32_t color)
 Draws polygon line on currently active layer. More...
 
void TM_DMA2DGRAPHIC_DrawRectangle (uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint32_t color)
 Draws rectangle on currently active layer. More...
 
void TM_DMA2DGRAPHIC_DrawFilledRectangle (uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint32_t color)
 Draws filled rectangle on currently active layer. More...
 
void TM_DMA2DGRAPHIC_DrawRoundedRectangle (uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t r, uint32_t color)
 Draws rounded rectangle on currently active layer. More...
 
void TM_DMA2DGRAPHIC_DrawFilledRoundedRectangle (uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t r, uint32_t color)
 Draws filled rounded rectangle on currently active layer. More...
 
void TM_DMA2DGRAPHIC_DrawCircle (uint16_t x0, uint16_t y0, uint16_t r, uint32_t color)
 Draws circle on currently active layer. More...
 
void TM_DMA2DGRAPHIC_DrawFilledCircle (uint16_t x0, uint16_t y0, uint16_t r, uint32_t color)
 Draws filed circle on currently active layer. More...
 
void TM_DMA2DGRAPHIC_DrawTriangle (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3, uint32_t color)
 Draws triangle on currently active layer. More...
 
void TM_DMA2DGRAPHIC_DrawFilledTriangle (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3, uint32_t color)
 Draws filled triangle on currently active layer. More...
 
void TM_DMA2DGRAPHIC_CopyBuffer (void *pSrc, void *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLineSrc, uint32_t OffLineDst)
 
void TM_DMA2DGRAPHIC_CopyBufferIT (void *pSrc, void *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLineSrc, uint32_t OffLineDst)
 
void TM_INT_DMA2DGRAPHIC_SetConf (TM_DMA2DGRAPHIC_INT_Conf_t *Conf)
 

Detailed Description

Library Functions.

Function Documentation

void TM_DMA2DGRAPHIC_DrawCircle ( uint16_t  x0,
uint16_t  y0,
uint16_t  r,
uint32_t  color 
)

Draws circle on currently active layer.

Parameters
x0X coordinate of circle center on LCD
y0Y coordinate of circle center on LCD
rCircle radius in pixels
colorColor in RGB565 format
Return values
None
void TM_DMA2DGRAPHIC_DrawFilledCircle ( uint16_t  x0,
uint16_t  y0,
uint16_t  r,
uint32_t  color 
)

Draws filed circle on currently active layer.

Parameters
x0X coordinate of circle center on LCD
y0Y coordinate of circle center on LCD
rCircle radius in pixels
colorColor in RGB565 format
Return values
None
void TM_DMA2DGRAPHIC_DrawFilledRectangle ( uint16_t  x,
uint16_t  y,
uint16_t  width,
uint16_t  height,
uint32_t  color 
)

Draws filled rectangle on currently active layer.

Parameters
xTop left X location for rectangle on LCD
yTop left Y location for rectangle on LCD
widthRectangle width in pixels
heightRectangle height in pixels
colorColor in RGB565 format
Return values
None
void TM_DMA2DGRAPHIC_DrawFilledRoundedRectangle ( uint16_t  x,
uint16_t  y,
uint16_t  width,
uint16_t  height,
uint16_t  r,
uint32_t  color 
)

Draws filled rounded rectangle on currently active layer.

Parameters
xTop left X location for rectangle on LCD
yTop left Y location for rectangle on LCD
widthRectangle width in pixels
heightRectangle height in pixels
rCorner radius in pixels
colorColor in RGB565 format
Return values
None
void TM_DMA2DGRAPHIC_DrawFilledTriangle ( uint16_t  x1,
uint16_t  y1,
uint16_t  x2,
uint16_t  y2,
uint16_t  x3,
uint16_t  y3,
uint32_t  color 
)

Draws filled triangle on currently active layer.

Parameters
x1First point, X coordinate
y1First point, Y coordinate
x2Second point, X coordinate
y2Second point, Y coordinate
x3Third point, X coordinate
y3Third point, Y coordinate
colorColor in RGB565 format
Return values
None
void TM_DMA2DGRAPHIC_DrawHorizontalLine ( int16_t  x,
int16_t  y,
uint16_t  length,
uint32_t  color 
)

Draws horizontal line on currently active layer.

Parameters
xX coordinate on LCD
yY coordinate on LCD
lengthHorizontal line length in pixels
colorColor in RGB565 format
Return values
None
void TM_DMA2DGRAPHIC_DrawLine ( int16_t  x1,
int16_t  y1,
int16_t  x2,
int16_t  y2,
uint32_t  color 
)

Draws line on currently active layer.

Parameters
x1X1 coordinate on LCD
y1Y1 coordinate on LCD
x2X1 coordinate on LCD
y2Y1 coordinate on LCD
colorColor in RGB565 format
Return values
None
void TM_DMA2DGRAPHIC_DrawPixel ( uint16_t  x,
uint16_t  y,
uint32_t  color 
)

Draws single pixel on currently active layer.

Parameters
xX coordinate on LCD
yY coordinate on LCD
colorPixel color in RGB565 format
Return values
None
void TM_DMA2DGRAPHIC_DrawPolyLine ( TM_DMA2DRAPHIC_Poly_t Coordinates,
uint16_t  count,
uint32_t  color 
)

Draws polygon line on currently active layer.

Parameters
*CoordinatesPointer to TM_DMA2DRAPHIC_Poly_t array of coordinates
countNumber of coordinates
colorColor in RGB565 format
Return values
None
void TM_DMA2DGRAPHIC_DrawRectangle ( uint16_t  x,
uint16_t  y,
uint16_t  width,
uint16_t  height,
uint32_t  color 
)

Draws rectangle on currently active layer.

Parameters
xTop left X location for rectangle on LCD
yTop left Y location for rectangle on LCD
widthRectangle width in pixels
heightRectangle height in pixels
colorColor in RGB565 format
Return values
None
void TM_DMA2DGRAPHIC_DrawRoundedRectangle ( uint16_t  x,
uint16_t  y,
uint16_t  width,
uint16_t  height,
uint16_t  r,
uint32_t  color 
)

Draws rounded rectangle on currently active layer.

Parameters
xTop left X location for rectangle on LCD
yTop left Y location for rectangle on LCD
widthRectangle width in pixels
heightRectangle height in pixels
rCorner radius in pixels
colorColor in RGB565 format
Return values
None
void TM_DMA2DGRAPHIC_DrawTriangle ( uint16_t  x1,
uint16_t  y1,
uint16_t  x2,
uint16_t  y2,
uint16_t  x3,
uint16_t  y3,
uint32_t  color 
)

Draws triangle on currently active layer.

Parameters
x1First point, X coordinate
y1First point, Y coordinate
x2Second point, X coordinate
y2Second point, Y coordinate
x3Third point, X coordinate
y3Third point, Y coordinate
colorColor in RGB565 format
Return values
None
void TM_DMA2DGRAPHIC_DrawVerticalLine ( int16_t  x,
int16_t  y,
uint16_t  length,
uint32_t  color 
)

Draws vertical line on currently active layer.

Parameters
xX coordinate on LCD
yY coordinate on LCD
lengthVertical line length in pixels
colorColor in RGB565 format
Return values
None
void TM_DMA2DGRAPHIC_Fill ( uint32_t  color)

Fills entire LCD memory layer with custom color.

Parameters
colorColor in RGB565 format to use for LCD fill
Return values
None
uint32_t TM_DMA2DGRAPHIC_GetPixel ( uint16_t  x,
uint16_t  y 
)

Gets single pixel on currently active layer.

Parameters
xX coordinate on LCD
yY coordinate on LCD
Return values
Pixelcolor in RGB565 format
void TM_DMA2DGRAPHIC_Init ( void  )

Initializes and prepare DMA2D for working.

Note
This function has to be called before anything can be used
Parameters
None
Return values
None
void TM_DMA2DGRAPHIC_SetLayer ( uint8_t  layer_number)

Sets layer for DMA2D working memory.

Note
This functions just works in memory, so when you set layer, basically just address offset is used and changed.
To show anything on LCD you need LTDC or anything else for transmission
Parameters
layer_numberLayer number, starting from 1 to infinity. You are limited by your LCD size and available memory size
Return values
None
void TM_DMA2DGRAPHIC_SetOrientation ( uint8_t  orientation)

Sets orientation for DMA2D peripheral.

Note
You have to match DMA2D graphic library with your LCD orientation in order to display correct.
Parameters
orientationMemory orientation for your LCD
  • 0: Normal, no orientation.
  • 1: 180 Degrees orientation
  • 2: 90 Degrees orientation
  • 3: 270 Degrees orientation
Return values
None