Skip to content

Latest commit

 

History

History
130 lines (95 loc) · 10.2 KB

TIMI.md

File metadata and controls

130 lines (95 loc) · 10.2 KB

P2 TIMI Spin2 Object

A reusable object written in spin2 for driving the TIMI serial IPS LCD-TFT displays.

Project Maintenance

License

Breadboard Mates (BBM) produces the TIMI line of displays. These are similar to teh Nextion devices we've seen in that we select the screens to be displayed and upload them to the device (essentially flashing the device.) Then we connect the device containing the screens to our project via serial and simply send values to the screen fields or labels.

Table of Contents

On this Page:

Additional pages:

The Hardware

Here is the TIMI-130 I'm using for this project:

The TIMI object PUBLIC Interface

The object isp_timi_mates.spin2 when first started configures the serial pins at the requested baud rate [Default: 9600].

The object provides the following methods for starting up, tearing down and accessing the values read from the device and writing values to the device:

OBJECT Interface Description
>--- SETUP
PUB start(pinTx, pinRx, pinReset, baudRate) : bDidSucceed Start simple serial comms on given pins at baudrate
PUB stop() Stop underlying serial device and release pins
PUB error() : latestError Return latest Mates Error Code
PUB hardReset() : bDidSucceed Uses hardware driven signal to hard reset Timi device
Returns the boolean response from the reset
PUB softReset() : bDidSucceed Sends a serial command to the connected Timi device to trigger a reset
Returns the boolean response from the reset
PUB setBacklight(backlightValue) : bDidSucceed Sets the intensity of the backlight of connected device: where {backlightValue} is [0-255]
Returns the boolean response from the backlight command
>--- Normal Interaction
PUB setPage(pageIndex, timeout) : bDidSucceed Sets the page to be displayed on the connected device
Returns T/F where T indicates success
PUB getPage() : pageIdx Returns {pageIdx} the index of the current page displayed by the connected device
PUB setWidgetValueById(widgetId, widgetValue) : bDidSucceed Sets the value of a specific widget based on the provided identifier
Returns T/F where T indicates success
PUB getWidgetValueById(widgetId) : widgetValue Gets the value of a widget based on the {widgetId}
Returns {widgetValue} an integer corresponding to widget value.
PUB  setWidgetValueByIndex(widgetType, widgetIndex, widgetValue) : bDidSucceed
Sets the value of a specific widget based on the index within a widget type
Returns T/F where T indicates success
PUB getWidgetValueByIndex(widgetType, widgetIndex) : widgetValue Gets the value of a specific widget based on the index within a widget type
Returns {widgetValue} an integer corresponding to widget value.
PUB setLedDigitsShortValue(widgetIndex, widgetValue) : bDidSucceed Sets the value of specifically int16 LED Digits widgets based on the widget index
Returns T/F where T indicates success
PUB setLedDigitsLongValue(widgetIndex, widgetValue) : bDidSucceed Sets the value of specifically int32 LED Digits widgets based on the widget index
Returns T/F where T indicates success
PUB setLedDigitsFloatValue(widgetIndex, floatWidgetValue) : bDidSucceed Sets the value of specifically float32 LED Digits widgets based on the widget index
Returns T/F where T indicates success
PUB setSpectrumValue(spectrumId, gaugeIndex, widgetValue) : bDidSucceed Sets the value of specifically Spectrum widgets based the spectrum id and gauge index
Returns T/F where T indicates success
PUB setLedSpectrumValue(ledSpectrumIndex, gaugeIndex, widgetValue) : bDidSucceed Sets the value of specific LED Spectrum widgets based on the gauge index
Returns T/F where T indicates success
PUB setMediaSpectrumValue(mediaIndex, gaugeIndex, widgetValue) : bDidSucceed Sets the value of specific Media Spectrum widgets based on the Media Spectrum index and the gauge index
Returns T/F where T indicates success
PUB setWidgetParamById(widgetId, param, widgetValue) : bDidSucceed Sets the value of a widget parameter based on widget id and parameter id
Returns T/F where T indicates success
PUB getWidgetParamById(widgetId, param) : targetParamValue Gets the value of a widget parameter based on widget id and parameter id
Returns and integer containing the target parameter value.
PUB setWidgetParamByIndex(widgetType, widgetIndex, param, widgetValue) : bDidSucceed Sets the value of a widget parameter based on widget index and parameter id
Returns T/F where T indicates success
PUB getWidgetParamByIndex(widgetType, widgetIndex, param) : widgetValue Gets the value of a widget parameter based on widget index and parameter id
Returns {widgetValue} the target parameter value
PUB clearTextArea(textAreaIndex) : bDidSucceed Clears a targeted Text Area
Returns T/F where T indicates success
PUB updateTextArea(textAreaIndex, pString) : bDidSucceed Updates the text displayed within Text Area widget
Returns T/F where T indicates success
PUB clearPrintArea(printAreaIndex) : bDidSucceed Clears a targeted Print Area
Returns T/F where T indicates success
PUB setPrintAreaColor565(printAreaIndex, rgb565Value) : bDidSucceed Sets the color of a PrintArea Widget based on an rgb565 value
Returns T/F where T indicates success
PUB setPrintAreaColorRGB(printAreaIndex, redValue, greenValue, blueValue) : bDidSucceed Sets the color of a PrintArea Widget
Returns T/F where T indicates success
PUB appendArrayToPrintArea(printAreaIndex, pBytes, byteCount) : bDidSucceed Appends {pBytes} a list of integers to the {printAreaIndex} Print Area widget
Returns T/F where T indicates success
PUB appendStringToPrintArea(printAreaIndex, pString) : bDidSucceed Appends {pString} to the {printAreaIndex} Print Area widget
Returns T/F where T indicates success
PUB appendToScopeWidget(scopeIndex, pWordBuffer, countWords) : bDidSucceed Appends {pWordBuffer} a list of integers to the {scopeIndex} Scope widget
Returns T/F where T indicates success
PUB updateDotMatrixWidget(matrixIndex, pString) : bDidSucceed Writes {pString} to the {matrixIndex} Dot Matrix widget
Returns T/F where T indicates success
PUB getButtonEventCount() : countButtonEvents Gets the number of events recorded from applicable button widgets
Returns {countButtonEvents} the number of events recorded
PUB getNextButtonEvent() : widgetId Gets the next event source logged from applicable buttons
Returns {widgetId} an integer corresponding to the button widget ID
PUB getSwipeEventCount() : eventCount Gets the number of events recorded from swipe gestures
Returns {eventCount} an integer corresponding to the number of events
PUB getNextSwipeEvent() : swipeEvent Gets the next swipe event value
Returns {swipeEvent} an integer corresponding to the swipe event
PUB getVersion() : pVerString Helper function to obtain the version of the Python Mates Controller library
Returns {pVerString} string response of library version
PUB getCompatibility() : pVerString Helper function to obtain the version of the Mates Studio compatible with this library version
Returns {pVerString} string response of Mates Studio version compatible with this library
PUB printVersion() Debugging function to print the version of the Mates Studio compatible along with this specific library version.
PUB getError() : latestError Helper function to obtain the current error state of the Mates Controller
Returns {latestError} MatesError response of current error
>--- NOT Implemented
PUB setBufferSize(size) setBufferSize(size) NOT Implemented!!
PUB takeScreenshot() : bDidSucceed, pImage takeScreenshot() NOT Implemented!!
PUB saveScreenshot(pFilenameStr) : bDidSave saveScreenshot() NOT Implemented!!

The Source Code

The following files comprise our driver source code:

Filename Purpose Description
Driver FILEs
isp_timi_mates.spin2 DRIVER the TIMI Driver object
isp_serial.spin2 DRIVER underlying serial HW interface
jm_nstring.spin2 DRIVER string formatting routines (fm JonnyMac)

If you like my work and/or this has helped you in some way then feel free to help me out for a couple of ☕'s or 🍕 slices!

coffee    -OR-    PatreonPatreon.com/IronSheep


Disclaimer and Legal

Parallax, Propeller Spin, and the Parallax and Propeller Hat logos are trademarks of Parallax Inc., dba Parallax Semiconductor

This project is a community project not for commercial use.

This project is in no way affiliated with, authorized, maintained, sponsored or endorsed by Parallax Inc., dba Parallax Semiconductor or any of its affiliates or subsidiaries.


License

Licensed under the MIT License.

Follow these links for more information: