Difference between revisions of "Unit STMPE"

From Ultibo.org
Jump to: navigation, search
 
(10 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
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:
 
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
+
STMPE610 - 6 GPIO/4-wire Touch/I2C/SPI
 
   
 
   
STMPE801 - 8 GPIO / I2C
+
STMPE801 - 8 GPIO/I2C
 
   
 
   
STMPE811 - 8 GPIO / 4-wire Touch / I2C / SPI
+
STMPE811 - 8 GPIO/4-wire Touch/I2C/SPI
 
   
 
   
STMPE1601 - 16 GPIO / 4 PWM / I2C
+
STMPE1601 - 16 GPIO/4 PWM/I2C
 
   
 
   
STMPE1801 - 18 GPIO / I2C
+
STMPE1801 - 18 GPIO/I2C
 
   
 
   
STMPE2401 - 24 GPIO / 3 PWM / I2C
+
STMPE2401 - 24 GPIO/3 PWM/I2C
 
   
 
   
STMPE2403 - 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.
 
Note: A number of variations also support Keypad, Temperature and other features which are not currently handled by this driver.
Line 178: Line 178:
 
|-
 
|-
 
| <code>STMPE1601_GPIO_MAX_FUNCTION = GPIO_FUNCTION_ALT1;</code>
 
| <code>STMPE1601_GPIO_MAX_FUNCTION = GPIO_FUNCTION_ALT1;</code>
| Alternate function 0 = Keypad / Alternate function 1 = PWM
+
| Alternate function 0 = Keypad/Alternate function 1 = PWM
 
|-
 
|-
 
| <code>STMPE1601_GPIO_FUNCTION_COUNT = 4;</code>
 
| <code>STMPE1601_GPIO_FUNCTION_COUNT = 4;</code>
Line 237: Line 237:
 
<br />   
 
<br />   
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''STMPE chip constants''' <code> STMPE_CHIP_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''STMPE chip''' <code> STMPE_CHIP_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 243: Line 243:
 
| <code>STMPE_CHIP_STMPE610 = 1;</code>
 
| <code>STMPE_CHIP_STMPE610 = 1;</code>
 
| style="width: 50%;"|&nbsp;
 
| style="width: 50%;"|&nbsp;
|-
 
| <code>STMPE_CHIP_STMPE801 = 2;</code>
 
| &nbsp;
 
 
|-
 
|-
 
| <code>STMPE_CHIP_STMPE801 = 2;</code>
 
| <code>STMPE_CHIP_STMPE801 = 2;</code>
Line 269: Line 266:
 
<br />   
 
<br />   
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''STMPE direction constants''' <code> STMPE_DIR_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''STMPE direction''' <code> STMPE_DIR_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 283: Line 280:
 
<br />   
 
<br />   
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''STMPE I2C constants''' <code> STMPE_I2C_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''STMPE I2C''' <code> STMPE_I2C_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 294: Line 291:
 
<br />   
 
<br />   
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''STMPE SPI constants''' <code> STMPE_SPI_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''STMPE SPI''' <code> STMPE_SPI_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 310: Line 307:
 
<br />   
 
<br />   
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''STMPE register constants''' <code> STMPE*_REG_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''STMPE register''' <code> STMPE*_REG_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
|colspan="2"|''STMPE610 / STMPE811''
+
|colspan="2"|''STMPE610/STMPE811''
 
|-
 
|-
 
| <code>STMPE811_REG_CHIP_ID = $00;</code>
 
| <code>STMPE811_REG_CHIP_ID = $00;</code>
Line 320: Line 317:
 
|-
 
|-
 
| <code>STMPE811_REG_ID_VER = $02;</code>
 
| <code>STMPE811_REG_ID_VER = $02;</code>
| Revision number (0x01 for engineering sample / 0x03 for final silicon)
+
| Revision number (0x01 for engineering sample/0x03 for final silicon)
 
|-
 
|-
 
| <code>STMPE811_REG_SYS_CTRL1 = $03;</code>
 
| <code>STMPE811_REG_SYS_CTRL1 = $03;</code>
Line 495: Line 492:
 
|-
 
|-
 
| <code>STMPE801_REG_ID_VER = $02;</code>
 
| <code>STMPE801_REG_ID_VER = $02;</code>
| Revision number (0x01 for engineering sample / 0x02 for final silicon)
+
| Revision number (0x01 for engineering sample/0x02 for final silicon)
 
|-
 
|-
 
| <code>STMPE801_REG_SYS_CTRL = $04;</code>
 
| <code>STMPE801_REG_SYS_CTRL = $04;</code>
Line 828: Line 825:
 
|colspan="2"|&nbsp;  
 
|colspan="2"|&nbsp;  
 
|-
 
|-
|colspan="2"|''STMPE2401 / STMPE2403''
+
|colspan="2"|''STMPE2401/STMPE2403''
 
|-
 
|-
 
| <code>STMPE240X_REG_CHIP_ID = $80;</code>
 
| <code>STMPE240X_REG_CHIP_ID = $80;</code>
Line 1,035: Line 1,032:
 
<br />   
 
<br />   
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''STMPE ID constants''' <code> STMPE*_CHIP_ID </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''STMPE Id''' <code> STMPE*_CHIP_ID </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
|colspan="2"|''STMPE610 / STMPE811''
+
|colspan="2"|''STMPE610/STMPE811''
 
|-
 
|-
 
| <code>STMPE811_CHIP_ID = $0811;</code>
 
| <code>STMPE811_CHIP_ID = $0811;</code>
Line 1,067: Line 1,064:
 
|colspan="2"|&nbsp;
 
|colspan="2"|&nbsp;
 
|-
 
|-
|colspan="2"|''STMPE2401 / STMPE2403''
+
|colspan="2"|''STMPE2401/STMPE2403''
 
|-
 
|-
 
| <code>STMPE240X_CHIP_ID = $01;</code>
 
| <code>STMPE240X_CHIP_ID = $01;</code>
Line 1,076: Line 1,073:
 
<br />   
 
<br />   
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''STMPE system control constants''' <code> STMPE*_SYS_CTRL*_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''STMPE system control''' <code> STMPE*_SYS_CTRL*_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
|colspan="2"|''STMPE610 / STMPE811''
+
|colspan="2"|''STMPE610/STMPE811''
 
|-
 
|-
 
| <code>STMPE811_SYS_CTRL2_TS_OFF = (1 shl 3);</code>
 
| <code>STMPE811_SYS_CTRL2_TS_OFF = (1 shl 3);</code>
Line 1,153: Line 1,150:
 
<br />   
 
<br />   
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''STMPE touchscreen control constants''' <code> STMPE*_TSC_CTRL_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''STMPE touchscreen control''' <code> STMPE*_TSC_CTRL_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
|colspan="2"|''STMPE610 / STMPE811''
+
|colspan="2"|''STMPE610/STMPE811''
 
|-
 
|-
 
| <code>STMPE811_TSC_CTRL_TSC_STA = (1 shl 7);</code>
 
| <code>STMPE811_TSC_CTRL_TSC_STA = (1 shl 7);</code>
| TSC status (Reads '1' when touch is detected / Reads '0' when touch is not detected)
+
| TSC status (Reads '1' when touch is detected/Reads '0' when touch is not detected)
 
|-
 
|-
 
| <code>STMPE811_TSC_CTRL_TRACK_MASK = (7 shl 4);</code>
 
| <code>STMPE811_TSC_CTRL_TRACK_MASK = (7 shl 4);</code>
Line 1,187: Line 1,184:
 
<br />   
 
<br />   
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''STMPE touchscreen config constants''' <code> STMPE*_TSC_CFG_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''STMPE touchscreen configuration''' <code> STMPE*_TSC_CFG_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
|colspan="2"|''STMPE610 / STMPE811''
+
|colspan="2"|''STMPE610/STMPE811''
 
|-
 
|-
 
| <code>STMPE811_TSC_CFG_AVE_CTRL_1 = (0 shl 6);</code>
 
| <code>STMPE811_TSC_CFG_AVE_CTRL_1 = (0 shl 6);</code>
Line 1,215: Line 1,212:
 
<br />   
 
<br />   
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''STMPE ADC control 1 constants''' <code> STMPE*_ADC_CTRL1_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''STMPE ADC control 1''' <code> STMPE*_ADC_CTRL1_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
|colspan="2"|''STMPE610 / STMPE811''
+
|colspan="2"|''STMPE610/STMPE811''
 
|-
 
|-
 
| <code>STMPE811_ADC_CTRL1_SAMPLE_TIME_MASK = (7 shl 4);</code>
 
| <code>STMPE811_ADC_CTRL1_SAMPLE_TIME_MASK = (7 shl 4);</code>
Line 1,225: Line 1,222:
 
|-
 
|-
 
| <code>STMPE811_ADC_CTRL1_MOD_12B = (1 shl 3);</code>
 
| <code>STMPE811_ADC_CTRL1_MOD_12B = (1 shl 3);</code>
| MOD_12B: Selects 10 or 12-bit ADC operation (1: 12 bit ADC / 0: 10 bit ADC)
+
| MOD_12B: Selects 10 or 12-bit ADC operation (1: 12 bit ADC/0: 10 bit ADC)
 
|-
 
|-
 
| <code>STMPE811_ADC_CTRL1_REF_SEL = (1 shl 1);</code>
 
| <code>STMPE811_ADC_CTRL1_REF_SEL = (1 shl 1);</code>
| REF_SEL: Selects between internal or external reference for the ADC (1: External reference / 0: Internal reference)
+
| REF_SEL: Selects between internal or external reference for the ADC (1: External reference/0: Internal reference)
 
|-
 
|-
 
|}
 
