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
To be documented
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