diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html
index 0408f82ac8..ebb3eff4bf 100644
--- a/Documentation/NuttxPortingGuide.html
+++ b/Documentation/NuttxPortingGuide.html
@@ -131,7 +131,8 @@
6.3.12 PWM Drivers
6.3.13 CAN Drivers
6.3.14 Quadrature Encoder Drivers
- 6.3.15 Watchdog Timer Drivers
+ 6.3.15 Watchdog Timer Drivers
+ 6.3.16 Keyboard/Keypad Drivers
6.4 Power Management
+ "Out-of-Band" Commands. + Keyboards and keypads are the same device for NuttX. + A keypad is thought of as simply a keyboard with fewer keys. + In NuttX, a keyboard/keypad driver is simply a character driver that may have an (optional) encoding/decoding layer on the data returned by the character driver. + A keyboard may return simple text data (alphabetic, numeric, and punctuaction) or control characters (enter, control-C, etc.). + We can think about this the normal "in-band" keyboard data stream. + However, in addition, most keyboards support actions that cannot be represented as text data. + Such actions include things like cursor controls (home, up arrow, page down, etc.), editing functions (insert, delete, etc.), volume controls, (mute, volume up, etc.) and other special functions. + We can think about this as special, "out-of-band" keyboard commands. + In this case, some special encoding may be required to multiplex the in-band text data and out-of-band command streams. +
+
+ Encoding/Decoding Layer.
+ An optional encoding/decoding layer can be used with the basic character driver to encode the out-of-band commands into the text data stream.
+ The function interfaces that comprise that encoding/decoding layer are defined in the header file include/nuttx/input/kbd_code.h
.
+ These functions provide an matched set of (a) driver encoding interfaces, and (b) application decoding interfaces.
+
+ Driver Encoding Interfaces. +
+
+ kbd_puttext()
+
Function Prototype:
++#include <nuttx/streams.h> +#include <nuttx/input/kbd_codec.h> +void kbd_puttext(int ch, FAR struct lib_outstream_s *stream); +
Description:
+Input Pameters:
+ch
: The character to be added to the output stream.
+ stream
: An instance of lib_outstream_s
to perform the actual low-level put operation.
+ Returned Value:
+
+ kbd_putspecial()
+
Function Prototype:
++#include <nuttx/streams.h> +#include <nuttx/input/kbd_codec.h> +void kbd_putspecial(enum kbd_keycode_e keycode, FAR struct lib_outstream_s *stream); ++
Description:
+Input Pameters:
+keycode
: The command to be added to the output stream.
+ The enumeration enum kbd_keycode_e keycode
identifies all commands known to the system.
+ stream
: An instance of lib_outstream_s
to perform the actual low-level put operation.
+ Returned Value:
++ Application Decoding Interfaces. +
+
+ kbd_get()
+
Function Prototype:
++#include <nuttx/streams.h> +#include <nuttx/input/kbd_codec.h> +int kbd_get(FAR struct lib_instream_s *stream, FAR struct kbd_getstate_s *state, FAR uint8_t *pch); +
Description:
+Input Pameters:
+stream
: An instance of lib_instream_s
to perform the actual low-level get operation.
+ pch
: The location character to save the returned value.
+ This may be either a normal, "in-band" ASCII characer or a special, "out-of-band" command (i.e., a value from enum kbd_getstate_s
.
+ state
: A user provided buffer to support parsing.
+ This structure should be cleared the first time that kbd_get
is called.
+ Returned Value:
+pch
is a value from enum kbd_getstate_s
.
+ pch
is a simple byte of text or control data.
+ EOF
:
+ An error has getting the next character (reported by the stream
).
+ Normally indicates the end of file.
+
+ I/O Streams.
+ Notice the use of the abstract I/O streams in these interfaces.
+ These stream interfaces are defined in include/nuttx/streams.h
.
+