Difference between revisions of "Unit STMPE"

From Ultibo.org
Jump to: navigation, search
Line 26: Line 26:
 
----
 
----
  
''To be documented''
+
 
 +
<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 specific constants''' <code> STMPE*_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>STMPE610_GPIO_DESCRIPTION = 'STMicroelectronics STMPE610 I/O Expander';</code>
 +
| Description of STMPE610 GPIO device
 +
|-
 +
| <code>STMPE801_GPIO_DESCRIPTION = 'STMicroelectronics STMPE801 I/O Expander';</code>
 +
| Description of STMPE801 GPIO device
 +
|-
 +
| <code>STMPE811_GPIO_DESCRIPTION = 'STMicroelectronics STMPE811 I/O Expander';</code>
 +
| Description of STMPE811 GPIO device
 +
|-
 +
| <code>STMPE1601_GPIO_DESCRIPTION = 'STMicroelectronics STMPE1601 I/O Expander';</code>
 +
| Description of STMPE1601 GPIO device
 +
|-
 +
| <code>STMPE1801_GPIO_DESCRIPTION = 'STMicroelectronics STMPE1801 I/O Expander';</code>
 +
| Description of STMPE1801 GPIO device
 +
|-
 +
| <code>STMPE2401_GPIO_DESCRIPTION = 'STMicroelectronics STMPE2401 I/O Expander';</code>
 +
| Description of STMPE2401 GPIO device
 +
|-
 +
| <code>STMPE2403_GPIO_DESCRIPTION = 'STMicroelectronics STMPE2403 I/O Expander';</code>
 +
| Description of STMPE2403 GPIO device
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE610_TOUCH_DESCRIPTION = 'STMicroelectronics STMPE610 Touch Controller';</code>
 +
| Description of STMPE610 Touch device
 +
|-
 +
| <code>STMPE811_TOUCH_DESCRIPTION = 'STMicroelectronics STMPE811 Touch Controller';</code>
 +
| Description of STMPE811 Touch device
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE610_GPIO_MIN_PIN = GPIO_PIN_2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE610_GPIO_MAX_PIN = GPIO_PIN_7;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE610_GPIO_PIN_COUNT = 6;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE801_GPIO_MIN_PIN = GPIO_PIN_0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE801_GPIO_MAX_PIN = GPIO_PIN_7;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE801_GPIO_PIN_COUNT = 8;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE811_GPIO_MIN_PIN = GPIO_PIN_0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE811_GPIO_MAX_PIN = GPIO_PIN_7;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE811_GPIO_PIN_COUNT = 8;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE1601_GPIO_MIN_PIN = GPIO_PIN_0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1601_GPIO_MAX_PIN = GPIO_PIN_15;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1601_GPIO_PIN_COUNT = 16;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE1801_GPIO_MIN_PIN = GPIO_PIN_0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_GPIO_MAX_PIN = GPIO_PIN_17;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_GPIO_PIN_COUNT = 18;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE240X_GPIO_MIN_PIN = GPIO_PIN_0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_GPIO_MAX_PIN = GPIO_PIN_23;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_GPIO_PIN_COUNT = 24;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE_GPIO_MAX_LEVEL = GPIO_LEVEL_HIGH;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE_GPIO_MAX_PULL = GPIO_PULL_DOWN;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE610_GPIO_MIN_FUNCTION = GPIO_FUNCTION_IN;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE610_GPIO_MAX_FUNCTION = GPIO_FUNCTION_ALT0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE610_GPIO_FUNCTION_COUNT = 3;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE801_GPIO_MIN_FUNCTION = GPIO_FUNCTION_IN;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE801_GPIO_MAX_FUNCTION = GPIO_FUNCTION_OUT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE801_GPIO_FUNCTION_COUNT = 2;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE811_GPIO_MIN_FUNCTION = GPIO_FUNCTION_IN;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE811_GPIO_MAX_FUNCTION = GPIO_FUNCTION_ALT0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE811_GPIO_FUNCTION_COUNT = 3;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE1601_GPIO_MIN_FUNCTION = GPIO_FUNCTION_IN;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1601_GPIO_MAX_FUNCTION = GPIO_FUNCTION_ALT1;</code>
 +
| Alternate function 0 = Keypad / Alternate function 1 = PWM
 +
|-
 +
| <code>STMPE1601_GPIO_FUNCTION_COUNT = 4;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE1801_GPIO_MIN_FUNCTION = GPIO_FUNCTION_IN;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_GPIO_MAX_FUNCTION = GPIO_FUNCTION_ALT0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_GPIO_FUNCTION_COUNT = 3;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE240X_GPIO_MIN_FUNCTION = GPIO_FUNCTION_IN;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_GPIO_MAX_FUNCTION = GPIO_FUNCTION_ALT2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_GPIO_FUNCTION_COUNT = 5;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE610_MAX_POINTS = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE610_MAX_X = $FFF;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE610_MAX_Y = $FFF;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE610_MAX_Z = $FF;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE811_MAX_POINTS = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE811_MAX_X = $FFF;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE811_MAX_Y = $FFF;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE811_MAX_Z = $FF;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<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 class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>STMPE_CHIP_STMPE610 = 1;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>STMPE_CHIP_STMPE801 = 2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE_CHIP_STMPE801 = 2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE_CHIP_STMPE811 = 3;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE_CHIP_STMPE1601 = 4;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE_CHIP_STMPE1801 = 5;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE_CHIP_STMPE2401 = 6;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE_CHIP_STMPE2403 = 7;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<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 class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>STMPE_DIR_ASCENDING = 0;</code>
 +
| Register addresses in ascending order (Bits go from LSB to MSB)
 +
|-
 +
| <code>STMPE_DIR_DESCENDING = 1;</code>
 +
| Register addresses in descending order (Bits go from MSB to LSB)
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<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 class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>STMPE_I2C_RATE = 400000;</code>
 +
| Default I2C clock rate (Device supports 100KHz and 400KHz)
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<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 class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>STMPE_SPI_RATE = 500000;</code>
 +
| Default SPI clock rate (Device supports up to 1MHz)
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE_SPI_READ_CMD = (1 shl 7);</code>
 +
| First bit of address must be set for a read
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<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 class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''STMPE610 / STMPE811''
 +
|-
 +
| <code>STMPE811_REG_CHIP_ID = $00;</code>
 +
| Device identification
 +
|-
 +
| <code>STMPE811_REG_ID_VER = $02;</code>
 +
| Revision number (0x01 for engineering sample / 0x03 for final silicon)
 +
|-
 +
| <code>STMPE811_REG_SYS_CTRL1 = $03;</code>
 +
| Reset control
 +
|-
 +
| <code>STMPE811_REG_SYS_CTRL2 = $04;</code>
 +
| Clock control
 +
|-
 +
| <code>STMPE811_REG_SPI_CFG = $08;</code>
 +
| SPI interface configuration
 +
|-
 +
| <code>STMPE811_REG_INT_CTRL = $09;</code>
 +
| Interrupt control register
 +
|-
 +
| <code>STMPE811_REG_INT_EN = $0A;</code>
 +
| Interrupt enable register
 +
|-
 +
| <code>STMPE811_REG_INT_STA = $0B;</code>
 +
| Interrupt status register
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE811_REG_GPIO_INT_EN = $0C;</code>
 +
| GPIO interrupt enable register
 +
|-
 +
| <code>STMPE811_REG_GPIO_INT_STA = $0D;</code>
 +
| GPIO interrupt status register
 +
|-
 +
| <code>STMPE811_REG_ADC_INT_EN = $0E;</code>
 +
| ADC interrupt enable register
 +
|-
 +
| <code>STMPE811_REG_ADC_INT_STA = $0F;</code>
 +
| ADC interrupt status register
 +
|-
 +
| <code>STMPE811_REG_GPIO_SET_PIN = $10;</code>
 +
| GPIO set pin register
 +
|-
 +
| <code>STMPE811_REG_GPIO_CLR_PIN = $11;</code>
 +
| GPIO clear pin register
 +
|-
 +
| <code>STMPE811_REG_GPIO_MP_STA = $12;</code>
 +
| GPIO monitor pin state register
 +
|-
 +
| <code>STMPE811_REG_GPIO_SET_DIR = $13;</code>
 +
| GPIO direction register
 +
|-
 +
| <code>STMPE811_REG_GPIO_ED = $14;</code>
 +
| GPIO edge detect register
 +
|-
 +
| <code>STMPE811_REG_GPIO_RE = $15;</code>
 +
| GPIO rising edge register
 +
|-
 +
| <code>STMPE811_REG_GPIO_FE = $16;</code>
 +
| GPIO falling edge register
 +
|-
 +
| <code>STMPE811_REG_GPIO_AF = $17;</code>
 +
| Alternate function register
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE811_REG_ADC_CTRL1 = $20;</code>
 +
| ADC control
 +
|-
 +
| <code>STMPE811_REG_ADC_CTRL2 = $21;</code>
 +
| ADC control
 +
|-
 +
| <code>STMPE811_REG_ADC_CAPT = $22;</code>
 +
| To initiate ADC data acquisition
 +
|-
 +
| <code>STMPE811_REG_ADC_DATA_CH0 = $30;</code>
 +
| ADC channel 0
 +
|-
 +
| <code>STMPE811_REG_ADC_DATA_CH1 = $32;</code>
 +
| ADC channel 1
 +
|-
 +
| <code>STMPE811_REG_ADC_DATA_CH2 = $34;</code>
 +
| ADC channel 2
 +
|-
 +
| <code>STMPE811_REG_ADC_DATA_CH3 = $36;</code>
 +
| ADC channel 3
 +
|-
 +
| <code>STMPE811_REG_ADC_DATA_CH4 = $38;</code>
 +
| ADC channel 4
 +
|-
 +
| <code>STMPE811_REG_ADC_DATA_CH5 = $3A;</code>
 +
| ADC channel 5
 +
|-
 +
| <code>STMPE811_REG_ADC_DATA_CH6 = $3C;</code>
 +
| ADC channel 6
 +
|-
 +
| <code>STMPE811_REG_ADC_DATA_CH7 = $3E;</code>
 +
| ADC channel 7
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE811_REG_TSC_CTRL = $40;</code>
 +
| 4-wire touchscreen controller setup
 +
|-
 +
| <code>STMPE811_REG_TSC_CFG = $41;</code>
 +
| Touchscreen controller configuration
 +
|-
 +
| <code>STMPE811_REG_WDW_TR_X = $42;</code>
 +
| Window setup for top right X
 +
|-
 +
| <code>STMPE811_REG_WDW_TR_Y = $44;</code>
 +
| Window setup for top right Y
 +
|-
 +
| <code>STMPE811_REG_WDW_BL_X = $46;</code>
 +
| Window setup for bottom left X
 +
|-
 +
| <code>STMPE811_REG_WDW_BL_Y = $48;</code>
 +
| Window setup for bottom left Y
 +
|-
 +
| <code>STMPE811_REG_FIFO_TH = $4A;</code>
 +
| FIFO level to generate interrupt
 +
|-
 +
| <code>STMPE811_REG_FIFO_STA = $4B;</code>
 +
| Current status of FIFO
 +
|-
 +
| <code>STMPE811_REG_FIFO_SIZE = $4C;</code>
 +
| Current filled level of FIFO
 +
|-
 +
| <code>STMPE811_REG_TSC_DATA_X = $4D;</code>
 +
| Data port for touchscreen controller data access
 +
|-
 +
| <code>STMPE811_REG_TSC_DATA_Y = $4F;</code>
 +
| Data port for touchscreen controller data access
 +
|-
 +
| <code>STMPE811_REG_TSC_DATA_Z = $51;</code>
 +
| Data port for touchscreen controller data access
 +
|-
 +
| <code>STMPE811_REG_TSC_DATA_XYZ = $52;</code>
 +
| Data port for touchscreen controller data access
 +
|-
 +
| <code>STMPE811_REG_TSC_FRACTION_Z = $56;</code>
 +
| Touchscreen controller FRACTION_Z
 +
|-
 +
| <code>STMPE811_REG_TSC_DATA = $57;</code>
 +
| Data port for touchscreen controller data access
 +
|-
 +
| <code>STMPE811_REG_TSC_I_DRIVE = $58;</code>
 +
| Touchscreen controller drive I
 +
|-
 +
| <code>STMPE811_REG_TSC_SHIELD = $59;</code>
 +
| Touchscreen controller shield
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''STMPE811''
 +
|-
 +
| <code>STMPE811_REG_TEMP_CTRL= $60;</code>
 +
| Temperature sensor setup
 +
|-
 +
| <code>STMPE811_REG_TEMP_DATA = $61;</code>
 +
| Temperature data access port
 +
|-
 +
| <code>STMPE811_REG_TEMP_TH = $62;</code>
 +
| Threshold for temperature controlled interrupt
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE811_REG_MAX = $62;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE811_REG_SIZE = 1;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''STMPE801''
 +
|-
 +
| <code>STMPE801_REG_CHIP_ID = $00;</code>
 +
| Device identification
 +
|-
 +
| <code>STMPE801_REG_ID_VER = $02;</code>
 +
| Revision number (0x01 for engineering sample / 0x02 for final silicon)
 +
|-
 +
| <code>STMPE801_REG_SYS_CTRL = $04;</code>
 +
| Reset and interrupt control
 +
|-
 +
| <code>STMPE801_REG_GPIO_INT_EN = $08;</code>
 +
| GPIO interrupt enable register
 +
|-
 +
| <code>STMPE801_REG_GPIO_INT_STA = $09;</code>
 +
| GPIO interrupt status register
 +
|-
 +
| <code>STMPE801_REG_GPIO_MP_STA = $10;</code>
 +
| GPIO monitor pin state register
 +
|-
 +
| <code>STMPE801_REG_GPIO_SET_PIN = $11;</code>
 +
| GPIO set pin state register
 +
|-
 +
| <code>STMPE801_REG_GPIO_SET_DIR = $12;</code>
 +
| GPIO set pin direction register
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE801_REG_MAX = $12;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE801_REG_SIZE = 1;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''STMPE1601''
 +
|-
 +
| <code>STMPE1601_REG_CHIP_ID = $80;</code>
 +
| Device identification
 +
|-
 +
| <code>STMPE1601_REG_ID_VER = $81;</code>
 +
| Revision number
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE1601_REG_SYS_CTRL = $02;</code>
 +
| System control register
 +
|-
 +
| <code>STMPE1601_REG_SYS_CTRL2 = $03;</code>
 +
| System control register 2
 +
|-
 +
| <code>STMPE1601_REG_INT_CTRL_MSB = $10;</code>
 +
| Interrupt control register
 +
|-
 +
| <code>STMPE1601_REG_INT_CTRL_LSB = $11;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1601_REG_INT_EN_MSB = $12;</code>
 +
| Interrupt enable mask register
 +
|-
 +
| <code>STMPE1601_REG_INT_EN_LSB = $13;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1601_REG_INT_STA_MSB = $14;</code>
 +
| Interrupt status register
 +
|-
 +
| <code>STMPE1601_REG_INT_STA_LSB = $15;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE1601_REG_GPIO_INT_EN_MSB  = $16;</code>
 +
| Interrupt enable GPIO mask register
 +
|-
 +
| <code>STMPE1601_REG_GPIO_INT_EN_LSB = $17;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1601_REG_GPIO_INT_STA_MSB = $18;</code>
 +
| Interrupt status GPIO register
 +
|-
 +
| <code>STMPE1601_REG_GPIO_INT_STA_LSB = $19;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE1601_REG_GPIO_SET_PIN_MSB = $82;</code>
 +
| GPIO set pin state register
 +
|-
 +
| <code>STMPE1601_REG_GPIO_SET_PIN_LSB = $83;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1601_REG_GPIO_CLR_PIN_MSB = $84;</code>
 +
| GPIO clear pin state register
 +
|-
 +
| <code>STMPE1601_REG_GPIO_CLR_PIN_LSB = $85; </code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1601_REG_GPIO_MP_STA_MSB = $86;</code>
 +
| GPIO monitor pin state register
 +
|-
 +
| <code>STMPE1601_REG_GPIO_MP_STA_LSB = $87;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1601_REG_GPIO_SET_DIR_MSB = $88;</code>
 +
| GPIO set pin direction register
 +
|-
 +
| <code>STMPE1601_REG_GPIO_SET_DIR_LSB = $89;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE1601_REG_GPIO_ED_MSB = $8A;</code>
 +
| GPIO edge detect status register
 +
|-
 +
| <code>STMPE1601_REG_GPIO_ED_LSB = $8B;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1601_REG_GPIO_RE_MSB = $8C;</code>
 +
| GPIO rising edge register
 +
|-
 +
| <code>STMPE1601_REG_GPIO_RE_LSB = $8D;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1601_REG_GPIO_FE_MSB = $8E;</code>
 +
| GPIO falling edge register
 +
|-
 +
| <code>STMPE1601_REG_GPIO_FE_LSB = $8F;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1601_REG_GPIO_PU_MSB = $90;</code>
 +
| GPIO pull up register
 +
|-
 +
| <code>STMPE1601_REG_GPIO_PU_LSB = $91;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1601_REG_GPIO_AF_U_MSB = $92;</code>
 +
| GPIO alternate function register (upper word)
 +
|-
 +
| <code>STMPE1601_REG_GPIO_AF_U_LSB = $93;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1601_REG_GPIO_AF_L_MSB = $94;</code>
 +
| GPIO alternate function register (lower word)
 +
|-
 +
| <code>STMPE1601_REG_GPIO_AF_L_LSB = $95;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE1601_REG_GPIO_LT_EN = $96;</code>
 +
| GPIO level translator enable
 +
|-
 +
| <code>STMPE1601_REG_GPIO_LT_DIR = $97;</code>
 +
| GPIO level translator direction
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE1601_REG_MAX = $BF;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1601_REG_SIZE = 2;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''STMPE1801''
 +
|-
 +
| <code>STMPE1801_REG_CHIP_ID = $00;</code>
 +
| Device identification
 +
|-
 +
| <code>STMPE1801_REG_ID_VER = $01;</code>
 +
| Revision number
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE1801_REG_SYS_CTRL = $02;</code>
 +
| System control
 +
|-
 +
| <code>STMPE1801_REG_INT_CTRL_LOW = $04;</code>
 +
| Interrupt control
 +
|-
 +
| <code>STMPE1801_REG_INT_CTRL_HIGH = $05;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_INT_EN_LOW = $06;</code>
 +
| Interrupt enable mask
 +
|-
 +
| <code>STMPE1801_REG_INT_EN_HIGH = $07;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_INT_STA_LOW = $08;</code>
 +
| Interrupt status
 +
|-
 +
| <code>STMPE1801_REG_INT_STA_HIGH = $09;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_INT_EN_LOW = $0A;</code>
 +
| Interrupt enable GPIO mask
 +
|-
 +
| <code>STMPE1801_REG_GPIO_INT_EN_MID = $0B;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_INT_EN_HIGH = $0C;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_INT_STA_LOW = $0D;</code>
 +
| Interrupt status GPIO
 +
|-
 +
| <code>STMPE1801_REG_GPIO_INT_STA_MID = $0E;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_INT_STA_HIGH = $0F;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_SET_PIN_LOW = $10;</code>
 +
| GPIO set pin state
 +
|-
 +
| <code>STMPE1801_REG_GPIO_SET_PIN_MID = $11;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_SET_PIN_HIGH = $12 </code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_CLR_PIN_LOW = $13;</code>
 +
| GPIO clear pin state
 +
|-
 +
| <code>STMPE1801_REG_GPIO_CLR_PIN_MID = $14;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_CLR_PIN_HIGH = $15;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_MP_STA_LOW = $16;</code>
 +
| GPIO monitor pin state
 +
|-
 +
| <code>STMPE1801_REG_GPIO_MP_STA_MID = $17;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_MP_STA_HIGH = $18;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_SET_DIR_LOW = $19;</code>
 +
| GPIO set pin direction register
 +
|-
 +
| <code>STMPE1801_REG_GPIO_SET_DIR_MID = $1A;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_SET_DIR_HIGH = $1B;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_RE_LOW = $1C;</code>
 +
| GPIO rising edge
 +
|-
 +
| <code>STMPE1801_REG_GPIO_RE_MID = $1D;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_RE_HIGH = $1E;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_FE_LOW = $1F;</code>
 +
| GPIO falling edge
 +
|-
 +
| <code>STMPE1801_REG_GPIO_FE_MID = $20;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_FE_HIGH = $21;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_PULL_UP_LOW = $22;</code>
 +
| GPIO pull up
 +
|-
 +
| <code>STMPE1801_REG_GPIO_PULL_UP_MID = $23;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_GPIO_PULL_UP_HIGH = $24;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE1801_REG_KPC_ROW = $30;</code>
 +
| Keypad row scanning
 +
|-
 +
| <code>STMPE1801_REG_KPC_COL_LOW = $31;</code>
 +
| Keypad column scanning
 +
|-
 +
| <code>STMPE1801_REG_KPC_COL_HIGH = $32;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_KPC_CTRL_LOW = $33;</code>
 +
| Key config: Scan count and dedicated key
 +
|-
 +
| <code>STMPE1801_REG_KPC_CTRL_MID = $34;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_KPC_CTRL_HIGH = $35;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_KPC_CMD = $36;</code>
 +
| Keypad command
 +
|-
 +
| <code>STMPE1801_REG_KPC_COMB_KEY_0 = $37;</code>
 +
| Keypad combination key mask
 +
|-
 +
| <code>STMPE1801_REG_KPC_COMB_KEY_1 = $38;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_KPC_COMB_KEY_2 = $39;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_KPC_DATA_BYTE0 = $3A;</code>
 +
| Keypad data}
 +
|-
 +
| <code>STMPE1801_REG_KPC_DATA_BYTE1 = $3B;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_KPC_DATA_BYTE2 = $3C;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_KPC_DATA_BYTE3 = $3D;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_KPC_DATA_BYTE4 = $3E;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE1801_REG_MAX = $3E;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE1801_REG_SIZE = 3;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''STMPE2401 / STMPE2403''
 +
|-
 +
| <code>STMPE240X_REG_CHIP_ID = $80;</code>
 +
| Device identification
 +
|-
 +
| <code>STMPE240X_REG_ID_VER = $81;</code>
 +
| Revision number
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE240X_REG_SYS_CTRL = $02;</code>
 +
| System control register
 +
|-
 +
| <code>STMPE240X_REG_INT_CTRL_MSB = $10;</code>
 +
| Interrupt Control Register
 +
|-
 +
| <code>STMPE240X_REG_INT_CTRL_LSB = $11;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_INT_EN_MSB = $12;</code>
 +
| Interrupt Enable Mask Register
 +
|-
 +
| <code>STMPE240X_REG_INT_EN_LSB = $13;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_INT_STA_MSB = $14;</code>
 +
| Interrupt Status Register
 +
|-
 +
| <code>STMPE240X_REG_INT_STA_LSB = $15;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_INT_EN_MSB = $16;</code>
 +
| Interrupt Enable GPIO Mask Register
 +
|-
 +
| <code>STMPE240X_REG_GPIO_INT_EN_MID = $17;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_INT_EN_LSB = $18;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_INT_STA_MSB = $19;</code>
 +
| Interrupt Status GPIO Register
 +
|-
 +
| <code>STMPE240X_REG_GPIO_INT_STA_MID = $1A;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_INT_STA_LSB = $1B;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_MP_STA_MSB = $A2;</code>
 +
| GPIO Monitor Pin State Register
 +
|-
 +
| <code>STMPE240X_REG_GPIO_MP_STA_MID = $A3;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_MP_STA_LSB = $A4;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_SET_PIN_MSB = $83;</code>
 +
| GPIO Set Pin State Register
 +
|-
 +
| <code>STMPE240X_REG_GPIO_SET_PIN_MID = $84;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_SET_PIN_LSB = $85;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_CLR_PIN_MSB = $86;</code>
 +
| GPIO Clear Pin State Register
 +
|-
 +
| <code>STMPE240X_REG_GPIO_CLR_PIN_MID = $87;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_CLR_PIN_LSB = $88;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_SET_DIR_MSB = $89;</code>
 +
| GPIO Set Pin Direction Register
 +
|-
 +
| <code>STMPE240X_REG_GPIO_SET_DIR_MID = $8A;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_SET_DIR_LSB = $8B;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_ED_MSB = $8C;</code>
 +
| GPIO Edge Detect Status Register
 +
|-
 +
| <code>STMPE240X_REG_GPIO_ED_MID = $8D;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_ED_LSB = $8E;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_RE_MSB = $8F;</code>
 +
| GPIO Rising Edge Register
 +
|-
 +
| <code>STMPE240X_REG_GPIO_RE_MID = $90;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_RE_LSB = $91;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_FE_MSB = $92;</code>
 +
| GPIO Falling Edge Register
 +
|-
 +
| <code>STMPE240X_REG_GPIO_FE_MID = $93;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_FE_LSB = $94;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_PULL_UP_MSB = $95;</code>
 +
| GPIO Pull Up Register
 +
|-
 +
| <code>STMPE240X_REG_GPIO_PULL_UP_MID = $96;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_PULL_UP_LSB = $97;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_PULL_DN_MSB = $98;</code>
 +
| GPIO Pull Down Register
 +
|-
 +
| <code>STMPE240X_REG_GPIO_PULL_DN_MID = $99;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_PULL_DN_LSB = $9A;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_AF_U_MSB = $9B;</code>
 +
| GPIO Alternate Function Register (Upper Bit)
 +
|-
 +
| <code>STMPE240X_REG_GPIO_AF_U_MID = $9C;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_AF_U_LSB = $9D;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_AF_L_MSB = $9E;</code>
 +
| GPIO Alternate Function Register(Lower Bit)
 +
|-
 +
| <code>STMPE240X_REG_GPIO_AF_L_MID = $9F;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_GPIO_AF_L_LSB = $A0;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE240X_REG_PWMCS = $30;</code>
 +
| PWM Control and Status register
 +
|-
 +
| <code>STMPE240X_REG_PWMIC0 = $38;</code>
 +
| PWM instructions are initialized through this data port
 +
|-
 +
| <code>STMPE240X_REG_PWMIC1 = $39;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_PWMIC2 = $3A;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE240X_REG_KPC_COL = $60;</code>
 +
| Keypad column scanning register
 +
|-
 +
| <code>STMPE240X_REG_KPC_ROW_MSB = $61;</code>
 +
| Keypad row scanning register
 +
|-
 +
| <code>STMPE240X_REG_KPC_ROW_LSB = $62;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_KPC_CTRL_MSB = $63;</code>
 +
| Keypad control register
 +
|-
 +
| <code>STMPE240X_REG_KPC_CTRL_LSB = $64;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_KPC_DATA_BYTE0 = $68;</code>
 +
| Keypad data register
 +
|-
 +
| <code>STMPE240X_REG_KPC_DATA_BYTE1 = $69;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_KPC_DATA_BYTE2 = $6A;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE240X_REG_MAX = $BF;</code>
 +
| &nbsp;
 +
|-
 +
| <code>STMPE240X_REG_SIZE = 3;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>STMPE_REG_UNKNOWN = $FF;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<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 class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''STMPE610 / STMPE811''
 +
|-
 +
| <code>STMPE811_CHIP_ID = $0811;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''STMPE801''
 +
|-
 +
| <code>STMPE801_CHIP_ID = $0801;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''STMPE1601''
 +
|-
 +
| <code>STMPE1601_CHIP_ID = $02;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''STMPE1801''
 +
|-
 +
| <code>STMPE1801_CHIP_ID = $C1;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''STMPE2401 / STMPE2403''
 +
|-
 +
| <code>STMPE240X_CHIP_ID = $01;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<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 class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''STMPE610 / STMPE811''
 +
|-
 +
| <code>STMPE811_SYS_CTRL2_TS_OFF = (1 shl 3);</code>
 +
| 1: Switches off the clock supply to the temperature sensor
 +
|-
 +
| <code>STMPE811_SYS_CTRL2_GPIO_OFF  (1 shl 2);</code>
 +
| 1: Switches off the clock supply to the GPIO
 +
|-
 +
| <code>STMPE811_SYS_CTRL2_TSC_OFF = (1 shl 1);</code>
 +
| 1: Switches off the clock supply to the touchscreen controller
 +
|-
 +
| <code>STMPE811_SYS_CTRL2_ADC_OFF = (1 shl 0);</code>
 +
| 1: Switches off the clock supply to the ADC
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''STMPE801''
 +
|-
 +
| <code>STMPE801_SYS_CTRL_RESET = (1 shl 7);</code>
 +
| Writing 1 to this bit causes a soft reset.
 +
|-
 +
| <code>STMPE801_SYS_CTRL_INT_EN = (1 shl 2);</code>
 +
| INT Enable 1 to enable, 0 to disable INT output.
 +
|-
 +
| <code>STMPE801_SYS_CTRL_INT_HI = (1 shl 0);</code>
 +
| INT Polarity 1 for active HI, 0 for active LOW.
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''STMPE1601''
 +
|-
 +
| <code>STMPE1601_SYS_CTRL_RESET = (1 shl 7);</code>
 +
| Writing a 1 to this bit will do a soft reset of the device. Once the reset is done, this bit will be cleared to 0 by the HW.
 +
|-
 +
| <code>STMPE1601_SYS_CTRL_ENABLE_GPIO = (1 shl 3);</code>
 +
| Writing a 0 to this bit will gate off the clock to the GPIO module, thus stopping its operation.
 +
|-
 +
| <code>STMPE1601_SYS_CTRL_ENABLE_KPC = (1 shl 1);</code>
 +
| Writing a 0 to this bit will gate off the clock to the keypad controller module, thus stopping its operation.
 +
|-
 +
| <code>STMPE1601_SYS_CTRL_ENABLE_SPWM = (1 shl 0);</code>
 +
| Writing a 0 to this bit will gate off the clock to the simple PWM controller module, thus stopping its operation.
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''STMPE1801''
 +
|-
 +
| <code>STMPE1801_SYS_CTRL_RESET = (1 shl 7);</code>
 +
| Writing a 1 to this bit will do a soft reset of the device. Once the reset is done, this bit will be cleared to 0 by the HW.
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''STMPE240X''
 +
|-
 +
| <code>STMPE240X_SYS_CTRL_RESET = (1 shl 7);</code>
 +
| Writing a 1 to this bit will do a soft reset of the device. Once the reset is done, this bit will be cleared to 0 by the HW.
 +
|-
 +
| <code>STMPE240X_SYS_CTRL_ENABLE_GPIO = (1 shl 3);</code>
 +
| Writing a 0 to this bit will gate off the clock to the GPIO module, thus stopping its operation.
 +
|-
 +
| <code>STMPE240X_SYS_CTRL_ENABLE_PWM = (1 shl 2);</code>
 +
| Writing a 0 to this bit will gate off the clock to the PWM module, thus stopping its operation.
 +
|-
 +
| <code>STMPE240X_SYS_CTRL_ENABLE_KPC = (1 shl 1);</code>
 +
| Writing a 0 to this bit will gate off the clock to the Keypad Controller module, thus stopping its operation.
 +
|-
 +
| <code>STMPE240X_SYS_CTRL_ENABLE_ROT = (1 shl 0);</code>
 +
| Writing a 0 to this bit will gate off the clock to the Rotator module, thus stopping its operation.
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<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 class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''STMPE610 / STMPE811''
 +
|-
 +
| <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)
 +
|-
 +
| <code>STMPE811_TSC_CTRL_TRACK_MASK = (7 shl 4);</code>
 +
| TRACK: Tracking index
 +
|-
 +
| <code>STMPE811_TSC_CTRL_OPMODE_XYZ = (0 shl 1);</code>
 +
| OP_MOD: TSC operating mode: X, Y, Z acquisition
 +
|-
 +
| <code>STMPE811_TSC_CTRL_OPMODE_XY = (1 shl 1);</code>
 +
| OP_MOD: TSC operating mode: X, Y only
 +
|-
 +
| <code>STMPE811_TSC_CTRL_OPMODE_X = (2 shl 1);</code>
 +
| OP_MOD: TSC operating mode: X only
 +
|-
 +
| <code>STMPE811_TSC_CTRL_OPMODE_Y = (3 shl 1);</code>
 +
| OP_MOD: TSC operating mode: Y only
 +
|-
 +
| <code>STMPE811_TSC_CTRL_OPMODE_Z = (4 shl 1);</code>
 +
| OP_MOD: TSC operating mode: Z only
 +
|-
 +
| <code>STMPE811_TSC_CTRL_TSC_EN = (1 shl 0);</code>
 +
| Enable TSC
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<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 class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''STMPE610 / STMPE811''
 +
|-
 +
| <code>STMPE811_TSC_CFG_AVE_CTRL_1 = (0 shl 6);</code>
 +
| AVE_CTRL: Average control: 1 sample
 +
|-
 +
| <code>STMPE811_TSC_CFG_AVE_CTRL_2 = (1 shl 6);</code>
 +
| AVE_CTRL: Average control: 2 samples
 +
|-
 +
| <code>STMPE811_TSC_CFG_AVE_CTRL_4 = (2 shl 6);</code>
 +
| AVE_CTRL: Average control: 4 samples
 +
|-
 +
| <code>STMPE811_TSC_CFG_AVE_CTRL_8 = (3 shl 6);</code>
 +
| AVE_CTRL: Average control: 8 samples
 +
|-
 +
| <code>STMPE811_TSC_CFG_TOUCH_DET_DELAY_MASK = (7 shl 3);</code>
 +
| TOUCH_DET_DELAY: Touch detect delay
 +
|-
 +
| <code>STMPE811_TSC_CFG_SETTLING_MASK = (7 shl 0);</code>
 +
| SETTLING: Panel driver settling time
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<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 class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''STMPE610 / STMPE811''
 +
|-
 +
| <code>STMPE811_ADC_CTRL1_SAMPLE_TIME_MASK = (7 shl 4);</code>
 +
| SAMPLE_TIMEn: ADC conversion time in number of clock
 +
|-
 +
| <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)
 +
|-
 +
| <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)
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<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 class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''STMPE610 / STMPE811''
 +
|-
 +
| <code>STMPE811_ADC_CTRL2_ADC_FREQ_MASK = (3 shl 0);</code>
 +
| ADC_FREQ: Selects the clock speed of ADC
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<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 class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''STMPE610 / STMPE811''
 +
|-
 +
| <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)
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<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 class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''STMPE610 / STMPE811''
 +
|-
 +
| <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)
 +
|-
 +
| <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)
 +
|-
 +
| <code>STMPE811_INT_CTRL_GLOBAL = (1 shl 0);</code>
 +
| This is master enable for the interrupt system (1: Global interrupt / 0: Stops all interrupts)
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<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 class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''STMPE610 / STMPE811''
 +
|-
 +
| <code>STMPE811_INT_EN_GPIO = (1 shl 7);</code>
 +
| GPIO: Any enabled GPIO interrupts
 +
|-
 +
| <code>STMPE811_INT_EN_ADC = (1 shl 6);</code>
 +
| ADC: Any enabled ADC interrupts
 +
|-
 +
| <code>STMPE811_INT_EN_TEMP_SENS = (1 shl 5);</code>
 +
| TEMP_SENS: Temperature threshold triggering
 +
|-
 +
| <code>STMPE811_INT_EN_FIFO_EMPTY = (1 shl 4);</code>
 +
| FIFO_EMPTY: FIFO is empty
 +
|-
 +
| <code>STMPE811_INT_EN_FIFO_FULL = (1 shl 3);</code>
 +
| FIFO_FULL: FIFO is full
 +
|-
 +
| <code>STMPE811_INT_EN_FIFO_OFLOW = (1 shl 2);</code>
 +
| FIFO_OFLOW: FIFO is overflowed
 +
|-
 +
| <code>STMPE811_INT_EN_FIFO_TH = (1 shl 1);</code>
 +
| FIFO_TH: FIFO is equal or above threshold value
 +
|-
 +
| <code>STMPE811_INT_EN_TOUCH_DET = (1 shl 0);</code>
 +
| TOUCH_DET: Touch is detected
 +
|-
 +
|}
 +
</div></div>
 +
<br /> 
 +
<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 class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''STMPE610 / STMPE811''
 +
|-
 +
| <code>STMPE811_INT_STA_GPIO = (1 shl 7);</code>
 +
| GPIO: Any enabled GPIO interrupts
 +
|-
 +
| <code>STMPE811_INT_STA_ADC = (1 shl 6);</code>
 +
| ADC: Any enabled ADC interrupts
 +
|-
 +
| <code>STMPE811_INT_STA_TEMP_SENS = (1 shl 5);</code>
 +
| TEMP_SENS: Temperature threshold triggering
 +
|-
 +
| <code>STMPE811_INT_STA_FIFO_EMPTY = (1 shl 4);</code>
 +
| FIFO_EMPTY: FIFO is empty
 +
|-
 +
| <code>STMPE811_INT_STA_FIFO_FULL = (1 shl 3);</code>
 +
| FIFO_FULL: FIFO is full
 +
|-
 +
| <code>STMPE811_INT_STA_FIFO_OFLOW = (1 shl 2);</code>
 +
| FIFO_OFLOW: FIFO is overflowed
 +
|-
 +
| <code>STMPE811_INT_STA_FIFO_TH = (1 shl 1);</code>
 +
| FIFO_TH: FIFO is equal or above threshold value
 +
|-
 +
| <code>STMPE811_INT_STA_TOUCH_DET = (1 shl 0);</code>
 +
| TOUCH_DET: Touch is detected
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|<code>STMPE811_INT_STA_TOUCH_MASK = STMPE811_INT_STA_FIFO_EMPTY or STMPE811_INT_STA_FIFO_FULL or STMPE811_INT_STA_FIFO_OFLOW or STMPE811_INT_STA_FIFO_TH or STMPE811_INT_STA_TOUCH_DET;</code>
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Type definitions ===
 
=== Type definitions ===

Revision as of 00:30, 19 December 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



[Expand]
STMPE specific constants STMPE*_*


[Expand]
STMPE chip constants STMPE_CHIP_*


[Expand]
STMPE direction constants STMPE_DIR_*


[Expand]
STMPE I2C constants STMPE_I2C_*


[Expand]
STMPE SPI constants STMPE_SPI_*


[Expand]
STMPE register constants STMPE*_REG_*


[Expand]
STMPE ID constants STMPE*_CHIP_ID


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


[Expand]
STMPE touchscreen control constants STMPE*_TSC_CTRL_*


[Expand]
STMPE touchscreen config constants STMPE*_TSC_CFG_*


[Expand]
STMPE ADC control 1 constants STMPE*_ADC_CTRL1_*


[Expand]
STMPE ADC control 2 constants STMPE*_ADC_CTRL2_*


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


[Expand]
STMPE interrupt control constants STMPE*_INT_CTRL_*


[Expand]
STMPE interrupt enable constants STMPE*_INT_EN_*


[Expand]
STMPE interrupt status constants STMPE*_INT_STA_*


Type definitions


To be documented

Public variables


To be documented

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