61 #define STMPE811_MAX_INSTANCE 2 117 static uint8_t stmpe811_GetInstance(uint16_t DeviceAddr);
137 instance = stmpe811_GetInstance(DeviceAddr);
143 empty = stmpe811_GetInstance(0);
303 tmp &= ~(uint8_t)0x04;
329 tmp &= ~(uint8_t)0x02;
439 uint8_t error_code = 0;
485 error_code = (uint8_t) IO_Mode;
510 tmp |= (uint8_t)IO_Pin;
514 tmp &= ~(uint8_t)IO_Pin;
537 tmp |= (uint8_t)IO_Pin;
560 tmp &= ~(uint8_t)IO_Pin;
579 uint8_t tmp1 = 0, tmp2 = 0;
586 tmp1 &= ~(uint8_t)IO_Pin;
589 tmp2 &= ~(uint8_t)IO_Pin;
594 tmp1 |= (uint8_t)IO_Pin;
600 tmp2 |= (uint8_t)IO_Pin;
691 tmp |= (uint8_t)IO_Pin;
713 tmp &= ~(uint8_t)IO_Pin;
877 uldataXYZ = (dataXYZ[0] << 24)|(dataXYZ[1] << 16)|(dataXYZ[2] << 8)|(dataXYZ[3] << 0);
878 *X = (uldataXYZ >> 20) & 0x00000FFF;
879 *Y = (uldataXYZ >> 8) & 0x00000FFF;
945 static uint8_t stmpe811_GetInstance(uint16_t DeviceAddr)
uint8_t stmpe811_ReadGITStatus(uint16_t DeviceAddr, uint8_t Source)
Return the Global interrupts status.
#define STMPE811_REG_TSC_CFG
void stmpe811_Init(uint16_t DeviceAddr)
Initialize the stmpe811 and configure the needed hardware resources.
void stmpe811_IO_ClearIT(uint16_t DeviceAddr, uint32_t IO_Pin)
Clear the selected IO interrupt pending bit(s).
#define STMPE811_REG_IO_DIR
#define STMPE811_REG_SYS_CTRL2
void stmpe811_Reset(uint16_t DeviceAddr)
Reset the stmpe811 by Software.
#define STMPE811_EDGE_RISING
void stmpe811_SetITType(uint16_t DeviceAddr, uint8_t Type)
Set the global interrupt Type.
#define STMPE811_REG_FIFO_SIZE
uint8_t stmpe811_IO_Config(uint16_t DeviceAddr, uint32_t IO_Pin, IO_ModeTypedef IO_Mode)
Configures the IO pin(s) according to IO mode structure value.
void stmpe811_SetITPolarity(uint16_t DeviceAddr, uint8_t Polarity)
Set the global interrupt Polarity.
uint8_t stmpe811_TS_DetectTouch(uint16_t DeviceAddr)
Return if there is touch detected or not.
#define STMPE811_REG_IO_CLR_PIN
#define STMPE811_REG_FIFO_TH
#define STMPE811_REG_IO_MP_STA
void stmpe811_DisableITSource(uint16_t DeviceAddr, uint8_t Source)
Disable the interrupt mode for the selected IT source.
#define STMPE811_REG_IO_INT_STA
IO_DrvTypeDef stmpe811_io_drv
#define STMPE811_REG_INT_CTRL
#define STMPE811_POLARITY_HIGH
#define STMPE811_MAX_INSTANCE
void stmpe811_IO_EnableAF(uint16_t DeviceAddr, uint32_t IO_Pin)
Enable the AF for the selected IO pin(s).
#define STMPE811_TS_CTRL_STATUS
#define STMPE811_TYPE_EDGE
uint8_t stmpe811[STMPE811_MAX_INSTANCE]
#define STMPE811_TOUCH_IO_ALL
#define STMPE811_REG_FIFO_STA
void stmpe811_IO_DisableIT(uint16_t DeviceAddr)
Disable the global IO interrupt source.
#define STMPE811_REG_CHP_ID_MSB
void IOE_Delay(uint32_t delay)
void stmpe811_TS_Start(uint16_t DeviceAddr)
Configures the touch Screen Controller (Single point detection)
void stmpe811_IO_InitPin(uint16_t DeviceAddr, uint32_t IO_Pin, uint8_t Direction)
Initialize the selected IO pin direction.
#define STMPE811_EDGE_FALLING
#define STMPE811_REG_TSC_I_DRIVE
#define STMPE811_DIRECTION_OUT
#define STMPE811_REG_IO_INT_EN
uint16_t IOE_ReadMultiple(uint8_t addr, uint8_t reg, uint8_t *buffer, uint16_t length)
#define STMPE811_REG_INT_EN
This file contains all the functions prototypes for the stmpe811.c IO expander driver.
uint8_t IOE_Read(uint8_t addr, uint8_t reg)
void stmpe811_IO_DisablePinIT(uint16_t DeviceAddr, uint32_t IO_Pin)
Disable interrupt mode for the selected IO pin(s).
void stmpe811_IO_EnablePinIT(uint16_t DeviceAddr, uint32_t IO_Pin)
Enable interrupt mode for the selected IO pin(s).
void stmpe811_IO_SetEdgeMode(uint16_t DeviceAddr, uint32_t IO_Pin, uint8_t Edge)
Configure the Edge for which a transition is detectable for the selected pin.
void IOE_Write(uint8_t addr, uint8_t reg, uint8_t value)
TS_DrvTypeDef stmpe811_ts_drv
uint16_t stmpe811_ReadID(uint16_t DeviceAddr)
Read the stmpe811 IO Expander device ID.
uint32_t stmpe811_IO_ITStatus(uint16_t DeviceAddr, uint32_t IO_Pin)
Check the status of the selected IO interrupt pending bit.
void stmpe811_DisableGlobalIT(uint16_t DeviceAddr)
Disable the Global interrupt.
void stmpe811_IO_EnableIT(uint16_t DeviceAddr)
Enable the global IO interrupt source.
void stmpe811_IO_DisableAF(uint16_t DeviceAddr, uint32_t IO_Pin)
Disable the AF for the selected IO pin(s).
#define STMPE811_REG_TSC_FRACT_XYZ
#define STMPE811_REG_IO_RE
void stmpe811_EnableGlobalIT(uint16_t DeviceAddr)
Enable the Global interrupt.
void stmpe811_IO_Start(uint16_t DeviceAddr, uint32_t IO_Pin)
Start the IO functionality use and disable the AF for selected IO pin(s).
#define STMPE811_REG_IO_FE
#define STMPE811_REG_TSC_CTRL
#define STMPE811_REG_CHP_ID_LSB
uint32_t stmpe811_IO_ReadPin(uint16_t DeviceAddr, uint32_t IO_Pin)
Return the state of the selected IO pin(s).
#define STMPE811_DIRECTION_IN
void stmpe811_EnableITSource(uint16_t DeviceAddr, uint8_t Source)
Enable the interrupt mode for the selected IT source.
void stmpe811_TS_DisableIT(uint16_t DeviceAddr)
Configure the selected source to generate a global interrupt or not.
#define STMPE811_POLARITY_LOW
#define STMPE811_REG_SYS_CTRL1
void stmpe811_TS_GetXY(uint16_t DeviceAddr, uint16_t *X, uint16_t *Y)
Get the touch screen X and Y positions values.
void stmpe811_ClearGlobalIT(uint16_t DeviceAddr, uint8_t Source)
Clear the selected Global interrupt pending bit(s)
#define STMPE811_REG_ADC_CTRL2
uint8_t stmpe811_GlobalITStatus(uint16_t DeviceAddr, uint8_t Source)
Check the selected Global interrupt source pending bit.
#define STMPE811_REG_IO_AF
#define STMPE811_REG_IO_ED
uint8_t stmpe811_TS_ITStatus(uint16_t DeviceAddr)
Configure the selected source to generate a global interrupt or not.
void stmpe811_TS_EnableIT(uint16_t DeviceAddr)
Configure the selected source to generate a global interrupt or not.
#define STMPE811_REG_ADC_CTRL1
#define STMPE811_REG_INT_STA
void stmpe811_IO_WritePin(uint16_t DeviceAddr, uint32_t IO_Pin, uint8_t PinState)
Write a new IO pin state.
void stmpe811_TS_ClearIT(uint16_t DeviceAddr)
Configure the selected source to generate a global interrupt or not.
#define STMPE811_REG_TSC_DATA_NON_INC
#define STMPE811_REG_IO_SET_PIN
#define STMPE811_TYPE_LEVEL