0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include "spk_priv.h"
0013 #include "speakup.h"
0014
0015 #define DRV_VERSION "2.11"
0016 #define SYNTH_CLEAR 0x18
0017 #define PROCSPEECH '\r'
0018
0019 static struct var_t vars[] = {
0020 { CAPS_START, .u.s = {"\x05P8" } },
0021 { CAPS_STOP, .u.s = {"\x05P5" } },
0022 { RATE, .u.n = {"\x05R%d", 5, 0, 9, 0, 0, NULL } },
0023 { PITCH, .u.n = {"\x05P%d", 5, 0, 9, 0, 0, NULL } },
0024 { VOL, .u.n = {"\x05V%d", 5, 0, 9, 0, 0, NULL } },
0025 { TONE, .u.n = {"\x05T%c", 12, 0, 25, 61, 0, NULL } },
0026 { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } },
0027 V_LAST_VAR
0028 };
0029
0030
0031
0032 static struct kobj_attribute caps_start_attribute =
0033 __ATTR(caps_start, 0644, spk_var_show, spk_var_store);
0034 static struct kobj_attribute caps_stop_attribute =
0035 __ATTR(caps_stop, 0644, spk_var_show, spk_var_store);
0036 static struct kobj_attribute pitch_attribute =
0037 __ATTR(pitch, 0644, spk_var_show, spk_var_store);
0038 static struct kobj_attribute rate_attribute =
0039 __ATTR(rate, 0644, spk_var_show, spk_var_store);
0040 static struct kobj_attribute tone_attribute =
0041 __ATTR(tone, 0644, spk_var_show, spk_var_store);
0042 static struct kobj_attribute vol_attribute =
0043 __ATTR(vol, 0644, spk_var_show, spk_var_store);
0044
0045 static struct kobj_attribute delay_time_attribute =
0046 __ATTR(delay_time, 0644, spk_var_show, spk_var_store);
0047 static struct kobj_attribute direct_attribute =
0048 __ATTR(direct, 0644, spk_var_show, spk_var_store);
0049 static struct kobj_attribute full_time_attribute =
0050 __ATTR(full_time, 0644, spk_var_show, spk_var_store);
0051 static struct kobj_attribute jiffy_delta_attribute =
0052 __ATTR(jiffy_delta, 0644, spk_var_show, spk_var_store);
0053 static struct kobj_attribute trigger_time_attribute =
0054 __ATTR(trigger_time, 0644, spk_var_show, spk_var_store);
0055
0056
0057
0058
0059
0060 static struct attribute *synth_attrs[] = {
0061 &caps_start_attribute.attr,
0062 &caps_stop_attribute.attr,
0063 &pitch_attribute.attr,
0064 &rate_attribute.attr,
0065 &tone_attribute.attr,
0066 &vol_attribute.attr,
0067 &delay_time_attribute.attr,
0068 &direct_attribute.attr,
0069 &full_time_attribute.attr,
0070 &jiffy_delta_attribute.attr,
0071 &trigger_time_attribute.attr,
0072 NULL,
0073 };
0074
0075 static struct spk_synth synth_txprt = {
0076 .name = "txprt",
0077 .version = DRV_VERSION,
0078 .long_name = "Transport",
0079 .init = "\x05N1",
0080 .procspeech = PROCSPEECH,
0081 .clear = SYNTH_CLEAR,
0082 .delay = 500,
0083 .trigger = 50,
0084 .jiffies = 50,
0085 .full = 40000,
0086 .dev_name = SYNTH_DEFAULT_DEV,
0087 .startup = SYNTH_START,
0088 .checkval = SYNTH_CHECK,
0089 .vars = vars,
0090 .io_ops = &spk_ttyio_ops,
0091 .probe = spk_ttyio_synth_probe,
0092 .release = spk_ttyio_release,
0093 .synth_immediate = spk_ttyio_synth_immediate,
0094 .catch_up = spk_do_catch_up,
0095 .flush = spk_synth_flush,
0096 .is_alive = spk_synth_is_alive_restart,
0097 .synth_adjust = NULL,
0098 .read_buff_add = NULL,
0099 .get_index = NULL,
0100 .indexing = {
0101 .command = NULL,
0102 .lowindex = 0,
0103 .highindex = 0,
0104 .currindex = 0,
0105 },
0106 .attributes = {
0107 .attrs = synth_attrs,
0108 .name = "txprt",
0109 },
0110 };
0111
0112 module_param_named(ser, synth_txprt.ser, int, 0444);
0113 module_param_named(dev, synth_txprt.dev_name, charp, 0444);
0114 module_param_named(start, synth_txprt.startup, short, 0444);
0115
0116 MODULE_PARM_DESC(ser, "Set the serial port for the synthesizer (0-based).");
0117 MODULE_PARM_DESC(dev, "Set the device e.g. ttyUSB0, for the synthesizer.");
0118 MODULE_PARM_DESC(start, "Start the synthesizer once it is loaded.");
0119
0120 module_spk_synth(synth_txprt);
0121
0122 MODULE_AUTHOR("Kirk Reiser <kirk@braille.uwo.ca>");
0123 MODULE_AUTHOR("David Borowski");
0124 MODULE_DESCRIPTION("Speakup support for Transport synthesizers");
0125 MODULE_LICENSE("GPL");
0126 MODULE_VERSION(DRV_VERSION);
0127