xiaoxiang781216 commented on code in PR #18951:
URL: https://github.com/apache/nuttx/pull/18951#discussion_r3328022943


##########
arch/sim/Kconfig:
##########
@@ -256,6 +256,43 @@ config SIM_CANDEV_SOCK
 
 endif # SIM_CANDEV
 
+config SIM_FT2232H
+       bool "Support FT2232H USB bridge to control external devices"
+       default n
+       depends on ARCH_SIM

Review Comment:
   remove 



##########
arch/sim/src/sim/sim_ft2232h_ioexpander.h:
##########
@@ -0,0 +1,67 @@
+/****************************************************************************
+ * arch/sim/src/sim/sim_ft2232h_ioexpander.h
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_SIM_SRC_SIM_FT2232H_IOEXPANDER_H
+#define __ARCH_SIM_SRC_SIM_FT2232H_IOEXPANDER_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#ifdef __SIM__
+#  include "config.h"
+#endif
+
+#include <stdint.h>
+#include <ftdi.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define FT2232H_GPIO_LINE_BASE        20
+#define FT2232_GPIO_NPINS             8
+
+/****************************************************************************
+ * Type Definitions
+ ****************************************************************************/
+
+struct host_ft2232h_gpio_dev
+{
+  struct ftdi_context *ftdi;
+  uint8_t port_dir;
+  uint8_t port_value;
+};
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+struct host_ft2232h_gpio_dev *host_ft2232h_gpio_alloc(uint8_t pins_dir);

Review Comment:
   why not share the host interface of SIM_GPIOCHIP? so we don't need add 
sim_ft2232h_gpio_initialize, but implement host_gpiochip_xxx instead.



##########
arch/sim/Kconfig:
##########
@@ -256,6 +256,43 @@ config SIM_CANDEV_SOCK
 
 endif # SIM_CANDEV
 
+config SIM_FT2232H

Review Comment:
   should you group SIM_FT2232H and  SIM_GPIOCHIP into choice?



-- 
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