STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
Data Structures | Macros | Functions | Variables
ft5336.h File Reference

This file contains all the functions prototypes for the ft5336.c Touch screen driver. More...

#include "../Common/ts.h"

Go to the source code of this file.

Data Structures

struct  ft5336_handle_TypeDef
 

Macros

#define TS_MULTI_TOUCH_SUPPORTED   1
 
#define FT5336_ASSERT(__condition__)
 
#define FT5336_I2C_SLAVE_ADDRESS   ((uint8_t)0x70)
 
#define FT5336_MAX_WIDTH   ((uint16_t)480) /* Touchscreen pad max width */
 
#define FT5336_MAX_HEIGHT   ((uint16_t)272) /* Touchscreen pad max height */
 
#define FT5336_STATUS_OK   ((uint8_t)0x00)
 
#define FT5336_STATUS_NOT_OK   ((uint8_t)0x01)
 
#define FT5336_I2C_NOT_INITIALIZED   ((uint8_t)0x00)
 
#define FT5336_I2C_INITIALIZED   ((uint8_t)0x01)
 
#define FT5336_MAX_DETECTABLE_TOUCH   ((uint8_t)0x05)
 
#define FT5336_DEV_MODE_REG   ((uint8_t)0x00)
 : Definitions for FT5336 I2C register addresses on 8 bit More...
 
#define FT5336_DEV_MODE_WORKING   ((uint8_t)0x00)
 
#define FT5336_DEV_MODE_FACTORY   ((uint8_t)0x04)
 
#define FT5336_DEV_MODE_MASK   ((uint8_t)0x07)
 
#define FT5336_DEV_MODE_SHIFT   ((uint8_t)0x04)
 
#define FT5336_GEST_ID_REG   ((uint8_t)0x01)
 
#define FT5336_GEST_ID_NO_GESTURE   ((uint8_t)0x00)
 
#define FT5336_GEST_ID_MOVE_UP   ((uint8_t)0x10)
 
#define FT5336_GEST_ID_MOVE_RIGHT   ((uint8_t)0x14)
 
#define FT5336_GEST_ID_MOVE_DOWN   ((uint8_t)0x18)
 
#define FT5336_GEST_ID_MOVE_LEFT   ((uint8_t)0x1C)
 
#define FT5336_GEST_ID_SINGLE_CLICK   ((uint8_t)0x20)
 
#define FT5336_GEST_ID_DOUBLE_CLICK   ((uint8_t)0x22)
 
#define FT5336_GEST_ID_ROTATE_CLOCKWISE   ((uint8_t)0x28)
 
#define FT5336_GEST_ID_ROTATE_C_CLOCKWISE   ((uint8_t)0x29)
 
#define FT5336_GEST_ID_ZOOM_IN   ((uint8_t)0x40)
 
#define FT5336_GEST_ID_ZOOM_OUT   ((uint8_t)0x49)
 
#define FT5336_TD_STAT_REG   ((uint8_t)0x02)
 
#define FT5336_TD_STAT_MASK   ((uint8_t)0x0F)
 
#define FT5336_TD_STAT_SHIFT   ((uint8_t)0x00)
 
#define FT5336_TOUCH_EVT_FLAG_PRESS_DOWN   ((uint8_t)0x00)
 
#define FT5336_TOUCH_EVT_FLAG_LIFT_UP   ((uint8_t)0x01)
 
#define FT5336_TOUCH_EVT_FLAG_CONTACT   ((uint8_t)0x02)
 
#define FT5336_TOUCH_EVT_FLAG_NO_EVENT   ((uint8_t)0x03)
 
#define FT5336_TOUCH_EVT_FLAG_SHIFT   ((uint8_t)0x06)
 
#define FT5336_TOUCH_EVT_FLAG_MASK   ((uint8_t)(3 << FT5336_TOUCH_EVT_FLAG_SHIFT))
 
