Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: CMSIS_STM32L4xx CMSIS_DSP_401 STM32L4xx_HAL_Driver
Components/stmpe811/stmpe811.h@0:ad9dfc0179dc, 2015-11-02 (annotated)
- Committer:
- EricLew
- Date:
- Mon Nov 02 19:38:36 2015 +0000
- Revision:
- 0:ad9dfc0179dc
commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| EricLew | 0:ad9dfc0179dc | 1 | /** |
| EricLew | 0:ad9dfc0179dc | 2 | ****************************************************************************** |
| EricLew | 0:ad9dfc0179dc | 3 | * @file stmpe811.h |
| EricLew | 0:ad9dfc0179dc | 4 | * @author MCD Application Team |
| EricLew | 0:ad9dfc0179dc | 5 | * @version V2.0.0 |
| EricLew | 0:ad9dfc0179dc | 6 | * @date 15-December-2014 |
| EricLew | 0:ad9dfc0179dc | 7 | * @brief This file contains all the functions prototypes for the |
| EricLew | 0:ad9dfc0179dc | 8 | * stmpe811.c IO expander driver. |
| EricLew | 0:ad9dfc0179dc | 9 | ****************************************************************************** |
| EricLew | 0:ad9dfc0179dc | 10 | * @attention |
| EricLew | 0:ad9dfc0179dc | 11 | * |
| EricLew | 0:ad9dfc0179dc | 12 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
| EricLew | 0:ad9dfc0179dc | 13 | * |
| EricLew | 0:ad9dfc0179dc | 14 | * Redistribution and use in source and binary forms, with or without modification, |
| EricLew | 0:ad9dfc0179dc | 15 | * are permitted provided that the following conditions are met: |
| EricLew | 0:ad9dfc0179dc | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
| EricLew | 0:ad9dfc0179dc | 17 | * this list of conditions and the following disclaimer. |
| EricLew | 0:ad9dfc0179dc | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
| EricLew | 0:ad9dfc0179dc | 19 | * this list of conditions and the following disclaimer in the documentation |
| EricLew | 0:ad9dfc0179dc | 20 | * and/or other materials provided with the distribution. |
| EricLew | 0:ad9dfc0179dc | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
| EricLew | 0:ad9dfc0179dc | 22 | * may be used to endorse or promote products derived from this software |
| EricLew | 0:ad9dfc0179dc | 23 | * without specific prior written permission. |
| EricLew | 0:ad9dfc0179dc | 24 | * |
| EricLew | 0:ad9dfc0179dc | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| EricLew | 0:ad9dfc0179dc | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| EricLew | 0:ad9dfc0179dc | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| EricLew | 0:ad9dfc0179dc | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| EricLew | 0:ad9dfc0179dc | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| EricLew | 0:ad9dfc0179dc | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| EricLew | 0:ad9dfc0179dc | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| EricLew | 0:ad9dfc0179dc | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| EricLew | 0:ad9dfc0179dc | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| EricLew | 0:ad9dfc0179dc | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| EricLew | 0:ad9dfc0179dc | 35 | * |
| EricLew | 0:ad9dfc0179dc | 36 | ****************************************************************************** |
| EricLew | 0:ad9dfc0179dc | 37 | */ |
| EricLew | 0:ad9dfc0179dc | 38 | |
| EricLew | 0:ad9dfc0179dc | 39 | /* Define to prevent recursive inclusion -------------------------------------*/ |
| EricLew | 0:ad9dfc0179dc | 40 | #ifndef __STMPE811_H |
| EricLew | 0:ad9dfc0179dc | 41 | #define __STMPE811_H |
| EricLew | 0:ad9dfc0179dc | 42 | |
| EricLew | 0:ad9dfc0179dc | 43 | #ifdef __cplusplus |
| EricLew | 0:ad9dfc0179dc | 44 | extern "C" { |
| EricLew | 0:ad9dfc0179dc | 45 | #endif |
| EricLew | 0:ad9dfc0179dc | 46 | |
| EricLew | 0:ad9dfc0179dc | 47 | /* Includes ------------------------------------------------------------------*/ |
| EricLew | 0:ad9dfc0179dc | 48 | #include "../Common/ts.h" |
| EricLew | 0:ad9dfc0179dc | 49 | #include "../Common/io.h" |
| EricLew | 0:ad9dfc0179dc | 50 | |
| EricLew | 0:ad9dfc0179dc | 51 | /** @addtogroup BSP |
| EricLew | 0:ad9dfc0179dc | 52 | * @{ |
| EricLew | 0:ad9dfc0179dc | 53 | */ |
| EricLew | 0:ad9dfc0179dc | 54 | |
| EricLew | 0:ad9dfc0179dc | 55 | /** @addtogroup Components |
| EricLew | 0:ad9dfc0179dc | 56 | * @{ |
| EricLew | 0:ad9dfc0179dc | 57 | */ |
| EricLew | 0:ad9dfc0179dc | 58 | |
| EricLew | 0:ad9dfc0179dc | 59 | /** @defgroup STMPE811 |
| EricLew | 0:ad9dfc0179dc | 60 | * @{ |
| EricLew | 0:ad9dfc0179dc | 61 | */ |
| EricLew | 0:ad9dfc0179dc | 62 | |
| EricLew | 0:ad9dfc0179dc | 63 | /** @defgroup STMPE811_Exported_Types |
| EricLew | 0:ad9dfc0179dc | 64 | * @{ |
| EricLew | 0:ad9dfc0179dc | 65 | */ |
| EricLew | 0:ad9dfc0179dc | 66 | /** |
| EricLew | 0:ad9dfc0179dc | 67 | * @} |
| EricLew | 0:ad9dfc0179dc | 68 | */ |
| EricLew | 0:ad9dfc0179dc | 69 | |
| EricLew | 0:ad9dfc0179dc | 70 | /** @defgroup STMPE811_Exported_Constants |
| EricLew | 0:ad9dfc0179dc | 71 | * @{ |
| EricLew | 0:ad9dfc0179dc | 72 | */ |
| EricLew | 0:ad9dfc0179dc | 73 | |
| EricLew | 0:ad9dfc0179dc | 74 | /* Chip IDs */ |
| EricLew | 0:ad9dfc0179dc | 75 | #define STMPE811_ID 0x0811 |
| EricLew | 0:ad9dfc0179dc | 76 | |
| EricLew | 0:ad9dfc0179dc | 77 | /* Identification registers & System Control */ |
| EricLew | 0:ad9dfc0179dc | 78 | #define STMPE811_REG_CHP_ID_LSB 0x00 |
| EricLew | 0:ad9dfc0179dc | 79 | #define STMPE811_REG_CHP_ID_MSB 0x01 |
| EricLew | 0:ad9dfc0179dc | 80 | #define STMPE811_REG_ID_VER 0x02 |
| EricLew | 0:ad9dfc0179dc | 81 | |
| EricLew | 0:ad9dfc0179dc | 82 | /* Global interrupt Enable bit */ |
| EricLew | 0:ad9dfc0179dc | 83 | #define STMPE811_GIT_EN 0x01 |
| EricLew | 0:ad9dfc0179dc | 84 | |
| EricLew | 0:ad9dfc0179dc | 85 | /* IO expander functionalities */ |
| EricLew | 0:ad9dfc0179dc | 86 | #define STMPE811_ADC_FCT 0x01 |
| EricLew | 0:ad9dfc0179dc | 87 | #define STMPE811_TS_FCT 0x02 |
| EricLew | 0:ad9dfc0179dc | 88 | #define STMPE811_IO_FCT 0x04 |
| EricLew | 0:ad9dfc0179dc | 89 | #define STMPE811_TEMPSENS_FCT 0x08 |
| EricLew | 0:ad9dfc0179dc | 90 | |
| EricLew | 0:ad9dfc0179dc | 91 | /* Global Interrupts definitions */ |
| EricLew | 0:ad9dfc0179dc | 92 | #define STMPE811_GIT_IO 0x80 /* IO interrupt */ |
| EricLew | 0:ad9dfc0179dc | 93 | #define STMPE811_GIT_ADC 0x40 /* ADC interrupt */ |
| EricLew | 0:ad9dfc0179dc | 94 | #define STMPE811_GIT_TEMP 0x20 /* Not implemented */ |
| EricLew | 0:ad9dfc0179dc | 95 | #define STMPE811_GIT_FE 0x10 /* FIFO empty interrupt */ |
| EricLew | 0:ad9dfc0179dc | 96 | #define STMPE811_GIT_FF 0x08 /* FIFO full interrupt */ |
| EricLew | 0:ad9dfc0179dc | 97 | #define STMPE811_GIT_FOV 0x04 /* FIFO overflowed interrupt */ |
| EricLew | 0:ad9dfc0179dc | 98 | #define STMPE811_GIT_FTH 0x02 /* FIFO above threshold interrupt */ |
| EricLew | 0:ad9dfc0179dc | 99 | #define STMPE811_GIT_TOUCH 0x01 /* Touch is detected interrupt */ |
| EricLew | 0:ad9dfc0179dc | 100 | #define STMPE811_ALL_GIT 0x1F /* All global interrupts */ |
| EricLew | 0:ad9dfc0179dc | 101 | #define STMPE811_TS_IT (STMPE811_GIT_TOUCH | STMPE811_GIT_FTH | STMPE811_GIT_FOV | STMPE811_GIT_FF | STMPE811_GIT_FE) /* Touch screen interrupts */ |
| EricLew | 0:ad9dfc0179dc | 102 | |
| EricLew | 0:ad9dfc0179dc | 103 | /* General Control Registers */ |
| EricLew | 0:ad9dfc0179dc | 104 | #define STMPE811_REG_SYS_CTRL1 0x03 |
| EricLew | 0:ad9dfc0179dc | 105 | #define STMPE811_REG_SYS_CTRL2 0x04 |
| EricLew | 0:ad9dfc0179dc | 106 | #define STMPE811_REG_SPI_CFG 0x08 |
| EricLew | 0:ad9dfc0179dc | 107 | |
| EricLew | 0:ad9dfc0179dc | 108 | /* Interrupt system Registers */ |
| EricLew | 0:ad9dfc0179dc | 109 | #define STMPE811_REG_INT_CTRL 0x09 |
| EricLew | 0:ad9dfc0179dc | 110 | #define STMPE811_REG_INT_EN 0x0A |
| EricLew | 0:ad9dfc0179dc | 111 | #define STMPE811_REG_INT_STA 0x0B |
| EricLew | 0:ad9dfc0179dc | 112 | #define STMPE811_REG_IO_INT_EN 0x0C |
| EricLew | 0:ad9dfc0179dc | 113 | #define STMPE811_REG_IO_INT_STA 0x0D |
| EricLew | 0:ad9dfc0179dc | 114 | |
| EricLew | 0:ad9dfc0179dc | 115 | /* IO Registers */ |
| EricLew | 0:ad9dfc0179dc | 116 | #define STMPE811_REG_IO_SET_PIN 0x10 |
| EricLew | 0:ad9dfc0179dc | 117 | #define STMPE811_REG_IO_CLR_PIN 0x11 |
| EricLew | 0:ad9dfc0179dc | 118 | #define STMPE811_REG_IO_MP_STA 0x12 |
| EricLew | 0:ad9dfc0179dc | 119 | #define STMPE811_REG_IO_DIR 0x13 |
| EricLew | 0:ad9dfc0179dc | 120 | #define STMPE811_REG_IO_ED 0x14 |
| EricLew | 0:ad9dfc0179dc | 121 | #define STMPE811_REG_IO_RE 0x15 |
| EricLew | 0:ad9dfc0179dc | 122 | #define STMPE811_REG_IO_FE 0x16 |
| EricLew | 0:ad9dfc0179dc | 123 | #define STMPE811_REG_IO_AF 0x17 |
| EricLew | 0:ad9dfc0179dc | 124 | |
| EricLew | 0:ad9dfc0179dc | 125 | /* ADC Registers */ |
| EricLew | 0:ad9dfc0179dc | 126 | #define STMPE811_REG_ADC_INT_EN 0x0E |
| EricLew | 0:ad9dfc0179dc | 127 | #define STMPE811_REG_ADC_INT_STA 0x0F |
| EricLew | 0:ad9dfc0179dc | 128 | #define STMPE811_REG_ADC_CTRL1 0x20 |
| EricLew | 0:ad9dfc0179dc | 129 | #define STMPE811_REG_ADC_CTRL2 0x21 |
| EricLew | 0:ad9dfc0179dc | 130 | #define STMPE811_REG_ADC_CAPT 0x22 |
| EricLew | 0:ad9dfc0179dc | 131 | #define STMPE811_REG_ADC_DATA_CH0 0x30 |
| EricLew | 0:ad9dfc0179dc | 132 | #define STMPE811_REG_ADC_DATA_CH1 0x32 |
| EricLew | 0:ad9dfc0179dc | 133 | #define STMPE811_REG_ADC_DATA_CH2 0x34 |
| EricLew | 0:ad9dfc0179dc | 134 | #define STMPE811_REG_ADC_DATA_CH3 0x36 |
| EricLew | 0:ad9dfc0179dc | 135 | #define STMPE811_REG_ADC_DATA_CH4 0x38 |
| EricLew | 0:ad9dfc0179dc | 136 | #define STMPE811_REG_ADC_DATA_CH5 0x3A |
| EricLew | 0:ad9dfc0179dc | 137 | #define STMPE811_REG_ADC_DATA_CH6 0x3B |
| EricLew | 0:ad9dfc0179dc | 138 | #define STMPE811_REG_ADC_DATA_CH7 0x3C |
| EricLew | 0:ad9dfc0179dc | 139 | |
| EricLew | 0:ad9dfc0179dc | 140 | /* Touch Screen Registers */ |
| EricLew | 0:ad9dfc0179dc | 141 | #define STMPE811_REG_TSC_CTRL 0x40 |
| EricLew | 0:ad9dfc0179dc | 142 | #define STMPE811_REG_TSC_CFG 0x41 |
| EricLew | 0:ad9dfc0179dc | 143 | #define STMPE811_REG_WDM_TR_X 0x42 |
| EricLew | 0:ad9dfc0179dc | 144 | #define STMPE811_REG_WDM_TR_Y 0x44 |
| EricLew | 0:ad9dfc0179dc | 145 | #define STMPE811_REG_WDM_BL_X 0x46 |
| EricLew | 0:ad9dfc0179dc | 146 | #define STMPE811_REG_WDM_BL_Y 0x48 |
| EricLew | 0:ad9dfc0179dc | 147 | #define STMPE811_REG_FIFO_TH 0x4A |
| EricLew | 0:ad9dfc0179dc | 148 | #define STMPE811_REG_FIFO_STA 0x4B |
| EricLew | 0:ad9dfc0179dc | 149 | #define STMPE811_REG_FIFO_SIZE 0x4C |
| EricLew | 0:ad9dfc0179dc | 150 | #define STMPE811_REG_TSC_DATA_X 0x4D |
| EricLew | 0:ad9dfc0179dc | 151 | #define STMPE811_REG_TSC_DATA_Y 0x4F |
| EricLew | 0:ad9dfc0179dc | 152 | #define STMPE811_REG_TSC_DATA_Z 0x51 |
| EricLew | 0:ad9dfc0179dc | 153 | #define STMPE811_REG_TSC_DATA_XYZ 0x52 |
| EricLew | 0:ad9dfc0179dc | 154 | #define STMPE811_REG_TSC_FRACT_XYZ 0x56 |
| EricLew | 0:ad9dfc0179dc | 155 | #define STMPE811_REG_TSC_DATA_INC 0x57 |
| EricLew | 0:ad9dfc0179dc | 156 | #define STMPE811_REG_TSC_DATA_NON_INC 0xD7 |
| EricLew | 0:ad9dfc0179dc | 157 | #define STMPE811_REG_TSC_I_DRIVE 0x58 |
| EricLew | 0:ad9dfc0179dc | 158 | #define STMPE811_REG_TSC_SHIELD 0x59 |
| EricLew | 0:ad9dfc0179dc | 159 | |
| EricLew | 0:ad9dfc0179dc | 160 | /* Touch Screen Pins definition */ |
| EricLew | 0:ad9dfc0179dc | 161 | #define STMPE811_TOUCH_YD STMPE811_PIN_7 |
| EricLew | 0:ad9dfc0179dc | 162 | #define STMPE811_TOUCH_XD STMPE811_PIN_6 |
| EricLew | 0:ad9dfc0179dc | 163 | #define STMPE811_TOUCH_YU STMPE811_PIN_5 |
| EricLew | 0:ad9dfc0179dc | 164 | #define STMPE811_TOUCH_XU STMPE811_PIN_4 |
| EricLew | 0:ad9dfc0179dc | 165 | #define STMPE811_TOUCH_IO_ALL (uint32_t)(STMPE811_TOUCH_YD | STMPE811_TOUCH_XD | STMPE811_TOUCH_YU | STMPE811_TOUCH_XU) |
| EricLew | 0:ad9dfc0179dc | 166 | |
| EricLew | 0:ad9dfc0179dc | 167 | /* IO Pins definition */ |
| EricLew | 0:ad9dfc0179dc | 168 | #define STMPE811_PIN_0 0x01 |
| EricLew | 0:ad9dfc0179dc | 169 | #define STMPE811_PIN_1 0x02 |
| EricLew | 0:ad9dfc0179dc | 170 | #define STMPE811_PIN_2 0x04 |
| EricLew | 0:ad9dfc0179dc | 171 | #define STMPE811_PIN_3 0x08 |
| EricLew | 0:ad9dfc0179dc | 172 | #define STMPE811_PIN_4 0x10 |
| EricLew | 0:ad9dfc0179dc | 173 | #define STMPE811_PIN_5 0x20 |
| EricLew | 0:ad9dfc0179dc | 174 | #define STMPE811_PIN_6 0x40 |
| EricLew | 0:ad9dfc0179dc | 175 | #define STMPE811_PIN_7 0x80 |
| EricLew | 0:ad9dfc0179dc | 176 | #define STMPE811_PIN_ALL 0xFF |
| EricLew | 0:ad9dfc0179dc | 177 | |
| EricLew | 0:ad9dfc0179dc | 178 | /* IO Pins directions */ |
| EricLew | 0:ad9dfc0179dc | 179 | #define STMPE811_DIRECTION_IN 0x00 |
| EricLew | 0:ad9dfc0179dc | 180 | #define STMPE811_DIRECTION_OUT 0x01 |
| EricLew | 0:ad9dfc0179dc | 181 | |
| EricLew | 0:ad9dfc0179dc | 182 | /* IO IT types */ |
| EricLew | 0:ad9dfc0179dc | 183 | #define STMPE811_TYPE_LEVEL 0x00 |
| EricLew | 0:ad9dfc0179dc | 184 | #define STMPE811_TYPE_EDGE 0x02 |
| EricLew | 0:ad9dfc0179dc | 185 | |
| EricLew | 0:ad9dfc0179dc | 186 | /* IO IT polarity */ |
| EricLew | 0:ad9dfc0179dc | 187 | #define STMPE811_POLARITY_LOW 0x00 |
| EricLew | 0:ad9dfc0179dc | 188 | #define STMPE811_POLARITY_HIGH 0x04 |
| EricLew | 0:ad9dfc0179dc | 189 | |
| EricLew | 0:ad9dfc0179dc | 190 | /* IO Pin IT edge modes */ |
| EricLew | 0:ad9dfc0179dc | 191 | #define STMPE811_EDGE_FALLING 0x01 |
| EricLew | 0:ad9dfc0179dc | 192 | #define STMPE811_EDGE_RISING 0x02 |
| EricLew | 0:ad9dfc0179dc | 193 | |
| EricLew | 0:ad9dfc0179dc | 194 | /* TS registers masks */ |
| EricLew | 0:ad9dfc0179dc | 195 | #define STMPE811_TS_CTRL_ENABLE 0x01 |
| EricLew | 0:ad9dfc0179dc | 196 | #define STMPE811_TS_CTRL_STATUS 0x80 |
| EricLew | 0:ad9dfc0179dc | 197 | /** |
| EricLew | 0:ad9dfc0179dc | 198 | * @} |
| EricLew | 0:ad9dfc0179dc | 199 | */ |
| EricLew | 0:ad9dfc0179dc | 200 | |
| EricLew | 0:ad9dfc0179dc | 201 | /** @defgroup STMPE811_Exported_Macros |
| EricLew | 0:ad9dfc0179dc | 202 | * @{ |
| EricLew | 0:ad9dfc0179dc | 203 | */ |
| EricLew | 0:ad9dfc0179dc | 204 | /** |
| EricLew | 0:ad9dfc0179dc | 205 | * @} |
| EricLew | 0:ad9dfc0179dc | 206 | */ |
| EricLew | 0:ad9dfc0179dc | 207 | |
| EricLew | 0:ad9dfc0179dc | 208 | /** @defgroup STMPE811_Exported_Functions |
| EricLew | 0:ad9dfc0179dc | 209 | * @{ |
| EricLew | 0:ad9dfc0179dc | 210 | */ |
| EricLew | 0:ad9dfc0179dc | 211 | |
| EricLew | 0:ad9dfc0179dc | 212 | /** |
| EricLew | 0:ad9dfc0179dc | 213 | * @brief STMPE811 Control functions |
| EricLew | 0:ad9dfc0179dc | 214 | */ |
| EricLew | 0:ad9dfc0179dc | 215 | void stmpe811_Init(uint16_t DeviceAddr); |
| EricLew | 0:ad9dfc0179dc | 216 | void stmpe811_Reset(uint16_t DeviceAddr); |
| EricLew | 0:ad9dfc0179dc | 217 | uint16_t stmpe811_ReadID(uint16_t DeviceAddr); |
| EricLew | 0:ad9dfc0179dc | 218 | void stmpe811_EnableGlobalIT(uint16_t DeviceAddr); |
| EricLew | 0:ad9dfc0179dc | 219 | void stmpe811_DisableGlobalIT(uint16_t DeviceAddr); |
| EricLew | 0:ad9dfc0179dc | 220 | void stmpe811_EnableITSource(uint16_t DeviceAddr, uint8_t Source); |
| EricLew | 0:ad9dfc0179dc | 221 | void stmpe811_DisableITSource(uint16_t DeviceAddr, uint8_t Source); |
| EricLew | 0:ad9dfc0179dc | 222 | void stmpe811_SetITPolarity(uint16_t DeviceAddr, uint8_t Polarity); |
| EricLew | 0:ad9dfc0179dc | 223 | void stmpe811_SetITType(uint16_t DeviceAddr, uint8_t Type); |
| EricLew | 0:ad9dfc0179dc | 224 | uint8_t stmpe811_GlobalITStatus(uint16_t DeviceAddr, uint8_t Source); |
| EricLew | 0:ad9dfc0179dc | 225 | uint8_t stmpe811_ReadGITStatus(uint16_t DeviceAddr, uint8_t Source); |
| EricLew | 0:ad9dfc0179dc | 226 | void stmpe811_ClearGlobalIT(uint16_t DeviceAddr, uint8_t Source); |
| EricLew | 0:ad9dfc0179dc | 227 | |
| EricLew | 0:ad9dfc0179dc | 228 | /** |
| EricLew | 0:ad9dfc0179dc | 229 | * @brief STMPE811 IO functionalities functions |
| EricLew | 0:ad9dfc0179dc | 230 | */ |
| EricLew | 0:ad9dfc0179dc | 231 | void stmpe811_IO_Start(uint16_t DeviceAddr, uint32_t IO_Pin); |
| EricLew | 0:ad9dfc0179dc | 232 | uint8_t stmpe811_IO_Config(uint16_t DeviceAddr, uint32_t IO_Pin, IO_ModeTypedef IO_Mode); |
| EricLew | 0:ad9dfc0179dc | 233 | void stmpe811_IO_InitPin(uint16_t DeviceAddr, uint32_t IO_Pin, uint8_t Direction); |
| EricLew | 0:ad9dfc0179dc | 234 | void stmpe811_IO_EnableAF(uint16_t DeviceAddr, uint32_t IO_Pin); |
| EricLew | 0:ad9dfc0179dc | 235 | void stmpe811_IO_DisableAF(uint16_t DeviceAddr, uint32_t IO_Pin); |
| EricLew | 0:ad9dfc0179dc | 236 | void stmpe811_IO_SetEdgeMode(uint16_t DeviceAddr, uint32_t IO_Pin, uint8_t Edge); |
| EricLew | 0:ad9dfc0179dc | 237 | void stmpe811_IO_WritePin(uint16_t DeviceAddr, uint32_t IO_Pin, uint8_t PinState); |
| EricLew | 0:ad9dfc0179dc | 238 | uint32_t stmpe811_IO_ReadPin(uint16_t DeviceAddr, uint32_t IO_Pin); |
| EricLew | 0:ad9dfc0179dc | 239 | void stmpe811_IO_EnableIT(uint16_t DeviceAddr); |
| EricLew | 0:ad9dfc0179dc | 240 | void stmpe811_IO_DisableIT(uint16_t DeviceAddr); |
| EricLew | 0:ad9dfc0179dc | 241 | void stmpe811_IO_EnablePinIT(uint16_t DeviceAddr, uint32_t IO_Pin); |
| EricLew | 0:ad9dfc0179dc | 242 | void stmpe811_IO_DisablePinIT(uint16_t DeviceAddr, uint32_t IO_Pin); |
| EricLew | 0:ad9dfc0179dc | 243 | uint32_t stmpe811_IO_ITStatus(uint16_t DeviceAddr, uint32_t IO_Pin); |
| EricLew | 0:ad9dfc0179dc | 244 | void stmpe811_IO_ClearIT(uint16_t DeviceAddr, uint32_t IO_Pin); |
| EricLew | 0:ad9dfc0179dc | 245 | |
| EricLew | 0:ad9dfc0179dc | 246 | /** |
| EricLew | 0:ad9dfc0179dc | 247 | * @brief STMPE811 Touch screen functionalities functions |
| EricLew | 0:ad9dfc0179dc | 248 | */ |
| EricLew | 0:ad9dfc0179dc | 249 | void stmpe811_TS_Start(uint16_t DeviceAddr); |
| EricLew | 0:ad9dfc0179dc | 250 | uint8_t stmpe811_TS_DetectTouch(uint16_t DeviceAddr); |
| EricLew | 0:ad9dfc0179dc | 251 | void stmpe811_TS_GetXY(uint16_t DeviceAddr, uint16_t *X, uint16_t *Y); |
| EricLew | 0:ad9dfc0179dc | 252 | void stmpe811_TS_EnableIT(uint16_t DeviceAddr); |
| EricLew | 0:ad9dfc0179dc | 253 | void stmpe811_TS_DisableIT(uint16_t DeviceAddr); |
| EricLew | 0:ad9dfc0179dc | 254 | uint8_t stmpe811_TS_ITStatus (uint16_t DeviceAddr); |
| EricLew | 0:ad9dfc0179dc | 255 | void stmpe811_TS_ClearIT (uint16_t DeviceAddr); |
| EricLew | 0:ad9dfc0179dc | 256 | |
| EricLew | 0:ad9dfc0179dc | 257 | void IOE_Init(void); |
| EricLew | 0:ad9dfc0179dc | 258 | void IOE_ITConfig (void); |
| EricLew | 0:ad9dfc0179dc | 259 | void IOE_Delay(uint32_t delay); |
| EricLew | 0:ad9dfc0179dc | 260 | void IOE_Write(uint8_t addr, uint8_t reg, uint8_t value); |
| EricLew | 0:ad9dfc0179dc | 261 | uint8_t IOE_Read(uint8_t addr, uint8_t reg); |
| EricLew | 0:ad9dfc0179dc | 262 | uint16_t IOE_ReadMultiple(uint8_t addr, uint8_t reg, uint8_t *buffer, uint16_t length); |
| EricLew | 0:ad9dfc0179dc | 263 | |
| EricLew | 0:ad9dfc0179dc | 264 | /* Touch screen driver structure */ |
| EricLew | 0:ad9dfc0179dc | 265 | extern TS_DrvTypeDef stmpe811_ts_drv; |
| EricLew | 0:ad9dfc0179dc | 266 | |
| EricLew | 0:ad9dfc0179dc | 267 | /* IO driver structure */ |
| EricLew | 0:ad9dfc0179dc | 268 | extern IO_DrvTypeDef stmpe811_io_drv; |
| EricLew | 0:ad9dfc0179dc | 269 | |
| EricLew | 0:ad9dfc0179dc | 270 | #ifdef __cplusplus |
| EricLew | 0:ad9dfc0179dc | 271 | } |
| EricLew | 0:ad9dfc0179dc | 272 | #endif |
| EricLew | 0:ad9dfc0179dc | 273 | #endif /* __STMPE811_H */ |
| EricLew | 0:ad9dfc0179dc | 274 | |
| EricLew | 0:ad9dfc0179dc | 275 | /** |
| EricLew | 0:ad9dfc0179dc | 276 | * @} |
| EricLew | 0:ad9dfc0179dc | 277 | */ |
| EricLew | 0:ad9dfc0179dc | 278 | |
| EricLew | 0:ad9dfc0179dc | 279 | /** |
| EricLew | 0:ad9dfc0179dc | 280 | * @} |
| EricLew | 0:ad9dfc0179dc | 281 | */ |
| EricLew | 0:ad9dfc0179dc | 282 | |
| EricLew | 0:ad9dfc0179dc | 283 | /** |
| EricLew | 0:ad9dfc0179dc | 284 | * @} |
| EricLew | 0:ad9dfc0179dc | 285 | */ |
| EricLew | 0:ad9dfc0179dc | 286 | |
| EricLew | 0:ad9dfc0179dc | 287 | /** |
| EricLew | 0:ad9dfc0179dc | 288 | * @} |
| EricLew | 0:ad9dfc0179dc | 289 | */ |
| EricLew | 0:ad9dfc0179dc | 290 | |
| EricLew | 0:ad9dfc0179dc | 291 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
| EricLew | 0:ad9dfc0179dc | 292 |