You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "acassis (via GitHub)" <gi...@apache.org> on 2023/09/21 14:20:51 UTC

[GitHub] [nuttx] acassis commented on a diff in pull request #10735: arch/sim: add sim uart_ram support

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


##########
arch/sim/Kconfig:
##########
@@ -625,6 +625,54 @@ config SIM_UART3_NAME
 		A UART port must also exist on the host system
 		with the exact same name specified here.
 
+config SIM_RAM_UART
+	bool "Sim ram uart driver"
+	depends on RAM_UART
+	default n
+	---help---
+		Enable sim ram uart

Review Comment:
   ```suggestion
   		Enable SIM RAM UART. It emulates a UART device but using a RAM memory instead a physical peripheral.



##########
arch/sim/Kconfig:
##########
@@ -625,6 +625,54 @@ config SIM_UART3_NAME
 		A UART port must also exist on the host system
 		with the exact same name specified here.
 
+config SIM_RAM_UART
+	bool "Sim ram uart driver"

Review Comment:
   ```suggestion
   	bool "SIM RAM UART Driver"



##########
arch/sim/Kconfig:
##########
@@ -625,6 +625,54 @@ config SIM_UART3_NAME
 		A UART port must also exist on the host system
 		with the exact same name specified here.
 
+config SIM_RAM_UART
+	bool "Sim ram uart driver"
+	depends on RAM_UART
+	default n
+	---help---
+		Enable sim ram uart
+
+if SIM_RAM_UART
+config SIM_RAM_UART0
+	bool "SIM ram uart driver 0"
+	default n
+	---help---
+		sim ram uart device 0
+
+config SIM_RAM_UART0_SLAVE
+	bool "SIM_RAM_UART0 is slave"
+	depends on SIM_RAM_UART0
+	default n
+	---help---
+		The sim ram uart0 is slave

Review Comment:
   ```suggestion
   		The SIM RAM UART0 is slave



##########
arch/sim/Kconfig:
##########
@@ -625,6 +625,54 @@ config SIM_UART3_NAME
 		A UART port must also exist on the host system
 		with the exact same name specified here.
 
+config SIM_RAM_UART
+	bool "Sim ram uart driver"
+	depends on RAM_UART
+	default n
+	---help---
+		Enable sim ram uart
+
+if SIM_RAM_UART
+config SIM_RAM_UART0
+	bool "SIM ram uart driver 0"
+	default n
+	---help---
+		sim ram uart device 0
+
+config SIM_RAM_UART0_SLAVE
+	bool "SIM_RAM_UART0 is slave"
+	depends on SIM_RAM_UART0
+	default n
+	---help---
+		The sim ram uart0 is slave
+
+config SIM_RAM_UART1
+	bool "SIM ram uart driver 1"
+	default n
+	---help---
+		sim ram uart device 1
+
+config SIM_RAM_UART1_SLAVE
+	bool "SIM_RAM_UART1 is slave"
+	depends on SIM_RAM_UART1
+	default n
+	---help---
+		The sim ram uart1 is slave
+
+config SIM_RAM_UART2
+	bool "SIM ram uart driver 2"
+	default n
+	---help---
+		sim ram uart device 2

Review Comment:
   ```suggestion
   		SIM RAM UART Device 2



