1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 14:25:20 +03:00

Abstracted displayPort from CMS

This commit is contained in:
Martin Budden 2016-11-03 21:24:31 +00:00
parent 82d85181f4
commit 1f5e593120
13 changed files with 313 additions and 229 deletions

View file

@ -1,27 +1,6 @@
#pragma once
struct displayPort_s;
typedef struct displayPortVTable_s {
int (*begin)(void);
int (*end)(void);
int (*clear)(void);
int (*write)(uint8_t col, uint8_t row, char *text);
int (*heartbeat)(void);
void (*resync)(struct displayPort_s *pPort);
uint32_t (*txBytesFree)(void);
} displayPortVTable_t;
typedef struct displayPort_s {
displayPortVTable_t *vTable;
uint8_t rows;
uint8_t cols;
uint16_t buftime;
uint16_t bufsize;
// CMS state
bool cleared;
} displayPort_t;
#include "drivers/display.h"
// Device management
typedef void (*cmsDeviceInitFuncPtr)(displayPort_t *pPort);
@ -31,11 +10,6 @@ bool cmsDeviceRegister(cmsDeviceInitFuncPtr);
void cmsInit(void);
void cmsHandler(uint32_t currentTime);
// Required for external CMS tables
void cmsScreenClear(displayPort_t *pPort);
void cmsScreenResync(displayPort_t *pPort);
int cmsScreenWrite(displayPort_t *pPort, uint8_t x, uint8_t y, char *s);
long cmsMenuChange(displayPort_t *pPort, void *ptr);
long cmsMenuExit(displayPort_t *pPort, void *ptr);