acassis commented on code in PR #19937:
URL: https://github.com/apache/nuttx/pull/19937#discussion_r3838869591


##########
include/nuttx/ioexpander/ch422g.h:
##########
@@ -0,0 +1,116 @@
+/****************************************************************************
+ * include/nuttx/ioexpander/ch422g.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.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_NUTTX_IOEXPANDER_CH422G_H
+#define __INCLUDE_NUTTX_IOEXPANDER_CH422G_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <nuttx/i2c/i2c_master.h>
+
+#include <stdbool.h>
+#include <stdint.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Pin numbering used by the ioexpander interface.
+ *
+ * The CH422G offers eight bi-directional pins, IO0-IO7, and four
+ * open-drain outputs, OC0-OC3.  They are presented as one contiguous pin
+ * space so that a single ioexpander_dev_s covers the whole chip.
+ */
+
+#define CH422G_IO0              0
+#define CH422G_IO1              1
+#define CH422G_IO2              2
+#define CH422G_IO3              3
+#define CH422G_IO4              4
+#define CH422G_IO5              5
+#define CH422G_IO6              6
+#define CH422G_IO7              7
+#define CH422G_OC0              8
+#define CH422G_OC1              9
+#define CH422G_OC2              10
+#define CH422G_OC3              11
+
+#define CH422G_NPINS            12

Review Comment:
   No, please see PCA9538_GPIO_NPINS for example.



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