/** * @file touch_dev.c * @touch dev source file. * * @Copyright (c) 2022 Semidrive Semiconductor. * @All rights reserved. * **/ #include #include "touch_cfg.h" #include //#define GOODIX #define FOCALTECH #ifdef GOODIX #include "goodix.h" #endif #ifdef FOCALTECH #include "focaltech.h" #endif touch_data_t g_touch_data = {0}; int sdrv_touch_init(sdrv_i2c_t *i2c_ctrl) { int ret = -1; g_touch_dev.i2c_ctrl = i2c_ctrl; #ifdef GOODIX if (!strcmp(g_touch_dev.name, "goodix")) ret = goodix_touch_init(&g_touch_dev); #endif #ifdef FOCALTECH if (!strcmp(g_touch_dev.name, "focaltech")) ret = focaltech_touch_init(&g_touch_dev); #endif ssdk_printf(SSDK_ERR, "%s, %s\r\n", __func__, ret?"fail":"pass"); return ret; } touch_data_t *sdrv_touch_data_pointer(void) { return &g_touch_data; }