|}
Line 1,234: Line 1,231:
 
<br />   
 
<br />   
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''STMPE ADC control 2 constants''' <code> STMPE*_ADC_CTRL2_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''STMPE ADC control 2''' <code> STMPE*_ADC_CTRL2_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
|colspan="2"|''STMPE610 / STMPE811''
+
|colspan="2"|''STMPE610/STMPE811''
 
|-
 
|-
 
| <code>STMPE811_ADC_CTRL2_ADC_FREQ_MASK = (3 shl 0);</code>
 
| <code>STMPE811_ADC_CTRL2_ADC_FREQ_MASK = (3 shl 0);</code>
Line 1,247: Line 1,244:
 
<br />   
 
<br />   
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''STMPE FIFO control and status constants''' <code> STMPE*_FIFO_STA_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''STMPE FIFO control and status''' <code> STMPE*_FIFO_STA_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
|colspan="2"|''STMPE610 / STMPE811''
+
|colspan="2"|''STMPE610/STMPE811''
 
|-
 
|-
 
| <code>STMPE811_FIFO_STA_RESET = (1 shl 0);</code>
 
| <code>STMPE811_FIFO_STA_RESET = (1 shl 0);</code>
| FIFO Reset (Write 0 : FIFO put out of reset mode / Write 1 : Resets FIFO. All data in FIFO will be cleared)
+
| FIFO Reset (Write 0 : FIFO put out of reset mode/Write 1 : Resets FIFO. All data in FIFO will be cleared)
 