#define FT5336_TOUCH_POS_MSB_MASK   ((uint8_t)0x0F)
 
#define FT5336_TOUCH_POS_MSB_SHIFT   ((uint8_t)0x00)
 
#define FT5336_TOUCH_POS_LSB_MASK   ((uint8_t)0xFF)
 
#define FT5336_TOUCH_POS_LSB_SHIFT   ((uint8_t)0x00)
 
#define FT5336_P1_XH_REG   ((uint8_t)0x03)
 
#define FT5336_P1_XL_REG   ((uint8_t)0x04)
 
#define FT5336_P1_YH_REG   ((uint8_t)0x05)
 
#define FT5336_P1_YL_REG   ((uint8_t)0x06)
 
#define FT5336_P1_WEIGHT_REG   ((uint8_t)0x07)
 
#define FT5336_TOUCH_WEIGHT_MASK   ((uint8_t)0xFF)
 
#define FT5336_TOUCH_WEIGHT_SHIFT   ((uint8_t)0x00)
 
#define FT5336_P1_MISC_REG   ((uint8_t)0x08)
 
#define FT5336_TOUCH_AREA_MASK   ((uint8_t)(0x04 << 4))
 
#define FT5336_TOUCH_AREA_SHIFT   ((uint8_t)0x04)
 
#define FT5336_P2_XH_REG   ((uint8_t)0x09)
 
#define FT5336_P2_XL_REG   ((uint8_t)0x0A)
 
#define FT5336_P2_YH_REG   ((uint8_t)0x0B)
 
#define FT5336_P2_YL_REG   ((uint8_t)0x0C)
 
#define FT5336_P2_WEIGHT_REG   ((uint8_t)0x0D)
 
#define FT5336_P2_MISC_REG   ((uint8_t)0x0E)
 
#define FT5336_P3_XH_REG   ((uint8_t)0x0F)
 
#define FT5336_P3_XL_REG   ((uint8_t)0x10)
 
#define FT5336_P3_YH_REG   ((uint8_t)0x11)
 
#define FT5336_P3_YL_REG   ((uint8_t)0x12)
 
#define FT5336_P3_WEIGHT_REG   ((uint8_t)0x13)
 
#define FT5336_P3_MISC_REG   ((uint8_t)0x14)
 
#define FT5336_P4_XH_REG   ((uint8_t)0x15)
 
#define FT5336_P4_XL_REG   ((uint8_t)0x16)
 
#define FT5336_P4_YH_REG   ((uint8_t)0x17)
 
#define FT5336_P4_YL_REG   ((uint8_t)0x18)
 
#define FT5336_P4_WEIGHT_REG   ((uint8_t)0x19)
 
#define FT5336_P4_MISC_REG   ((uint8_t)0x1A)
 
#define FT5336_P5_XH_REG   ((uint8_t)0x1B)
 
#define FT5336_P5_XL_REG   ((uint8_t)0x1C)
 
#define FT5336_P5_YH_REG   ((uint8_t)0x1D)
 
#define FT5336_P5_YL_REG   ((uint8_t)0x1E)
 
#define FT5336_P5_WEIGHT_REG   ((uint8_t)0x1F)
 
#define FT5336_P5_MISC_REG   ((uint8_t)0x20)
 
#define FT5336_P6_XH_REG   ((uint8_t)0x21)
 
#define FT5336_P6_XL_REG   ((uint8_t)0x22)
 
#define FT5336_P6_YH_REG   ((uint8_t)0x23)
 
#define FT5336_P6_YL_REG   ((uint8_t)0x24)
 
#define FT5336_P6_WEIGHT_REG   ((uint8_t)0x25)
 
#define FT5336_P6_MISC_REG   ((uint8_t)0x26)
 
#define FT5336_P7_XH_REG   ((uint8_t)0x27)
 
#define FT5336_P7_XL_REG   ((uint8_t)0x28)
 
