Added missing IO functions for Linux/RPI

This commit is contained in:
Larry Bank
2025-04-30 22:55:53 +01:00
parent 9d49a7bf66
commit 585a656d2e
2 changed files with 24 additions and 0 deletions
+22
View File
@@ -86,6 +86,17 @@ void delay(int iMS)
usleep(iMS * 1000);
} /* delay() */
long millis(void)
{
int iTime;
struct timespec res;
clock_gettime(CLOCK_MONOTONIC, &res);
iTime = 1000*res.tv_sec + res.tv_nsec/1000000;
return (long)iTime;
} /* millis() */
static void delayMicroseconds(int iMS)
{
usleep(iMS);
@@ -133,6 +144,17 @@ void bbepCMD2(BBEPDISP *pBBEP, uint8_t cmd1, uint8_t cmd2)
digitalWrite(pBBEP->iCSPin, HIGH);
digitalWrite(pBBEP->iDCPin, HIGH); // leave data mode as the default
} /* bbepCMD2() */
//
// Set the second CS pin for dual-controller displays
//
void bbepSetCS2(BBEPDISP *pBBEP, uint8_t cs)
{
pBBEP->iCS1Pin = pBBEP->iCSPin;
pBBEP->iCS2Pin = cs;
pinMode(cs, OUTPUT);
digitalWrite(cs, HIGH); // disable second CS for now
} /* bbepSetCS2() */
//
// Write a single byte as a COMMAND (D/C set low)
//
+2
View File
@@ -1639,6 +1639,7 @@ void bbepSetAddrWindow(BBEPDISP *pBBEP, int x, int y, int cx, int cy)
if (!pBBEP) return;
if (pBBEP->iFlags & (BBEP_4COLOR | BBEP_7COLOR)) return;
#ifdef FUTURE
if (pBBEP->chip_type == BBEP_CHIP_IT8951) {
uint16_t u16Temp[6];
u16Temp[0] = 0; // DEBUG (_endian_type << 8 | _pix_bpp << 4 | _rotate);
@@ -1649,6 +1650,7 @@ void bbepSetAddrWindow(BBEPDISP *pBBEP, int x, int y, int cx, int cy)
bbepWriteIT8951CmdArgs(pBBEP, IT8951_TCON_LD_IMG_AREA, u16Temp, 5);
return;
}
#endif
tx = x/8; // round down to next lower byte
ty = y;
cx = (cx + 7) & 0xfff8; // make width an even number of bytes