3.1. Inkplate Peripheral Mode
Peripheral mode for Inkplate by Soldered Peripheral mode is uploaded to each Inkplate. It enables you to use the board without reprogramming. You just need to send commands via UART and it will show contents on its screen. You can send commands via USB port or by directly connecting to ESP32 TX and RX pins.
Here is an example on how to use peripheral mode to drive Inkplate with a Raspberry Pi. And here is one for driving Inkplate with STM32.
Don’t forget you need to send #L(1)* after each command to show it on the display (equal to display.display()). Peripheral mode Arduino code for all inkplates can be found under examples/Diagnostics if needed to be installed again.
Settings are: 115200 baud, standard parity, ending with \n\r
3.1.1. echo: #?*
Check if the Inkplate receives commands on UARTResponse: OK
3.1.2. drawPixel: #0(XXX,YYY,CC)*
XXX - X coordinate (with leading zeros)YYY - Y coordinate (with leading zeros)CC - Color (with leading zeros)example:
#0(001,005,04)*
3.1.3. drawLine: #1(XXX,YYY,III,JJJ,CC)*
XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)III - End x coordinate (with leading zeros)JJJ - End y coordinate (with leading zeros)CC - Color (with leading zeros)example:
#1(001,004,010,123,01)*
3.1.4. drawFastVLine: #2(XXX,YYY,LLL,CC)*
XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)LLL - Length of line (with leading zeros)CC - Solor (with leading zeros)example:
#2(142,425,040,05)*
3.1.5. drawFastHLine: #3(XXX,YYY,LLL,CC)*
XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)LLL - Length of line (with leading zeros)CC - Color (with leading zeros)example:
#3(123,014,100,03)*
3.1.6. drawRect: #4(XXX,YYY,WWW,HHH,CC)*
XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)WWW - Width of rect. (with leading zeros)HHH - Height of rect. (with leading zeros)CC - Color (with leading zeros)example:
#4(123,014,050,010,01)*
3.1.7. drawCircle: #5(XXX,YYY,RRR,CC)*
XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)RRR - Radius of circle (with leading zeros)CC - Color (with leading zeros)example:
#5(050,100,040,01)*
3.1.8. drawTriangle: #6(XX1,YY1,XX2,YY2,XX3,YY3,CC)*
XX1 - X coordinate of first corner (with leading zeros)YY1 - Y coordinate of first corner (with leading zeros)XX2 - X coordinate of second corner (with leading zeros)YY2 - Y coordinate of second corner (with leading zeros)XX3 - X coordinate of third corner (with leading zeros)YY3 - Y coordinate of third corner (with leading zeros)CC - Color (with leading zeros)example:
#6(250,250,100,400,375,450,04)*
3.1.9. drawRoudRect: #7(XXX,YYY,WWW,HHH,RRR,CC)*
XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)WWW - Width of rect. (with leading zeros)HHH - Height of rect. (with leading zeros)RRR - Radius (with leading zeros)CC - Color (with leading zeros)example:
#7(123,014,050,010,005,00)*
3.1.10. fillRect: #8(XXX,YYY,WWW,HHH,CC)*
XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)WWW - Width of rect. (with leading zeros)HHH - Height of rect. (with leading zeros)CC - Color (with leading zeros)example:
#8(123,014,050,010,01)*
3.1.11. fillCircle: #9(XXX,YYY,RRR,CC)*
XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)RRR - Radius of circle (with leading zeros)CC - Color (with leading zeros)example:
#9(050,100,040,01)*
3.1.12. fillTriangle: #A(XX1,YY1,XX2,YY2,XX3,YY3,CC)*
XX1 - X coordinate of first corner (with leading zeros)YY1 - Y coordinate of first corner (with leading zeros)XX2 - X coordinate of second corner (with leading zeros)YY2 - Y coordinate of second corner (with leading zeros)XX3 - X coordinate of third corner (with leading zeros)YY3 - Y coordinate of third corner (with leading zeros)CC - Color (with leading zeros)example:
#A(250,250,100,400,375,450,04)*
3.1.13. fillRoudRect: #B(XXX,YYY,WWW,HHH,RRR,CC)*
XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)WWW - Width of rect. (with leading zeros)HHH - Height of rect. (with leading zeros)RRR - Radius (with leading zeros)CC - Color (with leading zeros)example:
#B(123,014,050,010,005,00)*
3.1.14. print: #C(“STRING”)*
STRING - Text/Strig coded in HEX Char (example: HELLO WORLD would be coded like 48454c4c4f20574f524c44, where 48 means 0x48 which is H in ASCII table)example: for HELLO WORLD:
#C("48454c4c4f20574f524c44")*
3.1.15. setTextSize: #D(NN)*
NNN - Text scaling (with leading zeros)example:
#D(02)*
3.1.16. setCursor: #E(XXX,YYY)*
XXX - X position of text cursor (with leading zeros)YYY - Y position of text cursor (with leading zeros)example:
#E(002,010)*
3.1.17. setTextWrap: #F(T/F)*
T - True if enable text wrapingF - False if disable text wrapingexample:
#F(T)* or #F(F)*
3.1.18. setRotation: #G(RRR)*
RRR - Sets rotation (0-3, where each increment rotates whole screen by 90 deg)example:
#G(003)*
3.1.19. drawBitmap: #H(XXX,YYY,”PATH”)*
XXX - X position of bitmap on displayYYY - Y position of bitmap on displayPATH - path to bitmap image on SD card, where path should be sent as HEX Char (same as for print command). Example: /image1.bmp should be sent as 2f696d616765312e626d70example: (2f696d616765312e626d70 means /image1.bmp)
#H(000,000,"2f696d616765312e626d70")*
| Response:
#H(1)* - Image loaded succesfully
#H(0)* - Image load failed
#H(-1)* - SD Card Init Error
3.1.20. setDisplayMode: #I(D)*
D - Display Mode (D = 3 -> 3 bit mode, D = 1 -> 1 bit mode)example:
#I(3)* or #I(1)*
3.1.21. getDisplayMode: #J(?)*
Response:
#J(1)* - 3 bit mode
#J(0)* - 1 bit mode
3.1.22. clearDisplay: #K(1)*
Clears display.
3.1.23. display: #L(1)*
Displays image buffer data to screen.
3.1.24. partialUpdate: #M(YY1, XX2, YY2)*
YY1 - Start Y position of part of the screen that will be updatedXX2 - End X position of part of the screen that will be updatedYY2 - End Y position of part of the screen that will be updatedexample:
#M(005,400,040)*
3.1.25. readTemperature: #N(?)*
Response:
#N(23)* - 23 Celsius degrees
3.1.26. readTouchpad: #O(P)*
P - Name of pad that needs to be read (1, 2 or 3)Response:
#O(1)* for high state of pad
or
#O(0)* for low state of pad
3.1.27. readBattery: #P(?)*
Response:
#P(3.65)* - Measured voltage on battery is 3.65VDC
3.1.28. panelSupply(einkOff/on):#Q(S)*
S - State of panel power supply (S = 1 -> panel has power supply, S = 0 -> panel power supply has benn turned off)Note: Not supported on Inkplate 2
3.1.29. getPanelState: #R(?)*
Response:
#R(1)* - panel has power supply or #R(0)* - panel supply has been turned off
3.1.30. drawImage: #S(XXX,YYY,”PATH”)*
XXX - X position of bitmap on displayYYY - Y position of bitmap on displayPATH - path to bitmap image on SD card, where path should be sent as HEX Char (same as for print command). Example: /image1.bmp should be sent as 2f696d616765312e626d70example: (2f696d616765312e626d70 means /image1.bmp)
#S(000,000,"2f696d616765312e626d70")*
| Response:
3.1.31. drawThickLine: #T(XXX,YYY,III,JJJ,TT,CC)*
XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)III - End x coordinate (with leading zeros)JJJ - End y coordinate (with leading zeros)TT - Line thicknessCC - Color (with leading zeros)example:
#T(001,004,010,123,05,01)*
3.1.32. drawElipse: #U(XXX,YYY,RRX,RRY,CC)*
XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)RRX - X radius (with leading zeros)RRY - Y radius (with leading zeros)CC - Color (with leading zeros)example:
#U(050,100,040,070,01)*
3.1.33. fillElipse: #V(XXX,YYY,RRX,RRY,CC)*
XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)RRX - X radius (with leading zeros)RRY - Y radius (with leading zeros)CC - Color (with leading zeros)example:
#V(050,100,040,070,01)*
3.1.34. rtcSetTime: #W(H,M,S)*
H - HoursM - MinutesS - Secondsexample:
#W(15,22,30)*
3.1.35. rtcSetDate: #X(WD,D,M,Y)*
WD - weekdayD - dayM - monthY - yearexample:
#X(4,23,3,2023)*
3.1.36. rtcSetEpoch: #Y(E)*
E - Time in epochexample:#Y(1679581587)*
3.1.37. rtcGetRtcData: #a(D)*
D - What data do you want to return? [0, 6]0 - rtcGetSecond();1 - rtcGetMinute();2 - rtcGetHour();3 - rtcGetDay();4 - rtcGetWeekday();5 - rtcGetMonth();6 - rtcGetYear();example:#a(2)* or #a(5)*
3.1.38. rtcSetAlarm: #b(AS,AM,AH,AD,AW)*
AS - Alarm secondsAM - Alarm minutesAH - Alarm hoursAD - Alarm dayAW - Alarm weekdayexample:#b(0,30,15,23,4)*
3.1.39. rtcSetAlarmEpoch: #c(AE,AMC)*
AE - Alarm epochAMC - Alarm matching (see System.h)example:#c(1679581587, 2)*
3.1.40. rtcCheckAlarmFlag: #d(?)*
Response:#d(1)* - if the alarm flag is 1 #d(0)* - if the alarm flag is 0
3.1.41. rtcClearAlarmFlag: #e(1)*
Clears alarm flag.
3.1.42. rtcGetAlarm: #f(D)*
D - Which component of the alarm want to get [0, 4]0 - rtcGetAlarmSecond();1 - rtcGetAlarmMinute();2 - rtcGetAlarmHour();3 - rtcGetAlarmDay();4 - rtcGetAlarmWeekday();example:#f(3)* or #f(1)*
3.1.43. rtcTimerSet: #g(SC,V,IE,IP)*
SC - rtcCountdownSrcClock -> [0,3], see System.hV - Coundowntime in secondsIE -> 1 = enable interrupt; 0 = disable interruptIP -> 1 = interrupt generate a pulse; 0 = interrupt follows timer flagexample:#g(2,10,0,0)*
3.1.44. rtcCheckTimerFlag: #h(?)*
Response:#h(1)* - if the flag is 1 #h(0)* - if the flag is 0
3.1.45. rtcClearTimerFlag: #i(1)*
Clears timer flag.
3.1.46. rtcDisableTimer: #j(1)*
Disables the timer.
3.1.47. rtcIsSet: #k(?)*
Response:#k(0)* - if RTC is not set #k(1)* - if RTC is set
3.1.48. rtcReset: #l(1)*
Resets RTC
Note: Next functions are only for Inkplate 6PLUS
3.1.49. frontlight: #m(F)*
F -> 1 to turn on; 0 to turn off the frontlightexample:#m(1)* or #m(0)*
3.1.50. setFrontlight: #n(BR)*
BR - brightness [0, 63]example:#n(50)*
3.1.51. tsInit: #o(PWRS)*
PWRS -> 1 for display.tsInit(1); 0 for display.tsInit(0);example:#o(1)* or #o(0)*
3.1.52. tsShutdown: #p(1)*
Turns off touchscreen power.
3.1.53. tsAvailable: #r(?)*
Response:#r(0)* - if not available or #r(1)* - if available
3.1.54. tsGetData: #s(?)*
Response:#s(x, y)*
3.1.55. tsGetRawData: #t(?)*
Response: raw data from the touchscreen in binary format
3.1.56. touchInArea: #u(XXX,YYY,TW,TH)*
XXX - rectangle top left corner x planeYYY - rectangle top left corner y planeTW - rectangle widthTH - rectangle heightexample:#u(0,0,200,300)*