Difference between revisions of "Unit ST77XX"

From Ultibo.org
Jump to: navigation, search
Line 347: Line 347:
 
----
 
----
  
''To be documented''
+
 
 +
'''ST77XX specific types'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PST77XXFramebuffer = ^TST77XXFramebuffer;</code>
 +
 
 +
<code>TST77XXFramebuffer = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''TFT Properties''
 +
|-
 +
| <code>TFT:TTFTFramebuffer;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Public variables ===
 
=== Public variables ===
Line 357: Line 374:
 
----
 
----
  
''To be documented''
 
  
 +
'''ST77XX functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function ST77XXFramebufferCreate(SPI:PSPIDevice; ChipSelect:Word; const Name:String; Rotation,Width,Height,ColStart:LongWord; RST,DC,BL:PGPIOInfo):PFramebufferDevice;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create, register and allocate a new ST77XX Framebuffer device which can be accessed using the framebuffer API</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! SPI
 +
| The SPI device that this ST77XX is connected to
 +
|-
 +
! ChipSelect
 +
| The SPI chip select to use when communicating with this device
 +
|-
 +
! Name
 +
| The text description of this device which will show in the device list (Optional)
 +
|-
 +
! Rotation
 +
| The rotation value for the framebuffer device (eg FRAMEBUFFER_ROTATION_180)
 +
|-
 +
! Width
 +
| The width of the framebuffer in pixels
 +
|-
 +
! Height
 +
| The height of the framebuffer in pixels
 +
|-
 +
! RST
 +
| GPIO pin information for the Reset pin (Optional)
 +
|-
 +
! DC
 +
| GPIO pin information for the Data/Command pin
 +
|-
 +
! BL
 +
| GPIO pin information for the Backlight pin (Optional)
 +
|-
 +
! Return
 +
