Оптимизированы функции полттера добавлены функции для рисования стрелок
Плоттер - функция для отрисовки интерфейса плоттера - функция для отрисовки самого графика (кривой) - функции для отрисовки float, int, uint8_t, uint16_t - добавлены сдвиги осей Стрелки - функция для рисования ортогональных стрелок (вправо, влево, вверх, вниз) - функция для рисования стрелок в любом направлении
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
#include "main.h"
|
||||
#include "string.h"
|
||||
#include "stdio.h"
|
||||
#include "oled.h"
|
||||
|
||||
#define GFX_BufferWidth 128 //ширина дисплея в пикселях
|
||||
#define GFX_BufferHeight 32 //высота дисплея в пикселях
|
||||
@@ -89,23 +88,23 @@ typedef struct
|
||||
uint8_t plotHeight;
|
||||
uint8_t plotWidth;
|
||||
|
||||
float *pDataPtr;
|
||||
uint32_t dataSize;
|
||||
float dataMax;
|
||||
int16_t dataX;
|
||||
int32_t dataY;
|
||||
float dataInd;
|
||||
int32_t dataPrevY;
|
||||
|
||||
float plotSpeed;
|
||||
float plotInd;
|
||||
uint8_t plotShift;
|
||||
uint8_t pixX;
|
||||
int32_t pixY;
|
||||
uint8_t prevPixY;
|
||||
int16_t plotXShift;
|
||||
int16_t plotYShift;
|
||||
|
||||
unsigned signedData:1;
|
||||
unsigned plotFrame:1;
|
||||
unsigned plotXAxis:1;
|
||||
unsigned plotYAxis:1;
|
||||
unsigned __initialized:1;
|
||||
}GFX_PlotterFloatHandleTypeDef;
|
||||
struct
|
||||
{
|
||||
unsigned dataSigned:1;
|
||||
unsigned plotFrame:1;
|
||||
unsigned plotXAxis:1;
|
||||
unsigned plotYAxis:1;
|
||||
unsigned initialized:1;
|
||||
}f;
|
||||
}GFX_PlotterHandleTypeDef;
|
||||
|
||||
|
||||
|
||||
@@ -126,7 +125,10 @@ void GFX_Draw_Circle(uint8_t *Buffer_Frame, GFX_CircleHandleTypeDef *hCircle);
|
||||
void GFX_Draw_Triangle(uint8_t *Buffer_Frame, GFX_TriangleHandleTypeDef *hTriangle);
|
||||
void GFX_Draw_Arrow(uint8_t *Buffer_Frame, GFX_ArrowHandleTypeDef *hArrow);
|
||||
void GFX_Draw_Arc(uint8_t *Buffer_Frame, GFX_ArcHandleTypeDef *hArc);
|
||||
void GFX_FloatPlotter(uint8_t *Buffer_Frame, GFX_PlotterFloatHandleTypeDef *hPlot, float *numb2plot);
|
||||
void GFX_Plotter_uint8_t(uint8_t *Buffer_Frame, GFX_PlotterHandleTypeDef *hPlot, uint8_t *data, uint32_t data_size, float data_step, uint8_t data_max);
|
||||
void GFX_Plotter_uint16_t(uint8_t *Buffer_Frame, GFX_PlotterHandleTypeDef *hPlot, uint16_t *data, uint32_t data_size, float data_step, uint16_t data_max);
|
||||
void GFX_Plotter_int(uint8_t *Buffer_Frame, GFX_PlotterHandleTypeDef *hPlot, int *data, uint32_t data_size, float data_step, int data_max);
|
||||
void GFX_Plotter_float(uint8_t *Buffer_Frame, GFX_PlotterHandleTypeDef *hPlot, float *data, uint32_t data_size, float data_step, float data_max);
|
||||
|
||||
|
||||
|
||||
@@ -141,5 +143,8 @@ void __GFX_Draw_Triangle(uint8_t *Buffer_Frame,
|
||||
uint8_t xPos3, uint8_t yPos3,
|
||||
uint8_t pxColor);
|
||||
void __GFX_Draw_Arrow(uint8_t *Buffer_Frame, uint8_t xPos, uint8_t yPos, uint8_t size, uint16_t angle, uint8_t pxColor);
|
||||
void __GFX_Draw_Arrow_Ortho(uint8_t *Buffer_Frame, uint8_t xPos, uint8_t yPos, uint8_t size, uint16_t angle, uint8_t pxColor);
|
||||
void __GFX_Draw_Arc(uint8_t *Buffer_Frame, uint8_t xPos, uint8_t yPos, uint8_t radius, uint16_t startAngle, uint16_t endAngle, uint8_t pxColor);
|
||||
HAL_StatusTypeDef __GFX_StartPlot(uint8_t *Buffer_Frame, GFX_PlotterHandleTypeDef *hPlot);
|
||||
void __GFX_Draw_Plotter_Value(uint8_t *Buffer_Frame, GFX_PlotterHandleTypeDef *hPlot);
|
||||
#endif /* INC_PIXEL_GRAPHICS_H_ */
|
||||
|
||||
Reference in New Issue
Block a user