Unit STMPE
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
STMPE*_*
STMPE610_GPIO_DESCRIPTION = 'STMicroelectronics STMPE610 I/O Expander';
|
Description of STMPE610 GPIO device |
STMPE801_GPIO_DESCRIPTION = 'STMicroelectronics STMPE801 I/O Expander';
|
Description of STMPE801 GPIO device |
STMPE811_GPIO_DESCRIPTION = 'STMicroelectronics STMPE811 I/O Expander';
|
Description of STMPE811 GPIO device |
STMPE1601_GPIO_DESCRIPTION = 'STMicroelectronics STMPE1601 I/O Expander';
|
Description of STMPE1601 GPIO device |
STMPE1801_GPIO_DESCRIPTION = 'STMicroelectronics STMPE1801 I/O Expander';
|
Description of STMPE1801 GPIO device |
STMPE2401_GPIO_DESCRIPTION = 'STMicroelectronics STMPE2401 I/O Expander';
|
Description of STMPE2401 GPIO device |
STMPE2403_GPIO_DESCRIPTION = 'STMicroelectronics STMPE2403 I/O Expander';
|
Description of STMPE2403 GPIO device |
STMPE610_TOUCH_DESCRIPTION = 'STMicroelectronics STMPE610 Touch Controller';
|
Description of STMPE610 Touch device |
STMPE811_TOUCH_DESCRIPTION = 'STMicroelectronics STMPE811 Touch Controller';
|
Description of STMPE811 Touch device |
STMPE610_GPIO_MIN_PIN = GPIO_PIN_2;
|
|
STMPE610_GPIO_MAX_PIN = GPIO_PIN_7;
|
|
STMPE610_GPIO_PIN_COUNT = 6;
|
|
STMPE801_GPIO_MIN_PIN = GPIO_PIN_0;
|
|
STMPE801_GPIO_MAX_PIN = GPIO_PIN_7;
|
|
STMPE801_GPIO_PIN_COUNT = 8;
|
|
STMPE811_GPIO_MIN_PIN = GPIO_PIN_0;
|
|
STMPE811_GPIO_MAX_PIN = GPIO_PIN_7;
|
|
STMPE811_GPIO_PIN_COUNT = 8;
|
|
STMPE1601_GPIO_MIN_PIN = GPIO_PIN_0;
|
|
STMPE1601_GPIO_MAX_PIN = GPIO_PIN_15;
|
|
STMPE1601_GPIO_PIN_COUNT = 16;
|
|
STMPE1801_GPIO_MIN_PIN = GPIO_PIN_0;
|
|
STMPE1801_GPIO_MAX_PIN = GPIO_PIN_17;
|
|
STMPE1801_GPIO_PIN_COUNT = 18;
|
|
STMPE240X_GPIO_MIN_PIN = GPIO_PIN_0;
|
|
STMPE240X_GPIO_MAX_PIN = GPIO_PIN_23;
|
|
STMPE240X_GPIO_PIN_COUNT = 24;
|
|
STMPE_GPIO_MAX_LEVEL = GPIO_LEVEL_HIGH;
|
|
STMPE_GPIO_MAX_PULL = GPIO_PULL_DOWN;
|
|
STMPE610_GPIO_MIN_FUNCTION = GPIO_FUNCTION_IN;
|
|
STMPE610_GPIO_MAX_FUNCTION = GPIO_FUNCTION_ALT0;
|
|
STMPE610_GPIO_FUNCTION_COUNT = 3;
|
|
STMPE801_GPIO_MIN_FUNCTION = GPIO_FUNCTION_IN;
|
|
STMPE801_GPIO_MAX_FUNCTION = GPIO_FUNCTION_OUT;
|
|
STMPE801_GPIO_FUNCTION_COUNT = 2;
|
|
STMPE811_GPIO_MIN_FUNCTION = GPIO_FUNCTION_IN;
|
|
STMPE811_GPIO_MAX_FUNCTION = GPIO_FUNCTION_ALT0;
|
|
STMPE811_GPIO_FUNCTION_COUNT = 3;
|
|
STMPE1601_GPIO_MIN_FUNCTION = GPIO_FUNCTION_IN;
|
|
STMPE1601_GPIO_MAX_FUNCTION = GPIO_FUNCTION_ALT1;
|
Alternate function 0 = Keypad / Alternate function 1 = PWM |
STMPE1601_GPIO_FUNCTION_COUNT = 4;
|
|
STMPE1801_GPIO_MIN_FUNCTION = GPIO_FUNCTION_IN;
|
|
STMPE1801_GPIO_MAX_FUNCTION = GPIO_FUNCTION_ALT0;
|
|
STMPE1801_GPIO_FUNCTION_COUNT = 3;
|
|
STMPE240X_GPIO_MIN_FUNCTION = GPIO_FUNCTION_IN;
|
|
STMPE240X_GPIO_MAX_FUNCTION = GPIO_FUNCTION_ALT2;
|
|
STMPE240X_GPIO_FUNCTION_COUNT = 5;
|
|
STMPE610_MAX_POINTS = 1;
|
|
STMPE610_MAX_X = $FFF;
|
|
STMPE610_MAX_Y = $FFF;
|
|
STMPE610_MAX_Z = $FF;
|
|
STMPE811_MAX_POINTS = 1;
|
|
STMPE811_MAX_X = $FFF;
|
|
STMPE811_MAX_Y = $FFF;
|
|
STMPE811_MAX_Z = $FF;
|
STMPE_CHIP_*
STMPE_CHIP_STMPE610 = 1;
|
|
STMPE_CHIP_STMPE801 = 2;
|
|
STMPE_CHIP_STMPE801 = 2;
|
|
STMPE_CHIP_STMPE811 = 3;
|
|
STMPE_CHIP_STMPE1601 = 4;
|
|
STMPE_CHIP_STMPE1801 = 5;
|
|
STMPE_CHIP_STMPE2401 = 6;
|
|
STMPE_CHIP_STMPE2403 = 7;
|
STMPE_DIR_*
STMPE_DIR_ASCENDING = 0;
|
Register addresses in ascending order (Bits go from LSB to MSB) |
STMPE_DIR_DESCENDING = 1;
|
Register addresses in descending order (Bits go from MSB to LSB) |
STMPE_I2C_*
STMPE_I2C_RATE = 400000;
|
Default I2C clock rate (Device supports 100KHz and 400KHz) |
STMPE_SPI_*
STMPE_SPI_RATE = 500000;
|
Default SPI clock rate (Device supports up to 1MHz) |
STMPE_SPI_READ_CMD = (1 shl 7);
|
First bit of address must be set for a read |
STMPE*_REG_*
STMPE610 / STMPE811 | |
STMPE811_REG_CHIP_ID = $00;
|
Device identification |
STMPE811_REG_ID_VER = $02;
|
Revision number (0x01 for engineering sample / 0x03 for final silicon) |
STMPE811_REG_SYS_CTRL1 = $03;
|
Reset control |
STMPE811_REG_SYS_CTRL2 = $04;
|
Clock control |
STMPE811_REG_SPI_CFG = $08;
|
SPI interface configuration |
STMPE811_REG_INT_CTRL = $09;
|
Interrupt control register |
STMPE811_REG_INT_EN = $0A;
|
Interrupt enable register |
STMPE811_REG_INT_STA = $0B;
|
Interrupt status register |
STMPE811_REG_GPIO_INT_EN = $0C;
|
GPIO interrupt enable register |
STMPE811_REG_GPIO_INT_STA = $0D;
|
GPIO interrupt status register |
STMPE811_REG_ADC_INT_EN = $0E;
|
ADC interrupt enable register |
STMPE811_REG_ADC_INT_STA = $0F;
|
ADC interrupt status register |
STMPE811_REG_GPIO_SET_PIN = $10;
|
GPIO set pin register |
STMPE811_REG_GPIO_CLR_PIN = $11;
|
GPIO clear pin register |
STMPE811_REG_GPIO_MP_STA = $12;
|
GPIO monitor pin state register |
STMPE811_REG_GPIO_SET_DIR = $13;
|
GPIO direction register |
STMPE811_REG_GPIO_ED = $14;
|
GPIO edge detect register |
STMPE811_REG_GPIO_RE = $15;
|
GPIO rising edge register |
STMPE811_REG_GPIO_FE = $16;
|
GPIO falling edge register |
STMPE811_REG_GPIO_AF = $17;
|
Alternate function register |
STMPE811_REG_ADC_CTRL1 = $20;
|
ADC control |
STMPE811_REG_ADC_CTRL2 = $21;
|
ADC control |
STMPE811_REG_ADC_CAPT = $22;
|
To initiate ADC data acquisition |
STMPE811_REG_ADC_DATA_CH0 = $30;
|
ADC channel 0 |
STMPE811_REG_ADC_DATA_CH1 = $32;
|
ADC channel 1 |
STMPE811_REG_ADC_DATA_CH2 = $34;
|
ADC channel 2 |
STMPE811_REG_ADC_DATA_CH3 = $36;
|
ADC channel 3 |
STMPE811_REG_ADC_DATA_CH4 = $38;
|
ADC channel 4 |
STMPE811_REG_ADC_DATA_CH5 = $3A;
|
ADC channel 5 |
STMPE811_REG_ADC_DATA_CH6 = $3C;
|
ADC channel 6 |
STMPE811_REG_ADC_DATA_CH7 = $3E;
|
ADC channel 7 |
STMPE811_REG_TSC_CTRL = $40;
|
4-wire touchscreen controller setup |
STMPE811_REG_TSC_CFG = $41;
|
Touchscreen controller configuration |
STMPE811_REG_WDW_TR_X = $42;
|
Window setup for top right X |
STMPE811_REG_WDW_TR_Y = $44;
|
Window setup for top right Y |
STMPE811_REG_WDW_BL_X = $46;
|
Window setup for bottom left X |
STMPE811_REG_WDW_BL_Y = $48;
|
Window setup for bottom left Y |
STMPE811_REG_FIFO_TH = $4A;
|
FIFO level to generate interrupt |
STMPE811_REG_FIFO_STA = $4B;
|
Current status of FIFO |
STMPE811_REG_FIFO_SIZE = $4C;
|
Current filled level of FIFO |
STMPE811_REG_TSC_DATA_X = $4D;
|
Data port for touchscreen controller data access |
STMPE811_REG_TSC_DATA_Y = $4F;
|
Data port for touchscreen controller data access |
STMPE811_REG_TSC_DATA_Z = $51;
|
Data port for touchscreen controller data access |
STMPE811_REG_TSC_DATA_XYZ = $52;
|
Data port for touchscreen controller data access |
STMPE811_REG_TSC_FRACTION_Z = $56;
|
Touchscreen controller FRACTION_Z |
STMPE811_REG_TSC_DATA = $57;
|
Data port for touchscreen controller data access |
STMPE811_REG_TSC_I_DRIVE = $58;
|
Touchscreen controller drive I |
STMPE811_REG_TSC_SHIELD = $59;
|
Touchscreen controller shield |
STMPE811 | |
STMPE811_REG_TEMP_CTRL= $60;
|
Temperature sensor setup |
STMPE811_REG_TEMP_DATA = $61;
|
Temperature data access port |
STMPE811_REG_TEMP_TH = $62;
|
Threshold for temperature controlled interrupt |
STMPE811_REG_MAX = $62;
|
|
STMPE811_REG_SIZE = 1;
|
|
STMPE801 | |
STMPE801_REG_CHIP_ID = $00;
|
Device identification |
STMPE801_REG_ID_VER = $02;
|
Revision number (0x01 for engineering sample / 0x02 for final silicon) |
STMPE801_REG_SYS_CTRL = $04;
|
Reset and interrupt control |
STMPE801_REG_GPIO_INT_EN = $08;
|
GPIO interrupt enable register |
STMPE801_REG_GPIO_INT_STA = $09;
|
GPIO interrupt status register |
STMPE801_REG_GPIO_MP_STA = $10;
|
GPIO monitor pin state register |
STMPE801_REG_GPIO_SET_PIN = $11;
|
GPIO set pin state register |
STMPE801_REG_GPIO_SET_DIR = $12;
|
GPIO set pin direction register |
STMPE801_REG_MAX = $12;
|
|
STMPE801_REG_SIZE = 1;
|
|
STMPE1601 | |
STMPE1601_REG_CHIP_ID = $80;
|
Device identification |
STMPE1601_REG_ID_VER = $81;
|
Revision number |
STMPE1601_REG_SYS_CTRL = $02;
|
System control register |
STMPE1601_REG_SYS_CTRL2 = $03;
|
System control register 2 |
STMPE1601_REG_INT_CTRL_MSB = $10;
|
Interrupt control register |
STMPE1601_REG_INT_CTRL_LSB = $11;
|
|
STMPE1601_REG_INT_EN_MSB = $12;
|
Interrupt enable mask register |
STMPE1601_REG_INT_EN_LSB = $13;
|
|
STMPE1601_REG_INT_STA_MSB = $14;
|
Interrupt status register |
STMPE1601_REG_INT_STA_LSB = $15;
|
|
STMPE1601_REG_GPIO_INT_EN_MSB = $16;
|
Interrupt enable GPIO mask register |
STMPE1601_REG_GPIO_INT_EN_LSB = $17;
|
|
STMPE1601_REG_GPIO_INT_STA_MSB = $18;
|
Interrupt status GPIO register |
STMPE1601_REG_GPIO_INT_STA_LSB = $19;
|
|
STMPE1601_REG_GPIO_SET_PIN_MSB = $82;
|
GPIO set pin state register |
STMPE1601_REG_GPIO_SET_PIN_LSB = $83;
|
|
STMPE1601_REG_GPIO_CLR_PIN_MSB = $84;
|
GPIO clear pin state register |
STMPE1601_REG_GPIO_CLR_PIN_LSB = $85;
|
|
STMPE1601_REG_GPIO_MP_STA_MSB = $86;
|
GPIO monitor pin state register |
STMPE1601_REG_GPIO_MP_STA_LSB = $87;
|
|
STMPE1601_REG_GPIO_SET_DIR_MSB = $88;
|
GPIO set pin direction register |
STMPE1601_REG_GPIO_SET_DIR_LSB = $89;
|
|
STMPE1601_REG_GPIO_ED_MSB = $8A;
|
GPIO edge detect status register |
STMPE1601_REG_GPIO_ED_LSB = $8B;
|
|
STMPE1601_REG_GPIO_RE_MSB = $8C;
|
GPIO rising edge register |
STMPE1601_REG_GPIO_RE_LSB = $8D;
|
|
STMPE1601_REG_GPIO_FE_MSB = $8E;
|
GPIO falling edge register |
STMPE1601_REG_GPIO_FE_LSB = $8F;
|
|
STMPE1601_REG_GPIO_PU_MSB = $90;
|
GPIO pull up register |
STMPE1601_REG_GPIO_PU_LSB = $91;
|
|
STMPE1601_REG_GPIO_AF_U_MSB = $92;
|
GPIO alternate function register (upper word) |
STMPE1601_REG_GPIO_AF_U_LSB = $93;
|
|
STMPE1601_REG_GPIO_AF_L_MSB = $94;
|
GPIO alternate function register (lower word) |
STMPE1601_REG_GPIO_AF_L_LSB = $95;
|
|
STMPE1601_REG_GPIO_LT_EN = $96;
|
GPIO level translator enable |
STMPE1601_REG_GPIO_LT_DIR = $97;
|
GPIO level translator direction |
STMPE1601_REG_MAX = $BF;
|
|
STMPE1601_REG_SIZE = 2;
|
|
STMPE1801 | |
STMPE1801_REG_CHIP_ID = $00;
|
Device identification |
STMPE1801_REG_ID_VER = $01;
|
Revision number |
STMPE1801_REG_SYS_CTRL = $02;
|
System control |
STMPE1801_REG_INT_CTRL_LOW = $04;
|
Interrupt control |
STMPE1801_REG_INT_CTRL_HIGH = $05;
|
|
STMPE1801_REG_INT_EN_LOW = $06;
|
Interrupt enable mask |
STMPE1801_REG_INT_EN_HIGH = $07;
|
|
STMPE1801_REG_INT_STA_LOW = $08;
|
Interrupt status |
STMPE1801_REG_INT_STA_HIGH = $09;
|
|
STMPE1801_REG_GPIO_INT_EN_LOW = $0A;
|
Interrupt enable GPIO mask |
STMPE1801_REG_GPIO_INT_EN_MID = $0B;
|
|
STMPE1801_REG_GPIO_INT_EN_HIGH = $0C;
|
|
STMPE1801_REG_GPIO_INT_STA_LOW = $0D;
|
Interrupt status GPIO |
STMPE1801_REG_GPIO_INT_STA_MID = $0E;
|
|
STMPE1801_REG_GPIO_INT_STA_HIGH = $0F;
|
|
STMPE1801_REG_GPIO_SET_PIN_LOW = $10;
|
GPIO set pin state |
STMPE1801_REG_GPIO_SET_PIN_MID = $11;
|
|
STMPE1801_REG_GPIO_SET_PIN_HIGH = $12
|
|
STMPE1801_REG_GPIO_CLR_PIN_LOW = $13;
|
GPIO clear pin state |
STMPE1801_REG_GPIO_CLR_PIN_MID = $14;
|
|
STMPE1801_REG_GPIO_CLR_PIN_HIGH = $15;
|
|
STMPE1801_REG_GPIO_MP_STA_LOW = $16;
|
GPIO monitor pin state |
STMPE1801_REG_GPIO_MP_STA_MID = $17;
|
|
STMPE1801_REG_GPIO_MP_STA_HIGH = $18;
|
|
STMPE1801_REG_GPIO_SET_DIR_LOW = $19;
|
GPIO set pin direction register |
STMPE1801_REG_GPIO_SET_DIR_MID = $1A;
|
|
STMPE1801_REG_GPIO_SET_DIR_HIGH = $1B;
|
|
STMPE1801_REG_GPIO_RE_LOW = $1C;
|
GPIO rising edge |
STMPE1801_REG_GPIO_RE_MID = $1D;
|
|
STMPE1801_REG_GPIO_RE_HIGH = $1E;
|
|
STMPE1801_REG_GPIO_FE_LOW = $1F;
|
GPIO falling edge |
STMPE1801_REG_GPIO_FE_MID = $20;
|
|
STMPE1801_REG_GPIO_FE_HIGH = $21;
|
|
STMPE1801_REG_GPIO_PULL_UP_LOW = $22;
|
GPIO pull up |
STMPE1801_REG_GPIO_PULL_UP_MID = $23;
|
|
STMPE1801_REG_GPIO_PULL_UP_HIGH = $24;
|
|
STMPE1801_REG_KPC_ROW = $30;
|
Keypad row scanning |
STMPE1801_REG_KPC_COL_LOW = $31;
|
Keypad column scanning |
STMPE1801_REG_KPC_COL_HIGH = $32;
|
|
STMPE1801_REG_KPC_CTRL_LOW = $33;
|
Key config: Scan count and dedicated key |
STMPE1801_REG_KPC_CTRL_MID = $34;
|
|
STMPE1801_REG_KPC_CTRL_HIGH = $35;
|
|
STMPE1801_REG_KPC_CMD = $36;
|
Keypad command |
STMPE1801_REG_KPC_COMB_KEY_0 = $37;
|
Keypad combination key mask |
STMPE1801_REG_KPC_COMB_KEY_1 = $38;
|
|
STMPE1801_REG_KPC_COMB_KEY_2 = $39;
|
|
STMPE1801_REG_KPC_DATA_BYTE0 = $3A;
|
Keypad data |
STMPE1801_REG_KPC_DATA_BYTE1 = $3B;
|
|
STMPE1801_REG_KPC_DATA_BYTE2 = $3C;
|
|
STMPE1801_REG_KPC_DATA_BYTE3 = $3D;
|
|
STMPE1801_REG_KPC_DATA_BYTE4 = $3E;
|
|
STMPE1801_REG_MAX = $3E;
|
|
STMPE1801_REG_SIZE = 3;
|
|
STMPE2401 / STMPE2403 | |
STMPE240X_REG_CHIP_ID = $80;
|
Device identification |
STMPE240X_REG_ID_VER = $81;
|
Revision number |
STMPE240X_REG_SYS_CTRL = $02;
|
System control register |
STMPE240X_REG_INT_CTRL_MSB = $10;
|
Interrupt Control Register |
STMPE240X_REG_INT_CTRL_LSB = $11;
|
|
STMPE240X_REG_INT_EN_MSB = $12;
|
Interrupt Enable Mask Register |
STMPE240X_REG_INT_EN_LSB = $13;
|
|
STMPE240X_REG_INT_STA_MSB = $14;
|
Interrupt Status Register |
STMPE240X_REG_INT_STA_LSB = $15;
|
|
STMPE240X_REG_GPIO_INT_EN_MSB = $16;
|
Interrupt Enable GPIO Mask Register |
STMPE240X_REG_GPIO_INT_EN_MID = $17;
|
|
STMPE240X_REG_GPIO_INT_EN_LSB = $18;
|
|
STMPE240X_REG_GPIO_INT_STA_MSB = $19;
|
Interrupt Status GPIO Register |
STMPE240X_REG_GPIO_INT_STA_MID = $1A;
|
|
STMPE240X_REG_GPIO_INT_STA_LSB = $1B;
|
|
STMPE240X_REG_GPIO_MP_STA_MSB = $A2;
|
GPIO Monitor Pin State Register |
STMPE240X_REG_GPIO_MP_STA_MID = $A3;
|
|
STMPE240X_REG_GPIO_MP_STA_LSB = $A4;
|
|
STMPE240X_REG_GPIO_SET_PIN_MSB = $83;
|
GPIO Set Pin State Register |
STMPE240X_REG_GPIO_SET_PIN_MID = $84;
|
|
STMPE240X_REG_GPIO_SET_PIN_LSB = $85;
|
|
STMPE240X_REG_GPIO_CLR_PIN_MSB = $86;
|
GPIO Clear Pin State Register |
STMPE240X_REG_GPIO_CLR_PIN_MID = $87;
|
|
STMPE240X_REG_GPIO_CLR_PIN_LSB = $88;
|
|
STMPE240X_REG_GPIO_SET_DIR_MSB = $89;
|
GPIO Set Pin Direction Register |
STMPE240X_REG_GPIO_SET_DIR_MID = $8A;
|
|
STMPE240X_REG_GPIO_SET_DIR_LSB = $8B;
|
|
STMPE240X_REG_GPIO_ED_MSB = $8C;
|
GPIO Edge Detect Status Register |
STMPE240X_REG_GPIO_ED_MID = $8D;
|
|
STMPE240X_REG_GPIO_ED_LSB = $8E;
|
|
STMPE240X_REG_GPIO_RE_MSB = $8F;
|
GPIO Rising Edge Register |
STMPE240X_REG_GPIO_RE_MID = $90;
|
|
STMPE240X_REG_GPIO_RE_LSB = $91;
|
|
STMPE240X_REG_GPIO_FE_MSB = $92;
|
GPIO Falling Edge Register |
STMPE240X_REG_GPIO_FE_MID = $93;
|
|
STMPE240X_REG_GPIO_FE_LSB = $94;
|
|
STMPE240X_REG_GPIO_PULL_UP_MSB = $95;
|
GPIO Pull Up Register |
STMPE240X_REG_GPIO_PULL_UP_MID = $96;
|
|
STMPE240X_REG_GPIO_PULL_UP_LSB = $97;
|
|
STMPE240X_REG_GPIO_PULL_DN_MSB = $98;
|
GPIO Pull Down Register |
STMPE240X_REG_GPIO_PULL_DN_MID = $99;
|
|
STMPE240X_REG_GPIO_PULL_DN_LSB = $9A;
|
|
STMPE240X_REG_GPIO_AF_U_MSB = $9B;
|
GPIO Alternate Function Register (Upper Bit) |
STMPE240X_REG_GPIO_AF_U_MID = $9C;
|
|
STMPE240X_REG_GPIO_AF_U_LSB = $9D;
|
|
STMPE240X_REG_GPIO_AF_L_MSB = $9E;
|
GPIO Alternate Function Register(Lower Bit) |
STMPE240X_REG_GPIO_AF_L_MID = $9F;
|
|
STMPE240X_REG_GPIO_AF_L_LSB = $A0;
|
|
STMPE240X_REG_PWMCS = $30;
|
PWM Control and Status register |
STMPE240X_REG_PWMIC0 = $38;
|
PWM instructions are initialized through this data port |
STMPE240X_REG_PWMIC1 = $39;
|
|
STMPE240X_REG_PWMIC2 = $3A;
|
|
STMPE240X_REG_KPC_COL = $60;
|
Keypad column scanning register |
STMPE240X_REG_KPC_ROW_MSB = $61;
|
Keypad row scanning register |
STMPE240X_REG_KPC_ROW_LSB = $62;
|
|
STMPE240X_REG_KPC_CTRL_MSB = $63;
|
Keypad control register |
STMPE240X_REG_KPC_CTRL_LSB = $64;
|
|
STMPE240X_REG_KPC_DATA_BYTE0 = $68;
|
Keypad data register |
STMPE240X_REG_KPC_DATA_BYTE1 = $69;
|
|
STMPE240X_REG_KPC_DATA_BYTE2 = $6A;
|
|
STMPE240X_REG_MAX = $BF;
|
|
STMPE240X_REG_SIZE = 3;
|
|
STMPE_REG_UNKNOWN = $FF;
|
STMPE*_CHIP_ID
STMPE610 / STMPE811 | |
STMPE811_CHIP_ID = $0811;
|
|
STMPE801 | |
STMPE801_CHIP_ID = $0801;
|
|
STMPE1601 | |
STMPE1601_CHIP_ID = $02;
|
|
STMPE1801 | |
STMPE1801_CHIP_ID = $C1;
|
|
STMPE2401 / STMPE2403 | |
STMPE240X_CHIP_ID = $01;
|
STMPE*_SYS_CTRL*_*
STMPE610 / STMPE811 | |
STMPE811_SYS_CTRL2_TS_OFF = (1 shl 3);
|
1: Switches off the clock supply to the temperature sensor |
STMPE811_SYS_CTRL2_GPIO_OFF (1 shl 2);
|
1: Switches off the clock supply to the GPIO |
STMPE811_SYS_CTRL2_TSC_OFF = (1 shl 1);
|
1: Switches off the clock supply to the touchscreen controller |
STMPE811_SYS_CTRL2_ADC_OFF = (1 shl 0);
|
1: Switches off the clock supply to the ADC |
STMPE801 | |
STMPE801_SYS_CTRL_RESET = (1 shl 7);
|
Writing 1 to this bit causes a soft reset. |
STMPE801_SYS_CTRL_INT_EN = (1 shl 2);
|
INT Enable 1 to enable, 0 to disable INT output. |
STMPE801_SYS_CTRL_INT_HI = (1 shl 0);
|
INT Polarity 1 for active HI, 0 for active LOW. |
STMPE1601 | |
STMPE1601_SYS_CTRL_RESET = (1 shl 7);
|
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. |
STMPE1601_SYS_CTRL_ENABLE_GPIO = (1 shl 3);
|
Writing a 0 to this bit will gate off the clock to the GPIO module, thus stopping its operation. |
STMPE1601_SYS_CTRL_ENABLE_KPC = (1 shl 1);
|
Writing a 0 to this bit will gate off the clock to the keypad controller module, thus stopping its operation. |
STMPE1601_SYS_CTRL_ENABLE_SPWM = (1 shl 0);
|
Writing a 0 to this bit will gate off the clock to the simple PWM controller module, thus stopping its operation. |
STMPE1801 | |
STMPE1801_SYS_CTRL_RESET = (1 shl 7);
|
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. |
STMPE240X | |
STMPE240X_SYS_CTRL_RESET = (1 shl 7);
|
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. |
STMPE240X_SYS_CTRL_ENABLE_GPIO = (1 shl 3);
|
Writing a 0 to this bit will gate off the clock to the GPIO module, thus stopping its operation. |
STMPE240X_SYS_CTRL_ENABLE_PWM = (1 shl 2);
|
Writing a 0 to this bit will gate off the clock to the PWM module, thus stopping its operation. |
STMPE240X_SYS_CTRL_ENABLE_KPC = (1 shl 1);
|
Writing a 0 to this bit will gate off the clock to the Keypad Controller module, thus stopping its operation. |
STMPE240X_SYS_CTRL_ENABLE_ROT = (1 shl 0);
|
Writing a 0 to this bit will gate off the clock to the Rotator module, thus stopping its operation. |
STMPE*_TSC_CTRL_*
STMPE610 / STMPE811 | |
STMPE811_TSC_CTRL_TSC_STA = (1 shl 7);
|
TSC status (Reads '1' when touch is detected / Reads '0' when touch is not detected) |
STMPE811_TSC_CTRL_TRACK_MASK = (7 shl 4);
|
TRACK: Tracking index |
STMPE811_TSC_CTRL_OPMODE_XYZ = (0 shl 1);
|
OP_MOD: TSC operating mode: X, Y, Z acquisition |
STMPE811_TSC_CTRL_OPMODE_XY = (1 shl 1);
|
OP_MOD: TSC operating mode: X, Y only |
STMPE811_TSC_CTRL_OPMODE_X = (2 shl 1);
|
OP_MOD: TSC operating mode: X only |
STMPE811_TSC_CTRL_OPMODE_Y = (3 shl 1);
|
OP_MOD: TSC operating mode: Y only |
STMPE811_TSC_CTRL_OPMODE_Z = (4 shl 1);
|
OP_MOD: TSC operating mode: Z only |
STMPE811_TSC_CTRL_TSC_EN = (1 shl 0);
|
Enable TSC |
STMPE*_TSC_CFG_*
STMPE610 / STMPE811 | |
STMPE811_TSC_CFG_AVE_CTRL_1 = (0 shl 6);
|
AVE_CTRL: Average control: 1 sample |
STMPE811_TSC_CFG_AVE_CTRL_2 = (1 shl 6);
|
AVE_CTRL: Average control: 2 samples |
STMPE811_TSC_CFG_AVE_CTRL_4 = (2 shl 6);
|
AVE_CTRL: Average control: 4 samples |
STMPE811_TSC_CFG_AVE_CTRL_8 = (3 shl 6);
|
AVE_CTRL: Average control: 8 samples |
STMPE811_TSC_CFG_TOUCH_DET_DELAY_MASK = (7 shl 3);
|
TOUCH_DET_DELAY: Touch detect delay |
STMPE811_TSC_CFG_SETTLING_MASK = (7 shl 0);
|
SETTLING: Panel driver settling time |
STMPE*_ADC_CTRL1_*
STMPE610 / STMPE811 | |
STMPE811_ADC_CTRL1_SAMPLE_TIME_MASK = (7 shl 4);
|
SAMPLE_TIMEn: ADC conversion time in number of clock |
STMPE811_ADC_CTRL1_MOD_12B = (1 shl 3);
|
MOD_12B: Selects 10 or 12-bit ADC operation (1: 12 bit ADC / 0: 10 bit ADC) |
STMPE811_ADC_CTRL1_REF_SEL = (1 shl 1);
|
REF_SEL: Selects between internal or external reference for the ADC (1: External reference / 0: Internal reference) |
STMPE*_ADC_CTRL2_*
STMPE610 / STMPE811 | |
STMPE811_ADC_CTRL2_ADC_FREQ_MASK = (3 shl 0);
|
ADC_FREQ: Selects the clock speed of ADC |
STMPE*_FIFO_STA_*
STMPE610 / STMPE811 | |
STMPE811_FIFO_STA_RESET = (1 shl 0);
|
FIFO Reset (Write 0 : FIFO put out of reset mode / Write 1 : Resets FIFO. All data in FIFO will be cleared) |
STMPE*_INT_CTRL_*
STMPE610 / STMPE811 | |
STMPE811_INT_CTRL_POLARITY = (1 shl 2);
|
This bit sets the INT pin polarity (1: Active high/rising edge / 0: Active low/falling edge) |
STMPE811_INT_CTRL_TYPE = (1 shl 1);
|
This bit sets the type of interrupt signal required by the host (1: Edge interrupt / 0: Level interrupt) |
STMPE811_INT_CTRL_GLOBAL = (1 shl 0);
|
This is master enable for the interrupt system (1: Global interrupt / 0: Stops all interrupts) |
STMPE*_INT_EN_*
STMPE610 / STMPE811 | |
STMPE811_INT_EN_GPIO = (1 shl 7);
|
GPIO: Any enabled GPIO interrupts |
STMPE811_INT_EN_ADC = (1 shl 6);
|
ADC: Any enabled ADC interrupts |
STMPE811_INT_EN_TEMP_SENS = (1 shl 5);
|
TEMP_SENS: Temperature threshold triggering |
STMPE811_INT_EN_FIFO_EMPTY = (1 shl 4);
|
FIFO_EMPTY: FIFO is empty |
STMPE811_INT_EN_FIFO_FULL = (1 shl 3);
|
FIFO_FULL: FIFO is full |
STMPE811_INT_EN_FIFO_OFLOW = (1 shl 2);
|
FIFO_OFLOW: FIFO is overflowed |
STMPE811_INT_EN_FIFO_TH = (1 shl 1);
|
FIFO_TH: FIFO is equal or above threshold value |
STMPE811_INT_EN_TOUCH_DET = (1 shl 0);
|
TOUCH_DET: Touch is detected |
STMPE*_INT_STA_*
STMPE610 / STMPE811 | |
STMPE811_INT_STA_GPIO = (1 shl 7);
|
GPIO: Any enabled GPIO interrupts |
STMPE811_INT_STA_ADC = (1 shl 6);
|
ADC: Any enabled ADC interrupts |
STMPE811_INT_STA_TEMP_SENS = (1 shl 5);
|
TEMP_SENS: Temperature threshold triggering |
STMPE811_INT_STA_FIFO_EMPTY = (1 shl 4);
|
FIFO_EMPTY: FIFO is empty |
STMPE811_INT_STA_FIFO_FULL = (1 shl 3);
|
FIFO_FULL: FIFO is full |
STMPE811_INT_STA_FIFO_OFLOW = (1 shl 2);
|
FIFO_OFLOW: FIFO is overflowed |
STMPE811_INT_STA_FIFO_TH = (1 shl 1);
|
FIFO_TH: FIFO is equal or above threshold value |
STMPE811_INT_STA_TOUCH_DET = (1 shl 0);
|
TOUCH_DET: Touch is detected |
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;
|
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
procedure STMPEInit;
Note | Called internally by other functions |
---|
STMPE functions
function STMPE610GPIOCreate(I2C:PI2CDevice; SPI:PSPIDevice; Address,ChipSelect:Word; IRQ:PGPIOInfo):PGPIODevice;
I2C | The I2C device this STMPE610 is connected to (Optional) |
---|---|
SPI | The SPI device this STMPE610 is connected to (Optional) |
Address | The I2C address for this STMPE610 (or I2C_ADDRESS_INVALID if SPI connected) |
ChipSelect | The SPI chip select for this STMPE610 (or SPI_CS_NONE if I2C connected) |
IRQ | The GPIO information for the IRQ line (Optional) |
Return | Pointer to the new GPIO device or nil on failure |
Note | Either I2C or SPI must be specified but not both |
function STMPE801GPIOCreate(I2C:PI2CDevice; Address:Word; IRQ:PGPIOInfo):PGPIODevice;
I2C | The I2C device this STMPE801 is connected to |
---|---|
Address | The I2C address for this STMPE801 |
IRQ | The GPIO information for the IRQ line (Optional) |
Return | Pointer to the new GPIO device or nil on failure |
function STMPE811GPIOCreate(I2C:PI2CDevice; SPI:PSPIDevice; Address,ChipSelect:Word; IRQ:PGPIOInfo):PGPIODevice;
I2C | The I2C device this STMPE811 is connected to (Optional) |
---|---|
SPI | The SPI device this STMPE811 is connected to (Optional) |
Address | The I2C address for this STMPE811 (or I2C_ADDRESS_INVALID if SPI connected) |
ChipSelect | The SPI chip select for this STMPE811 (or SPI_CS_NONE if I2C connected) |
IRQ | The GPIO information for the IRQ line (Optional) |
Return | Pointer to the new GPIO device or nil on failure |
Note | Either I2C or SPI must be specified but not both |
function STMPE1601GPIOCreate(I2C:PI2CDevice; Address:Word; IRQ:PGPIOInfo):PGPIODevice;
I2C | The I2C device this STMPE1601 is connected to |
---|---|
Address | The I2C address for this STMPE1601 |
IRQ | The GPIO information for the IRQ line (Optional) |
Return | Pointer to the new GPIO device or nil on failure |
function STMPE1801GPIOCreate(I2C:PI2CDevice; Address:Word; IRQ:PGPIOInfo):PGPIODevice;
I2C | The I2C device this STMPE1801 is connected to |
---|---|
Address | The I2C address for this STMPE1801 |
IRQ | The GPIO information for the IRQ line (Optional) |
Return | Pointer to the new GPIO device or nil on failure |
function STMPE2401GPIOCreate(I2C:PI2CDevice; Address:Word; IRQ:PGPIOInfo):PGPIODevice;
I2C | The I2C device this STMPE2401 is connected to |
---|---|
Address | The I2C address for this STMPE2401 |
IRQ | The GPIO information for the IRQ line (Optional) |
Return | Pointer to the new GPIO device or nil on failure |
function STMPEGPIODestroy(GPIO:PGPIODevice):LongWord;
GPIO | The GPIO device to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function STMPE610TouchCreate(I2C:PI2CDevice; SPI:PSPIDevice; Address,ChipSelect:Word; Width,Height:LongWord; IRQ:PGPIOInfo):PTouchDevice;
I2C | The I2C device this STMPE610 is connected to (Optional) |
---|---|
SPI | The SPI device this STMPE610 is connected to (Optional) |
Address | The I2C address for this STMPE610 (or I2C_ADDRESS_INVALID if SPI connected) |
ChipSelect | The SPI chip select for this STMPE610 (or SPI_CS_NONE if I2C connected) |
Width | The width of the screen in pixels |
Height | The height of the screen in pixels |
IRQ | The GPIO information for the IRQ line (Optional) |
Return | Pointer to the new Touch device or nil on failure |
Note | Either I2C or SPI must be specified but not both |
function STMPE811TouchCreate(I2C:PI2CDevice; SPI:PSPIDevice; Address,ChipSelect:Word; Width,Height:LongWord; IRQ:PGPIOInfo):PTouchDevice;
I2C | The I2C device this STMPE811 is connected to (Optional) |
---|---|
SPI | The SPI device this STMPE811 is connected to (Optional) |
Address | The I2C address for this STMPE811 (or I2C_ADDRESS_INVALID if SPI connected) |
ChipSelect | The SPI chip select for this STMPE811 (or SPI_CS_NONE if I2C connected) |
Width | The width of the screen in pixels |
Height | The height of the screen in pixels |
IRQ | The GPIO information for the IRQ line (Optional) |
Return | Pointer to the new Touch device or nil on failure |
Note | Either I2C or SPI must be specified but not both |
function STMPETouchDestroy(Touch:PTouchDevice):LongWord;
Touch | The Touch device to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
STMPE GPIO functions
function STMPEGPIOStart(GPIO:PGPIODevice):LongWord;
Note | Not intended to be called directly by applications, use GPIODeviceStart instead |
---|
function STMPEGPIOStop(GPIO:PGPIODevice):LongWord;
Note | Not intended to be called directly by applications, use GPIODeviceStop instead |
---|
function STMPEGPIORead(GPIO:PGPIODevice; Reg:LongWord):LongWord;
Note | Not intended to be called directly by applications, use GPIODeviceRead instead |
---|
procedure STMPEGPIOWrite(GPIO:PGPIODevice; Reg,Value:LongWord);
Note | Not intended to be called directly by applications, use GPIODeviceWrite instead |
---|
function STMPEGPIOInputGet(GPIO:PGPIODevice; Pin:LongWord):LongWord;
Note | Not intended to be called directly by applications, use GPIODeviceInputGet instead |
---|
function STMPEGPIOOutputSet(GPIO:PGPIODevice; Pin,Level:LongWord):LongWord;
Note | Not intended to be called directly by applications, use GPIODeviceOutputSet instead |
---|
function STMPEGPIOPullGet(GPIO:PGPIODevice; Pin:LongWord):LongWord;
Note | Not intended to be called directly by applications, use GPIODevicePullGet instead |
---|
function STMPEGPIOPullSelect(GPIO:PGPIODevice; Pin,Mode:LongWord):LongWord;
Note | Not intended to be called directly by applications, use GPIODevicePullSelect instead |
---|
function STMPEGPIOFunctionGet(GPIO:PGPIODevice; Pin:LongWord):LongWord;
Note | Not intended to be called directly by applications, use GPIODeviceFunctionGet instead |
---|
function STMPEGPIOFunctionSelect(GPIO:PGPIODevice; Pin,Mode:LongWord):LongWord;
Note | Not intended to be called directly by applications, use GPIODeviceFunctionSelect instead |
---|
STMPE touch functions
function STMPETouchStart(Touch:PTouchDevice):LongWord;
Note | Not intended to be called directly by applications, use TouchDeviceStart instead |
---|
function STMPETouchStop(Touch:PTouchDevice):LongWord;
Note | Not intended to be called directly by applications, use TouchDeviceStop instead |
---|
procedure STMPETouchTimer(Touch:PSTMPETouch);
Note | Not intended to be called directly by applications |
---|
procedure STMPETouchCallback(Touch:PSTMPETouch; Pin,Trigger:LongWord);
Note | Not intended to be called directly by applications |
---|
STMPE helper functions
function STMPEReadByte(Control:PSTMPEControl; Reg:Byte; Value:PByte):LongWord;
Note | None documented |
---|
function STMPEWriteByte(Control:PSTMPEControl; Reg,Value:Byte):LongWord;
Note | None documented |
---|
function STMPEReadWord(Control:PSTMPEControl; Reg:Byte; Value:PWord):LongWord;
Note | None documented |
---|
function STMPEWriteWord(Control:PSTMPEControl; Reg:Byte; Value:Word):LongWord;
Note | None documented |
---|
function STMPEReadBytes(Control:PSTMPEControl; Reg,Len:Byte; Values:PByte):LongWord;
Note | None documented |
---|
function STMPEWriteBytes(Control:PSTMPEControl; Reg,Len:Byte; Values:PByte):LongWord;
Note | None documented |
---|
function STMPESetBits(Control:PSTMPEControl; Reg,Mask,Value:Byte):LongWord;
Note | None documented |
---|
function STMPEResetFIFO(Control:PSTMPEControl; Reg:Byte):LongWord;
Note | None documented |
---|
Return to Unit Reference