mirror of
https://github.com/usetrmnl/bb_epaper.git
synced 2026-04-29 13:43:26 -07:00
Added missing IO functions for Linux/RPI
This commit is contained in:
@@ -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)
|
||||
//
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user