OSDN Git Service

チケット #30493 , チケット #30494 , チケット #30502
authorShinichiro Nakamura <shinta.main.jp@gmail.com>
Mon, 14 Jan 2013 02:40:50 +0000 (11:40 +0900)
committerShinichiro Nakamura <shinta.main.jp@gmail.com>
Mon, 14 Jan 2013 02:40:50 +0000 (11:40 +0900)
 * BlueTank用BSPファイルの新設をdevelopにマージする
 * SGTL-5000対応をdevelopにマージする
 * Natural Tiny Shell (NT-Shell)の追加をdevelopにマージする

33 files changed:
uzumeapp/kernel/config/blackfin/bsp_bluetank/Makefile.config [new file with mode: 0644]
uzumeapp/kernel/config/blackfin/bsp_bluetank/readme.txt [new file with mode: 0644]
uzumeapp/kernel/config/blackfin/bsp_bluetank/sys_config.h [new file with mode: 0644]
uzumeapp/kernel/config/blackfin/bsp_bluetank/sys_defs.h [new file with mode: 0644]
uzumeapp/kernel/uzume/bsp_bluetank.c [new file with mode: 0644]
uzumeapp/kernel/uzume/bsp_bluetank.cfg [new file with mode: 0644]
uzumeapp/kernel/uzume/bsp_bluetank.doxyfile [new file with mode: 0644]
uzumeapp/kernel/uzume/bsp_bluetank.h [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/ntconf.h [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/ntint.h [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/ntlibc.c [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/ntlibc.h [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/ntopt.c [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/ntopt.h [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/ntshell.c [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/ntshell.h [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/ntshell_task.c [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/ntshell_task.cfg [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/ntshell_task.h [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/text_editor.c [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/text_editor.h [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/text_history.c [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/text_history.h [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/vtrecv.c [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/vtrecv.h [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/vtsend.c [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/vtsend.h [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/xprintf.c [new file with mode: 0644]
uzumeapp/kernel/uzume/ntshell/xprintf.h [new file with mode: 0644]
uzumeapp/kernel/uzume/rotenc.c [new file with mode: 0644]
uzumeapp/kernel/uzume/rotenc.cfg [new file with mode: 0644]
uzumeapp/kernel/uzume/rotenc.h [new file with mode: 0644]
uzumeapp/kernel/uzume/sgtl5000.c [new file with mode: 0644]

diff --git a/uzumeapp/kernel/config/blackfin/bsp_bluetank/Makefile.config b/uzumeapp/kernel/config/blackfin/bsp_bluetank/Makefile.config
new file mode 100644 (file)
index 0000000..ce23fbf
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# Makefile のターゲットシステム依存部(bsp_bluetank用)
+#
+
+#
+# コンパイルオプション
+#
+INCLUDES := $(INCLUDES) -I$(SRCDIR)/config/$(CPU)/$(SYS) \
+                       -I$(SRCDIR)/config/$(CPU)/_common_bf592 \
+                       -I$(SRCDIR)/pdic/simple_sio \
+                       -I$(SRCDIR)/uzume \
+                       -I$(SRCDIR)/uzume/ntshell
+COPTS := $(COPTS)
+LDFLAGS := $(LDFLAGS)
+
+#
+# カーネルに関する定義
+#
+KERNEL_DIR := $(KERNEL_DIR) :$(SRCDIR)/config/$(CPU)/$(SYS) :$(SRCDIR)/config/$(CPU)/_common_bf592 :$(SRCDIR)/pdic/simple_sio :$(SRCDIR)/uzume :$(SRCDIR)/uzume/ntshell
+KERNEL_ASMOBJS := $(KERNEL_ASMOBJS)
+KERNEL_COBJS := $(KERNEL_COBJS) chip_config.o uart.o chip_debugboot.o chip_dump.o
+KERNEL_COBJS := $(KERNEL_COBJS) i2s_subsystem.o i2c_subsystem.o rotenc.o uzume_callback.o sgtl5000.o bsp_bluetank.o
+KERNEL_COBJS := $(KERNEL_COBJS) ntlibc.o ntopt.o ntshell.o ntshell_task.o text_editor.o text_history.o vtrecv.o vtsend.o xprintf.o
+
+#
+# リンカスクリプトの定義
+#
+LDSCRIPT = $(CPU)/_common_bf592/bf592elf.ld
+
diff --git a/uzumeapp/kernel/config/blackfin/bsp_bluetank/readme.txt b/uzumeapp/kernel/config/blackfin/bsp_bluetank/readme.txt
new file mode 100644 (file)
index 0000000..ce131af
--- /dev/null
@@ -0,0 +1,13 @@
+BlueTank ACB-BF592基板Board Support Package ( BF592 )。
+
+
+Makefile.configは、インクルード・パスおよびソースファイルへのパスとしてblackfin/_common_bf592を
+指定している。
+
+- Makefile.config : gnu環境のためのシステム依存部定義ファイル
+- readme.txt : このファイル
+- sys_config.h : システム依存部のうち、アプリケーションから見えない宣言
+- sys_defs.h : システム依存部のうち、アプリケーションから見える宣言
+
+2013/01/01
+    初版
diff --git a/uzumeapp/kernel/config/blackfin/bsp_bluetank/sys_config.h b/uzumeapp/kernel/config/blackfin/bsp_bluetank/sys_config.h
new file mode 100644 (file)
index 0000000..dbfe29d
--- /dev/null
@@ -0,0 +1,211 @@
+/*
+ *  TOPPERS/JSP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Just Standard Profile Kernel
+ *
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *
+ *  TOPPERS/JSP for Blackfin
+ *
+ *  Copyright (C) 2004,2006,2006 by Takemasa Nakamura
+ *  Copyright (C) 2004 by Ujinosuke
+ *
+ *  上記著作権者は,以下の (1)〜(4) の条件か,Free Software Foundation
+ *  によって公表されている GNU General Public License の Version 2 に記
+ *  述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
+ *  を改変したものを含む.以下同じ)を使用・複製・改変・再配布(以下,
+ *  利用と呼ぶ)することを無償で許諾する.
+ *  (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
+ *      権表示,この利用条件および下記の無保証規定が,そのままの形でソー
+ *      スコード中に含まれていること.
+ *  (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
+ *      用できる形で再配布する場合には,再配布に伴うドキュメント(利用
+ *      者マニュアルなど)に,上記の著作権表示,この利用条件および下記
+ *      の無保証規定を掲載すること.
+ *  (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
+ *      用できない形で再配布する場合には,次のいずれかの条件を満たすこ
+ *      と.
+ *    (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
+ *        作権表示,この利用条件および下記の無保証規定を掲載すること.
+ *    (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
+ *        報告すること.
+ *  (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+ *      害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
+ *
+ *  本ソフトウェアは,無保証で提供されているものである.上記著作権者お
+ *  よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
+ *  含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
+ *  接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
+ *
+ *
+ */
+
+
+#ifndef _SYS_CONFIG_H_
+#define _SYS_CONFIG_H_
+
+/*
+ *  カーネルの内部識別名のリネーム
+ */
+#include <sys_rename.h>
+
+/* blackfin/_common_bf533から読み込む */
+#include <chip_config.h>
+
+/*
+ *  ターゲットシステム依存モジュール(BSP-BLUETANK用)
+ *
+ *  このインクルードファイルは,t_config.h のみからインクルードされる.
+ *  他のファイルから直接インクルードしてはならない.
+*/
+
+/*
+ * どのようなクロック入力にも対応できるよう、以下でCSEL, SSEL, MSELの値
+ * とクロック入力周波数(Hz)を指定する。PLLのプログラムはsys_config.cの
+ * sys_initialize()関数で行われる。
+ *
+ * CSELVALは1,2,4,8の中から選ぶ。CLKINの単位はHz
+ */
+
+#define CSELVAL 1
+#define SSELVAL 4
+#define MSELVAL 16
+#define CLKIN 25000000
+
+/*
+ * Uzumeコンフィギュレーションマクロ群
+ *
+ * Uzumeの各機能モジュールはハードウェアに応じた自由度を持っている。それらの設定をデフォルト以外で
+ * 使う場合には引数となるマクロをシステム依存部のsys_config.hで宣言する。
+ *
+ * UZUME_INT_BITS はaudio_callback()の引数として渡されるオーディオ・サンプルの整数値の何ビット取るか
+ * 指定する。デフォルトは0である。符号部を除く整数部を7ビット取りたければ、7を指定する。
+ *
+ * UZUME_BLOCKSIZE は一回のDMA転送で転送するデータのサンプル数である。ステレオデータなので、実際に転送する
+ * データ数は UZUME_BLOCKSIZEで指定した量の倍のデータである。48kHzサンプルの場合に48を指定すると、1m秒に
+ * 一回割り込みがかかる。
+ *
+ * UZUME_SSM2603_I2C_ADRS はSSM2603 コーデックの I2Cデバイスアドレスである。7bitアドレスを右詰めで表現する
+ * デフォルトは0x1A
+ *
+ * UZUME_AD7999_I2C_ADRS はAD7999 ADCの I2Cデバイスアドレスである。7bitアドレスを右詰めで表現する。
+ * デフォルトは 0x28
+ *
+ * その他、I2Cペリフェラルのポート番号を指定するマクロもあるが、2012年時点で0以外には対応していないので
+ * ここでは説明しない。
+ */
+
+//#define UZUME_BLOCKSIZE 64
+//#define UZUME_INT_BITS 0
+//#define UZUME_SSM2603_I2C_ADRS 0x1A
+//#define UZUME_AD7999_I2C_ADRS 0x28
+
+// #define MAIN_TASK_PRIORITY    7
+// #define LOGTASK_PRIORITY      5
+// #define CODEC_TASK_PRIORITY   4
+// #define AD7999_TASK_PRIORITY  6
+
+// #define MAIN_TASK_STACK_SIZE   1024
+// #define LOGTASK_STACK_SIZE     1024
+// #define CODEC_TASK_STACK_SIZE  1024
+// #define AD7999_TASK_STACK_SIZE 1024
+
+/*
+ * システムタイマーの選択
+ * USE_TIC_COREをdefineすると、COREタイマーが使用される
+ * コメントアウトすると、GP_TIMER_2を使用する
+ *
+ * COREタイマーはwakeup信号を生成しないため、ディスパッチャ
+ * はidle命令を使ってCOREタイマーイベントを待つことができない。
+ * そのため、USE_TIC_COREを使うとディスパッチャはidle命令を
+ * 使わずに割り込み発生をポーリングで待つ。これは消費電力の
+ * 点で不利である。
+ *
+ * システムタイマーにコアタイマーを使うことは、推奨しない。
+ * この機能は、移植時の利便性のために残しており、実アプリケーションで
+ * つかうことは想定していない。
+ *
+ */
+//#define USE_TIC_CORE
+
+/*
+ * ハードウェア・エラー割り込みの許可
+ * QUICK_HW_ERRORをdefineすると、ハードウェア・エラー・イベント
+ * が即座に受理される。defineしない場合には、割り込み待ち状態で
+ * ハードウェア・エラー・割り込みが発生した場合、次の割り込みまで
+ * 待たされることになる。
+ *
+ */
+//#define QUICK_HW_ERROR
+
+
+/*
+ * 実行時初期化関数の使用
+ *
+ * マクロ USE_RUNTIME_INIT を定義すると、start.asmのなかで _mi_initialize
+ * を呼び出す。この関数はノーブートモードで起動するときにのみ必要になるので
+ * 通常は USE_RUNTIME_INITを使う必要はない。
+ * 詳細はADIのEE239に詳しい。http://tinyurl.com/2hpbk (tinyURL)
+ *
+*/
+//#define USE_RUNTIME_INIT
+
+/*
+ * カーネル管理外割り込みの宣言
+ *
+ * マクロUNMANAGED_INTはカーネル管理外割り込みを宣言する。この
+ * マクロは16ビットのビットマップになっており、以下にあるパターン
+ * のうちひとつを使う。なお、どのようなパターンを選んでもNMIは管理外
+ * 割込みとして扱われる。
+ * UNMANAGED_INTを宣言しない場合、NMIだけが管理外割込みとして扱われる。
+ *
+*/
+//#define UNMANAGED_INT 0x0020          // IVHWがカーネル管理外.
+//#define UNMANAGED_INT 0x0060          // IVTMRとIVHWがカーネル管理外.
+//#define UNMANAGED_INT 0x00E0          // IVG7, IVTMRとIVHWがカーネル管理外.
+//#define UNMANAGED_INT 0x01E0          // IVG8 ... IVG7, IVTMRとIVHWがカーネル管理外.
+//#define UNMANAGED_INT 0x03E0          // IVG9 ... IVG7, IVTMRとIVHWがカーネル管理外.
+//#define UNMANAGED_INT 0x07E0          // IVG10 ... IVG7, IVTMRとIVHWがカーネル管理外.
+//#define UNMANAGED_INT 0x0FE0          // IVG11 ... IVG7, IVTMRとIVHWがカーネル管理外.
+//#define UNMANAGED_INT 0x1FE0          // IVG12 ... IVG7, IVTMRとIVHWがカーネル管理外.
+//#define UNMANAGED_INT 0x3FE0          // IVG13 ... IVG7, IVTMRとIVHWがカーネル管理外.
+
+/*
+ * C++関連資源を用意する
+ *
+ * マクロINIT_C_PLUS_PLUSを定義すると、C++言語用のテーブルを
+ * 初期化コードを実行する。また、C++言語用のテーブルを宣言する
+ *
+*/
+// #define INIT_C_PLUS_PLUS
+
+/*
+ *  起動メッセージのターゲットシステム名
+ */
+#define TARGET_NAME "BSP-BLUETANK"
+
+
+/*
+ *  シリアルポート数の定義
+ *  TNUM_SIOP_XXXは、UARTの種別ごとに宣言する。
+ *  TNUM_SIOP_UARTはBF592内蔵UARTのうち、PDICが使用するもの。
+ *  BF592はUARTをひとつしかもっていないので、1か0を宣言する。
+ *  TNUM_PORTは、TNUM_SIOP_XXXのうち、GDICが使用するものの総和。
+ *  uart.cで使う。
+ */
+#define TNUM_PORT   1       /* GDICがサポートするシリアルポートの数 */
+#define TNUM_SIOP_UART  1   /* PIDCがサポートするシリアルポートの数 */
+
+/*
+ *  シリアルポート番号に関する定義
+ *  ログタスクがシリアルポートを使わない場合は無視していい。
+ */
+#define LOGTASK_PORTID  1   /* システムログに用いるシリアルポート番号。UART0はシリアルポート1である */
+
+/*  UART0のボーレート. */
+#define UART0_BAUD_RATE 57600       /* 57600 bps*/
+
+
+
+#endif /* _SYS_CONFIG_H_ */
diff --git a/uzumeapp/kernel/config/blackfin/bsp_bluetank/sys_defs.h b/uzumeapp/kernel/config/blackfin/bsp_bluetank/sys_defs.h
new file mode 100644 (file)
index 0000000..a171950
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ *  TOPPERS/JSP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Just Standard Profile Kernel
+ * 
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *
+ *  TOPPERS/JSP for Blackfin
+ *
+ *  Copyright (C) 2004,2006,2006 by Takemasa Nakamura
+ *  Copyright (C) 2004 by Ujinosuke
+ *
+ *  上記著作権者は,以下の (1)〜(4) の条件か,Free Software Foundation 
+ *  によって公表されている GNU General Public License の Version 2 に記
+ *  述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
+ *  を改変したものを含む.以下同じ)を使用・複製・改変・再配布(以下,
+ *  利用と呼ぶ)することを無償で許諾する.
+ *  (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
+ *      権表示,この利用条件および下記の無保証規定が,そのままの形でソー
+ *      スコード中に含まれていること.
+ *  (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
+ *      用できる形で再配布する場合には,再配布に伴うドキュメント(利用
+ *      者マニュアルなど)に,上記の著作権表示,この利用条件および下記
+ *      の無保証規定を掲載すること.
+ *  (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
+ *      用できない形で再配布する場合には,次のいずれかの条件を満たすこ
+ *      と.
+ *    (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
+ *        作権表示,この利用条件および下記の無保証規定を掲載すること.
+ *    (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
+ *        報告すること.
+ *  (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+ *      害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
+ * 
+ *  本ソフトウェアは,無保証で提供されているものである.上記著作権者お
+ *  よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
+ *  含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
+ *  接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
+ * 
+ *  
+ */
+
+
+/*
+ *  ターゲットシステムに依存する定義(BSP-BLUETANK用)
+ *
+ *  このインクルードファイルは,kernel.h と sil.h でインクルードされる.
+ *  他のファイルから直接インクルードすることはない.このファイルをイン
+ *  クルードする前に,t_stddef.h と itron.h がインクルードされるので,
+ *  それらに依存してもよい.
+ */
+
+#ifndef _SYS_DEFS_H_
+#define _SYS_DEFS_H_
+
+/* blackfin/_common_bf592から読む */
+#include <chip_defs.h>
+
+ /* システム略称  jsp/doc/config.txtの 2.(8)を参照 */
+#define BSP_BLUETANK
+
+/*
+ *  破壊性読み出しレジスタの判別式
+ *  与えられたアドレス iop が破壊性読み出しレジスタの
+ *  場合には真を返す。
+ *
+ *  ADSP-BF592の内蔵ペリフェラルについて考慮する必要はない
+ *  宣言しない場合は、デフォルトで外部ペリフェラルはすべて
+ *  破壊性読み出しとして扱われる
+ *
+ *  ADSP-BF592は外部ペリフェラルを持つことができないので、
+ *  無視していい
+ *
+ */
+// #define DESTRUCTIVE_READ( iop ) (iop<(VP)0xF0000000) 
+
+
+
+#endif /* _SYS_DEFS_H_ */
diff --git a/uzumeapp/kernel/uzume/bsp_bluetank.c b/uzumeapp/kernel/uzume/bsp_bluetank.c
new file mode 100644 (file)
index 0000000..5d8350d
--- /dev/null
@@ -0,0 +1,23 @@
+/**
+ * @file bsp_bluetank.c
+ * @author takemasa
+ * @brief BlueTank ACB-BF592ボード用のリソース
+ * @details
+ * ここにはBSP専用のリソースを置く。実際にはボードの初期化子を置く。
+ */
+#include <s_services.h>
+#include <t_services.h>
+#include <cdefBF592-A.h>
+#include <bsp_bluetank.h>
+
+void board_initialize(VP_INT exinf)
+{
+    // ADSP-BF592 PORTG設定
+    // DR0PRI, RSCK0, RFS0, TD0PRI, TSCK0, TSF0をMUXで0 ( Primary func )にする
+    *pPORTG_MUX &= ~0x00ee;
+
+    // ADSP-BF592 PORTG設定
+    // DR0PRI, RSCK0, RFS0, TD0PRI, TSCK0, TSF0をFERでイネーブルにする
+    *pPORTG_FER = 0x00ee;
+}
+
diff --git a/uzumeapp/kernel/uzume/bsp_bluetank.cfg b/uzumeapp/kernel/uzume/bsp_bluetank.cfg
new file mode 100644 (file)
index 0000000..e9be80f
--- /dev/null
@@ -0,0 +1,12 @@
+#include "i2c0_m.cfg"
+#include "i2s.cfg"
+#include "rotenc.cfg"
+#include "ntshell_task.cfg"
+
+INCLUDE("\"bsp_bluetank.h\"");
+
+ATT_INI({
+        TA_NULL,                /* 高級言語でインターフェースする */
+        0,                      /* イニシャライザに渡すパラメタ。0はTWI0 */
+        board_initialize       /* イニシャライザ本体 */
+        });
diff --git a/uzumeapp/kernel/uzume/bsp_bluetank.doxyfile b/uzumeapp/kernel/uzume/bsp_bluetank.doxyfile
new file mode 100644 (file)
index 0000000..ecd9e35
--- /dev/null
@@ -0,0 +1,1781 @@
+# Doxyfile 1.7.6.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a hash (#) is considered a comment and will be ignored.
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
+
+PROJECT_NAME = BlueTank ACB-BF592 BSP
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF = 
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO = 
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = 
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = 
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES = 
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding
+# "class=itcl::class" will allow you to use the command class in the
+# itcl::class meaning.
+
+TCL_SUBST = 
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING = 
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields will be shown inline in the documentation
+# of the scope in which they are defined (i.e. file, namespace, or group
+# documentation), provided this scope is documented. If set to NO (the default),
+# structs, classes, and unions are shown on a separate page (for HTML and Man
+# pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+SYMBOL_CACHE_SIZE = 0
+
+# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
+# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
+# their name and scope. Since this can be an expensive process and often the
+# same symbol appear multiple times in the code, doxygen keeps a cache of
+# pre-resolved symbols. If the cache is too small doxygen will become slower.
+# If the cache is too large, memory is wasted. The cache size is given by this
+# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+LOOKUP_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = YES
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = YES
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST = YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER = 
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. The create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE = 
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
+# feature you need bibtex and perl available in the search path.
+
+CITE_BIB_FILES = 
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = rotenc.c rotenc.h bsp_bluetank.c bsp_bluetank.h i2c_subsystem.c i2c_subsystem.h i2s_subsystem.c i2s_subsystem.h sgtl5000.c uzume.h
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS = 
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE = 
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = 
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS = 
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+#  for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is advised to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# style sheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET = 
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES = 
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the style sheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP = YES
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE = 
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME = 
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS = 
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS = 
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION = 
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+#  will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
+# at top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it. Since the tabs have the same information as the
+# navigation tree you can set this option to NO if you already set
+# GENERATE_TREEVIEW to YES.
+
+DISABLE_INDEX = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+# Since the tree basically has the same information as the tab index you
+# could consider to set DISABLE_INDEX to NO when enabling this option.
+
+GENERATE_TREEVIEW = NO
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE = 4
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the
+# mathjax.org site, so you can quickly see the result without installing
+# MathJax, but it is strongly recommended to install a local copy of MathJax
+# before deployment.
+
+MATHJAX_RELPATH = http://www.mathjax.org/mathjax
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS = 
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE = NO
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER = 
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE = plain
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load style sheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE = 
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA = 
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = 
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH = 
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = YES
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS = 0
+
+# By default doxygen will use the Helvetica font for all dot files that
+# doxygen generates. When you want a differently looking font you can specify
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find
+# the font, which can be done by putting it in a standard location or by setting
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font.
+
+DOT_FONTNAME = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the Helvetica font.
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
+# set the path where dot can find it.
+
+DOT_FONTPATH = 
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = YES
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = NO
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used. If you choose svg you need to set
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible in IE 9+ (other browsers do not have this requirement).
+
+DOT_IMAGE_FORMAT = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG = NO
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS = 
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS = 
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = YES
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
diff --git a/uzumeapp/kernel/uzume/bsp_bluetank.h b/uzumeapp/kernel/uzume/bsp_bluetank.h
new file mode 100644 (file)
index 0000000..2ade94a
--- /dev/null
@@ -0,0 +1,45 @@
+/**
+ * @file bsp_bluetank.h
+ * @author takemasa
+ * @brief BlueTank ACB-BF592ボード用のリソース
+ * @details
+ * ここにはBSP専用のリソースを置く。実際にはボードの初期化子を置く。
+ */
+
+/**
+ * @mainpage
+ * BlueTank ACB-BF592 ボードのBSP (Board Support Package)
+ *
+ * Uzumeを使う上のBSPは以下の構成になっている
+ * @li uzume/bsp_bluetank.cfg アプリケーションから読み込むべき
+ * 静的コンフィギュレーション・ファイル
+ * @li config/blackfin/bsp_bluetank BSPのシステム依存部
+ * @li uzume_callback.c ユーザー用オーディオコールバックと初期化部の実装
+ * @li uzume_app.c ユーザーアプリケーションが使うタスク。
+ * @li uzume_app.cfg アプリケーション
+ *
+ * BSPを使う場合には、次のようにする
+ * @li システム依存部から適切なBSPを選び、configure_projectの中で使用する。
+ * @li kernel/uzumeの中からBSPに合わせた.cfgファイルを選び、uzume_app.cfgから
+ * インクルードする
+ * @li configure_projectを実行する
+ *
+ * これでプロジェクトがmake可能になる。
+ *
+ * 信号処理のアルゴリズムは uzume_callback.c のなかの process_audio() に記述する。
+ * また、信号処理の前に初期以下が必要であれば init_audio() に初期化コードを記述する。
+ */
+#ifndef BSP_BLUETANK_H
+#define BSP_BLUETANK_H
+
+/**
+ * \brief ボード・イニシャライザ
+ * \param exinf 0を渡す。関数からは無視される。
+ * \details
+ * BSP用のイニシャライザである。アプリケーションに依存せず、uzumeが
+ * 必要とする初期化処理をおここで行う。具体的にはI2S用のピンの割付を行う
+ */
+void board_initialize(VP_INT exinf);
+
+#endif /* BSP_BLUETANK_H */
+
diff --git a/uzumeapp/kernel/uzume/ntshell/ntconf.h b/uzumeapp/kernel/uzume/ntshell/ntconf.h
new file mode 100644 (file)
index 0000000..490c49f
--- /dev/null
@@ -0,0 +1,58 @@
+/**
+ * @file ntconf.h
+ * @author Shinichiro Nakamura
+ * @brief NT-Shellのコンフィギュレーション。
+ */
+
+/*
+ * ===============================================================
+ *  Natural Tiny Shell (NT-Shell)
+ * ===============================================================
+ * Copyright (c) 2010-2012 Shinichiro Nakamura
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ * ===============================================================
+ */
+
+#ifndef NTCONF_H
+#define NTCONF_H
+
+/**
+ * @note
+ * ここでは、NT-Shellの内部実装で使用する共通の定義を行なう。
+ * NT-Shell内部では、複数のモジュールが互いに緩い依存関係を持つ。
+ * これはNT-Shellの最上位モジュールであるntshellが各モジュールを
+ * 使って機能を実現するためである。
+ */
+
+/**
+ * @brief 1行あたりの最大文字数。
+ */
+#define NTCONF_EDITOR_MAXLEN    (32)
+
+/**
+ * @brief テキストヒストリ数。
+ */
+#define NTCONF_HISTORY_DEPTH    (8)
+
+#endif
+
diff --git a/uzumeapp/kernel/uzume/ntshell/ntint.h b/uzumeapp/kernel/uzume/ntshell/ntint.h
new file mode 100644 (file)
index 0000000..868b156
--- /dev/null
@@ -0,0 +1,65 @@
+/**
+ * @file ntint.h
+ * @author Shinichiro Nakamura
+ * @brief 整数型定義。
+ */
+
+/*
+ * ===============================================================
+ *  Natural Tiny Shell (NT-Shell)
+ * ===============================================================
+ * Copyright (c) 2010-2012 Shinichiro Nakamura
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ * ===============================================================
+ */
+
+#ifndef NTINT_H
+#define NTINT_H
+
+/**
+ * @note
+ * このファイルでは整数型定義を行なう。
+ * 整数型定義は、比較的新しいツールチェインで
+ * #include <stdint.h>を期待しても良いが、
+ * これが使用できない場合もあるだろう。
+ * 例えば小規模組み込みシステム向け開発環境として
+ * libcやその他に依存させたくないケースも考えられる。
+ * ここではNT-Shellが使用する型定義を宣言する事にする。
+ * 既存の型定義を使用する場合、単に#include <stdint.h>
+ * のように既存の定義ファイルへのインクルードを宣言すれば良い。
+ */
+
+#if 1
+#   include <stdint.h>
+#else
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+typedef char int8_t;
+typedef short int16_t;
+typedef int int32_t;
+typedef unsigned int size_t;
+#endif
+
+#endif
+
diff --git a/uzumeapp/kernel/uzume/ntshell/ntlibc.c b/uzumeapp/kernel/uzume/ntshell/ntlibc.c
new file mode 100644 (file)
index 0000000..8cd13c4
--- /dev/null
@@ -0,0 +1,239 @@
+/**
+ * @file ntlibc.c
+ * @author Shinichiro Nakamura
+ * @brief 小規模組み込みシステム向けのlibcライクライブラリの実装。
+ */
+
+/*
+ * ===============================================================
+ *  Natural Tiny Shell (NT-Shell)
+ * ===============================================================
+ * Copyright (c) 2010-2012 Shinichiro Nakamura
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ * ===============================================================
+ */
+
+#include "ntlibc.h"
+
+int ntlibc_strlen(const char *s)
+{
+    const char *p = s;
+    int cnt = 0;
+    while (*p) {
+        cnt++;
+        p++;
+    }
+    return cnt;
+}
+
+char *ntlibc_strcpy(char *des, const char *src)
+{
+    char *d = des;
+    const char *s = src;
+    while (*s) {
+        *d = *s;
+        d++;
+        s++;
+    }
+    *d = '\0';
+    return des;
+}
+
+char *ntlibc_strcat(char *des, const char *src)
+{
+    char *d = des;
+    const char *s = src;
+    while (*d) {
+        d++;
+    }
+    while (*s) {
+        *d = *s;
+        d++;
+        s++;
+    }
+    *d = '\0';
+    return des;
+}
+
+int ntlibc_strcmp(const char *s1, const char *s2)
+{
+    char *p1 = (char *)s1;
+    char *p2 = (char *)s2;
+    while (*p1 || *p2) {
+        if (*p1 != *p2) {
+            return (*p1 < *p2) ? -1 : 1;
+        }
+        p1++;
+        p2++;
+    }
+    if (*p1 == *p2) {
+        return 0;
+    } else {
+        return (*p1 < *p2) ? -1 : 1;
+    }
+}
+
+int ntlibc_strncmp(const char *s1, const char *s2, int n)
+{
+    char *p1 = (char *)s1;
+    char *p2 = (char *)s2;
+    int len = 0;
+    while (*p1 || *p2) {
+        if (n <= len) {
+            break;
+        }
+        if (*p1 != *p2) {
+            return (*p1 < *p2) ? -1 : 1;
+        }
+        p1++;
+        p2++;
+        len++;
+    }
+    return 0;
+}
+
+int ntlibc_isdigit(int c)
+{
+  if (('0' <= c) && (c <= '9')) {
+    return 1;
+  }
+  return 0;
+}
+
+int ntlibc_isalpha(int c)
+{
+  if (('A' <= c) && (c <= 'Z')) {
+    return 1;
+  }
+  if (('a' <= c) && (c <= 'z')) {
+    return 1;
+  }
+  return 0;
+}
+
+int ntlibc_iscntrl(int c)
+{
+  if (c == 0x07) { return 0; }
+  if (c == 0x08) { return 0; }
+  if (c == 0x09) { return 0; }
+  if (c == 0x0a) { return 0; }
+  if (c == 0x0b) { return 0; }
+  if (c == 0x0c) { return 0; }
+  if (c == 0x0d) { return 0; }
+  if ((0x00 <= c) && (c <= 0x1f)) {
+    return 1;
+  }
+  return 0;
+}
+
+int ntlibc_toupper(int c)
+{
+  if (('a' <= c) && (c <= 'z')) {
+    int diff = 'a' - 'A';
+    return c - diff;
+  }
+  return c;
+}
+
+int ntlibc_tolower(int c)
+{
+  if (('A' <= c) && (c <= 'Z')) {
+    int diff = 'a' - 'A';
+    return c + diff;
+  }
+  return c;
+}
+
+int ntlibc_atoi(const char *nptr)
+{
+  int cnt;
+  int num = 0;
+  int ofs = 0;
+  int sign = 0;
+  int scnt = 0;
+  char *p = (char *)nptr;
+  while (*p != '\0') {
+    if (!ntlibc_isdigit(*p)) {
+      if (*p == ' ') {
+        ofs++;
+      }
+      if (*p == '+') {
+        sign = 0;
+        ofs++;
+        if (scnt++ > 0) {
+          return 0;
+        }
+      }
+      if (*p == '-') {
+        sign = 1;
+        ofs++;
+        if (scnt++ > 0) {
+          return 0;
+        }
+      }
+    }
+    p++;
+  }
+  for (cnt = ofs; (nptr[cnt] >= '0') && (nptr[cnt] <= '9'); cnt++) {
+    num = 10 * num + (nptr[cnt] - '0');
+  }
+  if (sign) {
+    return -num;
+  } else {
+    return num;
+  }
+}
+
+char *ntlibc_strchr(const char *s, int c)
+{
+  char *p = (char *)s;
+  while (*p) {
+    if (*p == c) {
+      return p;
+    }
+    p++;
+  }
+  return 0;
+}
+
+char *ntlibc_utoa(unsigned int value, char *s, int radix)
+{
+  char *s1 = s;
+  char *s2 = s;
+
+  do {
+    *s2++ = "0123456789abcdefghijklmnopqrstuvwxyz"[value % radix];
+    value /= radix;
+  } while (value > 0);
+
+  *s2-- = '\0';
+
+  while (s1 < s2) {
+    char c = *s1;
+    *s1++ = *s2;
+    *s2-- = c;
+  }
+
+  return s;
+}
+
diff --git a/uzumeapp/kernel/uzume/ntshell/ntlibc.h b/uzumeapp/kernel/uzume/ntshell/ntlibc.h
new file mode 100644 (file)
index 0000000..72d0e0e
--- /dev/null
@@ -0,0 +1,62 @@
+/**
+ * @file ntlibc.h
+ * @author Shinichiro Nakamura
+ * @brief 小規模組み込みシステム向けのlibcライクライブラリの定義。
+ */
+
+/*
+ * ===============================================================
+ *  Natural Tiny Shell (NT-Shell)
+ * ===============================================================
+ * Copyright (c) 2010-2012 Shinichiro Nakamura
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ * ===============================================================
+ */
+
+#ifndef NTLIBC_H
+#define NTLIBC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int ntlibc_strlen(const char *s);
+char *ntlibc_strcpy(char *des, const char *src);
+char *ntlibc_strcat(char *des, const char *src);
+int ntlibc_strcmp(const char *s1, const char *s2);
+int ntlibc_strncmp(const char *s1, const char *s2, int n);
+int ntlibc_isdigit(int c);
+int ntlibc_isalpha(int c);
+int ntlibc_iscntrl(int c);
+int ntlibc_toupper(int c);
+int ntlibc_tolower(int c);
+int ntlibc_atoi(const char *nptr);
+char *ntlibc_strchr(const char *s, int c);
+char *ntlibc_utoa(unsigned int value, char *s, int radix);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/uzumeapp/kernel/uzume/ntshell/ntopt.c b/uzumeapp/kernel/uzume/ntshell/ntopt.c
new file mode 100644 (file)
index 0000000..8c16588
--- /dev/null
@@ -0,0 +1,159 @@
+/**
+ * @file ntopt.c
+ * @author Shinichiro Nakamura
+ * @brief NT-Shell用オプション解析モジュールの実装。
+ */
+
+/*
+ * ===============================================================
+ *  Natural Tiny Shell (NT-Shell)
+ * ===============================================================
+ * Copyright (c) 2010-2012 Shinichiro Nakamura
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ * ===============================================================
+ */
+
+#include "ntopt.h"
+
+/**
+ * @brief 与えられた文字がデリミタであるかどうかを判定する。
+ * @param c 文字。
+ * @retval true デリミタである。
+ * @retval false デリミタでない。
+ */
+#define IS_DELIM(c) \
+    (((c) == '\r') || ((c) == '\n') || ((c) == '\t') || ((c) == '\0') || ((c) == ' '))
+
+static int ntopt_get_count(const char *str);
+static char *ntopt_get_text(
+        const char *str, const int n, char *buf, int siz, int *len);
+
+/**
+ * @brief 与えられた文字列のセンテンス数を取得する。
+ * @param str 文字列。
+ * @return センテンス数。
+ */
+static int ntopt_get_count(const char *str)
+{
+    int cnt = 0;
+    int wc = 0;
+    char *p = (char *)str;
+    while (*p) {
+        if (!IS_DELIM(*p)) {
+            wc++;
+            if (wc == 1) {
+                cnt++;
+            }
+        } else {
+            wc = 0;
+        }
+        p++;
+    }
+    return cnt;
+}
+
+/**
+ * @brief 与えられた文字列のセンテンスを取得する。
+ * @param str 文字列。
+ * @param n センテンス。(0からntopt-get_count(str) - 1までの値。)
+ * @param buf 格納バッファ。
+ * @param siz 格納バッファのサイズ。
+ * @param len 格納した文字列のサイズ。
+ * @retval !NULL 取得成功。格納バッファへのポインタ。
+ * @retval NULL 取得失敗。
+ */
+static char *ntopt_get_text(
+        const char *str, const int n, char *buf, int siz, int *len)
+{
+    int cnt = 0;
+    int wc = 0;
+    char *p = (char *)str;
+    *len = 0;
+    while (*p) {
+        if (!IS_DELIM(*p)) {
+            wc++;
+            if ((wc == 1)) {
+                if (cnt == n) {
+                    char *des = buf;
+                    int cc = 0;
+                    while (!IS_DELIM(*p)) {
+                        cc++;
+                        if (siz <= cc) {
+                            break;
+                        }
+                        *des = *p;
+                        des++;
+                        p++;
+                    }
+                    *des = '\0';
+                    *len = cc;
+                    return buf;
+                }
+                cnt++;
+            }
+        } else {
+            wc = 0;
+        }
+        p++;
+    }
+    return '\0';
+}
+
+/**
+ * @brief 与えられた文字列をデリミタで分割する。
+ * @param str 文字列。
+ * @param func コールバック関数。
+ * @param extobj 拡張オブジェクト。
+ * @return コールバック関数が返した値。
+ */
+int ntopt_parse(const char *str, NTOPT_CALLBACK func, void *extobj)
+{
+    int argc;
+    char argv[NTOPT_TEXT_MAXLEN];
+    char *argvp[NTOPT_TEXT_MAXARGS];
+    int i;
+    int total;
+    char *p;
+
+    argc = ntopt_get_count(str);
+    if (NTOPT_TEXT_MAXARGS <= argc) {
+        argc = NTOPT_TEXT_MAXARGS;
+    }
+
+    total = 0;
+    p = &argv[0];
+    for (i = 0; i < argc; i++) {
+        int len;
+        argvp[i] = ntopt_get_text(
+                str, i, p, NTOPT_TEXT_MAXLEN - total, &len);
+        if (total + len + 1 < NTOPT_TEXT_MAXLEN) {
+            p += len + 1;
+            total += len + 1;
+        } else {
+            break;
+        }
+    }
+
+    return func(argc, &argvp[0], extobj);
+}
+
diff --git a/uzumeapp/kernel/uzume/ntshell/ntopt.h b/uzumeapp/kernel/uzume/ntshell/ntopt.h
new file mode 100644 (file)
index 0000000..4b760bd
--- /dev/null
@@ -0,0 +1,82 @@
+/**
+ * @file ntopt.h
+ * @author Shinichiro Nakamura
+ * @brief NT-Shell用オプション解析モジュールの定義。
+ */
+
+/*
+ * ===============================================================
+ *  Natural Tiny Shell (NT-Shell)
+ * ===============================================================
+ * Copyright (c) 2010-2012 Shinichiro Nakamura
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ * ===============================================================
+ */
+
+#ifndef NTOPT_H
+#define NTOPT_H
+
+#include "ntconf.h"
+
+/**
+ * @brief パース可能な最大文字列長。
+ */
+#define NTOPT_TEXT_MAXLEN   (NTCONF_EDITOR_MAXLEN)
+
+/**
+ * @brief パース可能な最大パラメータ数。
+ */
+#define NTOPT_TEXT_MAXARGS  (NTCONF_EDITOR_MAXLEN / 2)
+
+/**
+ * @brief コールバック関数。
+ *
+ * @param argc パラメータの数。
+ * @param argv パラメータ。
+ * @param extobj 外部オブジェクト。
+ *
+ * @return 返値。
+ */
+typedef int (*NTOPT_CALLBACK)(int argc, char **argv, void *extobj);
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief 与えられた文字列をデリミタで分割する。
+ *
+ * @param str 文字列。
+ * @param func コールバック関数。
+ * @param extobj 拡張オブジェクト。
+ *
+ * @return コールバック関数が返した値。
+ */
+int ntopt_parse(const char *str, NTOPT_CALLBACK func, void *extobj);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/uzumeapp/kernel/uzume/ntshell/ntshell.c b/uzumeapp/kernel/uzume/ntshell/ntshell.c
new file mode 100644 (file)
index 0000000..d7ac3fe
--- /dev/null
@@ -0,0 +1,688 @@
+/**
+ * @file ntshell.c
+ * @author Shinichiro Nakamura
+ * @brief 小規模組み込みシステム向けのシェルシステムの実装。
+ */
+
+/*
+ * ===============================================================
+ *  Natural Tiny Shell (NT-Shell)
+ * ===============================================================
+ * Copyright (c) 2010-2012 Shinichiro Nakamura
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ * ===============================================================
+ */
+
+#include "ntshell.h"
+#include "ntlibc.h"
+
+#define VERSION_MAJOR   0   /**< メジャー番号。 */
+#define VERSION_MINOR   2   /**< マイナー番号。 */
+#define VERSION_RELEASE 0   /**< リリース番号。 */
+
+#define INITCODE    (0x4367)    /**< 初期化確認コード。 */
+
+/**
+ * @brief 未使用変数宣言。
+ *
+ * @param N 未使用変数。
+ */
+#define UNUSED_VARIABLE(N)      do { (void)(N); } while (0)
+
+/**
+ * @brief サジェストのインデックス番号。
+ *
+ * @param HANDLE ハンドル。
+ */
+#define SUGGEST_INDEX(HANDLE)   ((HANDLE)->suggest_index)
+
+/**
+ * @brief サジェストのソース文字列。
+ *
+ * @param HANDLE ハンドル。
+ */
+#define SUGGEST_SOURCE(HANDLE)  ((HANDLE)->suggest_source)
+
+/**
+ * @brief テキストエディタを取得する。
+ *
+ * @param HANDLE ハンドル。
+ */
+#define GET_EDITOR(HANDLE)      (&((HANDLE)->editor))
+
+/**
+ * @brief テキストヒストリを取得する。
+ *
+ * @param HANDLE ハンドル。
+ */
+#define GET_HISTORY(HANDLE)     (&((HANDLE)->history))
+
+/**
+ * @brief シリアルポートから読み込む。
+ *
+ * @param HANDLE ハンドル。
+ * @param BUF 読み込みバッファ。
+ * @param CNT 読み込み文字数。
+ *
+ * @return 実際に読み込んだ文字数。
+ */
+#define SERIAL_READ(HANDLE, BUF, CNT)   ((HANDLE)->func_read(BUF, CNT, (HANDLE)->extobj))
+
+/**
+ * @brief シリアルポートへ書き込む。
+ *
+ * @param HANDLE ハンドル。
+ * @param BUF 書き込みバッファ。
+ * @param CNT 書き込み文字数。
+ *
+ * @return 実際に書き込んだ文字数。
+ */
+#define SERIAL_WRITE(HANDLE, BUF, CNT)  ((HANDLE)->func_write(BUF, CNT, (HANDLE)->extobj))
+
+/**
+ * @brief シリアルポートへプロンプトを書き込む。
+ *
+ * @param HANDLE ハンドル。
+ */
+#define PROMPT_WRITE(HANDLE)            SERIAL_WRITE((HANDLE), (HANDLE)->prompt, ntlibc_strlen((HANDLE)->prompt))
+
+/**
+ * @brief シリアルポートへ改行を書き込む。
+ *
+ * @param HANDLE ハンドル。
+ */
+#define PROMPT_NEWLINE(HANDLE)          SERIAL_WRITE((HANDLE), NTSHELL_PROMPT_NEWLINE, ntlibc_strlen(NTSHELL_PROMPT_NEWLINE))
+
+/**
+ * @brief コールバックを呼び出す。
+ *
+ * @param HANDLE ハンドル。
+ * @param TEXT コールバック関数へ渡す文字列。
+ */
+#define CALLBACK(HANDLE, TEXT)          ((HANDLE)->func_callback((TEXT), (HANDLE)->extobj))
+
+#define VTSEND_ERASE_LINE(HANDLE)       (vtsend_erase_line(&((HANDLE)->vtsend)))
+#define VTSEND_CURSOR_HEAD(HANDLE)      (vtsend_cursor_backward(&((HANDLE)->vtsend), 80))
+#define VTSEND_CURSOR_PREV(HANDLE)      (vtsend_cursor_backward(&((HANDLE)->vtsend), 1))
+#define VTSEND_CURSOR_NEXT(HANDLE)      (vtsend_cursor_forward(&((HANDLE)->vtsend), 1))
+
+/**
+ * @brief テキストヒストリで1つ後ろを辿る。
+ * @details
+ * 論理上のテキスト編集装置内でのテキスト編集と編集結果をビューの更新を行なう。
+ * text_editorは論理上のテキスト編集装置であり、ビューに関して一切感知しない。
+ *
+ * @param ntshell ハンドラ。
+ * @param action アクション。
+ * @param ch 入力文字。
+ */
+static void actfunc_history_prev(ntshell_t *ntshell, vtrecv_action_t action, unsigned char ch)
+{
+    UNUSED_VARIABLE(action);
+    UNUSED_VARIABLE(ch);
+    if (text_history_read_point_prev(GET_HISTORY(ntshell))) {
+        char txt[TEXTHISTORY_MAXLEN];
+        int n = text_history_read(GET_HISTORY(ntshell), &txt[0], sizeof(txt));
+        if (0 < n) {
+            VTSEND_ERASE_LINE(ntshell);
+            VTSEND_CURSOR_HEAD(ntshell);
+            PROMPT_WRITE(ntshell);
+            SERIAL_WRITE(ntshell, txt, n);
+            text_editor_set_text(GET_EDITOR(ntshell), txt);
+        }
+    }
+}
+
+/**
+ * @brief テキストヒストリで1つ前を辿る。
+ * @details
+ * 論理上のテキスト編集装置内でのテキスト編集と編集結果をビューの更新を行なう。
+ * text_editorは論理上のテキスト編集装置であり、ビューに関して一切感知しない。
+ *
+ * @param ntshell ハンドラ。
+ * @param action アクション。
+ * @param ch 入力文字。
+ */
+static void actfunc_history_next(ntshell_t *ntshell, vtrecv_action_t action, unsigned char ch)
+{
+    UNUSED_VARIABLE(action);
+    UNUSED_VARIABLE(ch);
+    if (text_history_read_point_next(GET_HISTORY(ntshell))) {
+        char txt[TEXTHISTORY_MAXLEN];
+        int n = text_history_read(GET_HISTORY(ntshell), &txt[0], sizeof(txt));
+        if (0 < n) {
+            VTSEND_ERASE_LINE(ntshell);
+            VTSEND_CURSOR_HEAD(ntshell);
+            PROMPT_WRITE(ntshell);
+            SERIAL_WRITE(ntshell, txt, n);
+            text_editor_set_text(GET_EDITOR(ntshell), txt);
+        }
+    }
+}
+
+/**
+ * @brief カーソルを左へ移動させる。
+ * @details
+ * 論理上のテキスト編集装置内でのテキスト編集と編集結果をビューの更新を行なう。
+ * text_editorは論理上のテキスト編集装置であり、ビューに関して一切感知しない。
+ *
+ * @param ntshell ハンドラ。
+ * @param action アクション。
+ * @param ch 入力文字。
+ */
+static void actfunc_cursor_left(ntshell_t *ntshell, vtrecv_action_t action, unsigned char ch)
+{
+    UNUSED_VARIABLE(action);
+    UNUSED_VARIABLE(ch);
+    if (text_editor_cursor_left(GET_EDITOR(ntshell))) {
+        VTSEND_CURSOR_PREV(ntshell);
+    }
+}
+
+/**
+ * @brief カーソルを右へ移動させる。
+ * @details
+ * 論理上のテキスト編集装置内でのテキスト編集と編集結果をビューの更新を行なう。
+ * text_editorは論理上のテキスト編集装置であり、ビューに関して一切感知しない。
+ *
+ * @param ntshell ハンドラ。
+ * @param action アクション。
+ * @param ch 入力文字。
+ */
+static void actfunc_cursor_right(ntshell_t *ntshell, vtrecv_action_t action, unsigned char ch)
+{
+    UNUSED_VARIABLE(action);
+    UNUSED_VARIABLE(ch);
+    if (text_editor_cursor_right(GET_EDITOR(ntshell))) {
+        VTSEND_CURSOR_NEXT(ntshell);
+    }
+}
+
+/**
+ * @brief エンターキーの処理を実行する。
+ * @details
+ * 論理上のテキスト編集装置内でのテキスト編集と編集結果をビューの更新を行なう。
+ * text_editorは論理上のテキスト編集装置であり、ビューに関して一切感知しない。
+ *
+ * @param ntshell ハンドラ。
+ * @param action アクション。
+ * @param ch 入力文字。
+ */
+static void actfunc_enter(ntshell_t *ntshell, vtrecv_action_t action, unsigned char ch)
+{
+    UNUSED_VARIABLE(action);
+    UNUSED_VARIABLE(ch);
+    char txt[TEXTEDITOR_MAXLEN];
+    text_editor_get_text(GET_EDITOR(ntshell), &txt[0], sizeof(txt));
+    text_editor_clear(GET_EDITOR(ntshell));
+    text_history_write(GET_HISTORY(ntshell), txt);
+    PROMPT_NEWLINE(ntshell);
+    CALLBACK(ntshell, txt);
+    PROMPT_WRITE(ntshell);
+}
+
+/**
+ * @brief キャンセルキーの処理を実行する。
+ * @details
+ * 論理上のテキスト編集装置内でのテキスト編集と編集結果をビューの更新を行なう。
+ * text_editorは論理上のテキスト編集装置であり、ビューに関して一切感知しない。
+ *
+ * 一般的なOSのCTRL+C処理はシグナルを発行し、受信したプロセスが
+ * 中断処理を実行する。
+ * ここでのキャンセルは見た目を再現したもので、
+ * 入力中の文字列を破棄してカーソルを新しい入力に備えて復帰させるものだ。
+ *
+ * @param ntshell ハンドラ。
+ * @param action アクション。
+ * @param ch 入力文字。
+ */
+static void actfunc_cancel(ntshell_t *ntshell, vtrecv_action_t action, unsigned char ch)
+{
+    UNUSED_VARIABLE(action);
+    UNUSED_VARIABLE(ch);
+    text_editor_clear(GET_EDITOR(ntshell));
+    SERIAL_WRITE(ntshell, "^C", 2);
+    PROMPT_NEWLINE(ntshell);
+    PROMPT_WRITE(ntshell);
+}
+
+/**
+ * @brief 挿入処理を実行する。
+ * @details
+ * 論理上のテキスト編集装置内でのテキスト編集と編集結果をビューの更新を行なう。
+ * text_editorは論理上のテキスト編集装置であり、ビューに関して一切感知しない。
+ *
+ * @param ntshell ハンドラ。
+ * @param action アクション。
+ * @param ch 入力文字。
+ */
+static void actfunc_insert(ntshell_t *ntshell, vtrecv_action_t action, unsigned char ch)
+{
+    UNUSED_VARIABLE(action);
+    /*
+     * 入力があった場合、入力補完状態から抜ける。
+     */
+    SUGGEST_INDEX(ntshell) = -1;
+
+    /*
+     * テキストエディタを使って文字を文字列に挿入する。
+     */
+    if (text_editor_insert(GET_EDITOR(ntshell), ch)) {
+        char txt[TEXTEDITOR_MAXLEN];
+        int len = text_editor_get_text(GET_EDITOR(ntshell), &txt[0], sizeof(txt));
+        int pos = text_editor_cursor_get_position(GET_EDITOR(ntshell));
+        int n = len - pos;
+        SERIAL_WRITE(ntshell, (char *)&ch, sizeof(ch));
+        if (n > 0) {
+            int i;
+            SERIAL_WRITE(ntshell, txt + pos, len - pos);
+            for (i = 0; i < n; i++) {
+                VTSEND_CURSOR_PREV(ntshell);
+            }
+        }
+    }
+}
+
+/**
+ * @brief バックスペース処理を実行する。
+ * @details
+ * 論理上のテキスト編集装置内でのテキスト編集と編集結果をビューの更新を行なう。
+ * text_editorは論理上のテキスト編集装置であり、ビューに関して一切感知しない。
+ *
+ * @param ntshell ハンドラ。
+ * @param action アクション。
+ * @param ch 入力文字。
+ */
+static void actfunc_backspace(ntshell_t *ntshell, vtrecv_action_t action, unsigned char ch)
+{
+    UNUSED_VARIABLE(action);
+    UNUSED_VARIABLE(ch);
+    if (text_editor_backspace(GET_EDITOR(ntshell))) {
+        char txt[TEXTEDITOR_MAXLEN];
+        int len = text_editor_get_text(GET_EDITOR(ntshell), &txt[0], sizeof(txt));
+        int pos = text_editor_cursor_get_position(GET_EDITOR(ntshell));
+        int n = len - pos;
+        VTSEND_CURSOR_PREV(ntshell);
+        if (n > 0) {
+            int i;
+            SERIAL_WRITE(ntshell, txt + pos, n);
+            SERIAL_WRITE(ntshell, " ", 1);
+            for (i = 0; i < n + 1; i++) {
+                VTSEND_CURSOR_PREV(ntshell);
+            }
+        } else {
+            SERIAL_WRITE(ntshell, " ", 1);
+            VTSEND_CURSOR_PREV(ntshell);
+        }
+    }
+}
+
+/**
+ * @brief デリート処理を実行する。
+ * @details
+ * 論理上のテキスト編集装置内でのテキスト編集と編集結果をビューの更新を行なう。
+ * text_editorは論理上のテキスト編集装置であり、ビューに関して一切感知しない。
+ *
+ * @param ntshell ハンドラ。
+ * @param action アクション。
+ * @param ch 入力文字。
+ */
+static void actfunc_delete(ntshell_t *ntshell, vtrecv_action_t action, unsigned char ch)
+{
+    UNUSED_VARIABLE(action);
+    UNUSED_VARIABLE(ch);
+    if (text_editor_delete(GET_EDITOR(ntshell))) {
+        char txt[TEXTEDITOR_MAXLEN];
+        int len = text_editor_get_text(GET_EDITOR(ntshell), &txt[0], sizeof(txt));
+        int pos = text_editor_cursor_get_position(GET_EDITOR(ntshell));
+        int n = len - pos;
+        if (n > 0) {
+            int i;
+            SERIAL_WRITE(ntshell, txt + pos, n);
+            SERIAL_WRITE(ntshell, " ", 1);
+            for (i = 0; i < n + 1; i++) {
+                VTSEND_CURSOR_PREV(ntshell);
+            }
+        } else {
+            SERIAL_WRITE(ntshell, " ", 1);
+            VTSEND_CURSOR_PREV(ntshell);
+        }
+    }
+}
+
+/**
+ * @brief 入力補完処理を実行する。
+ * @details
+ * 論理上のテキスト編集装置内でのテキスト編集と編集結果をビューの更新を行なう。
+ * text_editorは論理上のテキスト編集装置であり、ビューに関して一切感知しない。
+ *
+ * @param ntshell ハンドラ。
+ * @param action アクション。
+ * @param ch 入力文字。
+ */
+static void actfunc_suggest(ntshell_t *ntshell, vtrecv_action_t action, unsigned char ch)
+{
+    UNUSED_VARIABLE(action);
+    UNUSED_VARIABLE(ch);
+    char buf[TEXTEDITOR_MAXLEN];
+    if (SUGGEST_INDEX(ntshell) < 0) {
+        /*
+         * 入力補完モードにこれから入る場合。
+         * 現在の入力文字列を元に補完候補を取得する。
+         */
+        if (text_editor_get_text(
+                    GET_EDITOR(ntshell),
+                    SUGGEST_SOURCE(ntshell),
+                    sizeof(SUGGEST_SOURCE(ntshell))) > 0) {
+            SUGGEST_INDEX(ntshell) = 0;
+            if (text_history_find(
+                        GET_HISTORY(ntshell),
+                        SUGGEST_INDEX(ntshell),
+                        SUGGEST_SOURCE(ntshell),
+                        buf,
+                        sizeof(buf)) == 0) {
+                // 候補が見つかればテキストを設定して、インデックスをメモする。
+                int n = ntlibc_strlen((const char *)buf);
+                VTSEND_ERASE_LINE(ntshell);
+                VTSEND_CURSOR_HEAD(ntshell);
+                PROMPT_WRITE(ntshell);
+                SERIAL_WRITE(ntshell, buf, n);
+                text_editor_set_text(GET_EDITOR(ntshell), buf);
+            } else {
+                // 候補がなければ入力補完モードから抜ける。
+                SUGGEST_INDEX(ntshell) = -1;
+            }
+        }
+    } else {
+        /*
+         * 既に入力補完モードに入っている場合、
+         * 次の候補を探して見つかればテキストとして設定する。
+         */
+        SUGGEST_INDEX(ntshell) = SUGGEST_INDEX(ntshell) + 1;
+        if (text_history_find(
+                    GET_HISTORY(ntshell),
+                    SUGGEST_INDEX(ntshell),
+                    SUGGEST_SOURCE(ntshell),
+                    buf,
+                    sizeof(buf)) == 0) {
+            // 候補が見つかればテキストを設定する。
+            int n = ntlibc_strlen((const char *)buf);
+            VTSEND_ERASE_LINE(ntshell);
+            VTSEND_CURSOR_HEAD(ntshell);
+            PROMPT_WRITE(ntshell);
+            SERIAL_WRITE(ntshell, buf, n);
+            text_editor_set_text(GET_EDITOR(ntshell), buf);
+        } else {
+            // 候補が見つからなければ元の入力文字列に戻し、入力補完モードから抜ける。
+            int n = ntlibc_strlen(SUGGEST_SOURCE(ntshell));
+            VTSEND_ERASE_LINE(ntshell);
+            VTSEND_CURSOR_HEAD(ntshell);
+            PROMPT_WRITE(ntshell);
+            SERIAL_WRITE(ntshell, SUGGEST_SOURCE(ntshell), n);
+            text_editor_set_text(GET_EDITOR(ntshell), SUGGEST_SOURCE(ntshell));
+            SUGGEST_INDEX(ntshell) = -1;
+        }
+    }
+}
+
+/**
+ * @brief カーソルを行頭へ移動させる。
+ * @details
+ * 論理上のテキスト編集装置内でのテキスト編集と編集結果をビューの更新を行なう。
+ * text_editorは論理上のテキスト編集装置であり、ビューに関して一切感知しない。
+ *
+ * @param ntshell ハンドラ。
+ * @param action アクション。
+ * @param ch 入力文字。
+ */
+static void actfunc_cursor_head(ntshell_t *ntshell, vtrecv_action_t action, unsigned char ch)
+{
+    UNUSED_VARIABLE(action);
+    UNUSED_VARIABLE(ch);
+    VTSEND_CURSOR_HEAD(ntshell);
+    PROMPT_WRITE(ntshell);
+    text_editor_cursor_head(GET_EDITOR(ntshell));
+}
+
+/**
+ * @brief カーソルを行末へ移動させる。
+ * @details
+ * 論理上のテキスト編集装置内でのテキスト編集と編集結果をビューの更新を行なう。
+ * text_editorは論理上のテキスト編集装置であり、ビューに関して一切感知しない。
+ *
+ * @param ntshell ハンドラ。
+ * @param action アクション。
+ * @param ch 入力文字。
+ */
+static void actfunc_cursor_tail(ntshell_t *ntshell, vtrecv_action_t action, unsigned char ch)
+{
+    char buf[TEXTEDITOR_MAXLEN];
+    int len;
+    UNUSED_VARIABLE(action);
+    UNUSED_VARIABLE(ch);
+    text_editor_get_text(GET_EDITOR(ntshell), buf, sizeof(buf));
+    len = ntlibc_strlen((const char *)buf);
+    VTSEND_CURSOR_HEAD(ntshell);
+    PROMPT_WRITE(ntshell);
+    SERIAL_WRITE(ntshell, buf, len);
+    text_editor_cursor_tail(GET_EDITOR(ntshell));
+}
+
+/**
+ * @brief アクションテーブルのデータ構造体。
+ * @details
+ * アクションは状態と入力文字によって与えられる。
+ * アクションに対する関数もここで定義する。
+ */
+typedef struct {
+    vtrecv_action_t action;
+    unsigned char ch;
+    void (*func)(ntshell_t *ntshell, vtrecv_action_t action, unsigned char ch);
+} ntshell_action_table_t;
+
+/**
+ * @brief アクションに対する処理関数テーブル。
+ * @details
+ * やってくるコードは仮想端末側の処理に依存する。
+ * よって様々なプラットフォームの様々な仮想端末で試すと良い。
+ *
+ * <table>
+ *   <th>
+ *     <td>Platform</td>
+ *     <td>Tools</td>
+ *   </th>
+ *   <tr>
+ *     <td>Windows</td>
+ *     <td>Hyper Terminal, Poderossa, TeraTerm</td>
+ *   </tr>
+ *   <tr>
+ *     <td>Linux</td>
+ *     <td>minicom, screen, kermit</td>
+ *   </tr>
+ * </table>
+ */
+static const ntshell_action_table_t action_table[] = {
+    {VTRECV_ACTION_EXECUTE, 0x01, actfunc_cursor_head},
+    {VTRECV_ACTION_EXECUTE, 0x02, actfunc_cursor_left},
+    {VTRECV_ACTION_EXECUTE, 0x03, actfunc_cancel},
+    {VTRECV_ACTION_EXECUTE, 0x04, actfunc_delete},
+    {VTRECV_ACTION_EXECUTE, 0x05, actfunc_cursor_tail},
+    {VTRECV_ACTION_EXECUTE, 0x06, actfunc_cursor_right},
+    {VTRECV_ACTION_EXECUTE, 0x08, actfunc_backspace},
+    {VTRECV_ACTION_EXECUTE, 0x09, actfunc_suggest},
+    {VTRECV_ACTION_EXECUTE, 0x0d, actfunc_enter},
+    {VTRECV_ACTION_EXECUTE, 0x0e, actfunc_history_next},
+    {VTRECV_ACTION_EXECUTE, 0x10, actfunc_history_prev},
+    {VTRECV_ACTION_CSI_DISPATCH, 0x41, actfunc_history_prev},
+    {VTRECV_ACTION_CSI_DISPATCH, 0x42, actfunc_history_next},
+    {VTRECV_ACTION_CSI_DISPATCH, 0x43, actfunc_cursor_right},
+    {VTRECV_ACTION_CSI_DISPATCH, 0x44, actfunc_cursor_left},
+    {VTRECV_ACTION_CSI_DISPATCH, 0x7e, actfunc_delete},
+    {VTRECV_ACTION_PRINT, 0x7f, actfunc_backspace},
+};
+
+/**
+ * @brief パーサーに対するコールバック関数。
+ * @details vtrecvモジュールのコールバック関数に従った実装である。
+ *
+ * @param vtrecv パーサー。
+ * @param action アクション。
+ * @param ch キャラクタ。
+ */
+void vtrecv_callback(vtrecv_t *vtrecv, vtrecv_action_t action, unsigned char ch)
+{
+    ntshell_action_table_t *p;
+    int i;
+    const int ACTTBLSIZ = sizeof(action_table) / sizeof(action_table[0]);
+
+    /*
+     * 制御コードに対する処理はテーブルから探す。
+     */
+    p = (ntshell_action_table_t *)action_table;
+    for (i = 0; i < ACTTBLSIZ; i++) {
+        if ((p->action == action) && (p->ch == ch)) {
+            p->func(vtrecv->user_data, action, ch);
+            return;
+        }
+        p++;
+    }
+
+    /*
+     * 通常の文字列は入力として扱う。
+     */
+    if (VTRECV_ACTION_PRINT == action) {
+        actfunc_insert(vtrecv->user_data, action, ch);
+        return;
+    }
+
+    /*
+     * ここに到達する場合、
+     * テーブルに含まれない制御コードか、
+     * 通常の文字でない事が考えられる。
+     *
+     * 必要なキー入力に対する動作を加えたい場合、
+     * vtrecvによって得られるコードを調べるために
+     * ここにテストコードを加える事ができる。
+     */
+}
+
+/**
+ * @brief Natural Tiny Shellを初期化する。
+ *
+ * @param p NT-Shellハンドラ。
+ * @param func_read シリアルリード関数。
+ * @param func_write シリアルライト関数。
+ * @param func_callback コールバック関数。
+ * @param extobj コールバック関数呼び出し時に渡す拡張オブジェクト。
+ */
+void ntshell_init(ntshell_t *p,
+    NTSHELL_SERIAL_READ func_read,
+    NTSHELL_SERIAL_WRITE func_write,
+    NTSHELL_USER_CALLBACK func_callback,
+    void *extobj)
+{
+    /*
+     * vtrecvはユーザデータへのポインタを設定できるようになっている。
+     * Natural Tiny Shellはこれを利用してテキストエディタやヒストリ、
+     * リード関数やライト関数、コールバック関数を処理の中で使用できる
+     * ようにしてある。
+     */
+    p->func_read = func_read;
+    p->func_write = func_write;
+    p->func_callback = func_callback;
+    p->extobj = extobj;
+    ntlibc_strcpy(p->prompt, NTSHELL_PROMPT_DEFAULT);
+
+    p->vtrecv.user_data = p;
+
+    /*
+     * 各モジュールを初期化する。
+     */
+    vtsend_init(&(p->vtsend), func_write, 0);
+    vtrecv_init(&(p->vtrecv), vtrecv_callback);
+    text_editor_init(GET_EDITOR(p));
+    text_history_init(GET_HISTORY(p));
+    SUGGEST_INDEX(p) = -1;
+
+    /*
+     * 初期化確認コードを設定する。
+     */
+    p->initcode = INITCODE;
+}
+
+/**
+ * @brief Natural Tiny Shellを実行する。
+ * @details この関数は実行を返さない。
+ *
+ * @param p NT-Shellハンドラ。
+ */
+void ntshell_execute(ntshell_t *p)
+{
+    /*
+     * 初期化確認コードを検証する。
+     */
+    if (p->initcode != INITCODE) {
+      return;
+    }
+
+    /*
+     * ユーザ入力ループ。
+     */
+    PROMPT_WRITE(p);
+    while (1) {
+        unsigned char ch;
+        SERIAL_READ(p, (char *)&ch, sizeof(ch));
+        vtrecv_execute(&(p->vtrecv), &ch, sizeof(ch));
+    }
+}
+
+/**
+ * @brief Natural Tiny Shellのプロンプトを設定する。
+ */
+void ntshell_set_prompt(ntshell_t *p, const char *prompt)
+{
+    /*
+     * 初期化確認コードを検証する。
+     */
+    if (p->initcode != INITCODE) {
+      return;
+    }
+
+    ntlibc_strcpy(p->prompt, prompt);
+}
+
+/**
+ * @brief Natural Tiny Shellのバージョンを返す。
+ * @details 返すバージョンはリリースバージョンである。
+ *
+ * @param major メージャーバージョン。
+ * @param minor マイナーバージョン。
+ * @param release リリースバージョン。
+ */
+void ntshell_version(int *major, int *minor, int *release)
+{
+    *major = VERSION_MAJOR;
+    *minor = VERSION_MINOR;
+    *release = VERSION_RELEASE;
+}
+
diff --git a/uzumeapp/kernel/uzume/ntshell/ntshell.h b/uzumeapp/kernel/uzume/ntshell/ntshell.h
new file mode 100644 (file)
index 0000000..0d50203
--- /dev/null
@@ -0,0 +1,92 @@
+/**
+ * @file ntshell.h
+ * @author Shinichiro Nakamura
+ * @brief 小規模組み込みシステム向けのシェルシステムの定義。
+ */
+
+/*
+ * ===============================================================
+ *  Natural Tiny Shell (NT-Shell)
+ * ===============================================================
+ * Copyright (c) 2010-2012 Shinichiro Nakamura
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ * ===============================================================
+ */
+
+#ifndef NTSHELL_H
+#define NTSHELL_H
+
+#include "vtrecv.h"
+#include "vtsend.h"
+#include "text_editor.h"
+#include "text_history.h"
+
+#define NTSHELL_PROMPT_MAXLEN   (32)
+#define NTSHELL_PROMPT_DEFAULT  ">"
+#define NTSHELL_PROMPT_NEWLINE  "\r\n"
+
+typedef int (*NTSHELL_SERIAL_READ)(char *buf, int cnt, void *extobj);
+typedef int (*NTSHELL_SERIAL_WRITE)(const char *buf, int cnt, void *extobj);
+typedef int (*NTSHELL_USER_CALLBACK)(const char *text, void *extobj);
+
+/**
+ * @brief NT-Shelハンドラの実装。
+ * @details
+ * 本来このハンドラは定義のみを公開し、実装の詳細を隠蔽すべきだが、
+ * ヒープからメモリを確保するインターフェースのない環境も有り得る事を考慮して公開してある。
+ * このため、スタックに置いた構造体を使って制御する事も可能である。
+ */
+typedef struct {
+    unsigned int initcode;  /**< 初期化確認コード。 */
+    vtsend_t vtsend;        /**< vtsendハンドラ。 */
+    vtrecv_t vtrecv;        /**< vtrecvハンドラ。 */
+    text_editor_t editor;   /**< text_editorハンドラ。 */
+    text_history_t history; /**< text_historyハンドラ。 */
+    int suggest_index;
+    char suggest_source[TEXTEDITOR_MAXLEN];
+    NTSHELL_SERIAL_READ func_read;
+    NTSHELL_SERIAL_WRITE func_write;
+    NTSHELL_USER_CALLBACK func_callback;
+    void *extobj;
+    char prompt[NTSHELL_PROMPT_MAXLEN];
+} ntshell_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void ntshell_init(ntshell_t *p,
+    NTSHELL_SERIAL_READ func_read,
+    NTSHELL_SERIAL_WRITE func_write,
+    NTSHELL_USER_CALLBACK func_callback,
+    void *extobj);
+void ntshell_execute(ntshell_t *p);
+void ntshell_set_prompt(ntshell_t *p, const char *prompt);
+void ntshell_version(int *major, int *minor, int *release);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/uzumeapp/kernel/uzume/ntshell/ntshell_task.c b/uzumeapp/kernel/uzume/ntshell/ntshell_task.c
new file mode 100644 (file)
index 0000000..352034c
--- /dev/null
@@ -0,0 +1,103 @@
+/**
+ * @file ntshell_task.c
+ * @author Shinichiro Nakamura
+ * @brief NT-Shell\e$B%?%9%/!#\e(B
+ * @details
+ */
+
+/*
+ * ===============================================================
+ *  Natural Tiny Shell (NT-Shell)
+ * ===============================================================
+ * Copyright (c) 2010-2012 Shinichiro Nakamura
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ * ===============================================================
+ */
+
+#include <t_services.h>
+#include "ntshell.h"
+#include "ntshell_task.h"
+#include "ntlibc.h"
+#include "xprintf.h"
+
+#define SERIAL_PORT_ID  (1)
+
+static ntshell_t ntshell;
+
+static int func_read(char *buf, int cnt, void *extobj)
+{
+    int i;
+    for (i = 0; i < cnt; i++) {
+        char c;
+        syscall(serial_rea_dat(SERIAL_PORT_ID, &c, 1));
+        buf[i] = c;
+    }
+    return cnt;
+}
+
+static int func_write(const char *buf, int cnt, void *extobj)
+{
+    int i;
+    for (i = 0; i < cnt; i++) {
+        char c = buf[i];
+        syscall(serial_wri_dat(SERIAL_PORT_ID, &c, 1));
+
+    }
+    return cnt;
+}
+
+static void uxo(unsigned char c)
+{
+    syscall(serial_wri_dat(SERIAL_PORT_ID, &c, 1));
+}
+
+static unsigned char uxi(void)
+{
+    char c;
+    syscall(serial_rea_dat(SERIAL_PORT_ID, &c, 1));
+    return c;
+}
+
+void (*xfunc_out)(unsigned char) = uxo;
+unsigned char (*xfunc_in)(void) = uxi;
+
+static int func_callback(const char *text, void *extobj)
+{
+    if (ntlibc_strlen(text) > 0) {
+        xprintf("User command is '%s'\r\n", text);
+    }
+    return 0;
+}
+
+void ntshell_task(VP_INT exinf)
+{
+    syscall(
+            serial_ctl_por(SERIAL_PORT_ID,
+                (IOCTL_CRLF | IOCTL_FCSND | IOCTL_FCRCV))
+            );
+
+    ntshell_init(&ntshell, func_read, func_write, func_callback, (void *)&ntshell);
+    ntshell_set_prompt(&ntshell, "BlueTank>");
+    ntshell_execute(&ntshell);
+}
+
diff --git a/uzumeapp/kernel/uzume/ntshell/ntshell_task.cfg b/uzumeapp/kernel/uzume/ntshell/ntshell_task.cfg
new file mode 100644 (file)
index 0000000..a1aa0df
--- /dev/null
@@ -0,0 +1,15 @@
+
+#define _MACRO_ONLY
+
+INCLUDE("\"ntshell_task.h\"");
+
+CRE_TSK( NTSHELL_TASK,
+            {
+                TA_HLNG|TA_ACT,             /* 初期状態からアクティブ */
+                0,                          /* タスク引数 */
+                ntshell_task,               /* タスク本体 */
+                NTSHELL_TASK_PRIORITY,      /* タスク優先順位 */
+                NTSHELL_TASK_STACK_SIZE,    /* タスク・スタックサイズ */
+                NULL                        /* タスク・スタック。NULLならシステムが準備 */
+             });
+
diff --git a/uzumeapp/kernel/uzume/ntshell/ntshell_task.h b/uzumeapp/kernel/uzume/ntshell/ntshell_task.h
new file mode 100644 (file)
index 0000000..6880cde
--- /dev/null
@@ -0,0 +1,56 @@
+/**
+ * @file ntshell_task.h
+ * @author Shinichiro Nakamura
+ * @brief NT-Shellタスク。
+ * @details
+ */
+
+/*
+ * ===============================================================
+ *  Natural Tiny Shell (NT-Shell)
+ * ===============================================================
+ * Copyright (c) 2010-2012 Shinichiro Nakamura
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ * ===============================================================
+ */
+
+#ifndef NTSHELL_TASK_H
+#define NTSHELL_TASK_H
+
+#include <t_services.h>
+#include <s_services.h>
+
+#ifndef NTSHELL_TASK_PRIORITY
+#   define NTSHELL_TASK_PRIORITY    (7)
+#endif
+
+#ifndef NTSHELL_TASK_STACK_SIZE
+#   define NTSHELL_TASK_STACK_SIZE  (2048)
+#endif
+
+#ifndef _MACRO_ONLY
+void ntshell_task(VP_INT exinf);
+#endif
+
+#endif
+
diff --git a/uzumeapp/kernel/uzume/ntshell/text_editor.c b/uzumeapp/kernel/uzume/ntshell/text_editor.c
new file mode 100644 (file)
index 0000000..a990bfb
--- /dev/null
@@ -0,0 +1,256 @@
+/**
+ * @file text_editor.c
+ * @author Shinichiro Nakamura
+ * @brief NT-Shell用テキストエディタモジュールの実装。
+ * @details
+ * 文字列の編集を論理的に扱うためのモジュール。
+ * このモジュールはビューに関して一切感知しない。
+ */
+
+/*
+ * ===============================================================
+ *  Natural Tiny Shell (NT-Shell)
+ * ===============================================================
+ * Copyright (c) 2010-2012 Shinichiro Nakamura
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ * ===============================================================
+ */
+
+#include "text_editor.h"
+
+/**
+ * @brief テキストエディタを初期化する。
+ *
+ * @param p テキストエディタ構造体。
+ */
+void text_editor_init(text_editor_t *p)
+{
+    p->pos = 0;
+    p->len = 0;
+    p->buffer[p->len] = '\0';
+}
+
+/**
+ * @brief 文字を挿入する。
+ *
+ * @param p テキストエディタ構造体。
+ * @param c 文字。
+ */
+int text_editor_insert(text_editor_t *p, char c)
+{
+    if (p->len < (int)sizeof(p->buffer) - 1) {
+        int n = p->len - p->pos + 1;
+        int i;
+        char *src = p->buffer + p->len + 0;
+        char *des = p->buffer + p->len + 1;
+        for (i = 0; i < n; i++) {
+            *des = *src;
+            des--;
+            src--;
+        }
+
+        p->buffer[p->pos] = c;
+        p->pos++;
+        p->len++;
+        p->buffer[p->len] = '\0';
+        return 1;
+    }
+    return 0;
+}
+
+/**
+ * @brief 文字を削除する。
+ *
+ * @param p テキストエディタ構造体。
+ */
+int text_editor_backspace(text_editor_t *p)
+{
+    if (0 < p->pos) {
+        int n = p->len - p->pos;
+        int i;
+        char *src = p->buffer + p->pos - 0;
+        char *des = p->buffer + p->pos - 1;
+        p->pos--;
+        p->len--;
+        for (i = 0; i < n; i++) {
+            *des = *src;
+            des++;
+            src++;
+        }
+        *(p->buffer + p->len) = '\0';
+        return 1;
+    }
+    return 0;
+}
+
+/**
+ * @brief 文字を削除する。
+ *
+ * @param p テキストエディタ構造体。
+ */
+int text_editor_delete(text_editor_t *p)
+{
+    if (p->pos < p->len) {
+        int n = p->len - p->pos - 1;
+        int i;
+        char *src = p->buffer + p->pos + 1;
+        char *des = p->buffer + p->pos + 0;
+        p->len--;
+        for (i = 0; i < n; i++) {
+            *des = *src;
+            des++;
+            src++;
+        }
+        *(p->buffer + p->len) = '\0';
+        return 1;
+    }
+    return 0;
+}
+
+/**
+ * @brief カーソル位置を取得する。
+ *
+ * @param p テキストエディタ構造体。
+ */
+int text_editor_cursor_get_position(text_editor_t *p)
+{
+    return p->pos;
+}
+
+/**
+ * @brief カーソルを先頭に移動させる。
+ *
+ * @param p テキストエディタ構造体。
+ */
+int text_editor_cursor_head(text_editor_t *p)
+{
+    if (0 < p->pos) {
+        p->pos = 0;
+        return 1;
+    }
+    return 0;
+}
+
+/**
+ * @brief カーソルを最後尾に移動させる。
+ *
+ * @param p テキストエディタ構造体。
+ */
+int text_editor_cursor_tail(text_editor_t *p)
+{
+    if (p->pos < p->len) {
+        p->pos = p->len;
+        return 1;
+    }
+    return 0;
+}
+
+/**
+ * @brief カーソルを左へ移動させる。
+ *
+ * @param p テキストエディタ構造体。
+ */
+int text_editor_cursor_left(text_editor_t *p)
+{
+    if (0 < p->pos) {
+        p->pos--;
+        return 1;
+    }
+    return 0;
+}
+
+/**
+ * @brief カーソルを右へ移動させる。
+ *
+ * @param p テキストエディタ構造体。
+ */
+int text_editor_cursor_right(text_editor_t *p)
+{
+    if (p->pos < p->len) {
+        p->pos++;
+        return 1;
+    }
+    return 0;
+}
+
+/**
+ * @brief 文字列を設定する。
+ *
+ * @param p テキストエディタ構造体。
+ * @param buf 文字列が格納されたバッファ。
+ */
+int text_editor_set_text(text_editor_t *p, char *buf)
+{
+    char *src = buf;
+    char *des = p->buffer;
+    int n = 0;
+    while (*src) {
+        *des = *src;
+        des++;
+        src++;
+        n++;
+        if ((int)sizeof(p->buffer) <= n - 1) {
+            break;
+        }
+    }
+    *des = '\0';
+    p->len = n;
+    p->pos = p->len;
+    return n;
+}
+
+/**
+ * @brief 文字列を取得する。
+ *
+ * @param p テキストエディタ構造体。
+ * @param buf 文字列を格納するバッファ。
+ * @param siz バッファサイズ。
+ */
+int text_editor_get_text(text_editor_t *p, char *buf, int siz)
+{
+    char *src = p->buffer;
+    char *des = buf;
+    int n = 0;
+    while (*src) {
+        *des++ = *src++;
+        n++;
+        if (siz <= n) {
+            break;
+        }
+    }
+    *des = '\0';
+    return n;
+}
+
+/**
+ * @brief 文字列を消去する。
+ *
+ * @param p テキストエディタ構造体。
+ */
+void text_editor_clear(text_editor_t *p)
+{
+    p->pos = 0;
+    p->len = 0;
+    p->buffer[p->len] = '\0';
+}
+
diff --git a/uzumeapp/kernel/uzume/ntshell/text_editor.h b/uzumeapp/kernel/uzume/ntshell/text_editor.h
new file mode 100644 (file)
index 0000000..d610c47
--- /dev/null
@@ -0,0 +1,80 @@
+/**
+ * @file text_editor.h
+ * @author Shinichiro Nakamura
+ * @brief NT-Shell用テキストエディタモジュールの定義。
+ * @details
+ * 文字列の編集を論理的に扱うためのモジュール。
+ * このモジュールはビューに関して一切感知しない。
+ */
+
+/*
+ * ===============================================================
+ *  Natural Tiny Shell (NT-Shell)
+ * ===============================================================
+ * Copyright (c) 2010-2012 Shinichiro Nakamura
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ * ===============================================================
+ */
+
+#ifndef TEXT_EDITOR_H
+#define TEXT_EDITOR_H
+
+#include "ntconf.h"
+
+/**
+ * @brief 編集可能な文字列最大長。
+ */
+#define TEXTEDITOR_MAXLEN   (NTCONF_EDITOR_MAXLEN)
+
+/**
+ * @brief テキストエディタ構造体の実装。
+ */
+typedef struct {
+    char buffer[TEXTEDITOR_MAXLEN]; /**< バッファ。 */
+    int pos;                        /**< カーソル位置。 */
+    int len;                        /**< テキスト長さ。 */
+} text_editor_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void text_editor_init(text_editor_t *p);
+int text_editor_insert(text_editor_t *p, char c);
+int text_editor_backspace(text_editor_t *p);
+int text_editor_delete(text_editor_t *p);
+int text_editor_cursor_get_position(text_editor_t *p);
+int text_editor_cursor_head(text_editor_t *p);
+int text_editor_cursor_tail(text_editor_t *p);
+int text_editor_cursor_left(text_editor_t *p);
+int text_editor_cursor_right(text_editor_t *p);
+int text_editor_set_text(text_editor_t *p, char *buf);
+int text_editor_get_text(text_editor_t *p, char *buf, int siz);
+void text_editor_clear(text_editor_t *p);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/uzumeapp/kernel/uzume/ntshell/text_history.c b/uzumeapp/kernel/uzume/ntshell/text_history.c
new file mode 100644 (file)
index 0000000..9d8aeff
--- /dev/null
@@ -0,0 +1,180 @@
+/**
+ * @file text_history.c
+ * @author Shinichiro Nakamura
+ * @brief NT-Shell用テキストヒストリモジュールの実装。
+ * @details
+ * 文字列の入力履歴を論理的に扱うためのモジュール。
+ * このモジュールはビューに関して一切感知しない。
+ */
+
+/*
+ * ===============================================================
+ *  Natural Tiny Shell (NT-Shell)
+ * ===============================================================
+ * Copyright (c) 2010-2012 Shinichiro Nakamura
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ * ===============================================================
+ */
+
+#include "text_history.h"
+#include "ntlibc.h"
+
+/**
+ * @brief 初期化する。
+ *
+ * @param p テキストヒストリ構造体。
+ */
+void text_history_init(text_history_t *p)
+{
+    int i;
+    p->rp = 0;
+    p->wp = 0;
+    for (i = 0; i < (int)sizeof(p->history); i++) {
+        p->history[i] = 0;
+    }
+}
+
+/**
+ * @brief テキストヒストリに対して書き込みを実行する。
+ *
+ * @param p テキストヒストリ構造体。
+ * @param buf バッファ。
+ */
+int text_history_write(text_history_t *p, char *buf)
+{
+    char *sp = p->history + (TEXTHISTORY_MAXLEN * p->wp);
+    if (buf[0] == '\0') {
+        return 0;
+    }
+    while (*buf) {
+        *sp = *buf;
+        sp++;
+        buf++;
+    }
+    *sp = '\0';
+    p->wp = (p->wp + 1) % TEXTHISTORY_DEPTH;
+    p->rp = p->wp;
+    return 1;
+}
+
+/**
+ * @brief テキストヒストリから読み出しを実行する。
+ * @details
+ * 得られる文字列が与えられたバッファサイズよりも大きい場合、
+ * バッファに格納される文字列は途中で途切れるものとする。
+ *
+ * @param p テキストヒストリ構造体。
+ * @param buf バッファ。
+ * @param siz バッファサイズ。
+ */
+int text_history_read(text_history_t *p, char *buf, const int siz)
+{
+    char *sp = p->history + (TEXTHISTORY_MAXLEN * p->rp);
+    int n = 0;
+    while (*sp) {
+        *buf = *sp;
+        buf++;
+        sp++;
+        n++;
+        if (siz - 1 <= n) {
+            break;
+        }
+    }
+    *buf = '\0';
+    return n;
+}
+
+/**
+ * @brief 読み出しポインタを次に進める。
+ *
+ * @param p テキストヒストリ構造体。
+ */
+int text_history_read_point_next(text_history_t *p)
+{
+    int n = (p->rp + 1) % TEXTHISTORY_DEPTH;
+    if (n != p->wp) {
+        p->rp = n;
+        return 1;
+    }
+    return 0;
+}
+
+/**
+ * @brief 読み出しポインタを前に戻す。
+ *
+ * @param p テキストヒストリ構造体。
+ */
+int text_history_read_point_prev(text_history_t *p)
+{
+    int n = (p->rp == 0) ? (TEXTHISTORY_DEPTH - 1) : (p->rp - 1);
+    if (n != p->wp) {
+        char *sp = p->history + (TEXTHISTORY_MAXLEN * n);
+        if (*sp != '\0') {
+            p->rp = n;
+            return 1;
+        }
+    }
+    return 0;
+}
+
+/**
+ * @brief 与えられたテキストで始まる文字列を探す。
+ * @details このインターフェースはテキスト入力補完のために作られた。
+ *
+ * @param p テキストヒストリオブジェクト。
+ * @param index ヒストリ中で見つかる文字列のindex個目。
+ * @param text 検索する文字列。
+ * @param buf 格納先バッファ。
+ * @param siz 格納先バッファサイズ。
+ *
+ * @retval 0 成功。
+ * @retval 0以外 失敗。
+ */
+int text_history_find(text_history_t *p,
+        const int index, const char *text,
+        char *buf, const int siz)
+{
+    const int text_len = ntlibc_strlen((const char *)text);
+    int found = 0;
+    int i;
+    for (i = 0; i < TEXTHISTORY_DEPTH; i++) {
+        int target = (p->rp + i) % TEXTHISTORY_DEPTH;
+        char *txtp = p->history + (TEXTHISTORY_MAXLEN * target);
+        const int target_len = ntlibc_strlen((const char *)txtp);
+        int comp_len = (target_len < text_len) ? target_len : text_len;
+        if ((ntlibc_strncmp(
+                    (const char *)txtp,
+                    (const char *)text, comp_len) == 0) && (comp_len > 0)) {
+            if (found == index) {
+                if (siz <= ntlibc_strlen(txtp)) {
+                    return -1;
+                }
+                ntlibc_strcpy((char *)buf, (char *)txtp);
+                return 0;
+            }
+            found++;
+        }
+    }
+    return -1;
+}
+
diff --git a/uzumeapp/kernel/uzume/ntshell/text_history.h b/uzumeapp/kernel/uzume/ntshell/text_history.h
new file mode 100644 (file)
index 0000000..e6b95be
--- /dev/null
@@ -0,0 +1,90 @@
+/**
+ * @file text_history.h
+ * @author Shinichiro Nakamura
+ * @brief NT-Shell用テキストヒストリモジュールの定義。
+ * @details
+ * 文字列の入力履歴を論理的に扱うためのモジュール。
+ * このモジュールはビューに関して一切感知しない。
+ */
+
+/*
+ * ===============================================================
+ *  Natural Tiny Shell (NT-Shell)
+ * ===============================================================
+ * Copyright (c) 2010-2012 Shinichiro Nakamura
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ * ===============================================================
+ */
+
+#ifndef TEXT_HISTORY_H
+#define TEXT_HISTORY_H
+
+#include "ntconf.h"
+
+/**
+ * @brief 1履歴あたりの文字列最大長。
+ */
+#define TEXTHISTORY_MAXLEN  (NTCONF_EDITOR_MAXLEN)
+
+/**
+ * @brief 履歴管理数。
+ */
+#define TEXTHISTORY_DEPTH   (NTCONF_HISTORY_DEPTH)
+
+/**
+ * @brief テキストヒストリ構造体。
+ */
+typedef struct {
+    /**
+     * @brief 履歴文字列バッファ。
+     */
+    char history[TEXTHISTORY_MAXLEN * TEXTHISTORY_DEPTH];
+
+    /**
+     * @brief リード位置。
+     */
+    int rp;
+
+    /**
+     * @brief ライト位置。
+     */
+    int wp;
+} text_history_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void text_history_init(text_history_t *p);
+int text_history_write(text_history_t *p, char *buf);
+int text_history_read(text_history_t *p, char *buf, const int siz);
+int text_history_read_point_next(text_history_t *p);
+int text_history_read_point_prev(text_history_t *p);
+int text_history_find(text_history_t *p, const int index, const char *text, char *buf, const int siz);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/uzumeapp/kernel/uzume/ntshell/vtrecv.c b/uzumeapp/kernel/uzume/ntshell/vtrecv.c
new file mode 100644 (file)
index 0000000..a9b2cb1
--- /dev/null
@@ -0,0 +1,2573 @@
+/**
+ * @file vtrecv.c
+ * @brief VT100互換の受信用パーサの実装。
+ * @details
+ * An implementation of Paul Williams' DEC compatible state machine parser
+ * This code is in the public domain.
+ *
+ * @author Joshua Haberman <joshua@reverberate.org>
+ * @author Shinichiro Nakamura : Modified for Natural Tiny Shell (NT-Shell)
+ */
+
+#include "vtrecv.h"
+
+/**
+ * @brief オリジナルに含まれるLUTを使うかどうかを決定する。
+ * @details
+ * オリジナルでは、シーケンスの遷移をテーブル参照で実装してあった。
+ * 15のステートで取りうる256パターンの入力を全網羅するテーブルである。
+ * これは3840個のテーブルデータを持つことになる。
+ *
+ * テーブル参照はメモリに対してリニアアクセス可能なプロセッサにおいて
+ * 固定時間で動作する。テーブル参照のメリットは固定時間での処理である。
+ *
+ * 一方、新たに実装した方法は、重複するデータが多数存在する事に着目した
+ * もので、区間毎に適用するシーケンスを定義したテーブルを用いる。
+ * これはテーブルを線形探索するため後方にあるデータになるほど動作は遅い。
+ * しかし、コードサイズはオリジナルの全網羅形式のテーブルよりも小さい。
+ *
+ * @retval 0 使わない。
+ * @retval 1 使う。
+ */
+#define USE_ORIGINAL_LUT (0)
+
+static state_change_t GET_STATE_TABLE(const int state, const int ch);
+static vtrecv_action_t GET_ENTRY_ACTIONS(const int state);
+static vtrecv_action_t GET_EXIT_ACTIONS(const int state);
+
+static int vtrecv_strlen(const char *s)
+{
+    const char *p = s;
+    int cnt = 0;
+    while (*p) {
+        cnt++;
+        p++;
+    }
+    return cnt;
+}
+
+#if (USE_ORIGINAL_LUT==1)
+static const state_change_t STATE_TABLE[15][256] = {
+    {  /* VTRECV_STATE_ANYWHERE */
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        /*24 */  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        0,
+        /*26 */  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*27 */  0                                | (VTRECV_STATE_ESCAPE              << 4),
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        /*128*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*129*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*130*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*131*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*132*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*133*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*134*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*135*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*136*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*137*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*138*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*139*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*140*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*141*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*142*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*143*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*144*/  0                                | (VTRECV_STATE_DCS_ENTRY           << 4),
+        /*145*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*146*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*147*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*148*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*149*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*150*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*151*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*152*/  0                                | (VTRECV_STATE_SOS_PM_APC_STRING   << 4),
+        /*153*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*154*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*155*/  0                                | (VTRECV_STATE_CSI_ENTRY           << 4),
+        /*156*/  VTRECV_ACTION_EXECUTE            | (VTRECV_STATE_GROUND              << 4),
+        /*157*/  0                                | (VTRECV_STATE_OSC_STRING          << 4),
+        /*158*/  0                                | (VTRECV_STATE_SOS_PM_APC_STRING   << 4),
+        /*159*/  0                                | (VTRECV_STATE_SOS_PM_APC_STRING   << 4),
+    },
+    {  /* VTRECV_STATE_CSI_ENTRY */
+        /*0  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*1  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*2  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*3  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*4  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*5  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*6  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*7  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*8  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*9  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*10 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*11 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*12 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*13 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*14 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*15 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*16 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*17 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*18 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*19 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*20 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*21 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*22 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*23 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        0,
+        /*25 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        0,
+        0,
+        /*28 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*29 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*30 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*31 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*32 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*33 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*34 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*35 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*36 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*37 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*38 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*39 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*40 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*41 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*42 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*43 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*44 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*45 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*46 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*47 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*48 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_CSI_PARAM           << 4),
+        /*49 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_CSI_PARAM           << 4),
+        /*50 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_CSI_PARAM           << 4),
+        /*51 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_CSI_PARAM           << 4),
+        /*52 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_CSI_PARAM           << 4),
+        /*53 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_CSI_PARAM           << 4),
+        /*54 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_CSI_PARAM           << 4),
+        /*55 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_CSI_PARAM           << 4),
+        /*56 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_CSI_PARAM           << 4),
+        /*57 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_CSI_PARAM           << 4),
+        /*58 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*59 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_CSI_PARAM           << 4),
+        /*60 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_PARAM           << 4),
+        /*61 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_PARAM           << 4),
+        /*62 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_PARAM           << 4),
+        /*63 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_PARAM           << 4),
+        /*64 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*65 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*66 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*67 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*68 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*69 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*70 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*71 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*72 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*73 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*74 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*75 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*76 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*77 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*78 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*79 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*80 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*81 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*82 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*83 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*84 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*85 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*86 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*87 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*88 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*89 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*90 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*91 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*92 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*93 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*94 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*95 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*96 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*97 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*98 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*99 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*100*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*101*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*102*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*103*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*104*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*105*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*106*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*107*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*108*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*109*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*110*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*111*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*112*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*113*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*114*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*115*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*116*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*117*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*118*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*119*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*120*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*121*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*122*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*123*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*124*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*125*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*126*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*127*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+    },
+    {  /* VTRECV_STATE_CSI_IGNORE */
+        /*0  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*1  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*2  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*3  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*4  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*5  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*6  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*7  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*8  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*9  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*10 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*11 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*12 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*13 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*14 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*15 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*16 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*17 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*18 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*19 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*20 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*21 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*22 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*23 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        0,
+        /*25 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        0,
+        0,
+        /*28 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*29 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*30 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*31 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*32 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*33 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*34 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*35 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*36 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*37 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*38 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*39 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*40 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*41 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*42 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*43 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*44 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*45 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*46 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*47 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*48 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*49 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*50 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*51 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*52 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*53 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*54 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*55 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*56 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*57 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*58 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*59 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*60 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*61 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*62 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*63 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*64 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*65 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*66 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*67 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*68 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*69 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*70 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*71 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*72 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*73 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*74 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*75 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*76 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*77 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*78 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*79 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*80 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*81 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*82 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*83 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*84 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*85 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*86 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*87 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*88 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*89 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*90 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*91 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*92 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*93 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*94 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*95 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*96 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*97 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*98 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*99 */  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*100*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*101*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*102*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*103*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*104*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*105*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*106*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*107*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*108*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*109*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*110*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*111*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*112*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*113*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*114*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*115*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*116*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*117*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*118*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*119*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*120*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*121*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*122*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*123*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*124*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*125*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*126*/  0                                | (VTRECV_STATE_GROUND              << 4),
+        /*127*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+    },
+    {  /* VTRECV_STATE_CSI_INTERMEDIATE */
+        /*0  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*1  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*2  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*3  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*4  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*5  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*6  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*7  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*8  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*9  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*10 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*11 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*12 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*13 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*14 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*15 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*16 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*17 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*18 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*19 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*20 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*21 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*22 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*23 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        0,
+        /*25 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        0,
+        0,
+        /*28 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*29 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*30 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*31 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*32 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*33 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*34 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*35 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*36 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*37 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*38 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*39 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*40 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*41 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*42 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*43 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*44 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*45 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*46 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*47 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*48 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*49 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*50 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*51 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*52 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*53 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*54 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*55 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*56 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*57 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*58 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*59 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*60 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*61 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*62 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*63 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*64 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*65 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*66 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*67 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*68 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*69 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*70 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*71 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*72 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*73 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*74 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*75 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*76 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*77 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*78 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*79 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*80 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*81 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*82 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*83 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*84 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*85 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*86 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*87 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*88 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*89 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*90 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*91 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*92 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*93 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*94 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*95 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*96 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*97 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*98 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*99 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*100*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*101*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*102*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*103*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*104*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*105*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*106*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*107*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*108*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*109*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*110*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*111*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*112*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*113*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*114*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*115*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*116*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*117*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*118*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*119*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*120*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*121*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*122*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*123*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*124*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*125*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*126*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*127*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+    },
+    {  /* VTRECV_STATE_CSI_PARAM */
+        /*0  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*1  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*2  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*3  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*4  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*5  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*6  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*7  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*8  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*9  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*10 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*11 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*12 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*13 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*14 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*15 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*16 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*17 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*18 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*19 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*20 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*21 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*22 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*23 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        0,
+        /*25 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        0,
+        0,
+        /*28 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*29 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*30 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*31 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*32 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*33 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*34 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*35 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*36 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*37 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*38 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*39 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*40 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*41 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*42 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*43 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*44 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*45 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*46 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*47 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_CSI_INTERMEDIATE    << 4),
+        /*48 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*49 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*50 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*51 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*52 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*53 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*54 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*55 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*56 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*57 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*58 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*59 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*60 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*61 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*62 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*63 */  0                                | (VTRECV_STATE_CSI_IGNORE          << 4),
+        /*64 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*65 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*66 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*67 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*68 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*69 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*70 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*71 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*72 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*73 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*74 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*75 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*76 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*77 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*78 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*79 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*80 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*81 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*82 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*83 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*84 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*85 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*86 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*87 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*88 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*89 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*90 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*91 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*92 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*93 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*94 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*95 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*96 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*97 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*98 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*99 */  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*100*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*101*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*102*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*103*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*104*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*105*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*106*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*107*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*108*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*109*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*110*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*111*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*112*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*113*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*114*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*115*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*116*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*117*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*118*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*119*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*120*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*121*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*122*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*123*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*124*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*125*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*126*/  VTRECV_ACTION_CSI_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*127*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+    },
+    {  /* VTRECV_STATE_DCS_ENTRY */
+        /*0  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*1  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*2  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*3  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*4  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*5  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*6  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*7  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*8  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*9  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*10 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*11 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*12 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*13 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*14 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*15 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*16 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*17 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*18 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*19 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*20 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*21 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*22 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*23 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        0,
+        /*25 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        0,
+        0,
+        /*28 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*29 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*30 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*31 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*32 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*33 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*34 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*35 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*36 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*37 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*38 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*39 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*40 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*41 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*42 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*43 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*44 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*45 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*46 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*47 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*48 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_DCS_PARAM           << 4),
+        /*49 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_DCS_PARAM           << 4),
+        /*50 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_DCS_PARAM           << 4),
+        /*51 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_DCS_PARAM           << 4),
+        /*52 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_DCS_PARAM           << 4),
+        /*53 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_DCS_PARAM           << 4),
+        /*54 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_DCS_PARAM           << 4),
+        /*55 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_DCS_PARAM           << 4),
+        /*56 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_DCS_PARAM           << 4),
+        /*57 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_DCS_PARAM           << 4),
+        /*58 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*59 */  VTRECV_ACTION_PARAM              | (VTRECV_STATE_DCS_PARAM           << 4),
+        /*60 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_PARAM           << 4),
+        /*61 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_PARAM           << 4),
+        /*62 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_PARAM           << 4),
+        /*63 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_PARAM           << 4),
+        /*64 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*65 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*66 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*67 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*68 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*69 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*70 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*71 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*72 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*73 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*74 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*75 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*76 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*77 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*78 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*79 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*80 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*81 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*82 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*83 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*84 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*85 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*86 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*87 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*88 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*89 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*90 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*91 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*92 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*93 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*94 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*95 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*96 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*97 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*98 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*99 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*100*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*101*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*102*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*103*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*104*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*105*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*106*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*107*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*108*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*109*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*110*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*111*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*112*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*113*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*114*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*115*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*116*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*117*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*118*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*119*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*120*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*121*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*122*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*123*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*124*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*125*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*126*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*127*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+    },
+    {  /* VTRECV_STATE_DCS_IGNORE */
+        /*0  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*1  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*2  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*3  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*4  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*5  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*6  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*7  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*8  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*9  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*10 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*11 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*12 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*13 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*14 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*15 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*16 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*17 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*18 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*19 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*20 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*21 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*22 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*23 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        0,
+        /*25 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        0,
+        0,
+        /*28 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*29 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*30 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*31 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*32 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*33 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*34 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*35 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*36 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*37 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*38 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*39 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*40 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*41 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*42 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*43 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*44 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*45 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*46 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*47 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*48 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*49 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*50 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*51 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*52 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*53 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*54 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*55 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*56 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*57 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*58 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*59 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*60 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*61 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*62 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*63 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*64 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*65 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*66 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*67 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*68 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*69 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*70 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*71 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*72 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*73 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*74 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*75 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*76 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*77 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*78 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*79 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*80 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*81 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*82 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*83 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*84 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*85 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*86 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*87 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*88 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*89 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*90 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*91 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*92 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*93 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*94 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*95 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*96 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*97 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*98 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*99 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*100*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*101*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*102*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*103*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*104*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*105*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*106*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*107*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*108*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*109*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*110*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*111*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*112*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*113*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*114*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*115*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*116*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*117*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*118*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*119*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*120*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*121*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*122*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*123*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*124*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*125*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*126*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*127*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        /*156*/  0                                | (VTRECV_STATE_GROUND              << 4),
+    },
+    {  /* VTRECV_STATE_DCS_INTERMEDIATE */
+        /*0  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*1  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*2  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*3  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*4  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*5  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*6  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*7  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*8  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*9  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*10 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*11 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*12 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*13 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*14 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*15 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*16 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*17 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*18 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*19 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*20 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*21 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*22 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*23 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        0,
+        /*25 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        0,
+        0,
+        /*28 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*29 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*30 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*31 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*32 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*33 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*34 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*35 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*36 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*37 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*38 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*39 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*40 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*41 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*42 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*43 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*44 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*45 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*46 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*47 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*48 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*49 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*50 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*51 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*52 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*53 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*54 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*55 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*56 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*57 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*58 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*59 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*60 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*61 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*62 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*63 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*64 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*65 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*66 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*67 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*68 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*69 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*70 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*71 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*72 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*73 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*74 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*75 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*76 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*77 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*78 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*79 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*80 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*81 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*82 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*83 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*84 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*85 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*86 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*87 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*88 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*89 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*90 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*91 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*92 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*93 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*94 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*95 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*96 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*97 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*98 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*99 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*100*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*101*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*102*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*103*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*104*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*105*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*106*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*107*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*108*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*109*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*110*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*111*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*112*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*113*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*114*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*115*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*116*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*117*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*118*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*119*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*120*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*121*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*122*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*123*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*124*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*125*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*126*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*127*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+    },
+    {  /* VTRECV_STATE_DCS_PARAM */
+        /*0  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*1  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*2  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*3  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*4  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*5  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*6  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*7  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*8  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*9  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*10 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*11 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*12 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*13 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*14 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*15 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*16 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*17 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*18 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*19 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*20 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*21 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*22 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*23 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        0,
+        /*25 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        0,
+        0,
+        /*28 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*29 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*30 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*31 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*32 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*33 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*34 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*35 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*36 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*37 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*38 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*39 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*40 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*41 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*42 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*43 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*44 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*45 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*46 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*47 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_DCS_INTERMEDIATE    << 4),
+        /*48 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*49 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*50 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*51 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*52 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*53 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*54 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*55 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*56 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*57 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*58 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*59 */  VTRECV_ACTION_PARAM              | (0                                 << 4),
+        /*60 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*61 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*62 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*63 */  0                                | (VTRECV_STATE_DCS_IGNORE          << 4),
+        /*64 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*65 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*66 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*67 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*68 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*69 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*70 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*71 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*72 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*73 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*74 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*75 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*76 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*77 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*78 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*79 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*80 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*81 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*82 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*83 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*84 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*85 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*86 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*87 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*88 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*89 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*90 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*91 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*92 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*93 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*94 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*95 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*96 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*97 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*98 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*99 */  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*100*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*101*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*102*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*103*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*104*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*105*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*106*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*107*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*108*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*109*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*110*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*111*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*112*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*113*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*114*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*115*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*116*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*117*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*118*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*119*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*120*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*121*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*122*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*123*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*124*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*125*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*126*/  0                                | (VTRECV_STATE_DCS_PASSTHROUGH     << 4),
+        /*127*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+    },
+    {  /* VTRECV_STATE_DCS_PASSTHROUGH */
+        /*0  */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*1  */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*2  */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*3  */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*4  */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*5  */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*6  */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*7  */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*8  */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*9  */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*10 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*11 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*12 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*13 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*14 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*15 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*16 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*17 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*18 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*19 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*20 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*21 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*22 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*23 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        0,
+        /*25 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        0,
+        0,
+        /*28 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*29 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*30 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*31 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*32 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*33 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*34 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*35 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*36 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*37 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*38 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*39 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*40 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*41 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*42 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*43 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*44 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*45 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*46 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*47 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*48 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*49 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*50 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*51 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*52 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*53 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*54 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*55 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*56 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*57 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*58 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*59 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*60 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*61 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*62 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*63 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*64 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*65 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*66 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*67 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*68 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*69 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*70 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*71 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*72 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*73 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*74 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*75 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*76 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*77 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*78 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*79 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*80 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*81 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*82 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*83 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*84 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*85 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*86 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*87 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*88 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*89 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*90 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*91 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*92 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*93 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*94 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*95 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*96 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*97 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*98 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*99 */  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*100*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*101*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*102*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*103*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*104*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*105*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*106*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*107*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*108*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*109*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*110*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*111*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*112*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*113*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*114*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*115*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*116*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*117*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*118*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*119*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*120*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*121*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*122*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*123*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*124*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*125*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*126*/  VTRECV_ACTION_PUT                | (0                                 << 4),
+        /*127*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        /*156*/  0                                | (VTRECV_STATE_GROUND              << 4),
+    },
+    {  /* VTRECV_STATE_ESCAPE */
+        /*0  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*1  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*2  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*3  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*4  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*5  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*6  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*7  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*8  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*9  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*10 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*11 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*12 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*13 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*14 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*15 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*16 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*17 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*18 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*19 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*20 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*21 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*22 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*23 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        0,
+        /*25 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        0,
+        0,
+        /*28 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*29 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*30 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*31 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*32 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_ESCAPE_INTERMEDIATE << 4),
+        /*33 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_ESCAPE_INTERMEDIATE << 4),
+        /*34 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_ESCAPE_INTERMEDIATE << 4),
+        /*35 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_ESCAPE_INTERMEDIATE << 4),
+        /*36 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_ESCAPE_INTERMEDIATE << 4),
+        /*37 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_ESCAPE_INTERMEDIATE << 4),
+        /*38 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_ESCAPE_INTERMEDIATE << 4),
+        /*39 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_ESCAPE_INTERMEDIATE << 4),
+        /*40 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_ESCAPE_INTERMEDIATE << 4),
+        /*41 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_ESCAPE_INTERMEDIATE << 4),
+        /*42 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_ESCAPE_INTERMEDIATE << 4),
+        /*43 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_ESCAPE_INTERMEDIATE << 4),
+        /*44 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_ESCAPE_INTERMEDIATE << 4),
+        /*45 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_ESCAPE_INTERMEDIATE << 4),
+        /*46 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_ESCAPE_INTERMEDIATE << 4),
+        /*47 */  VTRECV_ACTION_COLLECT            | (VTRECV_STATE_ESCAPE_INTERMEDIATE << 4),
+        /*48 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*49 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*50 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*51 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*52 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*53 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*54 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*55 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*56 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*57 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*58 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*59 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*60 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*61 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*62 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*63 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*64 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*65 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*66 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*67 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*68 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*69 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*70 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*71 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*72 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*73 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*74 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*75 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*76 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*77 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*78 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*79 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*80 */  0                                | (VTRECV_STATE_DCS_ENTRY           << 4),
+        /*81 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*82 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*83 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*84 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*85 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*86 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*87 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*88 */  0                                | (VTRECV_STATE_SOS_PM_APC_STRING   << 4),
+        /*89 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*90 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*91 */  0                                | (VTRECV_STATE_CSI_ENTRY           << 4),
+        /*92 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*93 */  0                                | (VTRECV_STATE_OSC_STRING          << 4),
+        /*94 */  0                                | (VTRECV_STATE_SOS_PM_APC_STRING   << 4),
+        /*95 */  0                                | (VTRECV_STATE_SOS_PM_APC_STRING   << 4),
+        /*96 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*97 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*98 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*99 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*100*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*101*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*102*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*103*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*104*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*105*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*106*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*107*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*108*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*109*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*110*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*111*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*112*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*113*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*114*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*115*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*116*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*117*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*118*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*119*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*120*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*121*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*122*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*123*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*124*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*125*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*126*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*127*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+    },
+    {  /* VTRECV_STATE_ESCAPE_INTERMEDIATE */
+        /*0  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*1  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*2  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*3  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*4  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*5  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*6  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*7  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*8  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*9  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*10 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*11 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*12 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*13 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*14 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*15 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*16 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*17 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*18 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*19 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*20 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*21 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*22 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*23 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        0,
+        /*25 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        0,
+        0,
+        /*28 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*29 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*30 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*31 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*32 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*33 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*34 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*35 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*36 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*37 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*38 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*39 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*40 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*41 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*42 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*43 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*44 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*45 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*46 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*47 */  VTRECV_ACTION_COLLECT            | (0                                 << 4),
+        /*48 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*49 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*50 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*51 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*52 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*53 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*54 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*55 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*56 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*57 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*58 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*59 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*60 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*61 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*62 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*63 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*64 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*65 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*66 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*67 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*68 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*69 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*70 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*71 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*72 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*73 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*74 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*75 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*76 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*77 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*78 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*79 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*80 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*81 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*82 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*83 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*84 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*85 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*86 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*87 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*88 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*89 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*90 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*91 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*92 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*93 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*94 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*95 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*96 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*97 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*98 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*99 */  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*100*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*101*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*102*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*103*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*104*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*105*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*106*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*107*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*108*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*109*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*110*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*111*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*112*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*113*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*114*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*115*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*116*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*117*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*118*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*119*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*120*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*121*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*122*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*123*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*124*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*125*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*126*/  VTRECV_ACTION_ESC_DISPATCH       | (VTRECV_STATE_GROUND              << 4),
+        /*127*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+    },
+    {  /* VTRECV_STATE_GROUND */
+        /*0  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*1  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*2  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*3  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*4  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*5  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*6  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*7  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*8  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*9  */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*10 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*11 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*12 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*13 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*14 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*15 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*16 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*17 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*18 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*19 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*20 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*21 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*22 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*23 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        0,
+        /*25 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        0,
+        0,
+        /*28 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*29 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*30 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*31 */  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*32 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*33 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*34 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*35 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*36 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*37 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*38 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*39 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*40 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*41 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*42 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*43 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*44 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*45 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*46 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*47 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*48 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*49 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*50 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*51 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*52 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*53 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*54 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*55 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*56 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*57 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*58 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*59 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*60 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*61 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*62 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*63 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*64 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*65 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*66 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*67 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*68 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*69 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*70 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*71 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*72 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*73 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*74 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*75 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*76 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*77 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*78 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*79 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*80 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*81 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*82 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*83 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*84 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*85 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*86 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*87 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*88 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*89 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*90 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*91 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*92 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*93 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*94 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*95 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*96 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*97 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*98 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*99 */  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*100*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*101*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*102*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*103*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*104*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*105*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*106*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*107*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*108*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*109*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*110*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*111*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*112*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*113*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*114*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*115*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*116*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*117*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*118*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*119*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*120*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*121*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*122*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*123*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*124*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*125*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*126*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*127*/  VTRECV_ACTION_PRINT              | (0                                 << 4),
+        /*128*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*129*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*130*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*131*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*132*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*133*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*134*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*135*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*136*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*137*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*138*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*139*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*140*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*141*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*142*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*143*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        0,
+        /*145*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*146*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*147*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*148*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*149*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*150*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*151*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*152*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*153*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        /*154*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+        0,
+        /*156*/  VTRECV_ACTION_EXECUTE            | (0                                 << 4),
+    },
+    {  /* VTRECV_STATE_OSC_STRING */
+        /*0  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*1  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*2  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*3  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*4  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*5  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*6  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*7  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*8  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*9  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*10 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*11 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*12 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*13 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*14 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*15 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*16 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*17 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*18 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*19 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*20 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*21 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*22 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*23 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        0,
+        /*25 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        0,
+        0,
+        /*28 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*29 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*30 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*31 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*32 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*33 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*34 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*35 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*36 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*37 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*38 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*39 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*40 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*41 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*42 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*43 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*44 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*45 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*46 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*47 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*48 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*49 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*50 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*51 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*52 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*53 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*54 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*55 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*56 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*57 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*58 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*59 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*60 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*61 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*62 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*63 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*64 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*65 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*66 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*67 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*68 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*69 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*70 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*71 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*72 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*73 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*74 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*75 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*76 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*77 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*78 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*79 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*80 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*81 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*82 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*83 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*84 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*85 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*86 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*87 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*88 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*89 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*90 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*91 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*92 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*93 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*94 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*95 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*96 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*97 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*98 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*99 */  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*100*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*101*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*102*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*103*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*104*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*105*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*106*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*107*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*108*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*109*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*110*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*111*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*112*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*113*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*114*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*115*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*116*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*117*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*118*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*119*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*120*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*121*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*122*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*123*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*124*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*125*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*126*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        /*127*/  VTRECV_ACTION_OSC_PUT            | (0                                 << 4),
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        /*156*/  0                                | (VTRECV_STATE_GROUND              << 4),
+    },
+    {  /* VTRECV_STATE_SOS_PM_APC_STRING */
+        /*0  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*1  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*2  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*3  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*4  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*5  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*6  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*7  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*8  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*9  */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*10 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*11 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*12 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*13 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*14 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*15 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*16 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*17 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*18 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*19 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*20 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*21 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*22 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*23 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        0,
+        /*25 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        0,
+        0,
+        /*28 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*29 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*30 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*31 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*32 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*33 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*34 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*35 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*36 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*37 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*38 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*39 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*40 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*41 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*42 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*43 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*44 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*45 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*46 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*47 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*48 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*49 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*50 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*51 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*52 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*53 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*54 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*55 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*56 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*57 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*58 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*59 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*60 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*61 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*62 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*63 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*64 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*65 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*66 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*67 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*68 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*69 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*70 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*71 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*72 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*73 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*74 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*75 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*76 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*77 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*78 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*79 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*80 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*81 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*82 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*83 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*84 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*85 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*86 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*87 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*88 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*89 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*90 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*91 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*92 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*93 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*94 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*95 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*96 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*97 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*98 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*99 */  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*100*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*101*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*102*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*103*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*104*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*105*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*106*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*107*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*108*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*109*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*110*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*111*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*112*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*113*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*114*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*115*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*116*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*117*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*118*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*119*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*120*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*121*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*122*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*123*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*124*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*125*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*126*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        /*127*/  VTRECV_ACTION_IGNORE             | (0                                 << 4),
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        /*156*/  0                                | (VTRECV_STATE_GROUND              << 4),
+    },
+};
+#else
+typedef struct {
+    int state;
+    unsigned char code_start;
+    unsigned char code_end;
+    state_change_t state_change;
+} state_table_t;
+
+static const state_table_t table[] = {
+    /*
+     * ANYWHERE
+     */
+    {VTRECV_STATE_ANYWHERE,             0x18, 0x18, VTRECV_ACTION_EXECUTE       | (VTRECV_STATE_GROUND              << 4)},
+    {VTRECV_STATE_ANYWHERE,             0x1a, 0x1a, VTRECV_ACTION_EXECUTE       | (VTRECV_STATE_GROUND              << 4)},
+    {VTRECV_STATE_ANYWHERE,             0x80, 0x8f, VTRECV_ACTION_EXECUTE       | (VTRECV_STATE_GROUND              << 4)},
+    {VTRECV_STATE_ANYWHERE,             0x91, 0x97, VTRECV_ACTION_EXECUTE       | (VTRECV_STATE_GROUND              << 4)},
+    {VTRECV_STATE_ANYWHERE,             0x99, 0x99, VTRECV_ACTION_EXECUTE       | (VTRECV_STATE_GROUND              << 4)},
+    {VTRECV_STATE_ANYWHERE,             0x9a, 0x9a, VTRECV_ACTION_EXECUTE       | (VTRECV_STATE_GROUND              << 4)},
+    {VTRECV_STATE_ANYWHERE,             0x9c, 0x9c, VTRECV_ACTION_EXECUTE       | (VTRECV_STATE_GROUND              << 4)},
+    {VTRECV_STATE_ANYWHERE,             0x1b, 0x1b, 0                           | (VTRECV_STATE_ESCAPE              << 4)},
+    {VTRECV_STATE_ANYWHERE,             0x98, 0x98, 0                           | (VTRECV_STATE_SOS_PM_APC_STRING   << 4)},
+    {VTRECV_STATE_ANYWHERE,             0x9e, 0x9e, 0                           | (VTRECV_STATE_SOS_PM_APC_STRING   << 4)},
+    {VTRECV_STATE_ANYWHERE,             0x9f, 0x9f, 0                           | (VTRECV_STATE_SOS_PM_APC_STRING   << 4)},
+    {VTRECV_STATE_ANYWHERE,             0x90, 0x90, 0                           | (VTRECV_STATE_DCS_ENTRY           << 4)},
+    {VTRECV_STATE_ANYWHERE,             0x9d, 0x9d, 0                           | (VTRECV_STATE_OSC_STRING          << 4)},
+    {VTRECV_STATE_ANYWHERE,             0x9b, 0x9b, 0                           | (VTRECV_STATE_CSI_ENTRY           << 4)},
+    /*
+     * GROUND
+     */
+    {VTRECV_STATE_GROUND,               0x00, 0x17, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_GROUND,               0x19, 0x19, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_GROUND,               0x1c, 0x1f, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_GROUND,               0x20, 0x7f, VTRECV_ACTION_PRINT         | (0                                << 4)},
+    {VTRECV_STATE_GROUND,               0x80, 0x8f, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_GROUND,               0x91, 0x9a, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_GROUND,               0x9c, 0x9c, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    /*
+     * ESCAPE
+     */
+    {VTRECV_STATE_ESCAPE,               0x00, 0x17, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_ESCAPE,               0x19, 0x19, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_ESCAPE,               0x1c, 0x1f, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_ESCAPE,               0x7f, 0x7f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_ESCAPE,               0x20, 0x2f, VTRECV_ACTION_COLLECT       | (VTRECV_STATE_ESCAPE_INTERMEDIATE << 4)},
+    {VTRECV_STATE_ESCAPE,               0x30, 0x4f, VTRECV_ACTION_ESC_DISPATCH  | (VTRECV_STATE_GROUND              << 4)},
+    {VTRECV_STATE_ESCAPE,               0x51, 0x57, VTRECV_ACTION_ESC_DISPATCH  | (VTRECV_STATE_GROUND              << 4)},
+    {VTRECV_STATE_ESCAPE,               0x59, 0x59, VTRECV_ACTION_ESC_DISPATCH  | (VTRECV_STATE_GROUND              << 4)},
+    {VTRECV_STATE_ESCAPE,               0x5a, 0x5a, VTRECV_ACTION_ESC_DISPATCH  | (VTRECV_STATE_GROUND              << 4)},
+    {VTRECV_STATE_ESCAPE,               0x5c, 0x5c, VTRECV_ACTION_ESC_DISPATCH  | (VTRECV_STATE_GROUND              << 4)},
+    {VTRECV_STATE_ESCAPE,               0x60, 0x7e, VTRECV_ACTION_ESC_DISPATCH  | (VTRECV_STATE_GROUND              << 4)},
+    {VTRECV_STATE_ESCAPE,               0x5b, 0x5b, 0                           | (VTRECV_STATE_CSI_ENTRY           << 4)},
+    {VTRECV_STATE_ESCAPE,               0x5d, 0x5d, 0                           | (VTRECV_STATE_OSC_STRING          << 4)},
+    {VTRECV_STATE_ESCAPE,               0x50, 0x50, 0                           | (VTRECV_STATE_DCS_ENTRY           << 4)},
+    {VTRECV_STATE_ESCAPE,               0x58, 0x58, 0                           | (VTRECV_STATE_SOS_PM_APC_STRING   << 4)},
+    {VTRECV_STATE_ESCAPE,               0x5e, 0x5e, 0                           | (VTRECV_STATE_SOS_PM_APC_STRING   << 4)},
+    {VTRECV_STATE_ESCAPE,               0x5f, 0x5f, 0                           | (VTRECV_STATE_SOS_PM_APC_STRING   << 4)},
+    /*
+     * ESCAPE_INTERMEDIATE
+     */
+    {VTRECV_STATE_ESCAPE_INTERMEDIATE,  0x00, 0x17, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_ESCAPE_INTERMEDIATE,  0x19, 0x19, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_ESCAPE_INTERMEDIATE,  0x1c, 0x1f, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_ESCAPE_INTERMEDIATE,  0x20, 0x2f, VTRECV_ACTION_COLLECT       | (0                                << 4)},
+    {VTRECV_STATE_ESCAPE_INTERMEDIATE,  0x7f, 0x7f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_ESCAPE_INTERMEDIATE,  0x30, 0x7e, VTRECV_ACTION_ESC_DISPATCH  | (VTRECV_STATE_GROUND              << 4)},
+    /*
+     * CSI_ENTRY
+     */
+    {VTRECV_STATE_CSI_ENTRY,            0x00, 0x17, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_CSI_ENTRY,            0x19, 0x19, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_CSI_ENTRY,            0x1c, 0x1f, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_CSI_ENTRY,            0x7f, 0x7f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_CSI_ENTRY,            0x20, 0x2f, VTRECV_ACTION_COLLECT       | (VTRECV_STATE_CSI_INTERMEDIATE    << 4)},
+    {VTRECV_STATE_CSI_ENTRY,            0x3a, 0x3a, 0                           | (VTRECV_STATE_CSI_IGNORE          << 4)},
+    {VTRECV_STATE_CSI_ENTRY,            0x30, 0x39, VTRECV_ACTION_PARAM         | (VTRECV_STATE_CSI_PARAM           << 4)},
+    {VTRECV_STATE_CSI_ENTRY,            0x3b, 0x3b, VTRECV_ACTION_PARAM         | (VTRECV_STATE_CSI_PARAM           << 4)},
+    {VTRECV_STATE_CSI_ENTRY,            0x3c, 0x3f, VTRECV_ACTION_COLLECT       | (VTRECV_STATE_CSI_PARAM           << 4)},
+    {VTRECV_STATE_CSI_ENTRY,            0x40, 0x7e, VTRECV_ACTION_CSI_DISPATCH  | (VTRECV_STATE_GROUND              << 4)},
+    /*
+     * CSI_IGNORE
+     */
+    {VTRECV_STATE_CSI_IGNORE,           0x00, 0x17, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_CSI_IGNORE,           0x19, 0x19, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_CSI_IGNORE,           0x1c, 0x1f, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_CSI_IGNORE,           0x20, 0x3f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_CSI_IGNORE,           0x7f, 0x7f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_CSI_IGNORE,           0x40, 0x7e, 0                           | (VTRECV_STATE_GROUND              << 4)},
+    /*
+     * CSI_PARAM
+     */
+    {VTRECV_STATE_CSI_PARAM,            0x00, 0x17, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_CSI_PARAM,            0x19, 0x19, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_CSI_PARAM,            0x1c, 0x1f, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_CSI_PARAM,            0x30, 0x39, VTRECV_ACTION_PARAM         | (0                                << 4)},
+    {VTRECV_STATE_CSI_PARAM,            0x3b, 0x3b, VTRECV_ACTION_PARAM         | (0                                << 4)},
+    {VTRECV_STATE_CSI_PARAM,            0x7f, 0x7f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_CSI_PARAM,            0x3a, 0x3a, 0                           | (VTRECV_STATE_CSI_IGNORE          << 4)},
+    {VTRECV_STATE_CSI_PARAM,            0x3c, 0x3f, 0                           | (VTRECV_STATE_CSI_IGNORE          << 4)},
+    {VTRECV_STATE_CSI_PARAM,            0x20, 0x2f, VTRECV_ACTION_COLLECT       | (VTRECV_STATE_CSI_INTERMEDIATE    << 4)},
+    {VTRECV_STATE_CSI_PARAM,            0x40, 0x7e, VTRECV_ACTION_CSI_DISPATCH  | (VTRECV_STATE_GROUND              << 4)},
+    /*
+     * CSI_INTERMEDIATE
+     */
+    {VTRECV_STATE_CSI_INTERMEDIATE,     0x00, 0x17, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_CSI_INTERMEDIATE,     0x19, 0x19, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_CSI_INTERMEDIATE,     0x1c, 0x1f, VTRECV_ACTION_EXECUTE       | (0                                << 4)},
+    {VTRECV_STATE_CSI_INTERMEDIATE,     0x20, 0x2f, VTRECV_ACTION_COLLECT       | (0                                << 4)},
+    {VTRECV_STATE_CSI_INTERMEDIATE,     0x7f, 0x7f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_CSI_INTERMEDIATE,     0x30, 0x3f, 0                           | (VTRECV_STATE_CSI_IGNORE          << 4)},
+    {VTRECV_STATE_CSI_INTERMEDIATE,     0x40, 0x7e, VTRECV_ACTION_CSI_DISPATCH  | (VTRECV_STATE_GROUND              << 4)},
+    /*
+     * DCS_ENTRY
+     */
+    {VTRECV_STATE_DCS_ENTRY,            0x00, 0x17, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_DCS_ENTRY,            0x19, 0x19, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_DCS_ENTRY,            0x1c, 0x1f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_DCS_ENTRY,            0x7f, 0x7f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_DCS_ENTRY,            0x3a, 0x3a, 0                           | (VTRECV_STATE_DCS_IGNORE          << 4)},
+    {VTRECV_STATE_DCS_ENTRY,            0x20, 0x2f, VTRECV_ACTION_COLLECT       | (VTRECV_STATE_DCS_INTERMEDIATE    << 4)},
+    {VTRECV_STATE_DCS_ENTRY,            0x30, 0x39, VTRECV_ACTION_PARAM         | (VTRECV_STATE_DCS_PARAM           << 4)},
+    {VTRECV_STATE_DCS_ENTRY,            0x3b, 0x3b, VTRECV_ACTION_PARAM         | (VTRECV_STATE_DCS_PARAM           << 4)},
+    {VTRECV_STATE_DCS_ENTRY,            0x3c, 0x3f, VTRECV_ACTION_COLLECT       | (VTRECV_STATE_DCS_PARAM           << 4)},
+    {VTRECV_STATE_DCS_ENTRY,            0x40, 0x7e, 0                           | (VTRECV_STATE_DCS_PASSTHROUGH     << 4)},
+    /*
+     * DCS_INTERMEDIATE
+     */
+    {VTRECV_STATE_DCS_INTERMEDIATE,     0x00, 0x17, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_DCS_INTERMEDIATE,     0x19, 0x19, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_DCS_INTERMEDIATE,     0x1c, 0x1f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_DCS_INTERMEDIATE,     0x20, 0x2f, VTRECV_ACTION_COLLECT       | (0                                << 4)},
+    {VTRECV_STATE_DCS_INTERMEDIATE,     0x7f, 0x7f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_DCS_INTERMEDIATE,     0x30, 0x3f, 0                           | (VTRECV_STATE_DCS_IGNORE          << 4)},
+    {VTRECV_STATE_DCS_INTERMEDIATE,     0x40, 0x7e, 0                           | (VTRECV_STATE_DCS_PASSTHROUGH     << 4)},
+    /*
+     * DCS_IGNORE
+     */
+    {VTRECV_STATE_DCS_IGNORE,           0x00, 0x17, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_DCS_IGNORE,           0x19, 0x19, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_DCS_IGNORE,           0x1c, 0x1f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_DCS_IGNORE,           0x20, 0x7f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_DCS_IGNORE,           0x9c, 0x9c, 0                           | (VTRECV_STATE_GROUND              << 4)},
+    /*
+     * DCS_PARAM
+     */
+    {VTRECV_STATE_DCS_PARAM,            0x00, 0x17, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_DCS_PARAM,            0x19, 0x19, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_DCS_PARAM,            0x1c, 0x1f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_DCS_PARAM,            0x30, 0x39, VTRECV_ACTION_PARAM         | (0                                << 4)},
+    {VTRECV_STATE_DCS_PARAM,            0x3b, 0x3b, VTRECV_ACTION_PARAM         | (0                                << 4)},
+    {VTRECV_STATE_DCS_PARAM,            0x7f, 0x7f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_DCS_PARAM,            0x3a, 0x3a, 0                           | (VTRECV_STATE_DCS_IGNORE          << 4)},
+    {VTRECV_STATE_DCS_PARAM,            0x3c, 0x3f, 0                           | (VTRECV_STATE_DCS_IGNORE          << 4)},
+    {VTRECV_STATE_DCS_PARAM,            0x20, 0x2f, VTRECV_ACTION_COLLECT       | (VTRECV_STATE_DCS_INTERMEDIATE    << 4)},
+    {VTRECV_STATE_DCS_PARAM,            0x40, 0x7e, 0                           | (VTRECV_STATE_DCS_PASSTHROUGH     << 4)},
+    /*
+     * DCS_PASSTHROUGH
+     */
+    {VTRECV_STATE_DCS_PASSTHROUGH,      0x00, 0x17, VTRECV_ACTION_PUT           | (0                                << 4)},
+    {VTRECV_STATE_DCS_PASSTHROUGH,      0x19, 0x19, VTRECV_ACTION_PUT           | (0                                << 4)},
+    {VTRECV_STATE_DCS_PASSTHROUGH,      0x1c, 0x1f, VTRECV_ACTION_PUT           | (0                                << 4)},
+    {VTRECV_STATE_DCS_PASSTHROUGH,      0x20, 0x7e, VTRECV_ACTION_PUT           | (0                                << 4)},
+    {VTRECV_STATE_DCS_PASSTHROUGH,      0x7f, 0x7f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_DCS_PASSTHROUGH,      0x9c, 0x9c, 0                           | (VTRECV_STATE_GROUND              << 4)},
+    /*
+     * SOS_PM_APC_STRING
+     */
+    {VTRECV_STATE_SOS_PM_APC_STRING,    0x00, 0x17, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_SOS_PM_APC_STRING,    0x19, 0x19, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_SOS_PM_APC_STRING,    0x1c, 0x1f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_SOS_PM_APC_STRING,    0x20, 0x7f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_SOS_PM_APC_STRING,    0x9c, 0x9c, 0                           | (VTRECV_STATE_GROUND              << 4)},
+    /*
+     * OSC_STRING
+     */
+    {VTRECV_STATE_OSC_STRING,           0x00, 0x17, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_OSC_STRING,           0x19, 0x19, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_OSC_STRING,           0x1c, 0x1f, VTRECV_ACTION_IGNORE        | (0                                << 4)},
+    {VTRECV_STATE_OSC_STRING,           0x20, 0x7f, VTRECV_ACTION_OSC_PUT       | (0                                << 4)},
+    {VTRECV_STATE_OSC_STRING,           0x9c, 0x9c, 0                           | (VTRECV_STATE_GROUND              << 4)},
+};
+#endif
+
+static const vtrecv_action_t ENTRY_ACTIONS[] = {
+    (vtrecv_action_t)0  /* none for ANYWHERE */,
+    VTRECV_ACTION_CLEAR, /* CSI_ENTRY */
+    (vtrecv_action_t)0  /* none for CSI_IGNORE */,
+    (vtrecv_action_t)0  /* none for CSI_INTERMEDIATE */,
+    (vtrecv_action_t)0  /* none for CSI_PARAM */,
+    VTRECV_ACTION_CLEAR, /* DCS_ENTRY */
+    (vtrecv_action_t)0  /* none for DCS_IGNORE */,
+    (vtrecv_action_t)0  /* none for DCS_INTERMEDIATE */,
+    (vtrecv_action_t)0  /* none for DCS_PARAM */,
+    VTRECV_ACTION_HOOK, /* DCS_PASSTHROUGH */
+    VTRECV_ACTION_CLEAR, /* ESCAPE */
+    (vtrecv_action_t)0  /* none for ESCAPE_INTERMEDIATE */,
+    (vtrecv_action_t)0  /* none for GROUND */,
+    VTRECV_ACTION_OSC_START, /* OSC_STRING */
+    (vtrecv_action_t)0  /* none for SOS_PM_APC_STRING */,
+};
+
+static const vtrecv_action_t EXIT_ACTIONS[] = {
+    (vtrecv_action_t)0  /* none for ANYWHERE */,
+    (vtrecv_action_t)0  /* none for CSI_ENTRY */,
+    (vtrecv_action_t)0  /* none for CSI_IGNORE */,
+    (vtrecv_action_t)0  /* none for CSI_INTERMEDIATE */,
+    (vtrecv_action_t)0  /* none for CSI_PARAM */,
+    (vtrecv_action_t)0  /* none for DCS_ENTRY */,
+    (vtrecv_action_t)0  /* none for DCS_IGNORE */,
+    (vtrecv_action_t)0  /* none for DCS_INTERMEDIATE */,
+    (vtrecv_action_t)0  /* none for DCS_PARAM */,
+    VTRECV_ACTION_UNHOOK, /* DCS_PASSTHROUGH */
+    (vtrecv_action_t)0  /* none for ESCAPE */,
+    (vtrecv_action_t)0  /* none for ESCAPE_INTERMEDIATE */,
+    (vtrecv_action_t)0  /* none for GROUND */,
+    VTRECV_ACTION_OSC_END, /* OSC_STRING */
+    (vtrecv_action_t)0  /* none for SOS_PM_APC_STRING */,
+};
+
+state_change_t GET_STATE_TABLE(const int state, const int ch)
+{
+#if (USE_ORIGINAL_LUT==1)
+    /*
+     * テーブル参照による実現。
+     * 固定時間で動作するが、コードサイズは比較的大きい。
+     */
+    return STATE_TABLE[state][ch];
+#else
+    /*
+     * プログラムによる線形探索バージョン。
+     * テーブルの後方にあるデータになるほど動作は遅い。
+     * コードサイズはテーブル参照よりも小さい。
+     */
+    const int N = sizeof(table) / sizeof(table[0]);
+    const state_table_t *tp = &table[0];
+    int i;
+    for (i = 0; i < N; i++) {
+        if (tp->state == state) {
+            if ((tp->code_start <= ch) && (ch <= tp->code_end)) {
+                return tp->state_change;
+            }
+        }
+        tp++;
+    }
+    return 0;
+#endif
+}
+
+vtrecv_action_t GET_ENTRY_ACTIONS(const int state)
+{
+    return ENTRY_ACTIONS[state];
+}
+
+vtrecv_action_t GET_EXIT_ACTIONS(const int state)
+{
+    return EXIT_ACTIONS[state];
+}
+
+void vtrecv_init(vtrecv_t *parser, vtrecv_callback_t cb)
+{
+    parser->state                 = VTRECV_STATE_GROUND;
+    parser->intermediate_chars[0] = '\0';
+    parser->num_params            = 0;
+    parser->ignore_flagged        = 0;
+    parser->cb                    = cb;
+}
+
+static void do_action(vtrecv_t *parser, vtrecv_action_t action, char ch)
+{
+    /* Some actions we handle internally (like parsing parameters), others
+     * we hand to our client for processing */
+
+    switch(action) {
+        case VTRECV_ACTION_PRINT:
+        case VTRECV_ACTION_EXECUTE:
+        case VTRECV_ACTION_HOOK:
+        case VTRECV_ACTION_PUT:
+        case VTRECV_ACTION_OSC_START:
+        case VTRECV_ACTION_OSC_PUT:
+        case VTRECV_ACTION_OSC_END:
+        case VTRECV_ACTION_UNHOOK:
+        case VTRECV_ACTION_CSI_DISPATCH:
+        case VTRECV_ACTION_ESC_DISPATCH:
+            parser->cb(parser, action, ch);
+            break;
+
+        case VTRECV_ACTION_IGNORE:
+            /* do nothing */
+            break;
+
+        case VTRECV_ACTION_COLLECT:
+            {
+                /* Append the character to the intermediate params */
+                int num_intermediate_chars = vtrecv_strlen((char*)parser->intermediate_chars);
+
+                if(num_intermediate_chars + 1 > MAX_INTERMEDIATE_CHARS)
+                    parser->ignore_flagged = 1;
+                else
+                    parser->intermediate_chars[num_intermediate_chars++] = ch;
+
+                break;
+            }
+
+        case VTRECV_ACTION_PARAM:
+            {
+                /* process the param character */
+                if(ch == ';')
+                {
+                    parser->num_params += 1;
+                    parser->params[parser->num_params-1] = 0;
+                }
+                else
+                {
+                    /* the character is a digit */
+                    int current_param;
+
+                    if(parser->num_params == 0)
+                    {
+                        parser->num_params = 1;
+                        parser->params[0]  = 0;
+                    }
+
+                    current_param = parser->num_params - 1;
+                    parser->params[current_param] *= 10;
+                    parser->params[current_param] += (ch - '0');
+                }
+
+                break;
+            }
+
+        case VTRECV_ACTION_CLEAR:
+            parser->intermediate_chars[0] = '\0';
+            parser->num_params            = 0;
+            parser->ignore_flagged        = 0;
+            break;
+
+        default:
+            // Internal error: Unknown action.
+            break;
+    }
+}
+
+static void do_state_change(vtrecv_t *parser, state_change_t change, char ch)
+{
+    /* A state change is an action and/or a new state to transition to. */
+
+    vtrecv_state_t  new_state = STATE(change);
+    vtrecv_action_t action    = ACTION(change);
+
+
+    if(new_state)
+    {
+        /* Perform up to three actions:
+         *   1. the exit action of the old state
+         *   2. the action associated with the transition
+         *   3. the entry actionk of the new action
+         */
+
+        vtrecv_action_t exit_action = GET_EXIT_ACTIONS(parser->state);
+        vtrecv_action_t entry_action = GET_ENTRY_ACTIONS(new_state);
+
+        if(exit_action)
+            do_action(parser, exit_action, 0);
+
+        if(action)
+            do_action(parser, action, ch);
+
+        if(entry_action)
+            do_action(parser, entry_action, 0);
+
+        parser->state = new_state;
+    }
+    else
+    {
+        do_action(parser, action, ch);
+    }
+}
+
+void vtrecv_execute(vtrecv_t *parser, unsigned char *data, int len)
+{
+    int i;
+    for (i = 0; i < len; i++) {
+        unsigned char ch = data[i];
+
+        /* If a transition is defined from the "anywhere" state, always
+         * use that.  Otherwise use the transition from the current state. */
+
+        state_change_t change = GET_STATE_TABLE(VTRECV_STATE_ANYWHERE, ch);
+
+        if(!change)
+            change = GET_STATE_TABLE(parser->state, ch);
+
+        do_state_change(parser, change, data[i]);
+    }
+}
+
diff --git a/uzumeapp/kernel/uzume/ntshell/vtrecv.h b/uzumeapp/kernel/uzume/ntshell/vtrecv.h
new file mode 100644 (file)
index 0000000..84b2f4a
--- /dev/null
@@ -0,0 +1,82 @@
+/**
+ * @file vtrecv.h
+ * @brief VT100互換の受信用パーサの定義。
+ * @details
+ * An implementation of Paul Williams' DEC compatible state machine parser
+ * This code is in the public domain.
+ *
+ * @author Joshua Haberman <joshua@reverberate.org>
+ * @author Shinichiro Nakamura : Modified for Natural Tiny Shell (NT-Shell)
+ */
+
+#ifndef VTRECV_H
+#define VTRECV_H
+
+#define MAX_INTERMEDIATE_CHARS 2
+#define ACTION(state_change) (vtrecv_action_t)(state_change & 0x0F)
+#define STATE(state_change)  (vtrecv_state_t)(state_change >> 4)
+
+typedef enum {
+    VTRECV_STATE_ANYWHERE = 0,
+    VTRECV_STATE_CSI_ENTRY = 1,
+    VTRECV_STATE_CSI_IGNORE = 2,
+    VTRECV_STATE_CSI_INTERMEDIATE = 3,
+    VTRECV_STATE_CSI_PARAM = 4,
+    VTRECV_STATE_DCS_ENTRY = 5,
+    VTRECV_STATE_DCS_IGNORE = 6,
+    VTRECV_STATE_DCS_INTERMEDIATE = 7,
+    VTRECV_STATE_DCS_PARAM = 8,
+    VTRECV_STATE_DCS_PASSTHROUGH = 9,
+    VTRECV_STATE_ESCAPE = 10,
+    VTRECV_STATE_ESCAPE_INTERMEDIATE = 11,
+    VTRECV_STATE_GROUND = 12,
+    VTRECV_STATE_OSC_STRING = 13,
+    VTRECV_STATE_SOS_PM_APC_STRING = 14,
+} vtrecv_state_t;
+
+typedef enum {
+    VTRECV_ACTION_CLEAR = 1,
+    VTRECV_ACTION_COLLECT = 2,
+    VTRECV_ACTION_CSI_DISPATCH = 3,
+    VTRECV_ACTION_ESC_DISPATCH = 4,
+    VTRECV_ACTION_EXECUTE = 5,
+    VTRECV_ACTION_HOOK = 6,
+    VTRECV_ACTION_IGNORE = 7,
+    VTRECV_ACTION_OSC_END = 8,
+    VTRECV_ACTION_OSC_PUT = 9,
+    VTRECV_ACTION_OSC_START = 10,
+    VTRECV_ACTION_PARAM = 11,
+    VTRECV_ACTION_PRINT = 12,
+    VTRECV_ACTION_PUT = 13,
+    VTRECV_ACTION_UNHOOK = 14,
+} vtrecv_action_t;
+
+typedef unsigned char state_change_t;
+
+struct vtrecv;
+
+typedef void (*vtrecv_callback_t)(struct vtrecv*, vtrecv_action_t, unsigned char);
+
+typedef struct vtrecv {
+    vtrecv_state_t    state;
+    vtrecv_callback_t cb;
+    unsigned char      intermediate_chars[MAX_INTERMEDIATE_CHARS+1];
+    char               ignore_flagged;
+    int                params[16];
+    int                num_params;
+    void*              user_data;
+} vtrecv_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void vtrecv_init(vtrecv_t *parser, vtrecv_callback_t cb);
+void vtrecv_execute(vtrecv_t *parser, unsigned char *data, int len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/uzumeapp/kernel/uzume/ntshell/vtsend.c b/uzumeapp/kernel/uzume/ntshell/vtsend.c
new file mode 100644 (file)
index 0000000..5362a46
--- /dev/null
@@ -0,0 +1,273 @@
+/**
+ * @file vtsend.c
+ * @author Shinichiro Nakamura
+ * @brief VT100 Senderの実装。
+ */
+
+/*
+ * ===============================================================
+ *  Natural Tiny Shell (NT-Shell)
+ * ===============================================================
+ * Copyright (c) 2010-2012 Shinichiro Nakamura
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ * ===============================================================
+ */
+
+#include "vtsend.h"
+
+#define ESC (0x1B)
+#define UART_WRITE(P, BUF, SIZ)   (P)->uart_write(BUF, SIZ, (P)->extobj)
+
+int vtsend_init(vtsend_t *p, VTSEND_SERIAL_WRITE uart_write, void *extobj)
+{
+    p->uart_write = uart_write;
+    p->extobj = extobj;
+    return 0;
+}
+
+int vtsend_cursor_position(vtsend_t *p, const int column, const int line)
+{
+    char buf[8];
+    buf[0] = ESC;
+    buf[1] = '[';
+    buf[2] = '0' + (line / 10);
+    buf[3] = '0' + (line % 10);
+    buf[4] = ';';
+    buf[5] = '0' + (column / 10);
+    buf[6] = '0' + (column % 10);
+    buf[7] = 'H';
+    UART_WRITE(p, buf, sizeof(buf));
+    return 0;
+}
+
+int vtsend_cursor_up(vtsend_t *p, const int n)
+{
+    char buf[5];
+    buf[0] = ESC;
+    buf[1] = '[';
+    buf[2] = '0' + (n / 10);
+    buf[3] = '0' + (n % 10);
+    buf[4] = 'A';
+    UART_WRITE(p, buf, sizeof(buf));
+    return 0;
+}
+
+int vtsend_cursor_down(vtsend_t *p, const int n)
+{
+    char buf[5];
+    buf[0] = ESC;
+    buf[1] = '[';
+    buf[2] = '0' + (n / 10);
+    buf[3] = '0' + (n % 10);
+    buf[4] = 'B';
+    UART_WRITE(p, buf, sizeof(buf));
+    return 0;
+}
+
+int vtsend_cursor_forward(vtsend_t *p, const int n)
+{
+    char buf[5];
+    buf[0] = ESC;
+    buf[1] = '[';
+    buf[2] = '0' + (n / 10);
+    buf[3] = '0' + (n % 10);
+    buf[4] = 'C';
+    UART_WRITE(p, buf, sizeof(buf));
+    return 0;
+}
+
+int vtsend_cursor_backward(vtsend_t *p, const int n)
+{
+    char buf[5];
+    buf[0] = ESC;
+    buf[1] = '[';
+    buf[2] = '0' + (n / 10);
+    buf[3] = '0' + (n % 10);
+    buf[4] = 'D';
+    UART_WRITE(p, buf, sizeof(buf));
+    return 0;
+}
+
+int vtsend_cursor_position_save(vtsend_t *p)
+{
+    char buf[3];
+    buf[0] = ESC;
+    buf[1] = '[';
+    buf[2] = 's';
+    UART_WRITE(p, buf, sizeof(buf));
+    return 0;
+}
+
+int vtsend_cursor_position_restore(vtsend_t *p)
+{
+    char buf[3];
+    buf[0] = ESC;
+    buf[1] = '[';
+    buf[2] = 'u';
+    UART_WRITE(p, buf, sizeof(buf));
+    return 0;
+}
+
+int vtsend_erase_display(vtsend_t *p)
+{
+    char buf[4];
+    buf[0] = ESC;
+    buf[1] = '[';
+    buf[2] = '2';
+    buf[3] = 'J';
+    UART_WRITE(p, buf, sizeof(buf));
+    return 0;
+}
+
+int vtsend_erase_line(vtsend_t *p)
+{
+    char buf[4];
+    buf[0] = ESC;
+    buf[1] = '[';
+    buf[2] = '2';
+    buf[3] = 'K';
+    UART_WRITE(p, buf, sizeof(buf));
+    return 0;
+}
+
+int vtsend_set_color_foreground(vtsend_t *p, const int color)
+{
+    char buf[5];
+    buf[0] = ESC;
+    buf[1] = '[';
+    buf[2] = '0' + ((30 + color) / 10);
+    buf[3] = '0' + ((30 + color) % 10);
+    buf[4] = 'm';
+    UART_WRITE(p, buf, sizeof(buf));
+    return 0;
+}
+
+int vtsend_set_color_background(vtsend_t *p, const int color)
+{
+    char buf[5];
+    buf[0] = ESC;
+    buf[1] = '[';
+    buf[2] = '0' + ((40 + color) / 10);
+    buf[3] = '0' + ((40 + color) % 10);
+    buf[4] = 'm';
+    UART_WRITE(p, buf, sizeof(buf));
+    return 0;
+}
+
+int vtsend_set_attribute(vtsend_t *p, const int attr)
+{
+    char buf[5];
+    buf[0] = ESC;
+    buf[1] = '[';
+    buf[2] = '0' + ((attr) / 10);
+    buf[3] = '0' + ((attr) % 10);
+    buf[4] = 'm';
+    UART_WRITE(p, buf, sizeof(buf));
+    return 0;
+}
+
+int vtsend_set_scroll_region(vtsend_t *p, const int top, const int bottom)
+{
+    char buf[8];
+    buf[0] = ESC;
+    buf[1] = '[';
+    buf[2] = '0' + (top / 10);
+    buf[3] = '0' + (top % 10);
+    buf[4] = ';';
+    buf[5] = '0' + (bottom / 10);
+    buf[6] = '0' + (bottom % 10);
+    buf[7] = 'r';
+    UART_WRITE(p, buf, sizeof(buf));
+    return 0;
+}
+
+int vtsend_set_cursor(vtsend_t *p, const int visible)
+{
+    if (visible) {
+        char buf[6];
+        buf[0] = ESC;
+        buf[1] = '[';
+        buf[2] = '?';
+        buf[3] = '2';
+        buf[4] = '5';
+        buf[5] = 'h';
+        UART_WRITE(p, buf, sizeof(buf));
+    } else {
+        char buf[6];
+        buf[0] = ESC;
+        buf[1] = '[';
+        buf[2] = '?';
+        buf[3] = '2';
+        buf[4] = '5';
+        buf[5] = 'l';
+        UART_WRITE(p, buf, sizeof(buf));
+    }
+    return 0;
+}
+
+int vtsend_reset(vtsend_t *p)
+{
+    char buf[2];
+    buf[0] = ESC;
+    buf[1] = 'c';
+    UART_WRITE(p, buf, sizeof(buf));
+    return 0;
+}
+
+int vtsend_draw_box(
+        vtsend_t *p,
+        const int x1, const int y1, const int x2, const int y2)
+{
+    int i;
+
+    vtsend_cursor_position(p, x1, y1);
+    for (i = x1; i <= x2; i++) {
+        UART_WRITE(p, " ", 1);
+    }
+    vtsend_cursor_position(p, x1, y2);
+    for (i = x1; i <= x2; i++) {
+        UART_WRITE(p, " ", 1);
+    }
+    for (i = y1; i <= y2; i++) {
+        vtsend_cursor_position(p, x1, i);
+        UART_WRITE(p, " ", 1);
+        vtsend_cursor_position(p, x2, i);
+        UART_WRITE(p, " ", 1);
+    }
+    return 0;
+}
+
+int vtsend_fill_box(
+        vtsend_t *p,
+        const int x1, const int y1, const int x2, const int y2)
+{
+    int i, j;
+    for (i = y1; i <= y2; i++) {
+        vtsend_cursor_position(p, x1, i);
+        for (j = x1; j <= x2; j++) {
+            UART_WRITE(p, " ", 1);
+        }
+    }
+    return 0;
+}
+
diff --git a/uzumeapp/kernel/uzume/ntshell/vtsend.h b/uzumeapp/kernel/uzume/ntshell/vtsend.h
new file mode 100644 (file)
index 0000000..b451be8
--- /dev/null
@@ -0,0 +1,95 @@
+/**
+ * @file vtsend.h
+ * @author Shinichiro Nakamura
+ * @brief VT100 Senderの定義。
+ */
+
+/*
+ * ===============================================================
+ *  Natural Tiny Shell (NT-Shell)
+ * ===============================================================
+ * Copyright (c) 2010-2012 Shinichiro Nakamura
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ * ===============================================================
+ */
+
+#ifndef VTSEND_H
+#define VTSEND_H
+
+#define VTSEND_COLOR_BLACK      (0)
+#define VTSEND_COLOR_RED        (1)
+#define VTSEND_COLOR_GREEN      (2)
+#define VTSEND_COLOR_YELLOW     (3)
+#define VTSEND_COLOR_BLUE       (4)
+#define VTSEND_COLOR_MAGENTA    (5)
+#define VTSEND_COLOR_CYAN       (6)
+#define VTSEND_COLOR_WHITE      (7)
+
+#define VTSEND_ATTR_OFF             (0)
+#define VTSEND_ATTR_BOLD_ON         (1)
+#define VTSEND_ATTR_UNDERSCORE      (4)
+#define VTSEND_ATTR_BLINK_ON        (5)
+#define VTSEND_ATTR_REVERSE         (7)
+#define VTSEND_ATTR_CONCEALED_ON    (8)
+
+typedef int (*VTSEND_SERIAL_WRITE)(const char *buf, const int siz, void *extobj);
+
+typedef struct {
+    VTSEND_SERIAL_WRITE uart_write;
+    void *extobj;
+} vtsend_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int vtsend_init(vtsend_t *p, VTSEND_SERIAL_WRITE uart_write, void *extobj);
+int vtsend_cursor_position(vtsend_t *p, const int column, const int line);
+int vtsend_cursor_up(vtsend_t *p, const int n);
+int vtsend_cursor_down(vtsend_t *p, const int n);
+int vtsend_cursor_forward(vtsend_t *p, const int n);
+int vtsend_cursor_backward(vtsend_t *p, const int n);
+int vtsend_cursor_position_save(vtsend_t *p);
+int vtsend_cursor_position_restore(vtsend_t *p);
+int vtsend_erase_display(vtsend_t *p);
+int vtsend_erase_line(vtsend_t *p);
+int vtsend_set_color_foreground(vtsend_t *p, const int color);
+int vtsend_set_color_background(vtsend_t *p, const int color);
+int vtsend_set_attribute(vtsend_t *p, const int attr);
+int vtsend_set_scroll_region(vtsend_t *p, const int top, const int bottom);
+int vtsend_set_cursor(vtsend_t *p, const int visible);
+int vtsend_reset(vtsend_t *p);
+
+int vtsend_draw_box(
+        vtsend_t *p,
+        const int x1, const int y1, const int x2, const int y2);
+int vtsend_fill_box(
+        vtsend_t *p,
+        const int x1, const int y1, const int x2, const int y2);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/uzumeapp/kernel/uzume/ntshell/xprintf.c b/uzumeapp/kernel/uzume/ntshell/xprintf.c
new file mode 100644 (file)
index 0000000..fde70b2
--- /dev/null
@@ -0,0 +1,395 @@
+/*------------------------------------------------------------------------/\r
+  /  Universal string handler for user console interface\r
+  /-------------------------------------------------------------------------/\r
+  /\r
+  /  Copyright (C) 2011, ChaN, all right reserved.\r
+  /\r
+  / * This software is a free software and there is NO WARRANTY.\r
+  / * No restriction on use. You can use, modify and redistribute it for\r
+  /   personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY.\r
+  / * Redistributions of source code must retain the above copyright notice.\r
+  /\r
+  /-------------------------------------------------------------------------*/\r
+\r
+#include "xprintf.h"\r
+\r
+\r
+#if _USE_XFUNC_OUT\r
+#include <stdarg.h>\r
+void (*xfunc_out)(unsigned char); /* Pointer to the output stream */\r
+static char *outptr;\r
+\r
+/*----------------------------------------------*/\r
+/* Put a character                              */\r
+/*----------------------------------------------*/\r
+\r
+void xputc (char c)\r
+{\r
+    if (_CR_CRLF && c == '\n') xputc('\r');  /* CR -> CRLF */\r
+\r
+    if (outptr) {\r
+        *outptr++ = (unsigned char)c;\r
+        return;\r
+    }\r
+\r
+    if (xfunc_out) xfunc_out((unsigned char)c);\r
+}\r
+\r
+\r
+\r
+/*----------------------------------------------*/\r
+/* Put a null-terminated string                 */\r
+/*----------------------------------------------*/\r
+\r
+void xputs (     /* Put a string to the default device */\r
+        const char* str    /* Pointer to the string */\r
+        )\r
+{\r
+    while (*str)\r
+        xputc(*str++);\r
+}\r
+\r
+\r
+    void xfputs (     /* Put a string to the specified device */\r
+            void(*func)(unsigned char), /* Pointer to the output function */\r
+            const char* str    /* Pointer to the string */\r
+            )\r
+{\r
+    void (*pf)(unsigned char);\r
+\r
+\r
+    pf = xfunc_out;  /* Save current output device */\r
+    xfunc_out = func; /* Switch output to specified device */\r
+    while (*str)  /* Put the string */\r
+        xputc(*str++);\r
+    xfunc_out = pf;  /* Restore output device */\r
+}\r
+\r
+\r
+\r
+/*----------------------------------------------*/\r
+/* Formatted string output                      */\r
+/*----------------------------------------------*/\r
+/*  xprintf("%d", 1234);   "1234"\r
+    xprintf("%6d,%3d%%", -200, 5); "  -200,  5%"\r
+    xprintf("%-6u", 100);   "100   "\r
+    xprintf("%ld", 12345678L);  "12345678"\r
+    xprintf("%04x", 0xA3);   "00a3"\r
+    xprintf("%08LX", 0x123ABC);  "00123ABC"\r
+    xprintf("%016b", 0x550F);  "0101010100001111"\r
+    xprintf("%s", "String");  "String"\r
+    xprintf("%-4s", "abc");   "abc "\r
+    xprintf("%4s", "abc");   " abc"\r
+    xprintf("%c", 'a');    "a"\r
+    xprintf("%f", 10.0);            <xprintf lacks floating point support>\r
+    */\r
+\r
+    static\r
+void xvprintf (\r
+        const char* fmt, /* Pointer to the format string */\r
+        va_list arp   /* Pointer to arguments */\r
+        )\r
+{\r
+    unsigned int r, i, j, w, f;\r
+    unsigned long v;\r
+    char s[16], c, d, *p;\r
+\r
+\r
+    for (;;) {\r
+        c = *fmt++;     /* Get a char */\r
+        if (!c) break;    /* End of format? */\r
+        if (c != '%') {    /* Pass through it if not a % sequense */\r
+            xputc(c); continue;\r
+        }\r
+        f = 0;\r
+        c = *fmt++;     /* Get first char of the sequense */\r
+        if (c == '0') {    /* Flag: '0' padded */\r
+            f = 1; c = *fmt++;\r
+        } else {\r
+            if (c == '-') {   /* Flag: left justified */\r
+                f = 2; c = *fmt++;\r
+            }\r
+        }\r
+        for (w = 0; c >= '0' && c <= '9'; c = *fmt++) /* Minimum width */\r
+            w = w * 10 + c - '0';\r
+        if (c == 'l' || c == 'L') { /* Prefix: Size is long int */\r
+            f |= 4; c = *fmt++;\r
+        }\r
+        if (!c) break;    /* End of format? */\r
+        d = c;\r
+        if (d >= 'a') d -= 0x20;\r
+        switch (d) {    /* Type is... */\r
+            case 'S' :     /* String */\r
+                p = va_arg(arp, char*);\r
+                for (j = 0; p[j]; j++) ;\r
+                while (!(f & 2) && j++ < w) xputc(' ');\r
+                xputs(p);\r
+                while (j++ < w) xputc(' ');\r
+                continue;\r
+            case 'C' :     /* Character */\r
+                xputc((char)va_arg(arp, int)); continue;\r
+            case 'B' :     /* Binary */\r
+                r = 2; break;\r
+            case 'O' :     /* Octal */\r
+                r = 8; break;\r
+            case 'D' :     /* Signed decimal */\r
+            case 'U' :     /* Unsigned decimal */\r
+                r = 10; break;\r
+            case 'X' :     /* Hexdecimal */\r
+                r = 16; break;\r
+            default:     /* Unknown type (passthrough) */\r
+                xputc(c); continue;\r
+        }\r
+\r
+        /* Get an argument and put it in numeral */\r
+        v = (f & 4) ? va_arg(arp, long) : ((d == 'D') ? (long)va_arg(arp, int) : (long)va_arg(arp, unsigned int));\r
+        if (d == 'D' && (v & 0x80000000)) {\r
+            v = 0 - v;\r
+            f |= 8;\r
+        }\r
+        i = 0;\r
+        do {\r
+            d = (char)(v % r); v /= r;\r
+            if (d > 9) d += (c == 'x') ? 0x27 : 0x07;\r
+            s[i++] = d + '0';\r
+        } while (v && i < sizeof(s));\r
+        if (f & 8) s[i++] = '-';\r
+        j = i; d = (f & 1) ? '0' : ' ';\r
+        while (!(f & 2) && j++ < w) xputc(d);\r
+        do xputc(s[--i]); while(i);\r
+        while (j++ < w) xputc(' ');\r
+    }\r
+}\r
+\r
+\r
+void xprintf (   /* Put a formatted string to the default device */\r
+        const char* fmt, /* Pointer to the format string */\r
+        ...     /* Optional arguments */\r
+        )\r
+{\r
+    va_list arp;\r
+\r
+\r
+    va_start(arp, fmt);\r
+    xvprintf(fmt, arp);\r
+    va_end(arp);\r
+}\r
+\r
+\r
+void xsprintf (   /* Put a formatted string to the memory */\r
+        char* buff,   /* Pointer to the output buffer */\r
+        const char* fmt, /* Pointer to the format string */\r
+        ...     /* Optional arguments */\r
+        )\r
+{\r
+    va_list arp;\r
+\r
+\r
+    outptr = buff;  /* Switch destination for memory */\r
+\r
+    va_start(arp, fmt);\r
+    xvprintf(fmt, arp);\r
+    va_end(arp);\r
+\r
+    *outptr = 0;  /* Terminate output string with a \0 */\r
+    outptr = 0;   /* Switch destination for device */\r
+}\r
+\r
+\r
+    void xfprintf (     /* Put a formatted string to the specified device */\r
+            void(*func)(unsigned char), /* Pointer to the output function */\r
+            const char* fmt,   /* Pointer to the format string */\r
+            ...       /* Optional arguments */\r
+            )\r
+{\r
+    va_list arp;\r
+    void (*pf)(unsigned char);\r
+\r
+\r
+    pf = xfunc_out;  /* Save current output device */\r
+    xfunc_out = func; /* Switch output to specified device */\r
+\r
+    va_start(arp, fmt);\r
+    xvprintf(fmt, arp);\r
+    va_end(arp);\r
+\r
+    xfunc_out = pf;  /* Restore output device */\r
+}\r
+\r
+\r
+\r
+/*----------------------------------------------*/\r
+/* Dump a line of binary dump                   */\r
+/*----------------------------------------------*/\r
+\r
+void put_dump (\r
+        const void* buff,  /* Pointer to the array to be dumped */\r
+        unsigned long addr,  /* Heading address value */\r
+        int len,    /* Number of items to be dumped */\r
+        int width    /* Size of the items (DF_CHAR, DF_SHORT, DF_LONG) */\r
+        )\r
+{\r
+    int i;\r
+    const unsigned char *bp;\r
+    const unsigned short *sp;\r
+    const unsigned long *lp;\r
+\r
+\r
+    xprintf("%08lX ", addr);  /* address */\r
+\r
+    switch (width) {\r
+        case DW_CHAR:\r
+            bp = buff;\r
+            for (i = 0; i < len; i++)  /* Hexdecimal dump */\r
+                xprintf(" %02X", bp[i]);\r
+            xputc(' ');\r
+            for (i = 0; i < len; i++)  /* ASCII dump */\r
+                xputc((bp[i] >= ' ' && bp[i] <= '~') ? bp[i] : '.');\r
+            break;\r
+        case DW_SHORT:\r
+            sp = buff;\r
+            do        /* Hexdecimal dump */\r
+                xprintf(" %04X", *sp++);\r
+            while (--len);\r
+            break;\r
+        case DW_LONG:\r
+            lp = buff;\r
+            do        /* Hexdecimal dump */\r
+                xprintf(" %08LX", *lp++);\r
+            while (--len);\r
+            break;\r
+    }\r
+\r
+    xputc('\n');\r
+}\r
+\r
+#endif /* _USE_XFUNC_OUT */\r
+\r
+\r
+\r
+#if _USE_XFUNC_IN\r
+unsigned char (*xfunc_in)(void); /* Pointer to the input stream */\r
+\r
+/*----------------------------------------------*/\r
+/* Get a line from the input                    */\r
+/*----------------------------------------------*/\r
+\r
+int xgets (  /* 0:End of stream, 1:A line arrived */\r
+        char* buff, /* Pointer to the buffer */\r
+        int len  /* Buffer length */\r
+        )\r
+{\r
+    int c, i;\r
+\r
+\r
+    if (!xfunc_in) return 0;  /* No input function specified */\r
+\r
+    i = 0;\r
+    for (;;) {\r
+        c = xfunc_in();    /* Get a char from the incoming stream */\r
+        if (!c) return 0;   /* End of stream? */\r
+        if (c == '\r') break;  /* End of line? */\r
+        if (c == '\b' && i) {  /* Back space? */\r
+            i--;\r
+            if (_LINE_ECHO) xputc(c);\r
+            continue;\r
+        }\r
+        if (c >= ' ' && i < len - 1) { /* Visible chars */\r
+            buff[i++] = c;\r
+            if (_LINE_ECHO) xputc(c);\r
+        }\r
+    }\r
+    buff[i] = 0; /* Terminate with a \0 */\r
+    if (_LINE_ECHO) xputc('\n');\r
+    return 1;\r
+}\r
+\r
+\r
+    int xfgets ( /* 0:End of stream, 1:A line arrived */\r
+            unsigned char (*func)(void), /* Pointer to the input stream function */\r
+            char* buff, /* Pointer to the buffer */\r
+            int len  /* Buffer length */\r
+            )\r
+{\r
+    unsigned char (*pf)(void);\r
+    int n;\r
+\r
+\r
+    pf = xfunc_in;   /* Save current input device */\r
+    xfunc_in = func;  /* Switch input to specified device */\r
+    n = xgets(buff, len); /* Get a line */\r
+    xfunc_in = pf;   /* Restore input device */\r
+\r
+    return n;\r
+}\r
+\r
+\r
+/*----------------------------------------------*/\r
+/* Get a value of the string                    */\r
+/*----------------------------------------------*/\r
+/* "123 -5   0x3ff 0b1111 0377  w "\r
+   ^                           1st call returns 123 and next ptr\r
+   ^                        2nd call returns -5 and next ptr\r
+   ^                3rd call returns 1023 and next ptr\r
+   ^         4th call returns 15 and next ptr\r
+   ^    5th call returns 255 and next ptr\r
+   ^ 6th call fails and returns 0\r
+   */\r
+\r
+int xatoi (   /* 0:Failed, 1:Successful */\r
+        char **str,  /* Pointer to pointer to the string */\r
+        long *res  /* Pointer to the valiable to store the value */\r
+        )\r
+{\r
+    unsigned long val;\r
+    unsigned char c, r, s = 0;\r
+\r
+\r
+    *res = 0;\r
+\r
+    while ((c = **str) == ' ') (*str)++; /* Skip leading spaces */\r
+\r
+    if (c == '-') {  /* negative? */\r
+        s = 1;\r
+        c = *(++(*str));\r
+    }\r
+\r
+    if (c == '0') {\r
+        c = *(++(*str));\r
+        switch (c) {\r
+            case 'x':  /* hexdecimal */\r
+                r = 16; c = *(++(*str));\r
+                break;\r
+            case 'b':  /* binary */\r
+                r = 2; c = *(++(*str));\r
+                break;\r
+            default:\r
+                if (c <= ' ') return 1; /* single zero */\r
+                if (c < '0' || c > '9') return 0; /* invalid char */\r
+                r = 8;  /* octal */\r
+        }\r
+    } else {\r
+        if (c < '0' || c > '9') return 0; /* EOL or invalid char */\r
+        r = 10;   /* decimal */\r
+    }\r
+\r
+    val = 0;\r
+    while (c > ' ') {\r
+        if (c >= 'a') c -= 0x20;\r
+        c -= '0';\r
+        if (c >= 17) {\r
+            c -= 7;\r
+            if (c <= 9) return 0; /* invalid char */\r
+        }\r
+        if (c >= r) return 0;  /* invalid char for current radix */\r
+        val = val * r + c;\r
+        c = *(++(*str));\r
+    }\r
+    if (s) val = 0 - val;   /* apply sign if needed */\r
+\r
+    *res = val;\r
+    return 1;\r
+}\r
+\r
+#endif /* _USE_XFUNC_IN */\r
+\r
diff --git a/uzumeapp/kernel/uzume/ntshell/xprintf.h b/uzumeapp/kernel/uzume/ntshell/xprintf.h
new file mode 100644 (file)
index 0000000..4a8af14
--- /dev/null
@@ -0,0 +1,39 @@
+/*------------------------------------------------------------------------*/\r
+/* Universal string handler for user console interface  (C)ChaN, 2011     */\r
+/*------------------------------------------------------------------------*/\r
+\r
+#ifndef _STRFUNC\r
+#define _STRFUNC\r
+\r
+#define _USE_XFUNC_OUT  1 /* 1: Use output functions */\r
+#define _CR_CRLF        1 /* 1: Convert \n ==> \r\n in the output char */\r
+\r
+#define _USE_XFUNC_IN   1 /* 1: Use input function */\r
+#define _LINE_ECHO      1 /* 1: Echo back input chars in xgets function */\r
+\r
+\r
+#if _USE_XFUNC_OUT\r
+#define xdev_out(func) xfunc_out = (void(*)(unsigned char))(func)\r
+extern void (*xfunc_out)(unsigned char);\r
+void xputc (char c);\r
+void xputs (const char* str);\r
+void xfputs (void (*func)(unsigned char), const char* str);\r
+void xprintf (const char* fmt, ...);\r
+void xsprintf (char* buff, const char* fmt, ...);\r
+void xfprintf (void (*func)(unsigned char), const char* fmt, ...);\r
+void put_dump (const void* buff, unsigned long addr, int len, int width);\r
+#define DW_CHAR  sizeof(char)\r
+#define DW_SHORT sizeof(short)\r
+#define DW_LONG  sizeof(long)\r
+#endif\r
+\r
+#if _USE_XFUNC_IN\r
+#define xdev_in(func) xfunc_in = (unsigned char(*)(void))(func)\r
+extern unsigned char (*xfunc_in)(void);\r
+int xgets (char* buff, int len);\r
+int xfgets (unsigned char (*func)(void), char* buff, int len);\r
+int xatoi (char** str, long* res);\r
+#endif\r
+\r
+#endif\r
+\r
diff --git a/uzumeapp/kernel/uzume/rotenc.c b/uzumeapp/kernel/uzume/rotenc.c
new file mode 100644 (file)
index 0000000..7b33ff1
--- /dev/null
@@ -0,0 +1,81 @@
+/**
+ * \file rotenc.c
+ * \author Shinichiro Nakamura
+ * \brief AD799x I2C ADCからデータを読み込み、API経由でアプリケーションへ渡す
+ */
+
+#include <t_services.h>
+#include <s_services.h>
+#include <i2c_subsystem.h>
+#include "kernel_id.h"
+#include "uzume.h"
+#include "rotenc.h"
+
+/**
+ * @brief rotencのチャンネル数
+ */
+#define NUM_CH 4
+
+/**
+ * @brief ADC変換値保存用配列
+ * @details
+ * 変換値を保存する。アクセスは排他的でなければならない。値は符号付き左詰めである。
+ * 整数部はないので、1ビットの符号の右に小数部が連なる。
+ */
+static fract32 values[NUM_CH];
+
+/**
+ * \brief rotenc制御タスク
+ * \param exinf タスク引数。
+ */
+void rotenc_task(VP_INT exinf)
+{
+    while (1) {
+        /* 排他区間開始 */
+        syscall(wai_sem(ROTENC_SEM));
+        values[0] = (((0x0F) << 8) | 0xFF) << 19;
+        values[1] = (((0x0F) << 8) | 0xFF) << 19;
+        values[2] = (((0x0F) << 8) | 0xFF) << 19;
+        values[3] = (((0x0F) << 8) | 0xFF) << 19;
+        syscall(sig_sem(ROTENC_SEM));
+        /* 排他区間終了 */
+
+        tslp_tsk(1);
+    }
+}
+
+/**
+ * \brief ボリューム値の取得
+ * \param ch 0から始まるチャンネル指定番号。(3まで)
+ * \return 32bit符号付き固定小数点数のボリューム値
+ */
+
+fract32 get_volume(unsigned int ch)
+{
+    fract32 retval;
+
+    // パラメータチェック
+    if (ch >= NUM_CH) {
+        ch = NUM_CH - 1;
+    }
+
+    /* 排他区間開始 */
+    syscall(wai_sem(ROTENC_SEM));
+    retval = values[ch];
+    syscall(sig_sem(ROTENC_SEM));
+    /* 排他区間終了 */
+
+    return retval;
+}
+
+/**
+ * \brief ボリューム値の設定
+ * \param ch 0から始まるチャンネル指定番号。rotencは3まで
+ * \param value 32bit符号付き固定小数点数のボリューム設定値
+ * \details
+ * ボリュームに初期値を与える。
+ */
+void set_volume(unsigned int ch, fract32 value)
+{
+}
+
diff --git a/uzumeapp/kernel/uzume/rotenc.cfg b/uzumeapp/kernel/uzume/rotenc.cfg
new file mode 100644 (file)
index 0000000..d9ae61d
--- /dev/null
@@ -0,0 +1,38 @@
+
+/*
+* rotencをボリューム・入力として使うUZUMEのサブシステム(オプション)
+* このコンフィギュレーション・ファイルはBSPのコンフィギュレーション・ファイルから
+* インクルードして使う。
+*
+* 関連するソースは次の2つ
+* rotenc.h
+* rotenc.c
+*/
+
+#define _MACRO_ONLY
+
+INCLUDE("\"rotenc.h\"");
+
+/*
+* プライベートな資源
+*/
+
+    /* rotencサブシステムの排他利用のためのセマフォ */
+CRE_SEM(ROTENC_SEM,
+            {
+                TA_TPRI,    /* タスク優先順位に基づいてセマフォを奪い合う。 */
+                1,          /* 初期状態で資源数は1。すなわち、最初に排他領域を獲得しようとしたタスクは、待ちなしに獲得できる。 */
+                1           /* 最大返却資源数は1。これは PV セマフォによる排他処理を行う場合の普通の値。 */ 
+            }
+        );
+
+CRE_TSK(ROTENC_TASK,
+            {
+                TA_HLNG|TA_ACT,         /* 初期状態からアクティブ */
+                0,                      /* タスク引数(無視) */
+                rotenc_task,            /* タスク本体 */
+                ROTENC_TASK_PRIORITY,   /* タスク優先順位 */
+                ROTENC_TASK_STACK_SIZE, /* タスク・スタックサイズ */
+                NULL                    /* タスク・スタック。NULLならシステムが準備 */
+             });
+
diff --git a/uzumeapp/kernel/uzume/rotenc.h b/uzumeapp/kernel/uzume/rotenc.h
new file mode 100644 (file)
index 0000000..989ee1c
--- /dev/null
@@ -0,0 +1,34 @@
+/**
+ * \file rotenc.h
+ * \author Shinichiro Nakamura
+ * \brief ROTENC制御プログラム
+ * \details
+ * ROTENC制御タスク及びAPI。cfgファイルから読み込んで使う
+ */
+
+
+#ifndef ROTENC_H
+#define ROTENC_H
+
+#include "uzume.h"
+
+/*
+ * タスク優先順位はGUIや一般タスクより低くても構わない。
+ * タスク優先順位とスタックサイズを変更する場合には sys_config.h でマクロ宣言する
+ */
+#ifndef ROTENC_TASK_PRIORITY
+#define ROTENC_TASK_PRIORITY 7
+#endif
+
+#ifndef ROTENC_TASK_STACK_SIZE
+#define ROTENC_TASK_STACK_SIZE 1024
+#endif
+
+
+#ifndef _MACRO_ONLY
+
+extern void rotenc_task(VP_INT exinf);
+
+#endif
+#endif /* ROTENC_H */
+
diff --git a/uzumeapp/kernel/uzume/sgtl5000.c b/uzumeapp/kernel/uzume/sgtl5000.c
new file mode 100644 (file)
index 0000000..8acb139
--- /dev/null
@@ -0,0 +1,74 @@
+/**
+ * @file sgtl5000.c
+ * @author: Shinichiro Nakamura
+ * @brief SGTL5000初期化プログラム
+ * @details
+ * SGTL5000の初期化を行う。I2Cを使って初期化を行う。
+ */
+
+#include "i2s_subsystem.h"
+#include "i2c_subsystem.h"
+
+/**
+ * \brief コーデック初期化データ列の長さ
+ * \details
+ * SGTL5000に与える初期化データの長さである。長さはレジスタアドレスとデータの組が
+ * 何組であるかを示す。
+ */
+#define     CODECINITDATALEN        18      /* SGTL5000初期化データ長 */
+
+#ifndef     UZUME_SGTL5000_I2C_PORT
+    /**
+     * @brief CODECのI2Cポート。
+     * SGTL5000が接続されているI2Cペリフェラルのポート番号。デフォルトは0である。他のポートを使いたい時には
+     * sys_config.hで宣言すると良い。なお、I2Cコントローラ・ペリフェラルがひとつしかない場合には0を指定する。
+     */
+#   define  UZUME_SGTL5000_I2C_PORT   0
+#endif
+
+#ifndef     UZUME_SGTL5000_I2C_ADRS
+    /**
+     * @brief SGTL5000のI2Cデバイスアドレス(7bit右づめ)
+     */
+#   define  UZUME_SGTL5000_I2C_ADRS   0x0A
+#endif
+
+/* SGTL5000 TWI初期化データ列 */
+static const unsigned char sgtl5000_initdata[CODECINITDATALEN][4] =
+{
+    {0x00, 0x02, 0x00, 0x73}, // CHIP_DIG Power     0000-0000 0111-0011
+    {0x00, 0x30, 0x77, 0xFF}, // CHIP_ANA_POWER     0111-0111 1111-1111
+    {0x00, 0x32, 0x83, 0x12}, // CHIP_PLL_CTRL      1000-0011 0001-0010(16/786)
+    {0x00, 0x04, 0x00, 0x0B}, // CHIP_CLK_CTRL      0000-0000 0000-1011
+    {0x00, 0x06, 0x00, 0x80}, // CHIP_I2S_CTRL      0000-0000 1000-0000
+    {0x00, 0x0A, 0x00, 0x10}, // CHIP_SSS_CTRL      0000-0000 0001-0000
+    {0x00, 0x0E, 0x02, 0x00}, // CHIP_ADCDAC_CTRL   0000-0010 0000-0000
+    {0x00, 0x10, 0x3C, 0x3C}, // CHIP_DAC_VOL
+    {0x00, 0x14, 0x01, 0x5F}, // CHIP_PAD_STRENGTH  0000-0001 0101-1111
+    {0x00, 0x20, 0x01, 0x00}, // CHIP_ANA_ADC_CTRL  0000-0001 0000-0000
+    {0x00, 0x22, 0x18, 0x18}, // CHIP_ANA_HP_CTRL
+    {0x00, 0x24, 0x00, 0x04}, // CHIP_ANA_CTRL      0000-0000 0000-0100
+    {0x00, 0x26, 0x00, 0x00}, // CHIP_LINREG_CTRL   0000-0000 0000-0000
+    {0x00, 0x28, 0x00, 0x00}, // CHIP_REF_CTRL      0000-0000 0000-0000
+    {0x00, 0x2A, 0x00, 0x00}, // CHIP_MIC_CTRL      0000-0000 0000-0000
+    {0x00, 0x2C, 0x00, 0x00}, // CHIP_LINE_OUT_CTRL 0000-0000 0000-0000
+    {0x00, 0x2E, 0x06, 0x06}, // CHIP_LINE_OUT_VOL  0000-0110 0000-0110
+    {0x00, 0x34, 0x00, 0x00}, // CHIP_CLK_TOP_CTRL  0000-1000 0000-0000
+};
+
+/**
+ * @brief コーデックの初期化
+ * @details
+ * TLV32AIC23Bに初期化数値列をI2C経由で送り込む。タスクコンテキストで呼び出さなければならない。
+ * 初期化後、TLV32AIC23Bはクロック信号を生成して動作を開始する。
+ */
+void init_codec()
+{
+    int i;
+
+    /* SGTL5000に初期化データを送信する */
+    for ( i=0; i< CODECINITDATALEN; i++){
+        i2c_master_write(UZUME_SGTL5000_I2C_PORT, UZUME_SGTL5000_I2C_ADRS, sgtl5000_initdata[i], 4);
+    }
+}
+