#define FT5336_P7_YH_REG   ((uint8_t)0x29)
 
#define FT5336_P7_YL_REG   ((uint8_t)0x2A)
 
#define FT5336_P7_WEIGHT_REG   ((uint8_t)0x2B)
 
#define FT5336_P7_MISC_REG   ((uint8_t)0x2C)
 
#define FT5336_P8_XH_REG   ((uint8_t)0x2D)
 
#define FT5336_P8_XL_REG   ((uint8_t)0x2E)
 
#define FT5336_P8_YH_REG   ((uint8_t)0x2F)
 
#define FT5336_P8_YL_REG   ((uint8_t)0x30)
 
#define FT5336_P8_WEIGHT_REG   ((uint8_t)0x31)
 
#define FT5336_P8_MISC_REG   ((uint8_t)0x32)
 
#define FT5336_P9_XH_REG   ((uint8_t)0x33)
 
#define FT5336_P9_XL_REG   ((uint8_t)0x34)
 
#define FT5336_P9_YH_REG   ((uint8_t)0x35)
 
#define FT5336_P9_YL_REG   ((uint8_t)0x36)
 
#define FT5336_P9_WEIGHT_REG   ((uint8_t)0x37)
 
#define FT5336_P9_MISC_REG   ((uint8_t)0x38)
 
#define FT5336_P10_XH_REG   ((uint8_t)0x39)
 
#define FT5336_P10_XL_REG   ((uint8_t)0x3A)
 
#define FT5336_P10_YH_REG   ((uint8_t)0x3B)
 
#define FT5336_P10_YL_REG   ((uint8_t)0x3C)
 
#define FT5336_P10_WEIGHT_REG   ((uint8_t)0x3D)
 
#define FT5336_P10_MISC_REG   ((uint8_t)0x3E)
 
#define FT5336_TH_GROUP_REG   ((uint8_t)0x80)
 
#define FT5336_THRESHOLD_MASK   ((uint8_t)0xFF)
 
#define FT5336_THRESHOLD_SHIFT   ((uint8_t)0x00)
 
#define FT5336_TH_DIFF_REG   ((uint8_t)0x85)
 
#define FT5336_CTRL_REG   ((uint8_t)0x86)
 
#define FT5336_CTRL_KEEP_ACTIVE_MODE   ((uint8_t)0x00)
 
#define FT5336_CTRL_KEEP_AUTO_SWITCH_MONITOR_MODE   ((uint8_t)0x01
 
#define FT5336_TIMEENTERMONITOR_REG   ((uint8_t)0x87)
 
#define FT5336_PERIODACTIVE_REG   ((uint8_t)0x88)
 
#define FT5336_PERIODMONITOR_REG   ((uint8_t)0x89)
 
#define FT5336_RADIAN_VALUE_REG   ((uint8_t)0x91)
 
#define FT5336_OFFSET_LEFT_RIGHT_REG   ((uint8_t)0x92)
 
#define FT5336_OFFSET_UP_DOWN_REG   ((uint8_t)0x93)
 
#define FT5336_DISTANCE_LEFT_RIGHT_REG   ((uint8_t)0x94)
 
#define FT5336_DISTANCE_UP_DOWN_REG   ((uint8_t)0x95)
 
#define FT5336_DISTANCE_ZOOM_REG   ((uint8_t)0x96)
 
#define FT5336_LIB_VER_H_REG   ((uint8_t)0xA1)
 
#define FT5336_LIB_VER_L_REG   ((uint8_t)0xA2)
 
#define FT5336_CIPHER_REG   ((uint8_t)0xA3)
 
#define FT5336_GMODE_REG   ((uint8_t)0xA4)
 
#define FT5336_G_MODE_INTERRUPT_MASK   ((uint8_t)0x03)
 
#define FT5336_G_MODE_INTERRUPT_SHIFT   ((uint8_t)0x00)
 
#define FT5336_G_MODE_INTERRUPT_POLLING   ((uint8_t)0x00)
 
