diff --git a/Documentation/applications/audioutils/morsey/index.rst b/Documentation/applications/audioutils/morsey/index.rst new file mode 100644 index 0000000000000..2578abd312c17 --- /dev/null +++ b/Documentation/applications/audioutils/morsey/index.rst @@ -0,0 +1,16 @@ +========================= +``morsey`` Morsey library +========================= + +``morsey`` is a simple library for parsing ASCII text into Morse code marks, and +playing Morse using a user-defined interface. + +To use the ``morsey`` library, include it like so: + +.. code:: c + + #include + +See the `Morsey repository `_ for +documentation on how to use the library. Note that there is also an included +``example.c`` file where Morse code is printed to the console. diff --git a/Documentation/applications/examples/txmorse/index.rst b/Documentation/applications/examples/txmorse/index.rst new file mode 100644 index 0000000000000..bc655473e7f0e --- /dev/null +++ b/Documentation/applications/examples/txmorse/index.rst @@ -0,0 +1,44 @@ +================================== +``txmorse`` Morse code transmitter +================================== + +This application is an example which transmits Morse code messages using the +:doc:`Morsey library `. + +You can run ``txmorse -h`` to display help information. + +Supported Devices +----------------- + +.. note:: + + This application does not currently support all possible Morse code + transmission devices available on NuttX NuttX. Currently, only GPIO devices + are supported. + +In order to add support for a new output device, you must submit a patch +modifying the program to define the interface for the Morsey library for each +type of output device. Take a look at the current application code to see +examples for console devices and GPIO devices. + +The ``txfunc`` function is used by the ``morsey`` library to transmit a mark. +You can implement the appropriate driver operations (i.e. ``ioctl`` calls) in +this function. See the GPIO implementation for an example. + +The ``cleanupfunc`` function is used to cleanup the implementation. For most +NuttX devices, this involves closing the file descriptor. + +In the ``main`` function, the path to the output device is used to identify the +implementation to use. For instance, GPIO devices are under ``/dev/gpio``, so +device paths containing "gpio" cause the GPIO driver to be selected. If no +player can be associated with the device, the default player is selected which +just prints the Morse code to the console. + +Usage +----- + +The following will output "SOS" over a GPIO device (i.e. buzzer or LED): + +.. code:: console + + nsh> txmorse "sos" /dev/gpio0 diff --git a/Documentation/platforms/sim/sim/boards/sim/index.rst b/Documentation/platforms/sim/sim/boards/sim/index.rst index 813adabc614ee..4784676a20d2c 100644 --- a/Documentation/platforms/sim/sim/boards/sim/index.rst +++ b/Documentation/platforms/sim/sim/boards/sim/index.rst @@ -1459,6 +1459,19 @@ An example usage: hello nsh> +txmorse +------- + +This is a configuration with :doc:`the Morse transmitter example +` using the :doc:`Morsey library +`. + +.. code:: console + + nsh> txmorse "sos sos sos" + ... --- .../... --- .../... --- ... + nsh> + udgram ------ diff --git a/boards/sim/sim/sim/configs/txmorse/defconfig b/boards/sim/sim/sim/configs/txmorse/defconfig new file mode 100644 index 0000000000000..91b87107cabde --- /dev/null +++ b/boards/sim/sim/sim/configs/txmorse/defconfig @@ -0,0 +1,79 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# +# CONFIG_NSH_CMDOPT_HEXDUMP is not set +CONFIG_ARCH="sim" +CONFIG_ARCH_BOARD="sim" +CONFIG_ARCH_BOARD_SIM=y +CONFIG_ARCH_CHIP="sim" +CONFIG_ARCH_SIM=y +CONFIG_AUDIOUTILS_MORSEY=y +CONFIG_BOARDCTL_APP_SYMTAB=y +CONFIG_BOARDCTL_POWEROFF=y +CONFIG_BOARD_LOOPSPERMSEC=0 +CONFIG_BOOT_RUNFROMEXTSRAM=y +CONFIG_BUILTIN=y +CONFIG_COVERAGE_ALL=y +CONFIG_COVERAGE_TOOLCHAIN=y +CONFIG_DEBUG_ASSERTIONS=y +CONFIG_DEBUG_ASSERTIONS_EXPRESSION=y +CONFIG_DEBUG_FEATURES=y +CONFIG_DEBUG_SYMBOLS=y +CONFIG_DEV_GPIO=y +CONFIG_DEV_LOOP=y +CONFIG_ETC_FATDEVNO=2 +CONFIG_ETC_ROMFS=y +CONFIG_ETC_ROMFSDEVNO=1 +CONFIG_EXAMPLES_GPIO=y +CONFIG_EXAMPLES_HELLO=y +CONFIG_EXAMPLES_TXMORSE=y +CONFIG_FAT_LCNAMES=y +CONFIG_FAT_LFN=y +CONFIG_FS_BINFS=y +CONFIG_FS_FAT=y +CONFIG_FS_HOSTFS=y +CONFIG_FS_PROCFS=y +CONFIG_FS_RAMMAP=y +CONFIG_FS_ROMFS=y +CONFIG_GPIO_LOWER_HALF=y +CONFIG_HAVE_CXXINITIALIZE=y +CONFIG_IDLETHREAD_STACKSIZE=4096 +CONFIG_INIT_ENTRYPOINT="nsh_main" +CONFIG_IOEXPANDER=y +CONFIG_IOEXPANDER_DUMMY=y +CONFIG_LIBC_ENVPATH=y +CONFIG_LIBC_EXECFUNCS=y +CONFIG_LIBC_LOCALE=y +CONFIG_LIBC_LOCALE_CATALOG=y +CONFIG_LIBC_LOCALE_GETTEXT=y +CONFIG_LIBC_MAX_EXITFUNS=1 +CONFIG_LIBC_NUMBERED_ARGS=y +CONFIG_NDEBUG=y +CONFIG_NSH_BUILTIN_APPS=y +CONFIG_NSH_FILE_APPS=y +CONFIG_NSH_READLINE=y +CONFIG_PATH_INITIAL="/bin" +CONFIG_PIPES=y +CONFIG_PSEUDOFS_ATTRIBUTES=y +CONFIG_PSEUDOFS_FILE=y +CONFIG_PSEUDOFS_SOFTLINKS=y +CONFIG_READLINE_TABCOMPLETION=y +CONFIG_RTC=y +CONFIG_RTC_ARCH=y +CONFIG_RTC_DRIVER=y +CONFIG_SCHED_BACKTRACE=y +CONFIG_SCHED_EVENTS=y +CONFIG_SCHED_HAVE_PARENT=y +CONFIG_SCHED_WAITPID=y +CONFIG_SIM_HOSTFS=y +CONFIG_SIM_WALLTIME_SIGNAL=y +CONFIG_START_MONTH=6 +CONFIG_START_YEAR=2008 +CONFIG_SYSTEM_DUMPSTACK=y +CONFIG_SYSTEM_GCOV=y +CONFIG_SYSTEM_NSH=y +CONFIG_TESTING_OSTEST=y