Difference between revisions of "Unit STMPE"

From Ultibo.org
Jump to: navigation, search
Line 52: Line 52:
 
! '''Note'''
 
! '''Note'''
 
| Called internally by other functions
 
| Called internally by other functions
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''STMPE 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 STMPE610GPIOCreate(I2C:PI2CDevice; SPI:PSPIDevice; Address,ChipSelect:Word; IRQ:PGPIOInfo):PGPIODevice;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create, register and start a new STMPE610 GPIO device connected to the specified I2C or SPI device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''I2C'''
 +
| The I2C device this STMPE610 is connected to (Optional)
 +
|-
 +
! '''SPI'''
 +
| The SPI device this STMPE610 is connected to (Optional)
 +
|-
 +
! '''Address'''
 +
| The I2C address for this STMPE610 (or I2C_ADDRESS_INVALID if SPI connected)
 +
|-
 +
! '''ChipSelect'''
 +
| The SPI chip select for this STMPE610 (or SPI_CS_NONE if I2C connected)
 +
|-
 +
! '''IRQ'''
 +
| The GPIO information for the IRQ line (Optional)
 +
|-
 +
! '''Return'''
 +
| Pointer to the new GPIO device or nil on failure
 +
|-
 +
! '''Note'''
 +
| Either I2C or SPI must be specified but not both
 +
|-
 +
|}
 +
</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 STMPE801GPIOCreate(I2C:PI2CDevice; Address:Word; IRQ:PGPIOInfo):PGPIODevice;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create, register and start a new STMPE801 GPIO device connected to the specified I2C device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''I2C'''
 +
| The I2C device this STMPE801 is connected to
 +
|-
 +
! '''Address'''
 +
| The I2C address for this STMPE801
 +
|-
 +
! '''IRQ'''
 +
| The GPIO information for the IRQ line (Optional)
 +
|-
 +
! '''Return'''
 +
| Pointer to the new GPIO device or nil on failure
 +
|-
 +
|}
 +
</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 STMPE811GPIOCreate(I2C:PI2CDevice; SPI:PSPIDevice; Address,ChipSelect:Word; IRQ:PGPIOInfo):PGPIODevice;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create, register and start a new STMPE811 GPIO device connected to the specified I2C or SPI device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''I2C'''
 +
| The I2C device this STMPE811 is connected to (Optional)
 +
|-
 +
! '''SPI'''
 +
| The SPI device this STMPE811 is connected to (Optional)
 +
|-
 +
! '''Address'''
 +
| The I2C address for this STMPE811 (or I2C_ADDRESS_INVALID if SPI connected)
 +
|-
 +
! '''ChipSelect'''
 +
| The SPI chip select for this STMPE811 (or SPI_CS_NONE if I2C connected)
 +
|-
 +
! '''IRQ'''
 +
| The GPIO information for the IRQ line (Optional)
 +
|-
 +
! '''Return'''
 +
| Pointer to the new GPIO device or nil on failure
 +
|-
 +
! '''Note'''
 +
| Either I2C or SPI must be specified but not both
 +
|-
 +
|}
 +
</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 STMPE1601GPIOCreate(I2C:PI2CDevice; Address:Word; IRQ:PGPIOInfo):PGPIODevice;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create, register and start a new STMPE1601 GPIO device connected to the specified I2C device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''I2C'''
 +
| The I2C device this STMPE1601 is connected to
 +
|-
 +
! '''Address'''
 +
| The I2C address for this STMPE1601
 +
|-
 +
! '''IRQ'''
 +
| The GPIO information for the IRQ line (Optional)
 +
|-
 +
! '''Return'''
 +
| Pointer to the new GPIO device or nil on failure
 +
|-
 +
|}
 +
</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 STMPE1801GPIOCreate(I2C:PI2CDevice; Address:Word; IRQ:PGPIOInfo):PGPIODevice;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create, register and start a new STMPE1801 GPIO device connected to the specified I2C device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''I2C'''
 +
| The I2C device this STMPE1801 is connected to
 +
|-
 +
! '''Address'''
 +
| The I2C address for this STMPE1801
 +
|-
 +
! '''IRQ'''
 +
| The GPIO information for the IRQ line (Optional)
 +
|-
 +
! '''Return'''
 +
| Pointer to the new GPIO device or nil on failure
 +
|-
 +
|}
 +
</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 STMPE2401GPIOCreate(I2C:PI2CDevice; Address:Word; IRQ:PGPIOInfo):PGPIODevice;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create, register and start a new STMPE2401 GPIO device connected to the specified I2C device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''I2C'''
 +
| The I2C device this STMPE2401 is connected to
 +
|-
 +
! '''Address'''
 +
| The I2C address for this STMPE2401
 +
|-
 +
! '''IRQ'''
 +
| The GPIO information for the IRQ line (Optional)
 +
|-
 +
! '''Return'''
 +
| Pointer to the new GPIO device or nil on failure
 +
