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


##########
drivers/wireless/lpwan/sx126x/sx126x.c:
##########
@@ -0,0 +1,867 @@
+/****************************************************************************
+ * boards/arm/rp2040/rakwireless-rak11310/src/sx126x.c
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+ #include "sx126x.h"
+
+ #include <nuttx/arch.h>
+ #include <nuttx/config.h>
+ 
+ #include <debug.h>
+ #include <errno.h>
+ #include <nuttx/spi/spi.h>
+ #include <sched.h>
+ #include <stdint.h>
+ #include <stdio.h>
+ #include <sys/endian.h>
+ #include <syslog.h>
+ #include <unistd.h>
+ 
+ /****************************************************************************
+  * Private prototypes
+  ****************************************************************************/
+ 
+ typedef FAR struct file file_t;
+ static int sx126x_open(file_t *filep);
+ static int sx126x_close(file_t *filep);
+ static ssize_t sx126x_read(file_t *filep, FAR char *buffer, size_t buflen);
+ static ssize_t sx126x_write(file_t *filep, FAR const char *buf,
+                             size_t buflen);
+ 
+ /****************************************************************************
+  * Private data types
+  ****************************************************************************/
+ 
+ struct sx126x_dev_s
+ {
+   struct spi_dev_s *spi;
+   const struct sx126x_lower_s *lower;
+ };
+ 
+ enum sx126x_cmd_status
+ {
+   SX126X_STATUS_RESERVED, SX126X_STATUS_RFU, SX126X_STATUS_DATA_AVAILABLE,
+   SX126X_STATUS_TIMEOUT, SX126X_STATUS_ERROR, SX126X_STATUS_EXECUTE_FAIL,
+   SX126X_STATUS_TX_DONE
+ };
+ 
+ enum sx126x_chip_mode
+ {
+   SX126X_MODE_UNUSED, SX126X_MODE_RFU, SX126X_MODE_STBY_RC,
+   SX126X_MODE_STBY_XOSC, SX126X_MODE_FS, SX126X_MODE_RX, SX126X_MODE_TX
+ };
+ 
+ struct sx126x_status_s
+ {
+   enum sx126x_cmd_status cmd;
+   enum sx126x_chip_mode mode;
+ };
+ 
+ /****************************************************************************
+  * Globals
+  ****************************************************************************/
+ 
+ FAR struct sx126x_dev_s             g_sx126x_devices[SX126X_MAX_DEVICES];
+ static const struct file_operations sx126x_ops =
+ {
+   sx126x_open, sx126x_close, sx126x_read, sx126x_write, 0, 0,

Review Comment:
   Please put an operation by line, it is easier to stop mistake or missing ops



-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to