#define FT5336_G_MODE_INTERRUPT_TRIGGER   ((uint8_t)0x01)
 
#define FT5336_PWR_MODE_REG   ((uint8_t)0xA5)
 
#define FT5336_FIRMID_REG   ((uint8_t)0xA6)
 
#define FT5336_CHIP_ID_REG   ((uint8_t)0xA8)
 
#define FT5336_ID_VALUE   ((uint8_t)0x51)
 
#define FT5336_RELEASE_CODE_ID_REG   ((uint8_t)0xAF)
 
#define FT5336_STATE_REG   ((uint8_t)0xBC)
 

Functions

void ft5336_Init (uint16_t DeviceAddr)
 ft5336 Control functions More...
 
void ft5336_Reset (uint16_t DeviceAddr)
 Software Reset the ft5336. More...
 
uint16_t ft5336_ReadID (uint16_t DeviceAddr)
 Read the ft5336 device ID, pre initialize I2C in case of need to be able to read the FT5336 device ID, and verify this is a FT5336. More...
 
void ft5336_TS_Start (uint16_t DeviceAddr)
 Configures the touch Screen IC device to start detecting touches. More...
 
uint8_t ft5336_TS_DetectTouch (uint16_t DeviceAddr)
 Return if there is touches detected or not. Try to detect new touches and forget the old ones (reset internal global variables). More...
 
void ft5336_TS_GetXY (uint16_t DeviceAddr, uint16_t *X, uint16_t *Y)
 Get the touch screen X and Y positions values Manage multi touch thanks to touch Index global variable 'ft5336_handle.currActiveTouchIdx'. More...
 
void ft5336_TS_EnableIT (uint16_t DeviceAddr)
 Configure the FT5336 device to generate IT on given INT pin connected to MCU as EXTI. More...
 
void ft5336_TS_DisableIT (uint16_t DeviceAddr)
 Configure the FT5336 device to stop generating IT on the given INT pin connected to MCU as EXTI. More...
 
uint8_t ft5336_TS_ITStatus (uint16_t DeviceAddr)
 Get IT status from FT5336 interrupt status registers Should be called Following an EXTI coming to the MCU to know the detailed reason of the interrupt. More...
 
void ft5336_TS_ClearIT (uint16_t DeviceAddr)
 Clear IT status in FT5336 interrupt status clear registers Should be called Following an EXTI coming to the MCU. More...
 
void ft5336_TS_GetGestureID (uint16_t DeviceAddr, uint32_t *pGestureId)
 Get the last touch gesture identification (zoom, move up/down...). More...
 
void ft5336_TS_GetTouchInfo (uint16_t DeviceAddr, uint32_t touchIdx, uint32_t *pWeight, uint32_t *pArea, uint32_t *pEvent)
 Get the touch detailed informations on touch number 'touchIdx' (0..1) This touch detailed information contains : More...
 
void TS_IO_Init (void)
 Initializes Touchscreen low level. More...
 
void TS_IO_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
 Writes a single data. More...
 
uint8_t TS_IO_Read (uint8_t Addr, uint8_t Reg)
 Reads a single data. More...
 
void TS_IO_Delay (uint32_t Delay)
 Delay function used in TouchScreen low level driver. More...
 

Variables

TS_DrvTypeDef ft5336_ts_drv
 

Detailed Description

This file contains all the functions prototypes for the ft5336.c Touch screen driver.

Author
MCD Application Team
Version
V1.0.0
Date
25-June-2015
Attention

© COPYRIGHT(c) 2015 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file ft5336.h.

Macro Definition Documentation

#define FT5336_ASSERT (   __condition__)
Value:
do { if(__condition__) \
{ \
; \
} \
}while(0)

Definition at line 66 of file ft5336.h.

#define TS_MULTI_TOUCH_SUPPORTED   1

Definition at line 49 of file ft5336.h.