mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 08:15:30 +03:00
Made OSD device independent, now uses displayPort
This commit is contained in:
parent
25bcaa3a05
commit
c97e71e995
10 changed files with 205 additions and 81 deletions
|
@ -39,13 +39,24 @@ static int oledRelease(displayPort_t *displayPort)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int oledClear(displayPort_t *displayPort)
|
||||
static int oledClearScreen(displayPort_t *displayPort)
|
||||
{
|
||||
UNUSED(displayPort);
|
||||
i2c_OLED_clear_display_quick();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int oledDrawScreen(displayPort_t *displayPort)
|
||||
{
|
||||
UNUSED(displayPort);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int oledScreenSize(const displayPort_t *displayPort)
|
||||
{
|
||||
return displayPort->rows * displayPort->cols;
|
||||
}
|
||||
|
||||
static int oledWrite(displayPort_t *displayPort, uint8_t x, uint8_t y, const char *s)
|
||||
{
|
||||
UNUSED(displayPort);
|
||||
|
@ -54,6 +65,20 @@ static int oledWrite(displayPort_t *displayPort, uint8_t x, uint8_t y, const cha
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int oledWriteChar(displayPort_t *displayPort, uint8_t x, uint8_t y, uint8_t c)
|
||||
{
|
||||
UNUSED(displayPort);
|
||||
i2c_OLED_set_xy(x, y);
|
||||
i2c_OLED_send_char(c);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool oledIsTransferInProgress(const displayPort_t *displayPort)
|
||||
{
|
||||
UNUSED(displayPort);
|
||||
return false;
|
||||
}
|
||||
|
||||
static int oledHeartbeat(displayPort_t *displayPort)
|
||||
{
|
||||
UNUSED(displayPort);
|
||||
|
@ -74,8 +99,12 @@ static uint32_t oledTxBytesFree(const displayPort_t *displayPort)
|
|||
static const displayPortVTable_t oledVTable = {
|
||||
.grab = oledGrab,
|
||||
.release = oledRelease,
|
||||
.clear = oledClear,
|
||||
.clearScreen = oledClearScreen,
|
||||
.drawScreen = oledDrawScreen,
|
||||
.screenSize = oledScreenSize,
|
||||
.write = oledWrite,
|
||||
.writeChar = oledWriteChar,
|
||||
.isTransferInProgress = oledIsTransferInProgress,
|
||||
.heartbeat = oledHeartbeat,
|
||||
.resync = oledResync,
|
||||
.txBytesFree = oledTxBytesFree
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue