fdcavalcanti commented on code in PR #19674:
URL: https://github.com/apache/nuttx/pull/19674#discussion_r3712451229


##########
include/nuttx/input/st7123.h:
##########
@@ -0,0 +1,103 @@
+/****************************************************************************
+ * include/nuttx/input/st7123.h
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/* The ST7123 is an I2C capacitive touchscreen controller.  This header
+ * exposes the board-facing registration and interrupt entry points used to
+ * bind the driver to an I2C bus and GPIO interrupt.  Once registered, the
+ * device appears as /dev/inputN and reports multi-touch samples through the
+ * standard touchscreen upper half.
+ */
+
+#ifndef __INCLUDE_NUTTX_INPUT_ST7123_H
+#define __INCLUDE_NUTTX_INPUT_ST7123_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdint.h>
+
+#include <nuttx/i2c/i2c_master.h>
+
+#ifdef CONFIG_INPUT_ST7123
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
+/****************************************************************************
+ * Name: st7123_register
+ *
+ * Description:
+ *   Probe the ST7123 over I2C, configure the touchscreen lower half from
+ *   the reported resolution and touch-area count, and register it as
+ *   /dev/inputN where N is the given minor number.
+ *
+ *   I2C frequency and slave address are taken from
+ *   CONFIG_INPUT_ST7123_I2C_FREQUENCY and CONFIG_INPUT_ST7123_I2C_ADDRESS.
+ *
+ * Input Parameters:
+ *   i2c   - I2C master used to talk to the ST7123
+ *   minor - Device minor number used to form /dev/inputN
+ *
+ * Returned Value:
+ *   Zero (OK) on success.  Otherwise, a negated errno value is returned to
+ *   indicate the nature of the failure.
+ *
+ ****************************************************************************/
+
+int st7123_register(FAR struct i2c_master_s *i2c, uint8_t minor);
+
+/****************************************************************************
+ * Name: st7123_interrupt_callback
+ *
+ * Description:
+ *   Board-level interrupt callback for the ST7123.  The board GPIO ISR
+ *   should call this function when the controller asserts its interrupt
+ *   line.  Interrupts that arrive before st7123_register() has completed
+ *   are ignored.  Otherwise a high-priority work-queue job is scheduled to
+ *   read the touch frame and deliver it to the touchscreen upper half.
+ *
+ * Input Parameters:
+ *   arg - Unused; the driver uses its global device instance
+ *
+ ****************************************************************************/
+
+void st7123_interrupt_callback(FAR void *arg);

Review Comment:
   This should be configured by board level as says in the description.
   ST7123 has an interrupt pin to notify that new touchs are sampled.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to