|-
 
|-
 
|}
 
|}
Line 1,260: Line 1,257:
 
<br />   
 
<br />   
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''STMPE interrupt control constants''' <code> STMPE*_INT_CTRL_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''STMPE interrupt control''' <code> STMPE*_INT_CTRL_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
|colspan="2"|''STMPE610 / STMPE811''
+
|colspan="2"|''STMPE610/STMPE811''
 
|-
 
|-
 
| <code>STMPE811_INT_CTRL_POLARITY = (1 shl 2);</code>
 
| <code>STMPE811_INT_CTRL_POLARITY = (1 shl 2);</code>
| This bit sets the INT pin polarity (1: Active high/rising edge / 0: Active low/falling edge)
+
| This bit sets the INT pin polarity (1: Active high/rising edge/0: Active low/falling edge)
 
|-
 
|-
 
| <code>STMPE811_INT_CTRL_TYPE = (1 shl 1);</code>
 
| <code>STMPE811_INT_CTRL_TYPE = (1 shl 1);</code>
| This bit sets the type of interrupt signal required by the host (1: Edge interrupt / 0: Level interrupt)
+
| This bit sets the type of interrupt signal required by the host (1: Edge interrupt/0: Level interrupt)
 
|-
 
|-
 
| <code>STMPE811_INT_CTRL_GLOBAL = (1 shl 0);</code>
 
| <code>STMPE811_INT_CTRL_GLOBAL = (1 shl 0);</code>
| This is master enable for the interrupt system (1: Global interrupt / 0: Stops all interrupts)
+
| This is master enable for the interrupt system (1: Global interrupt/0: Stops all interrupts)
 
|-
 
|-
 
|}
 
|}
Line 1,279: Line 1,276:
 
<br />   
 
<br />   
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''STMPE interrupt enable constants''' <code> STMPE*_INT_EN_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''STMPE interrupt enable''' <code> STMPE*_INT_EN_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
|colspan="2"|''STMPE610 / STMPE811''
+
|colspan="2"|''STMPE610/STMPE811''
 
|-
 
|-
 
| <code>STMPE811_INT_EN_GPIO = (1 shl 7);</code>
 
| <code>STMPE811_INT_EN_GPIO = (1 shl 7);</code>
Line 1,313: Line 1,310:
 
<br />   
 
<br />   
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''STMPE interrupt status constants''' <code> STMPE*_INT_STA_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''STMPE interrupt status''' <code> STMPE*_INT_STA_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
|colspan="2"|''STMPE610 / STMPE811''
+
|colspan="2"|''STMPE610/STMPE811''
 
|-
 
|-
 
| <code>STMPE811_INT_STA_GPIO = (1 shl 7);</code>
 
| <code>STMPE811_INT_STA_GPIO = (1 shl 7);</code>
Line 1,351: Line 1,348:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''STMPE offset constants''' <code> STMPE*Offsets* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''STMPE offset''' <code> STMPE*Offsets* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
|colspan="2"|''STMPE610 / STMPE811 Offsets''
+
|colspan="2"|''STMPE610/STMPE811 Offsets''
 
|-
 
|-
 
|colspan="2"|<code>STMPE811Offsets:TSTMPEOffsets = (</code>
 
|colspan="2"|<code>STMPE811Offsets:TSTMPEOffsets = (</code>
Line 1,534: Line 1,531:
 
| <code>TSCIDrive:STMPE_REG_UNKNOWN );</code>
 
| <code>TSCIDrive:STMPE_REG_UNKNOWN );</code>
 
| &nbsp;
 
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 
|-
 
|-
 
|colspan="2"|&nbsp;
 
|colspan="2"|&nbsp;
Line 1,719: Line 1,718:
 
|colspan="2"|&nbsp;
 
|colspan="2"|&nbsp;
 
|-
 
|-
|colspan="2"|''STMPE2401 / STMPE2403 Offsets''
+
|colspan="2"|''STMPE2401/STMPE2403 Offsets''
 
|-
 
|-
 
|colspan="2"|<code>STMPE240XOffsets:TSTMPEOffsets = (</code>
 
|colspan="2"|<code>STMPE240XOffsets:TSTMPEOffsets = (</code>
Line 1,815: Line 1,814:
 
----
 
----
  
''To be documented''
+
 
 +
'''STMPE control'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PSTMPEControl = ^TSTMPEControl;</code>
 +
 
 +
<code>TSTMPEControl = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''General Properties''
 +
|-
 +
| <code>Chip:LongWord;</code>
 +
| The chip type (eg STMPE_CHIP_STMPE610)
 +
|-
 +
| <code>IRQ:TGPIOInfo;</code>
 +
| The GPIO information for the IRQ line (Optional)
 +
|-
 +
|colspan="2"|''I2C Properties''
 +
|-
 +
| <code>I2C:PI2CDevice;</code>
 +
| The I2C device this device is connected to (Optional)
 +
|-
 +
| <code>Address:Word;</code>
 +
| The I2C address of the device
 +
|-
 +
|colspan="2"|''SPI Properties''
 +
|-
 +
| <code>SPI:PSPIDevice;</code>
 +
| The SPI device this device is connected to (Optional)
 +
|-
 +
| <code>ChipSelect:Word;</code>
 +
| The SPI chip select of the device
 +
|-
 +
|colspan="2"|''Register Properties''
 +
|-
 +
| <code>RegMax:LongWord;</code>
 +
| The maximum register address for read or write
 +
|-
 +
| <code>RegDir:LongWord;</code>
 +
| The register address direction (Ascending/Descending)
 +
|-
 +
| <code>RegSize:LongWord;</code>
 +
| The standard size of a register read or write
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''STMPE offsets'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PSTMPEOffsets = ^TSTMPEOffsets;</code>
 +
 
 +
<code>TSTMPEOffsets = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''Control Register offsets''
 +
|-
 +
| <code>SysCtrl:Byte;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>IntCtrl:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IntEnable:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IntStatus:Byte;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''GPIO Registers offsets''
 +
|-
 +
| <code>GPIOIntEnable:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GPIOIntStatus:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GPIOPinGet:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GPIOPinSet:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GPIOPinClr:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GPIODirSet:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GPIOFuncSet:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GPIOPullUp:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GPIOPullDown:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GPIOEdgeDetect:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GPIORisingEdge:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GPIOFallingEdge:Byte;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Touchscreen Register offsets (610 and 811 Only)''
 +
|-
 +
| <code>ADCCtrl1:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ADCCtrl2:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TSCCtrl:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TSCCfg:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FIFOThreshold:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FIFOStatus:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TSCDataXYZ:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TSCFractionZ:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TSCIDrive:Byte;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''STMPE GPIO'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PSTMPEGPIO = ^TSTMPEGPIO;</code>
 +
 
 +
<code>TSTMPEGPIO = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''GPIO Properties''
 +
|-
 +
| <code>GPIO:TGPIODevice;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''STMPE Properties''
 +
|-
 +
| <code>Control:TSTMPEControl;</code>
 +
| The control information (Chip, I2C, SPI etc) for this device
 +
|-
 +
| <code>Offsets:TSTMPEOffsets;</code>
 +
| The register offsets for this device
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''STMPE touch'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PSTMPETouch = ^TSTMPETouch;</code>
 +
 
 +
<code>TSTMPETouch = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''Touch Properties''
 +
|-
 +
| <code>Touch:TTouchDevice;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''General Properties''
 +
|-
 +
| <code>MaxX:Word;</code>
 +
| Maximum X value for this device
 +
|-
 +
| <code>MaxY:Word;</code>
 +
| Maximum Y value for this device
 +
|-
 +
| <code>MaxZ:Word;</code>
 +
| Maximum Z value for this device
 +
|-
 +
| <code>Width:Word;</code>
 +
| Screen width for this device
 +
|-
 +
| <code>Height:Word;</code>
 +
| Screen height for this device
 +
|-
 +
| <code>MaxPoints:LongWord;</code>
 +
| Maximum touch points for this device
 +
|-
 +
|colspan="2"|''STMPE Properties''
 +
|-
 +
| <code>Control:TSTMPEControl;</code>
 +
| The control information (Chip, I2C, SPI etc) for this device
 +
|-
 +
| <code>Offsets:TSTMPEOffsets;</code>
 +
| The register offsets for this device
 +
|-
 +
| <code>Timer:TTimerHandle;</code>
 +
| Handle for touch release timer
 +
|-
 +
|}
 +
</div></div> 
 +
<br />
  
 
=== Public variables ===
 
=== Public variables ===
Line 1,826: Line 2,038:
 
|-
 
|-
 
| <code>STMPE_SAMPLE_TIME:Byte = 4;</code>
 
| <code>STMPE_SAMPLE_TIME:Byte = 4;</code>
| style="width: 65%;"|
+
| style="width: 40%;"|
 
|-
 
|-
 
|}
 
|}
Line 1,832: Line 2,044:
 
|-
 
|-
 
| <code>STMPE_MOD_12B:Byte = 1;</code>
 
| <code>STMPE_MOD_12B:Byte = 1;</code>
| style="width: 65%;"|
+
| style="width: 40%;"|
 
|-
 
|-
 
|}
 
|}
Line 1,838: Line 2,050:
 
|-
 
|-
 
| <code>STMPE_REF_SEL:Byte = 0;</code>
 
| <code>STMPE_REF_SEL:Byte = 0;</code>
| style="width: 65%;"|
+
| style="width: 40%;"|
 
|-
 
|-
 
|}
 
|}
Line 1,844: Line 2,056:
 
|-
 
|-
 
| <code>STMPE_ADC_FREQ:Byte = 2;</code>
 
| <code>STMPE_ADC_FREQ:Byte = 2;</code>
| style="width: 65%;"|
+
| style="width: 40%;"|
 
|-
 
|-
 
|}
 
|}
Line 1,850: Line 2,062:
 
|-
 
|-
 
| <code>STMPE_AVE_CTRL:Byte = 3;</code>
 
| <code>STMPE_AVE_CTRL:Byte = 3;</code>
| style="width: 65%;"|
+
| style="width: 40%;"|
 
|-
 
|-
 
|}
 
|}
Line 1,856: Line 2,068:
 
|-
 
|-
 
| <code>STMPE_TOUCH_DET_DELAY:Byte = 4;</code>
 
| <code>STMPE_TOUCH_DET_DELAY:Byte = 4;</code>
| style="width: 65%;"|
+
| style="width: 40%;"|
 
|-
 
|-
 
|}
 
|}
Line 1,862: Line 2,074:
 
|-
 
|-
 
| <code>STMPE_SETTLING:Byte = 2;</code>
 
| <code>STMPE_SETTLING:Byte = 2;</code>
| style="width: 65%;"|
+
| style="width: 40%;"|
 
|-
 
|-
 
|}
 
|}
Line 1,868: Line 2,080:
 
|-
 
|-
 
| <code>STMPE_FRACTION_Z:Byte = 7;</code>
 
| <code>STMPE_FRACTION_Z:Byte = 7;</code>
| style="width: 65%;"|
+
| style="width: 40%;"|
 
|-
 
|-
 
|}
 
|}
Line 1,874: Line 2,086:
 
|-
 
|-
 
| <code>STMPE_I_DRIVE:Byte = 0;</code>
 
| <code>STMPE_I_DRIVE:Byte = 0;</code>
| style="width: 65%;"|
+
| style="width: 40%;"|
 
|-
 
|-
 
|}
 
|}
Line 1,891: Line 2,103:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Called internally by other functions
 
| Called internally by other functions
 
|-
 
|-
Line 1,906: Line 2,118:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''I2C'''
+
! I2C
 
| The I2C device this STMPE610 is connected to (Optional)
 
| The I2C device this STMPE610 is connected to (Optional)
 
|-
 
|-
! '''SPI'''
+
! SPI
 
| The SPI device this STMPE610 is connected to (Optional)
 
| The SPI device this STMPE610 is connected to (Optional)
 
|-
 
|-
! '''Address'''
+
! Address
 
| The I2C address for this STMPE610 (or I2C_ADDRESS_INVALID if SPI connected)
 
| The I2C address for this STMPE610 (or I2C_ADDRESS_INVALID if SPI connected)
 
|-
 
|-
! '''ChipSelect'''
+
! ChipSelect
 
| The SPI chip select for this STMPE610 (or SPI_CS_NONE if I2C connected)
 
| The SPI chip select for this STMPE610 (or SPI_CS_NONE if I2C connected)
 
|-
 
|-
! '''IRQ'''
+
! IRQ
 
| The GPIO information for the IRQ line (Optional)
 
| The GPIO information for the IRQ line (Optional)
 
|-
 
|-
! '''Return'''
+
! Return
 
| Pointer to the new GPIO device or nil on failure
 
| Pointer to the new GPIO device or nil on failure
 
|-
 
|-
! '''Note'''
+
! Note
 
| Either I2C or SPI must be specified but not both
 
| Either I2C or SPI must be specified but not both
 
|-
 
|-
Line 1,936: Line 2,148:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''I2C'''
+
! I2C
 
| The I2C device this STMPE801 is connected to
 
| The I2C device this STMPE801 is connected to
 
|-
 
|-
! '''Address'''
+
! Address
 
| The I2C address for this STMPE801
 
| The I2C address for this STMPE801
 
|-
 
|-
! '''IRQ'''
+
! IRQ
 
| The GPIO information for the IRQ line (Optional)
 
| The GPIO information for the IRQ line (Optional)
 
|-
 
|-
! '''Return'''
+
! Return
 
| Pointer to the new GPIO device or nil on failure
 
| Pointer to the new GPIO device or nil on failure
 
|-
 
|-
Line 1,957: Line 2,169:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''I2C'''
+
! I2C
 
| The I2C device this STMPE811 is connected to (Optional)
 
| The I2C device this STMPE811 is connected to (Optional)
 
|-
 
|-
! '''SPI'''
+
! SPI
 
| The SPI device this STMPE811 is connected to (Optional)
 
| The SPI device this STMPE811 is connected to (Optional)
 
|-
 
|-
! '''Address'''
+
! Address
 
| The I2C address for this STMPE811 (or I2C_ADDRESS_INVALID if SPI connected)
 
| The I2C address for this STMPE811 (or I2C_ADDRESS_INVALID if SPI connected)
 
|-
 
|-
! '''ChipSelect'''
+
! ChipSelect
 
| The SPI chip select for this STMPE811 (or SPI_CS_NONE if I2C connected)
 
| The SPI chip select for this STMPE811 (or SPI_CS_NONE if I2C connected)
 
|-
 
|-
! '''IRQ'''
+
! IRQ
 
| The GPIO information for the IRQ line (Optional)
 
| The GPIO information for the IRQ line (Optional)
 
|-
 
|-
! '''Return'''
+
! Return
 
| Pointer to the new GPIO device or nil on failure
 
| Pointer to the new GPIO device or nil on failure
 
|-
 
|-
! '''Note'''
+
! Note
 
| Either I2C or SPI must be specified but not both
 
| Either I2C or SPI must be specified but not both
 
|-
 
|-
Line 1,987: Line 2,199:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''I2C'''
+
! 2C
 
| The I2C device this STMPE1601 is connected to
 
| The I2C device this STMPE1601 is connected to
 
|-
 
|-
! '''Address'''
+
! Address
 
| The I2C address for this STMPE1601
 
| The I2C address for this STMPE1601
 
|-
 
|-
! '''IRQ'''
+
! IRQ
 
| The GPIO information for the IRQ line (Optional)
 
| The GPIO information for the IRQ line (Optional)
 
|-
 
|-
! '''Return'''
+
! Return
 
| Pointer to the new GPIO device or nil on failure
 
| Pointer to the new GPIO device or nil on failure
 
|-
 
|-
Line 2,008: Line 2,220:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''I2C'''
+
! I2C
 
| The I2C device this STMPE1801 is connected to
 
| The I2C device this STMPE1801 is connected to
 
|-
 
|-
! '''Address'''
+
! Address
 
| The I2C address for this STMPE1801
 
| The I2C address for this STMPE1801
 
|-
 
|-
! '''IRQ'''
+
! IRQ
 
| The GPIO information for the IRQ line (Optional)
 
| The GPIO information for the IRQ line (Optional)
 
|-
 
|-
! '''Return'''
+
! Return
 
| Pointer to the new GPIO device or nil on failure
 
| Pointer to the new GPIO device or nil on failure
 
|-
 
|-
Line 2,029: Line 2,241:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''I2C'''
+
! I2C
 
| The I2C device this STMPE2401 is connected to
 
| The I2C device this STMPE2401 is connected to
 
|-
 
|-
! '''Address'''
+
! Address
 
| The I2C address for this STMPE2401
 
| The I2C address for this STMPE2401
 
|-
 
|-
! '''IRQ'''
+
! IRQ
 
| The GPIO information for the IRQ line (Optional)
 
| The GPIO information for the IRQ line (Optional)
 
|-
 
|-
! '''Return'''
+
! Return
 
| Pointer to the new GPIO device or nil on failure
 
| Pointer to the new GPIO device or nil on failure
 
|-
 
|-
Line 2,050: Line 2,262:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''GPIO'''
+
! GPIO
 
| The GPIO device to destroy
 
| The GPIO device to destroy
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
Line 2,065: Line 2,277:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''I2C'''
+
! I2C
 
| The I2C device this STMPE610 is connected to (Optional)
 
| The I2C device this STMPE610 is connected to (Optional)
 
|-
 
|-
! '''SPI'''
+
! SPI
 
| The SPI device this STMPE610 is connected to (Optional)
 
| The SPI device this STMPE610 is connected to (Optional)
 
|-
 
|-
! '''Address'''
+
! Address
 
| The I2C address for this STMPE610 (or I2C_ADDRESS_INVALID if SPI connected)
 
| The I2C address for this STMPE610 (or I2C_ADDRESS_INVALID if SPI connected)
 
|-
 
|-
! '''ChipSelect'''
+
! ChipSelect
 
| The SPI chip select for this STMPE610 (or SPI_CS_NONE if I2C connected)
 
| The SPI chip select for this STMPE610 (or SPI_CS_NONE if I2C connected)
 
|-
 
|-
! '''Width'''
+
! Width
 
| The width of the screen in pixels
 
| The width of the screen in pixels
 
|-
 
|-
! '''Height'''
+
! Height
 
| The height of the screen in pixels
 
| The height of the screen in pixels
 
|-
 
|-
! '''IRQ'''
+
! IRQ
 
| The GPIO information for the IRQ line (Optional)
 
| The GPIO information for the IRQ line (Optional)
 
|-
 
|-
! '''Return'''
+
! Return
 
| Pointer to the new Touch device or nil on failure
 
| Pointer to the new Touch device or nil on failure
 
|-
 
|-
! '''Note'''
+
! Note
 
| Either I2C or SPI must be specified but not both
 
| Either I2C or SPI must be specified but not both
 
|-
 
|-
Line 2,101: Line 2,313:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''I2C'''
+
! I2C
 
| The I2C device this STMPE811 is connected to (Optional)
 
| The I2C device this STMPE811 is connected to (Optional)
 
|-
 
|-
! '''SPI'''
+
! SPI
 
| The SPI device this STMPE811 is connected to (Optional)
 
| The SPI device this STMPE811 is connected to (Optional)
 
|-
 
|-
! '''Address'''
+
! Address
 
| The I2C address for this STMPE811 (or I2C_ADDRESS_INVALID if SPI connected)
 
| The I2C address for this STMPE811 (or I2C_ADDRESS_INVALID if SPI connected)
 
|-
 
|-
! '''ChipSelect'''
+
! ChipSelect
 
| The SPI chip select for this STMPE811 (or SPI_CS_NONE if I2C connected)
 
| The SPI chip select for this STMPE811 (or SPI_CS_NONE if I2C connected)
 
|-
 
|-
! '''Width'''
+
! Width
 
| The width of the screen in pixels
 
| The width of the screen in pixels
 
|-
 
|-
! '''Height'''
+
! Height
 
| The height of the screen in pixels
 
| The height of the screen in pixels
 
|-
 
|-
! '''IRQ'''
+
! IRQ
 
| The GPIO information for the IRQ line (Optional)
 
| The GPIO information for the IRQ line (Optional)
 
|-
 
|-
! '''Return'''
+
! Return
 
| Pointer to the new Touch device or nil on failure
 
| Pointer to the new Touch device or nil on failure
 
|-
 
|-
! '''Note'''
+
! Note
 
| Either I2C or SPI must be specified but not both
 
| Either I2C or SPI must be specified but not both
 
|-
 
|-
Line 2,137: Line 2,349:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Touch'''
+
! Touch
 
| The Touch device to destroy
 
| The Touch device to destroy
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
Line 2,155: Line 2,367:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Not intended to be called directly by applications, use GPIODeviceStart instead
+
| Not intended to be called directly by applications, use GPIODeviceStart instead.
 
|-
 
|-
 
|}
 
|}
Line 2,167: Line 2,379:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Not intended to be called directly by applications, use GPIODeviceStop instead
+
| Not intended to be called directly by applications, use GPIODeviceStop instead.
 
|-
 
|-
 
|}
 
|}
Line 2,179: Line 2,391:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Not intended to be called directly by applications, use GPIODeviceRead instead
+
| Not intended to be called directly by applications, use GPIODeviceRead instead.
 
|-
 
|-
 
|}
 
|}
Line 2,191: Line 2,403:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Not intended to be called directly by applications, use GPIODeviceWrite instead
+
| Not intended to be called directly by applications, use GPIODeviceWrite instead.
 
|-
 
|-
 
|}
 
|}
Line 2,203: Line 2,415:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Not intended to be called directly by applications, use GPIODeviceInputGet instead
+
| Not intended to be called directly by applications, use GPIODeviceInputGet instead.
 
|-
 
|-
 
|}
 
|}
Line 2,215: Line 2,427:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Not intended to be called directly by applications, use GPIODeviceOutputSet instead
+
| Not intended to be called directly by applications, use GPIODeviceOutputSet instead.
 
|-
 
|-
 
|}
 
|}
Line 2,227: Line 2,439:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Not intended to be called directly by applications, use GPIODevicePullGet instead
+
| Not intended to be called directly by applications, use GPIODevicePullGet instead.
 
|-
 
|-
 
|}
 
|}
Line 2,239: Line 2,451:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Not intended to be called directly by applications, use GPIODevicePullSelect instead
+
| Not intended to be called directly by applications, use GPIODevicePullSelect instead.
 
|-
 
|-
 
|}
 
|}
Line 2,251: Line 2,463:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Not intended to be called directly by applications, use GPIODeviceFunctionGet instead
+
| Not intended to be called directly by applications, use GPIODeviceFunctionGet instead.
 
|-
 
|-
 
|}
 
|}
Line 2,263: Line 2,475:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Not intended to be called directly by applications, use GPIODeviceFunctionSelect instead
+
| Not intended to be called directly by applications, use GPIODeviceFunctionSelect instead.
 
|-
 
|-
 
|}
 
|}
Line 2,278: Line 2,490:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Not intended to be called directly by applications, use TouchDeviceStart instead
+
| Not intended to be called directly by applications, use TouchDeviceStart instead.
 
|-
 
|-
 
|}
 
|}
Line 2,290: Line 2,502:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Not intended to be called directly by applications, use TouchDeviceStop instead
+
| Not intended to be called directly by applications, use TouchDeviceStop 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 STMPETouchUpdate(Touch:PTouchDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of TouchDeviceUpdate 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 TouchDeviceUpdate instead.
 
|-
 
|-
 
|}
 
|}
Line 2,302: Line 2,526:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Not intended to be called directly by applications
 
| Not intended to be called directly by applications
 
|-
 
|-
Line 2,314: Line 2,538:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Not intended to be called directly by applications
 
| Not intended to be called directly by applications
 
|-
 
|-
Line 2,329: Line 2,553:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 2,341: Line 2,565:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 2,353: Line 2,577:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 2,365: Line 2,589:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 2,377: Line 2,601:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 2,389: Line 2,613:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 2,401: Line 2,625:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 2,413: Line 2,637:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-

Latest revision as of 05:39, 13 September 2022

Return to Unit Reference


Description


ST Microelectronics STMPE Driver unit

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



[Expand]
STMPE specific constants STMPE*_*


[Expand]
STMPE chip STMPE_CHIP_*


[Expand]
STMPE direction STMPE_DIR_*


[Expand]
STMPE I2C STMPE_I2C_*


[Expand]
STMPE SPI STMPE_SPI_*


[Expand]
STMPE register STMPE*_REG_*


[Expand]
STMPE Id STMPE*_CHIP_ID


[Expand]
STMPE system control STMPE*_SYS_CTRL*_*


[Expand]
STMPE touchscreen control STMPE*_TSC_CTRL_*


[Expand]
STMPE touchscreen configuration STMPE*_TSC_CFG_*


[Expand]
STMPE ADC control 1 STMPE*_ADC_CTRL1_*


[Expand]
STMPE ADC control 2 STMPE*_ADC_CTRL2_*


[Expand]
STMPE FIFO control and status STMPE*_FIFO_STA_*


[Expand]
STMPE interrupt control STMPE*_INT_CTRL_*


[Expand]
STMPE interrupt enable STMPE*_INT_EN_*


[Expand]
STMPE interrupt status STMPE*_INT_STA_*


[Expand]
STMPE offset STMPE*Offsets*


Type definitions



STMPE control

[Expand]

PSTMPEControl = ^TSTMPEControl;

TSTMPEControl = record

STMPE offsets

[Expand]

PSTMPEOffsets = ^TSTMPEOffsets;

TSTMPEOffsets = record

STMPE GPIO

[Expand]

PSTMPEGPIO = ^TSTMPEGPIO;

TSTMPEGPIO = record

STMPE touch

[Expand]

PSTMPETouch = ^TSTMPETouch;

TSTMPETouch = record


Public variables



STMPE specific variables

STMPE_SAMPLE_TIME:Byte = 4;
STMPE_MOD_12B:Byte = 1;
STMPE_REF_SEL:Byte = 0;
STMPE_ADC_FREQ:Byte = 2;
STMPE_AVE_CTRL:Byte = 3;
STMPE_TOUCH_DET_DELAY:Byte = 4;
STMPE_SETTLING:Byte = 2;
STMPE_FRACTION_Z:Byte = 7;
STMPE_I_DRIVE:Byte = 0;


Function declarations



Initialization functions

[Expand]
procedure STMPEInit;
Description: Initialize the STMPE unit and parameters


STMPE functions

[Expand]
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


[Expand]
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


[Expand]
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


[Expand]
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


[Expand]
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


[Expand]
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


[Expand]
function STMPEGPIODestroy(GPIO:PGPIODevice):LongWord;
Description: Stop, deregister and destroy an STMPE GPIO device created by this driver


[Expand]
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


[Expand]
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


[Expand]
function STMPETouchDestroy(Touch:PTouchDevice):LongWord;
Description: Stop, deregister and destroy an STMPE Touch device created by this driver


STMPE GPIO functions

[Expand]
function STMPEGPIOStart(GPIO:PGPIODevice):LongWord;
Description: Implementation of GPIODeviceStart API for STMPE


[Expand]
function STMPEGPIOStop(GPIO:PGPIODevice):LongWord;
Description: Implementation of GPIODeviceStop API for STMPE


[Expand]
function STMPEGPIORead(GPIO:PGPIODevice; Reg:LongWord):LongWord;
Description: Implementation of GPIODeviceRead API for STMPE


[Expand]
procedure STMPEGPIOWrite(GPIO:PGPIODevice; Reg,Value:LongWord);
Description: Implementation of GPIODeviceWrite API for STMPE


[Expand]
function STMPEGPIOInputGet(GPIO:PGPIODevice; Pin:LongWord):LongWord;
Description: Implementation of GPIODeviceInputGet API for STMPE


[Expand]
function STMPEGPIOOutputSet(GPIO:PGPIODevice; Pin,Level:LongWord):LongWord;
Description: Implementation of GPIODeviceOutputSet API for STMPE


[Expand]
function STMPEGPIOPullGet(GPIO:PGPIODevice; Pin:LongWord):LongWord;
Description: Implementation of GPIODevicePullGet API for STMPE


[Expand]
function STMPEGPIOPullSelect(GPIO:PGPIODevice; Pin,Mode:LongWord):LongWord;
Description: Implementation of GPIODevicePullSelect API for STMPE


[Expand]
function STMPEGPIOFunctionGet(GPIO:PGPIODevice; Pin:LongWord):LongWord;
Description: Implementation of GPIODeviceFunctionGet API for STMPE


[Expand]
function STMPEGPIOFunctionSelect(GPIO:PGPIODevice; Pin,Mode:LongWord):LongWord;
Description: Implementation of GPIODeviceFunctionSelect API for STMPE


STMPE touch functions

[Expand]
function STMPETouchStart(Touch:PTouchDevice):LongWord;
Description: Implementation of TouchDeviceStart API for STMPE


[Expand]
function STMPETouchStop(Touch:PTouchDevice):LongWord;
Description: Implementation of TouchDeviceStop API for STMPE


[Expand]
function STMPETouchUpdate(Touch:PTouchDevice):LongWord;
Description: Implementation of TouchDeviceUpdate API for STMPE


[Expand]
procedure STMPETouchTimer(Touch:PSTMPETouch);
Description: Touch device timer event handler for STMPE


[Expand]
procedure STMPETouchCallback(Touch:PSTMPETouch; Pin,Trigger:LongWord);
Description: Touch device event callback (Interrupt) handler for STMPE


STMPE helper functions

[Expand]
function STMPEReadByte(Control:PSTMPEControl; Reg:Byte; Value:PByte):LongWord;
Description: To be documented


[Expand]
function STMPEWriteByte(Control:PSTMPEControl; Reg,Value:Byte):LongWord;
Description: To be documented


[Expand]
function STMPEReadWord(Control:PSTMPEControl; Reg:Byte; Value:PWord):LongWord;
Description: To be documented


[Expand]
function STMPEWriteWord(Control:PSTMPEControl; Reg:Byte; Value:Word):LongWord;
Description: To be documented


[Expand]
function STMPEReadBytes(Control:PSTMPEControl; Reg,Len:Byte; Values:PByte):LongWord;
Description: To be documented


[Expand]
function STMPEWriteBytes(Control:PSTMPEControl; Reg,Len:Byte; Values:PByte):LongWord;
Description: To be documented


[Expand]
function STMPESetBits(Control:PSTMPEControl; Reg,Mask,Value:Byte):LongWord;
Description: To be documented


[Expand]
function STMPEResetFIFO(Control:PSTMPEControl; Reg:Byte):LongWord;
Description: To be documented


Return to Unit Reference