[PATCH rtems-libbsd 5/5] libbsd: USB Template Driver Documentation

Husni Faiz ahamedhusni73 at gmail.com
Sun Aug 1 19:25:46 UTC 2021


Signed-off-by: Husni Faiz <ahamedhusni73 at gmail.com>
---
 libbsd/device_driver.rst | 30 ++++++++++++++++++++++++++++++
 libbsd/index.rst         |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 libbsd/device_driver.rst

diff --git a/libbsd/device_driver.rst b/libbsd/device_driver.rst
new file mode 100644
index 0000000..7562866
--- /dev/null
+++ b/libbsd/device_driver.rst
@@ -0,0 +1,30 @@
+.. SPDX-License-Identifier: CC-BY-SA-4.0
+
+Device Driver
+#################
+
+Introduction
+============
+
+USB
+===
+
+USB Template
+------------
+
+USB Template driver is initialized based on the value of `hw.usb.template` 
+sysctl variable. To set the variable use the `sysctlbyname` system call 
+as follows in your application,
+
+  .. code-block:: c
+		
+		int template = 1;
+		sysctlbyname("hw.usb.template", NULL, NULL, &template, sizeof(template));
+
+You can set the variable at runtime using the shell with the syctl utility.
+
+  .. code-block:: shell
+		
+		sysctl hw.usb.template=1
+		
+NOTE: Template 1 is the CDC Ethernet.
diff --git a/libbsd/index.rst b/libbsd/index.rst
index f790070..1ee349a 100644
--- a/libbsd/index.rst
+++ b/libbsd/index.rst
@@ -21,3 +21,4 @@ RTEMS LibBSD User Manual (|version|).
 
 	introduction
 	quick_start
+	device_driver
-- 
2.25.1



More information about the devel mailing list