add cmd cpm (#21030)

This commit is contained in:
gemu 2024-03-25 22:02:08 +01:00 committed by GitHub
parent bad2f4fb13
commit 28cce3f020
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 1 deletions

View File

@ -699,6 +699,9 @@ uDisplay::uDisplay(char *lp) : Renderer(800, 600) {
Serial.printf("CLK : %d\n", spi_clk);
Serial.printf("MOSI: %d\n", spi_mosi);
Serial.printf("DC : %d\n", spi_dc);
Serial.printf("TS_CS: %d\n", ut_spi_cs);
Serial.printf("TS_RST: %d\n", ut_reset);
Serial.printf("TS_IRQ: %d\n", ut_irq);
Serial.printf("BPAN: %d\n", bpanel);
Serial.printf("RES : %d\n", reset);
Serial.printf("MISO: %d\n", spi_miso);
@ -2743,6 +2746,14 @@ void uDisplay::ut_trans(char **sp, uint8_t **code) {
// cmp and set
*ut_code++ = UT_CPR;
*ut_code++ = ut_par(&cp, 0);
} else if (!strncmp(cp, "CPM", 3)) {
// cmp multiple and set
*ut_code++ = UT_CPM;
uint8_t num = ut_par(&cp, 0);
*ut_code++ = num;
for (uint32_t cnt = 0; cnt < num; cnt++) {
*ut_code++ = ut_par(&cp, 0);
}
} else if (!strncmp(cp, "CP", 2)) {
// cmp and set
*ut_code++ = UT_CP;
@ -2979,6 +2990,16 @@ uint16_t wval;
result = (iob == ut_array[0]);
break;
case UT_CPM:
// compare multiple
len = *ut_code++;
result = 0;
for (uint32_t cnt = 0; cnt < len; cnt++) {
iob = *ut_code++;
result |= (iob == ut_array[0]);
}
break;
case UT_CPR:
// compare
iob = *ut_code++;

View File

@ -18,7 +18,7 @@
#endif
enum {
UT_RD,UT_RDM,UT_CP,UT_RTF,UT_MV,UT_MVB,UT_RT,UT_RTT,UT_RDW,UT_RDWM,UT_WR,UT_WRW,UT_CPR,UT_AND,UT_SCALE,UT_LIM,UT_DBG,UT_GSRT,UT_XPT,UT_END
UT_RD,UT_RDM,UT_CP,UT_RTF,UT_MV,UT_MVB,UT_RT,UT_RTT,UT_RDW,UT_RDWM,UT_WR,UT_WRW,UT_CPR,UT_AND,UT_SCALE,UT_LIM,UT_DBG,UT_GSRT,UT_XPT,UT_CPM,UT_END
};
#define RA8876_DATA_WRITE 0x80