|-
 +
|}
 +
</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 STMPEGPIODestroy(GPIO:PGPIODevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Stop, deregister and destroy an STMPE GPIO 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;"
 +
|-
 +
! '''GPIO'''
 +
| The GPIO device to destroy
 +
|-
 +
! '''Return'''
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</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 STMPE610TouchCreate(I2C:PI2CDevice; SPI:PSPIDevice; Address,ChipSelect:Word; Width,Height:LongWord; IRQ:PGPIOInfo):PTouchDevice;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create, register and start a new STMPE610 Touch device connected to the specified I2C or SPI device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''I2C'''
 +
| The I2C device this STMPE610 is connected to (Optional)
 +
|-
 +
! '''SPI'''
 +
| The SPI device this STMPE610 is connected to (Optional)
 +
|-
 +
! '''Address'''
 +
| The I2C address for this STMPE610 (or I2C_ADDRESS_INVALID if SPI connected)
 +
|-
 +
! '''ChipSelect'''
 +
| The SPI chip select for this STMPE610 (or SPI_CS_NONE if I2C connected)
 +
|-
 +
! '''Width'''
 +
| The width of the screen in pixels
 +
|-
 +
! '''Height'''
 +
| The height of the screen in pixels
 +
|-
 +
! '''IRQ'''
 +
| The GPIO information for the IRQ line (Optional)
 +
|-
 +
! '''Return'''
 +
| Pointer to the new Touch device or nil on failure
 +
|-
 +
! '''Note'''
 +
| Either I2C or SPI must be specified but not both
 +
|-
 +
|}
 +
</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 STMPE811TouchCreate(I2C:PI2CDevice; SPI:PSPIDevice; Address,ChipSelect:Word; Width,Height:LongWord; IRQ:PGPIOInfo):PTouchDevice;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create, register and start a new STMPE811 Touch device connected to the specified I2C or SPI device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''I2C'''
 +
| The I2C device this STMPE811 is connected to (Optional)
 +
|-
 +
! '''SPI'''
 +
| The SPI device this STMPE811 is connected to (Optional)
 +
|-
 +
! '''Address'''
 +
| The I2C address for this STMPE811 (or I2C_ADDRESS_INVALID if SPI connected)
 +
|-
 +
! '''ChipSelect'''
 +
| The SPI chip select for this STMPE811 (or SPI_CS_NONE if I2C connected)
 +
|-
 +
! '''Width'''
 +
| The width of the screen in pixels
 +
|-
 +
! '''Height'''
 +
| The height of the screen in pixels
 +
|-
 +
! '''IRQ'''
 +
| The GPIO information for the IRQ line (Optional)
 +
|-
 +
! '''Return'''
 +
| Pointer to the new Touch device or nil on failure
 +
|-
 +
! '''Note'''
 +
| Either I2C or SPI must be specified but not both
 +
|-
 +
|}
 +
</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 STMPETouchDestroy(Touch:PTouchDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Stop, deregister and destroy an STMPE Touch 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;"
 +
|-
 +
! '''Touch'''
 +
| The Touch device to destroy
 +
|-
 +
! '''Return'''
 +
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
 
|}
 
|}

Revision as of 01:39, 14 October 2016

Return to Unit Reference


Description


The ST Microelectronics STMPE devices are a range of multi function chips that include GPIO, ADC, 4 wire touchscreen controller and PWM outputs in varying combinations. Many of the functions overlap so a pin can be used for example as a GPIO or a PWM but not both at once. The Touchscreen controller also consumes many of the GPIO pins in the models that support it. This driver supports the GPIO and Touchscreen functions of the following chips:

STMPE610 - 6 GPIO / 4-wire Touch / I2C / SPI

STMPE801 - 8 GPIO / I2C

STMPE811 - 8 GPIO / 4-wire Touch / I2C / SPI

STMPE1601 - 16 GPIO / 4 PWM / I2C

STMPE1801 - 18 GPIO / I2C

STMPE2401 - 24 GPIO / 3 PWM / I2C

STMPE2403 - 24 GPIO / 3 PWM / I2C

Note: A number of variations also support Keypad, Temperature and other features which are not currently handled by this driver.

Constants


To be documented

Type definitions


To be documented

Public variables


To be documented

Function declarations



Initialization functions

procedure STMPEInit;
Description: Initialize the STMPE unit and parameters
Note Called internally by other functions


STMPE functions

function STMPE610GPIOCreate(I2C:PI2CDevice; SPI:PSPIDevice; Address,ChipSelect:Word; IRQ:PGPIOInfo):PGPIODevice;
Description: Create, register and start a new STMPE610 GPIO device connected to the specified I2C or SPI device
I2C The I2C device this STMPE610 is connected to (Optional)
SPI The SPI device this STMPE610 is connected to (Optional)
Address The I2C address for this STMPE610 (or I2C_ADDRESS_INVALID if SPI connected)
ChipSelect The SPI chip select for this STMPE610 (or SPI_CS_NONE if I2C connected)
IRQ The GPIO information for the IRQ line (Optional)
Return Pointer to the new GPIO device or nil on failure
Note Either I2C or SPI must be specified but not both