##########
arch/sim/src/sim/sim_uart.c:
##########
@@ -676,6 +693,30 @@ static bool tty_txempty(struct uart_dev_s *dev)
 
 void sim_uartinit(void)
 {
+#ifdef CONFIG_SIM_RAM_UART0
+#  ifdef CONFIG_SIM_RAM_UART0_SLAVE
+  sim_uartram_register("/dev/tty0", true);
+#  else
+  sim_uartram_register("/dev/tty0", false);
+#  endif
+#endif
+
+#ifdef CONFIG_SIM_RAM_UART1
+#  ifdef CONFIG_SIM_RAM_UART1_SLAVE
+  sim_uartram_register("/dev/tty1", true);
+#  else
+  sim_uartram_register("/dev/tty1", false);
+#  endif
+#endif
+
+#ifdef CONFIG_SIM_RAM_UART2
+#  ifdef CONFIG_SIM_RAM_UART2_SLAVE
+  sim_uartram_register("/dev/tty2", true);
+#  else
+  sim_uartram_register("/dev/tty2", false);
+#  endif
+#endif
+

Review Comment:
   I think it is not a good idea to use tty0, tty1 and tty2 because these device names normally are reserved on Unix/Linux systems to virtual consoles. Maybe something like ttyVS0 (to virtual serial) or ttyVU0 (to virtual UART_



##########
arch/sim/Kconfig:
##########
@@ -625,6 +625,54 @@ config SIM_UART3_NAME
 		A UART port must also exist on the host system
 		with the exact same name specified here.
 
+config SIM_RAM_UART
+	bool "Sim ram uart driver"
+	depends on RAM_UART
+	default n
+	---help---
+		Enable sim ram uart
+
+if SIM_RAM_UART
+config SIM_RAM_UART0
+	bool "SIM ram uart driver 0"
+	default n
+	---help---
+		sim ram uart device 0
+
+config SIM_RAM_UART0_SLAVE
+	bool "SIM_RAM_UART0 is slave"
+	depends on SIM_RAM_UART0
+	default n
+	---help---
+		The sim ram uart0 is slave
+
+config SIM_RAM_UART1
+	bool "SIM ram uart driver 1"
+	default n
+	---help---
+		sim ram uart device 1
+
+config SIM_RAM_UART1_SLAVE
+	bool "SIM_RAM_UART1 is slave"
+	depends on SIM_RAM_UART1
+	default n
+	---help---
+		The sim ram uart1 is slave

Review Comment:
   ```suggestion
   		The SIM RAM UART1 is slave



##########
arch/sim/Kconfig:
##########
@@ -625,6 +625,54 @@ config SIM_UART3_NAME
 		A UART port must also exist on the host system
 		with the exact same name specified here.
 
+config SIM_RAM_UART
+	bool "Sim ram uart driver"
+	depends on RAM_UART
+	default n
+	---help---
+		Enable sim ram uart
+
+if SIM_RAM_UART
+config SIM_RAM_UART0
+	bool "SIM ram uart driver 0"

Review Comment:
   ```suggestion
   	bool "SIM RAM UART Driver 0"



##########
arch/sim/Kconfig:
##########
@@ -625,6 +625,54 @@ config SIM_UART3_NAME
 		A UART port must also exist on the host system
 		with the exact same name specified here.
 
+config SIM_RAM_UART
+	bool "Sim ram uart driver"
+	depends on RAM_UART
+	default n
+	---help---
+		Enable sim ram uart
+
+if SIM_RAM_UART
+config SIM_RAM_UART0
+	bool "SIM ram uart driver 0"
+	default n
+	---help---
+		sim ram uart device 0

Review Comment:
   ```suggestion
   		SIM RAM UART Device 0



##########
arch/sim/Kconfig:
##########
@@ -625,6 +625,54 @@ config SIM_UART3_NAME
 		A UART port must also exist on the host system
 		with the exact same name specified here.
 
+config SIM_RAM_UART
+	bool "Sim ram uart driver"
+	depends on RAM_UART
+	default n
+	---help---
+		Enable sim ram uart
+
+if SIM_RAM_UART
+config SIM_RAM_UART0
+	bool "SIM ram uart driver 0"
+	default n
+	---help---
+		sim ram uart device 0
+
+config SIM_RAM_UART0_SLAVE
+	bool "SIM_RAM_UART0 is slave"
+	depends on SIM_RAM_UART0
+	default n
+	---help---
+		The sim ram uart0 is slave
+
+config SIM_RAM_UART1
+	bool "SIM ram uart driver 1"
+	default n
+	---help---
+		sim ram uart device 1
+
+config SIM_RAM_UART1_SLAVE
+	bool "SIM_RAM_UART1 is slave"
+	depends on SIM_RAM_UART1
+	default n
+	---help---
+		The sim ram uart1 is slave
+
+config SIM_RAM_UART2
+	bool "SIM ram uart driver 2"
+	default n
+	---help---
+		sim ram uart device 2
+
+config SIM_RAM_UART2_SLAVE
+	bool "SIM_RAM_UART2 is slave"
+	depends on SIM_RAM_UART2
+	default n
+	---help---
+		The sim ram uart2 is slave

Review Comment:
   ```suggestion
   		The SIM RAM UART2 is slave



##########
arch/sim/Kconfig:
##########
@@ -625,6 +625,54 @@ config SIM_UART3_NAME
 		A UART port must also exist on the host system
 		with the exact same name specified here.
 
+config SIM_RAM_UART
+	bool "Sim ram uart driver"
+	depends on RAM_UART
+	default n
+	---help---
+		Enable sim ram uart
+
+if SIM_RAM_UART
+config SIM_RAM_UART0
+	bool "SIM ram uart driver 0"
+	default n
+	---help---
+		sim ram uart device 0
+
+config SIM_RAM_UART0_SLAVE
+	bool "SIM_RAM_UART0 is slave"
+	depends on SIM_RAM_UART0
+	default n
+	---help---
+		The sim ram uart0 is slave
+
+config SIM_RAM_UART1
+	bool "SIM ram uart driver 1"
+	default n
+	---help---
+		sim ram uart device 1

Review Comment:
   ```suggestion
   		SIM RAM UART Device 1



##########
arch/sim/Kconfig:
##########
@@ -625,6 +625,54 @@ config SIM_UART3_NAME
 		A UART port must also exist on the host system
 		with the exact same name specified here.
 
+config SIM_RAM_UART
+	bool "Sim ram uart driver"
+	depends on RAM_UART
+	default n
+	---help---
+		Enable sim ram uart
+
+if SIM_RAM_UART
+config SIM_RAM_UART0
+	bool "SIM ram uart driver 0"
+	default n
+	---help---
+		sim ram uart device 0
+
+config SIM_RAM_UART0_SLAVE
+	bool "SIM_RAM_UART0 is slave"
+	depends on SIM_RAM_UART0
+	default n
+	---help---
+		The sim ram uart0 is slave
+
+config SIM_RAM_UART1
+	bool "SIM ram uart driver 1"

Review Comment:
   ```suggestion
   	bool "SIM RAM UART Driver 1"



##########
arch/sim/Kconfig:
##########
@@ -625,6 +625,54 @@ config SIM_UART3_NAME
 		A UART port must also exist on the host system
 		with the exact same name specified here.
 
+config SIM_RAM_UART
+	bool "Sim ram uart driver"
+	depends on RAM_UART
+	default n
+	---help---
+		Enable sim ram uart
+
+if SIM_RAM_UART
+config SIM_RAM_UART0
+	bool "SIM ram uart driver 0"
+	default n
+	---help---
+		sim ram uart device 0
+
+config SIM_RAM_UART0_SLAVE
+	bool "SIM_RAM_UART0 is slave"
+	depends on SIM_RAM_UART0
+	default n
+	---help---
+		The sim ram uart0 is slave
+
+config SIM_RAM_UART1
+	bool "SIM ram uart driver 1"
+	default n
+	---help---
+		sim ram uart device 1
+
+config SIM_RAM_UART1_SLAVE
+	bool "SIM_RAM_UART1 is slave"
+	depends on SIM_RAM_UART1
+	default n
+	---help---
+		The sim ram uart1 is slave
+
+config SIM_RAM_UART2
+	bool "SIM ram uart driver 2"

Review Comment:
   ```suggestion
   	bool "SIM RAM UART Driver 2"



-- 
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-unsubscribe@nuttx.apache.org

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