| Pointer to the new Framebuffer device or nil if the framebuffer device could not be created
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function ST77XXFramebufferDestroy(Framebuffer:PFramebufferDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Release, deregister and destroy an ST77XX Framebuffer device created by this driver</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Framebuffer
 +
| The Framebuffer device to destroy
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''ST77XX framebuffer functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function ST77XXFramebufferBlank(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of FramebufferDeviceBlank API for ST77XX</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use FramebufferDeviceBlank instead
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function ST77XXFramebufferSetBacklight(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of FramebufferDeviceSetBacklight API for ST77XX</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use FramebufferDeviceSetBacklight instead
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''ST77XX TFTFramebuffer functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function ST77XXTFTFramebufferInitialize(Framebuffer:PTFTFramebuffer; Defaults:PFramebufferProperties):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of TFTFramebufferInitialize API for ST77XX</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-function ST77XXTFTFramebufferDeinitialize(Framebuffer:PTFTFramebuffer):LongWord;" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">FUNCTION</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of TFTFramebufferDeinitialize API for ST77XX</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function ST77XXTFTFramebufferGetDefaults(Framebuffer:PTFTFramebuffer; Properties,Defaults:PFramebufferProperties):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of TFTFramebufferGetDefaults API for ST77XX</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function ST77XXTFTFramebufferSetWriteAddress(Framebuffer:PTFTFramebuffer; X1,Y1,X2,Y2:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of TFTFramebufferSetWriteAddress API for ST77XX</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function ST77XXTFTFramebufferWriteMemory(Framebuffer:PTFTFramebuffer; Address:PtrUInt; Size:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of TFTFramebufferWriteMemory API for ST77XX</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''ST77XX helper functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function ST77XXWriteCommand(Framebuffer:PTFTFramebuffer; Value:Byte):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Write a single command value to the ST77XX</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function ST77XXWriteCommandEx(Framebuffer:PTFTFramebuffer; const Values:array of Byte):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Write multiple command values to the ST77XX</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function ST77XXWriteData(Framebuffer:PTFTFramebuffer; Value:Byte):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Write a single data value to the ST77XX</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function ST77XXWriteDataEx(Framebuffer:PTFTFramebuffer; const Values:array of Byte):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Write multiple data values to the ST77XX</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
Return to [[Unit_Reference|Unit Reference]]
 
Return to [[Unit_Reference|Unit Reference]]

Revision as of 05:21, 14 November 2023

Return to Unit Reference


Description


Sitronix ST77XX TFT LCD Driver unit

The ST77XX is a family of single-chip controllers/drivers for color, graphic type TFT-LCD display.

Instantiate the ST77XX driver by calling ST77XXFramebufferCreate() with the required parameters:

SPI: The SPI device that this ST77XX is connected to

ChipSelect: The SPI chip select to use when communicating with this device

Name: The text description of this device which will show in the device list (Optional)

Rotation: The rotation value for the framebuffer device (eg FRAMEBUFFER_ROTATION_180)

Width: The width of the framebuffer in pixels

Height: The height of the framebuffer in pixels

ColStart:

RST: GPIO pin information for the Reset pin (Optional)

DC: GPIO pin information for the Data/Command pin

BL: GPIO pin information for the Backlight pin (Optional)

Constants



[Expand]
ST77XX specific constants ST77XX_*


[Expand]
ST77XX SPI ST77XX_SPI_*


[Expand]
ST77XX control command ST77XX_*


[Expand]
ST77XX memory access control ST77XX_*CTL_*


Type definitions



ST77XX specific types

[Expand]

PST77XXFramebuffer = ^TST77XXFramebuffer;

TST77XXFramebuffer = record


Public variables


None defined

Function declarations



ST77XX functions

[Expand]
function ST77XXFramebufferCreate(SPI:PSPIDevice; ChipSelect:Word; const Name:String; Rotation,Width,Height,ColStart:LongWord; RST,DC,BL:PGPIOInfo):PFramebufferDevice;
Description: Create, register and allocate a new ST77XX Framebuffer device which can be accessed using the framebuffer API


[Expand]
function ST77XXFramebufferDestroy(Framebuffer:PFramebufferDevice):LongWord;
Description: Release, deregister and destroy an ST77XX Framebuffer device created by this driver


ST77XX framebuffer functions

[Expand]
function ST77XXFramebufferBlank(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;
Description: Implementation of FramebufferDeviceBlank API for ST77XX


[Expand]
function ST77XXFramebufferSetBacklight(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;
Description: Implementation of FramebufferDeviceSetBacklight API for ST77XX


ST77XX TFTFramebuffer functions

[Expand]
function ST77XXTFTFramebufferInitialize(Framebuffer:PTFTFramebuffer; Defaults:PFramebufferProperties):LongWord;
Description: Implementation of TFTFramebufferInitialize API for ST77XX


[Collapse]
FUNCTION
Description: Implementation of TFTFramebufferDeinitialize API for ST77XX
Note Not intended to be called directly by applications


[Expand]
function ST77XXTFTFramebufferGetDefaults(Framebuffer:PTFTFramebuffer; Properties,Defaults:PFramebufferProperties):LongWord;
Description: Implementation of TFTFramebufferGetDefaults API for ST77XX


[Expand]
function ST77XXTFTFramebufferSetWriteAddress(Framebuffer:PTFTFramebuffer; X1,Y1,X2,Y2:LongWord):LongWord;
Description: Implementation of TFTFramebufferSetWriteAddress API for ST77XX


[Expand]
function ST77XXTFTFramebufferWriteMemory(Framebuffer:PTFTFramebuffer; Address:PtrUInt; Size:LongWord):LongWord;
Description: Implementation of TFTFramebufferWriteMemory API for ST77XX


ST77XX helper functions

[Expand]
function ST77XXWriteCommand(Framebuffer:PTFTFramebuffer; Value:Byte):LongWord;
Description: Write a single command value to the ST77XX


[Expand]
function ST77XXWriteCommandEx(Framebuffer:PTFTFramebuffer; const Values:array of Byte):LongWord;
Description: Write multiple command values to the ST77XX


[Expand]
function ST77XXWriteData(Framebuffer:PTFTFramebuffer; Value:Byte):LongWord;
Description: Write a single data value to the ST77XX


[Expand]
function ST77XXWriteDataEx(Framebuffer:PTFTFramebuffer; const Values:array of Byte):LongWord;
Description: Write multiple data values to the ST77XX


Return to Unit Reference