STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
exc7200.c
Go to the documentation of this file.
1 
39 /* Includes ------------------------------------------------------------------*/
40 #include "exc7200.h"
41 
54 /* Private typedef -----------------------------------------------------------*/
55 
60 /* Private define ------------------------------------------------------------*/
61 
66 /* Private macro -------------------------------------------------------------*/
67 
72 /* Private variables ---------------------------------------------------------*/
73 
78 /* Touch screen driver structure initialization */
80 {
84 
88 
93 };
94 
95 uint8_t aBufferTS[10];
96 
101 /* Private function prototypes -----------------------------------------------*/
102 
107 /* Private functions ---------------------------------------------------------*/
108 
118 void exc7200_Init(uint16_t DeviceAddr)
119 {
120  /* Initialize IO BUS layer */
121  IOE_Init();
122 
123 }
124 
130 void exc7200_Reset(uint16_t DeviceAddr)
131 {
132 
133 }
134 
140 uint16_t exc7200_ReadID(uint16_t DeviceAddr)
141 {
142  return 0;
143 }
144 
150 void exc7200_TS_Start(uint16_t DeviceAddr)
151 {
152 }
153 
159 uint8_t exc7200_TS_DetectTouch(uint16_t DeviceAddr)
160 {
161  /* Read TS data : Send I2C Slave address + 1 Bit0=1 for:read */
162  IOE_ReadMultiple(DeviceAddr | 1, EXC7200_READ_CMD, aBufferTS, 10);
163 
164  /* check for first byte */
165  if (aBufferTS[1]==0x83)
166  {
167  return 1;
168  }
169 
170  return 0;
171 }
172 
180 void exc7200_TS_GetXY(uint16_t DeviceAddr, uint16_t *X, uint16_t *Y)
181 {
182  /* Calculate positions */
183  *X = (((aBufferTS[3]&0x00ff) << 4) | ((aBufferTS[2]&0x00f0) >> 4)) << 1;
184  *Y = (((aBufferTS[5]&0x00ff) << 4) | ((aBufferTS[4]&0x00f0) >> 4)) << 1;
185 
186  /* Dummy Read to deactivate read mode */
187  IOE_ReadMultiple(DeviceAddr, EXC7200_READ_CMD, aBufferTS, 10);
188 }
189 
195 void exc7200_TS_EnableIT(uint16_t DeviceAddr)
196 {
197 }
198 
204 void exc7200_TS_DisableIT(uint16_t DeviceAddr)
205 {
206 }
207 
213 uint8_t exc7200_TS_ITStatus(uint16_t DeviceAddr)
214 {
215  return 0;
216 }
217 
223 void exc7200_TS_ClearIT(uint16_t DeviceAddr)
224 {
225 }
226 
242 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
void exc7200_TS_Start(uint16_t DeviceAddr)
Configures the touch Screen Controller (Single point detection)
Definition: exc7200.c:150
void exc7200_TS_GetXY(uint16_t DeviceAddr, uint16_t *X, uint16_t *Y)
Get the touch screen X and Y positions values.
Definition: exc7200.c:180
#define EXC7200_READ_CMD
Definition: exc7200.h:75
void exc7200_TS_ClearIT(uint16_t DeviceAddr)
Configure the selected source to generate a global interrupt or not.
Definition: exc7200.c:223
uint8_t exc7200_TS_ITStatus(uint16_t DeviceAddr)
Configure the selected source to generate a global interrupt or not.
Definition: exc7200.c:213
uint8_t aBufferTS[10]
Definition: exc7200.c:95
uint16_t IOE_ReadMultiple(uint8_t addr, uint8_t reg, uint8_t *buffer, uint16_t length)
void exc7200_Reset(uint16_t DeviceAddr)
Reset the exc7200 by Software.
Definition: exc7200.c:130
TS_DrvTypeDef exc7200_ts_drv
Definition: exc7200.c:79
void exc7200_TS_EnableIT(uint16_t DeviceAddr)
Configure the selected source to generate a global interrupt or not.
Definition: exc7200.c:195
void exc7200_Init(uint16_t DeviceAddr)
Initialize the exc7200 and configure the needed hardware resources.
Definition: exc7200.c:118
void exc7200_TS_DisableIT(uint16_t DeviceAddr)
Configure the selected source to generate a global interrupt or not.
Definition: exc7200.c:204
This file contains all the functions prototypes for the exc7200.c IO expander driver.
void IOE_Init(void)
uint16_t exc7200_ReadID(uint16_t DeviceAddr)
Read the exc7200 IO Expander device ID.
Definition: exc7200.c:140
uint8_t exc7200_TS_DetectTouch(uint16_t DeviceAddr)
Return if there is touch detected or not.
Definition: exc7200.c:159