Clone13
Dependents: SignalProcessLab DigitalSignalAlgorithm_Lab DigitalSignal_Lab
Revision 1:fc2dc08db78b, committed 2019-08-28
- Comitter:
- ngtkien
- Date:
- Wed Aug 28 17:02:28 2019 +0000
- Parent:
- 0:ef139e18ca64
- Commit message:
- add several command
Changed in this revision
RK043FN48H.cpp | Show annotated file Show diff for this revision Revisions of this file |
RK043FN48H.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r ef139e18ca64 -r fc2dc08db78b RK043FN48H.cpp --- a/RK043FN48H.cpp Mon Aug 26 16:34:40 2019 +0000 +++ b/RK043FN48H.cpp Wed Aug 28 17:02:28 2019 +0000 @@ -197,3 +197,127 @@ +//New Function +//Add date: 25/08/2019 + +void RK043FN48H::DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length) +{ + BSP_LCD_DrawHLine(Xpos, Ypos, Length); +} + +void RK043FN48H::DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length) +{ + BSP_LCD_DrawVLine(Xpos, Ypos, Length); +} + +void RK043FN48H::DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) +{ + BSP_LCD_DrawLine(x1, y1, x2, y2); +} + +void RK043FN48H::DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height) +{ + BSP_LCD_DrawRect(Xpos, Ypos, Width, Height); +} + +void RK043FN48H::DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius) +{ + BSP_LCD_DrawCircle(Xpos, Ypos, Radius); +} + +void RK043FN48H::DrawPolygon(pPoint Points, uint16_t PointCount) +{ + BSP_LCD_DrawPolygon(Points, PointCount); +} + +void RK043FN48H::DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius) +{ + BSP_LCD_DrawEllipse(Xpos, Ypos, XRadius, YRadius); +} + +void RK043FN48H::DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp) +{ + BSP_LCD_DrawBitmap(Xpos, Ypos, pbmp); +} + +void RK043FN48H::FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height) +{ + BSP_LCD_FillRect(Xpos, Ypos, Width, Height); +} + +void RK043FN48H::FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius) +{ + BSP_LCD_FillCircle(Xpos, Ypos, Radius); +} + +void RK043FN48H::FillPolygon(pPoint Points, uint16_t PointCount) +{ + BSP_LCD_FillPolygon(Points, PointCount); +} + +void RK043FN48H::FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius) +{ + BSP_LCD_FillEllipse(Xpos, Ypos, XRadius, YRadius); +} + +void RK043FN48H::SetTextColor(uint32_t Color) +{ + BSP_LCD_SetTextColor(Color); +} + +uint32_t RK043FN48H::GetTextColor(void) +{ + return BSP_LCD_GetTextColor(); +} + +void RK043FN48H::SetBackColor(uint32_t Color) +{ + BSP_LCD_SetBackColor(Color); +} + +uint32_t RK043FN48H::GetBackColor(void) +{ + return BSP_LCD_GetBackColor(); +} + +void RK043FN48H::SetFont(sFONT *fonts) +{ + BSP_LCD_SetFont(fonts); +} + +sFONT *RK043FN48H::GetFont(void) +{ + return BSP_LCD_GetFont(); +} + +uint32_t RK043FN48H::ReadPixel(uint16_t Xpos, uint16_t Ypos) +{ + return BSP_LCD_ReadPixel(Xpos, Ypos); +} + +void RK043FN48H::DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t pixel) +{ + BSP_LCD_DrawPixel(Xpos, Ypos, pixel); +} + + +void RK043FN48H::ClearStringLine(uint32_t Line) +{ + BSP_LCD_ClearStringLine(Line); +} + +void RK043FN48H::DisplayStringAtLine(uint16_t Line, uint8_t *ptr) +{ + BSP_LCD_DisplayStringAtLine(Line, ptr); +} + +void RK043FN48H::DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode) +{ + BSP_LCD_DisplayStringAt(Xpos, Ypos, Text, Mode); +} + +void RK043FN48H::DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii) +{ + BSP_LCD_DisplayChar(Xpos, Ypos, Ascii); +} +
diff -r ef139e18ca64 -r fc2dc08db78b RK043FN48H.h --- a/RK043FN48H.h Mon Aug 26 16:34:40 2019 +0000 +++ b/RK043FN48H.h Wed Aug 28 17:02:28 2019 +0000 @@ -6,10 +6,13 @@ #include "Commons.h" #include "Display.h" -#include "stm32746g_discovery_lcd.h" +#include "../BSP_DISCO_F746NG/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_lcd.h" #define ALPHA_MASK 0x00FFFFFF +#define TITLE "Signal Process" +#define XPOS_TITLE 10 +#define YPOS_TITLE 10 /** * @brief Display layers available for RK043FN48H */ @@ -105,6 +108,218 @@ void SetLayersVisibility( bool background, bool foreground); + + //New Function + //Add date: 25/08/2019 + + + /** + * @brief Draws an horizontal line. + * @param Xpos: X position + * @param Ypos: Y position + * @param Length: Line length + * @retval None + */ + void DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length); + + /** + * @brief Draws a vertical line. + * @param Xpos: X position + * @param Ypos: Y position + * @param Length: Line length + * @retval None + */ + void DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length); + + /** + * @brief Draws an uni-line (between two points);. + * @param x1: Point 1 X position + * @param y1: Point 1 Y position + * @param x2: Point 2 X position + * @param y2: Point 2 Y position + * @retval None + */ + void DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2); + + /** + * @brief Draws a rectangle. + * @param Xpos: X position + * @param Ypos: Y position + * @param Width: Rectangle width + * @param Height: Rectangle height + * @retval None + */ + void DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height); + + /** + * @brief Draws a circle. + * @param Xpos: X position + * @param Ypos: Y position + * @param Radius: Circle radius + * @retval None + */ + void DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius); + + /** + * @brief Draws an poly-line (between many points);. + * @param Points: Pointer to the points array + * @param PointCount: Number of points + * @retval None + */ + void DrawPolygon(pPoint Points, uint16_t PointCount); + + /** + * @brief Draws an ellipse on LCD. + * @param Xpos: X position + * @param Ypos: Y position + * @param XRadius: Ellipse X radius + * @param YRadius: Ellipse Y radius + * @retval None + */ + void DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius); + + /** + * @brief Draws a pixel on LCD. + * @param Xpos: X position + * @param Ypos: Y position + * @param RGB_Code: Pixel color in ARGB mode (8-8-8-8); + * @retval None + */ + void DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t RGB_Code); + + /** + * @brief Draws a bitmap picture loaded in the internal Flash in ARGB888 format (32 bits per pixel);. + * @param Xpos: Bmp X position in the LCD + * @param Ypos: Bmp Y position in the LCD + * @param pbmp: Pointer to Bmp picture address in the internal Flash + * @retval None + */ + void DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp); + + + /** + * @brief Draws a full rectangle. + * @param Xpos: X position + * @param Ypos: Y position + * @param Width: Rectangle width + * @param Height: Rectangle height + * @retval None + */ + void FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height); + /** + * @brief Draws a full circle. + * @param Xpos: X position + * @param Ypos: Y position + * @param Radius: Circle radius + * @retval None + */ + void FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius); + + /** + * @brief Draws a full poly-line (between many points);. + * @param Points: Pointer to the points array + * @param PointCount: Number of points + * @retval None + */ + void FillPolygon(pPoint Points, uint16_t PointCount); + + /** + * @brief Draws a full ellipse. + * @param Xpos: X position + * @param Ypos: Y position + * @param XRadius: Ellipse X radius + * @param YRadius: Ellipse Y radius + * @retval None + */ + void FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius); + + + //Add LCD String Display + /** + * @brief Sets the LCD text color. + * @param Color: Text color code ARGB(8-8-8-8); + * @retval None + */ + void SetTextColor(uint32_t Color); + + /** + * @brief Gets the LCD text color. + * @retval Used text color. + */ + uint32_t GetTextColor(void); + + /** + * @brief Sets the LCD background color. + * @param Color: Layer background color code ARGB(8-8-8-8); + * @retval None + */ + void SetBackColor(uint32_t Color); + + /** + * @brief Gets the LCD background color. + * @retval Used background colour + */ + uint32_t GetBackColor(void); + + /** + * @brief Sets the LCD text font. + * @param fonts: Layer font to be used + * @retval None + */ + void SetFont(sFONT *fonts); + + /** + * @brief Gets the LCD text font. + * @retval Used layer font + */ + sFONT *GetFont(void); + + /** + * @brief Reads an LCD pixel. + * @param Xpos: X position + * @param Ypos: Y position + * @retval RGB pixel color + */ + uint32_t ReadPixel(uint16_t Xpos, uint16_t Ypos); + + /** + * @brief Clears the selected line. + * @param Line: Line to be cleared + * @retval None + */ + void ClearStringLine(uint32_t Line); + + /** + * @brief Displays one character. + * @param Xpos: Start column address + * @param Ypos: Line where to display the character shape. + * @param Ascii: Character ascii code + * This parameter must be a number between Min_Data = 0x20 and Max_Data = 0x7E + * @retval None + */ + void DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii); + + /** + * @brief Displays characters on the LCD. + * @param Xpos: X position (in pixel); + * @param Ypos: Y position (in pixel); + * @param Text: Pointer to string to display on LCD + * @param Mode: Display mode + * This parameter can be one of the following values: + * @arg CENTER_MODE + * @arg RIGHT_MODE + * @arg LEFT_MODE + * @retval None + */ + void DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode); + + /** + * @brief Displays a maximum of 60 characters on the LCD. + * @param Line: Line where to display the character shape + * @param ptr: Pointer to string to display on LCD + * @retval None + */ + void DisplayStringAtLine(uint16_t Line, uint8_t *ptr); private: // Frame buffer adresses for layers