mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 08:45:36 +03:00
Add support for FrSky OSD
- Add displayWriteFontCharacter() for font writing, removing all max7456 specific code. - Add displayIsReady() for asynchronous display initialization - Add displayBeginTransaction()/displayCommitTransaction() for display transactions, which allow performing complex drawing operations without flickering - Add displayGetCanvas(), which retrieves the canvas associated with a display (if it has it) - Add canvas implementation for pixel based access for a display - Add FrSkyOSD driver and displayPort driver - Enable FrSkyOSD driver for targets with flash > 256 - Rename max7456_symbols.h to osd_symbols.h
This commit is contained in:
parent
cb538ea2ed
commit
37e66b3dda
30 changed files with 2311 additions and 44 deletions
|
@ -26,6 +26,9 @@
|
|||
|
||||
#include "common/utils.h"
|
||||
|
||||
#include "drivers/display_canvas.h"
|
||||
#include "drivers/osd.h"
|
||||
|
||||
#include "display.h"
|
||||
|
||||
void displayClearScreen(displayPort_t *instance)
|
||||
|
@ -142,6 +145,54 @@ bool displayLayerCopy(displayPort_t *instance, displayPortLayer_e destLayer, dis
|
|||
return false;
|
||||
}
|
||||
|
||||
bool displayWriteFontCharacter(displayPort_t *instance, uint16_t addr, const osdCharacter_t *chr)
|
||||
{
|
||||
if (instance->vTable->writeFontCharacter) {
|
||||
return instance->vTable->writeFontCharacter(instance, addr, chr);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool displayIsReady(displayPort_t *instance)
|
||||
{
|
||||
if (instance->vTable->isReady) {
|
||||
return instance->vTable->isReady(instance);
|
||||
}
|
||||
// Drivers that don't provide an isReady method are
|
||||
// assumed to be immediately ready (either by actually
|
||||
// begin ready very quickly or by blocking)
|
||||
return true;
|
||||
}
|
||||
|
||||
void displayBeginTransaction(displayPort_t *instance, displayTransactionOption_e opts)
|
||||
{
|
||||
if (instance->vTable->beginTransaction) {
|
||||
instance->vTable->beginTransaction(instance, opts);
|
||||
}
|
||||
}
|
||||
|
||||
void displayCommitTransaction(displayPort_t *instance)
|
||||
{
|
||||
if (instance->vTable->commitTransaction) {
|
||||
instance->vTable->commitTransaction(instance);
|
||||
}
|
||||
}
|
||||
|
||||
bool displayGetCanvas(displayCanvas_t *canvas, const displayPort_t *instance)
|
||||
{
|
||||
#if defined(USE_CANVAS)
|
||||
if (canvas && instance->vTable->getCanvas && instance->vTable->getCanvas(canvas, instance)) {
|
||||
canvas->gridElementWidth = canvas->width / instance->cols;
|
||||
canvas->gridElementHeight = canvas->height / instance->rows;
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
UNUSED(canvas);
|
||||
UNUSED(instance);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
void displayInit(displayPort_t *instance, const displayPortVTable_t *vTable)
|
||||
{
|
||||
instance->vTable = vTable;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue