This is the David Smart RA8875 Library with mods for working with FRDM-K64F
Diff: RA8875.cpp
- Revision:
- 195:17e176dbd6eb
- Parent:
- 194:53c18f0e7922
- Child:
- 196:56820026701b
--- a/RA8875.cpp Tue Feb 11 15:35:02 2020 +0000 +++ b/RA8875.cpp Tue Feb 11 18:33:44 2020 +0000 @@ -18,7 +18,7 @@ #define swFree free #endif -//#define DEBUG "RAIO" +#define DEBUG "RAIO" // ... // INFO("Stuff to show %d", var); // new-line is automatically appended // @@ -1163,6 +1163,9 @@ RA8875::orientation_t RA8875::GetOrientation() { + #if 1 + return screen_orientation; + #else uint8_t dpcrVal = ReadCommand(RA8875_DPCR); dpcrVal &= 0x0C; // keep the scan direction bits @@ -1177,6 +1180,7 @@ case 0x04: return rotate_270; } + #endif } RetCode_t RA8875::SetOrientation(RA8875::orientation_t angle) @@ -1215,7 +1219,8 @@ default: return bad_parameter; } - INFO("Orientation: %d, %d", angle, portraitmode); + screen_orientation = angle; + INFO("Orientation: %d, %s", angle * 90, portraitmode ? "portrait" : "landscape"); WriteCommand(RA8875_MWCR0, mwcr0); WriteCommand(RA8875_FNCR1, fncr1Val); return WriteCommand(RA8875_DPCR, dpcrVal); @@ -1577,7 +1582,7 @@ RetCode_t RA8875::clsw(RA8875::Region_t region) { - INFO("clsw()"); + INFO("clsw(%d)", region); PERFORMANCE_RESET; WriteCommand(RA8875_MCLR, (region == ACTIVEWINDOW) ? 0xC0 : 0x80); if (!_WaitWhileReg(0x8E, 0x80)) {