Difference between revisions of "Unit STMPE"

From Ultibo.org
Jump to: navigation, search
Line 301: Line 301:
 
! '''Return'''
 
! '''Return'''
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''STMPE GPIO 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 STMPEGPIOStart(GPIO:PGPIODevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of GPIODeviceStart API for STMPE</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 GPIODeviceStart 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 STMPEGPIOStop(GPIO:PGPIODevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of GPIODeviceStop API for STMPE</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 GPIODeviceStop 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 STMPEGPIORead(GPIO:PGPIODevice; Reg:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of GPIODeviceRead API for STMPE</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 GPIODeviceRead 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;">procedure STMPEGPIOWrite(GPIO:PGPIODevice; Reg,Value:LongWord);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of GPIODeviceWrite API for STMPE</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 GPIODeviceWrite 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 STMPEGPIOInputGet(GPIO:PGPIODevice; Pin:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of GPIODeviceInputGet API for STMPE</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 GPIODeviceInputGet 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 STMPEGPIOOutputSet(GPIO:PGPIODevice; Pin,Level:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of GPIODeviceOutputSet API for STMPE</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 GPIODeviceOutputSet 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 STMPEGPIOPullGet(GPIO:PGPIODevice; Pin:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of GPIODevicePullGet API for STMPE</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 GPIODevicePullGet 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 STMPEGPIOPullSelect(GPIO:PGPIODevice; Pin,Mode:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of GPIODevicePullSelect API for STMPE</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 GPIODevicePullSelect 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 STMPEGPIOFunctionGet(GPIO:PGPIODevice; Pin:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of GPIODeviceFunctionGet API for STMPE</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 GPIODeviceFunctionGet 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 STMPEGPIOFunctionSelect(GPIO:PGPIODevice; Pin,Mode:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of GPIODeviceFunctionSelect API for STMPE</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 GPIODeviceFunctionSelect instead
 
|-
 
|-
 
|}
 
|}

Revision as of 01:40, 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


STMPE GPIO functions

function STMPEGPIOStart(GPIO:PGPIODevice):LongWord;
Description: Implementation of GPIODeviceStart API for STMPE
Note Not intended to be called directly by applications, use GPIODeviceStart instead


function STMPEGPIOStop(GPIO:PGPIODevice):LongWord;
Description: Implementation of GPIODeviceStop API for STMPE
Note Not intended to be called directly by applications, use GPIODeviceStop instead


function STMPEGPIORead(GPIO:PGPIODevice; Reg:LongWord):LongWord;
Description: Implementation of GPIODeviceRead API for STMPE
Note Not intended to be called directly by applications, use GPIODeviceRead instead


procedure STMPEGPIOWrite(GPIO:PGPIODevice; Reg,Value:LongWord);
Description: Implementation of GPIODeviceWrite API for STMPE
Note Not intended to be called directly by applications, use GPIODeviceWrite instead


function STMPEGPIOInputGet(GPIO:PGPIODevice; Pin:LongWord):LongWord;
Description: Implementation of GPIODeviceInputGet API for STMPE
Note Not intended to be called directly by applications, use GPIODeviceInputGet instead


function STMPEGPIOOutputSet(GPIO:PGPIODevice; Pin,Level:LongWord):LongWord;
Description: Implementation of GPIODeviceOutputSet API for STMPE
Note Not intended to be called directly by applications, use GPIODeviceOutputSet instead


function STMPEGPIOPullGet(GPIO:PGPIODevice; Pin:LongWord):LongWord;
Description: Implementation of GPIODevicePullGet API for STMPE
Note Not intended to be called directly by applications, use GPIODevicePullGet instead


function STMPEGPIOPullSelect(GPIO:PGPIODevice; Pin,Mode:LongWord):LongWord;
Description: Implementation of GPIODevicePullSelect API for STMPE
Note Not intended to be called directly by applications, use GPIODevicePullSelect instead


function STMPEGPIOFunctionGet(GPIO:PGPIODevice; Pin:LongWord):LongWord;
Description: Implementation of GPIODeviceFunctionGet API for STMPE
Note Not intended to be called directly by applications, use GPIODeviceFunctionGet instead


function STMPEGPIOFunctionSelect(GPIO:PGPIODevice; Pin,Mode:LongWord):LongWord;
Description: Implementation of GPIODeviceFunctionSelect API for STMPE
Note Not intended to be called directly by applications, use GPIODeviceFunctionSelect instead


Return to Unit Reference