function STMPE801GPIOCreate(I2C:PI2CDevice; Address:Word; IRQ:PGPIOInfo):PGPIODevice;
Description: Create, register and start a new STMPE801 GPIO device connected to the specified I2C device
I2C The I2C device this STMPE801 is connected to
Address The I2C address for this STMPE801
IRQ The GPIO information for the IRQ line (Optional)
Return Pointer to the new GPIO device or nil on failure


function STMPE811GPIOCreate(I2C:PI2CDevice; SPI:PSPIDevice; Address,ChipSelect:Word; IRQ:PGPIOInfo):PGPIODevice;
Description: Create, register and start a new STMPE811 GPIO device connected to the specified I2C or SPI device
I2C The I2C device this STMPE811 is connected to (Optional)
SPI The SPI device this STMPE811 is connected to (Optional)
Address The I2C address for this STMPE811 (or I2C_ADDRESS_INVALID if SPI connected)
ChipSelect The SPI chip select for this STMPE811 (or SPI_CS_NONE if I2C connected)
IRQ The GPIO information for the IRQ line (Optional)
Return Pointer to the new GPIO device or nil on failure
Note Either I2C or SPI must be specified but not both


function STMPE1601GPIOCreate(I2C:PI2CDevice; Address:Word; IRQ:PGPIOInfo):PGPIODevice;
Description: Create, register and start a new STMPE1601 GPIO device connected to the specified I2C device
I2C The I2C device this STMPE1601 is connected to
Address The I2C address for this STMPE1601
IRQ The GPIO information for the IRQ line (Optional)
Return Pointer to the new GPIO device or nil on failure


function STMPE1801GPIOCreate(I2C:PI2CDevice; Address:Word; IRQ:PGPIOInfo):PGPIODevice;
Description: Create, register and start a new STMPE1801 GPIO device connected to the specified I2C device
I2C The I2C device this STMPE1801 is connected to
Address The I2C address for this STMPE1801
IRQ The GPIO information for the IRQ line (Optional)
Return Pointer to the new GPIO device or nil on failure


function STMPE2401GPIOCreate(I2C:PI2CDevice; Address:Word; IRQ:PGPIOInfo):PGPIODevice;
Description: Create, register and start a new STMPE2401 GPIO device connected to the specified I2C device
I2C The I2C device this STMPE2401 is connected to
Address The I2C address for this STMPE2401
IRQ The GPIO information for the IRQ line (Optional)
Return Pointer to the new GPIO device or nil on failure


function STMPEGPIODestroy(GPIO:PGPIODevice):LongWord;
Description: Stop, deregister and destroy an STMPE GPIO device created by this driver
GPIO The GPIO device to destroy
Return ERROR_SUCCESS if completed or another error code on failure


function STMPE610TouchCreate(I2C:PI2CDevice; SPI:PSPIDevice; Address,ChipSelect:Word; Width,Height:LongWord; IRQ:PGPIOInfo):PTouchDevice;
Description: Create, register and start a new STMPE610 Touch device connected to the specified I2C or SPI device
I2C The I2C device this STMPE610 is connected to (Optional)
SPI The SPI device this STMPE610 is connected to (Optional)
Address The I2C address for this STMPE610 (or I2C_ADDRESS_INVALID if SPI connected)
ChipSelect The SPI chip select for this STMPE610 (or SPI_CS_NONE if I2C connected)
Width The width of the screen in pixels
Height The height of the screen in pixels
IRQ The GPIO information for the IRQ line (Optional)
Return Pointer to the new Touch device or nil on failure
Note Either I2C or SPI must be specified but not both


function STMPE811TouchCreate(I2C:PI2CDevice; SPI:PSPIDevice; Address,ChipSelect:Word; Width,Height:LongWord; IRQ:PGPIOInfo):PTouchDevice;
Description: Create, register and start a new STMPE811 Touch device connected to the specified I2C or SPI device
I2C The I2C device this STMPE811 is connected to (Optional)
SPI The SPI device this STMPE811 is connected to (Optional)
Address The I2C address for this STMPE811 (or I2C_ADDRESS_INVALID if SPI connected)
ChipSelect The SPI chip select for this STMPE811 (or SPI_CS_NONE if I2C connected)
Width The width of the screen in pixels
Height The height of the screen in pixels
IRQ The GPIO information for the IRQ line (Optional)
Return Pointer to the new Touch device or nil on failure
Note Either I2C or SPI must be specified but not both


function STMPETouchDestroy(Touch:PTouchDevice):LongWord;
Description: Stop, deregister and destroy an STMPE Touch device created by this driver
Touch The Touch device to destroy
Return ERROR_SUCCESS if completed or another error code on failure


Return to Unit Reference