You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/02/05 08:38:02 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #210: Reimplement sim uart on top of serial driver framework

xiaoxiang781216 commented on a change in pull request #210: Reimplement sim uart on top of serial driver framework
URL: https://github.com/apache/incubator-nuttx/pull/210#discussion_r375119272
 
 

 ##########
 File path: arch/sim/src/sim/up_devconsole.c
 ##########
 @@ -38,119 +38,245 @@
  ****************************************************************************/
 
 #include <nuttx/config.h>
+#include <nuttx/serial/serial.h>
 
-#include <sys/types.h>
-#include <stdbool.h>
-#include <sched.h>
-#include <errno.h>
-#include <fcntl.h>
+#include "up_internal.h"
 
-#include <nuttx/fs/fs.h>
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
 
-#include "up_internal.h"
+#define DEVCONSOLE_BUFSIZE 256
 
 /****************************************************************************
  * Private Function Prototypes
  ****************************************************************************/
 
-static ssize_t devconsole_read(FAR struct file *filep, FAR char *buffer,
-                 size_t buflen);
-static ssize_t devconsole_write(FAR struct file *filep,
-                 FAR const char *buffer, size_t buflen);
-static int     devconsole_poll(FAR struct file *filep, FAR struct pollfd *fds,
-                 bool setup);
+static int  devconsole_setup(FAR struct uart_dev_s *dev);
+static void devconsole_shutdown(FAR struct uart_dev_s *dev);
+static int  devconsole_attach(FAR struct uart_dev_s *dev);
+static void devconsole_detach(FAR struct uart_dev_s *dev);
+static int  devconsole_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
+static int  devconsole_receive(FAR struct uart_dev_s *dev, uint32_t *status);
+static void devconsole_rxint(FAR struct uart_dev_s *dev, bool enable);
+static bool devconsole_rxavailable(FAR struct uart_dev_s *dev);
+static void devconsole_send(FAR struct uart_dev_s *dev, int ch);
+static void devconsole_txint(FAR struct uart_dev_s *dev, bool enable);
+static bool devconsole_txready(FAR struct uart_dev_s *dev);
+static bool devconsole_txempty(FAR struct uart_dev_s *dev);
 
 /****************************************************************************
  * Private Data
  ****************************************************************************/
 
-static const struct file_operations devconsole_fops =
+static const struct uart_ops_s g_devconsole_fops =
 
 Review comment:
   Ok.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services