-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add circle rendering support and example
- Loading branch information
Showing
4 changed files
with
112 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include "SpeeduinoGL.h" | ||
#include "Arduino_H7_Video.h" | ||
#include "dsi.h" | ||
#include "SDRAM.h" | ||
|
||
uint16_t* FrameBuffer = (uint16_t*)SDRAM_START_ADDRESS; | ||
const int ResV = 480; | ||
|
||
Rectangle sq1 = { | ||
{ 0, 0 }, | ||
{ 0, 480 }, | ||
{ 800, 0 }, | ||
{ 800, 480 } | ||
}; | ||
|
||
Point centre = {400, 240}; | ||
|
||
// The buffer used to rotate and resize the frame | ||
Arduino_H7_Video Display(800, 480, GigaDisplayShield); | ||
|
||
void setup() { | ||
SDRAM.begin(); | ||
Display.begin(); | ||
|
||
dsi_lcdClear(0); | ||
dsi_drawCurrentFrameBuffer(); | ||
dsi_lcdClear(0); | ||
dsi_drawCurrentFrameBuffer(); | ||
|
||
ConfigBuffer(SDRAM_START_ADDRESS, ResV); | ||
FillRectangle(sq1, 0x00FF); | ||
} | ||
|
||
void loop() { | ||
|
||
int32_t t1 = micros(); | ||
// FillRectangle(sq1, 0x00FF); | ||
FillCircle(100, 0x0FFF, centre); | ||
Serial.println(micros() - t1); | ||
|
||
dsi_lcdDrawImage((void*)FrameBuffer, (void*)dsi_getCurrentFrameBuffer(), 480, 800, DMA2D_INPUT_RGB565); | ||
dsi_drawCurrentFrameBuffer(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters