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 void synth_flush(struct spk_synth *synth);
0020
0021 static struct var_t vars[] = {
0022 { CAPS_START, .u.s = {"\x05P+" } },
0023 { CAPS_STOP, .u.s = {"\x05P-" } },
0024 { RATE, .u.n = {"\x05R%d", 7, 0, 9, 0, 0, NULL } },
0025 { PITCH, .u.n = {"\x05P%d", 3, 0, 9, 0, 0, NULL } },
0026 { VOL, .u.n = {"\x05V%d", 9, 0, 9, 0, 0, NULL } },
0027 { TONE, .u.n = {"\x05T%c", 8, 0, 25, 65, 0, NULL } },
0028 { PUNCT, .u.n = {"\x05M%c", 0, 0, 3, 0, 0, "nsma" } },
0029 { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } },
0030 V_LAST_VAR
0031 };
0032
0033
0034
0035 static struct kobj_attribute caps_start_attribute =
0036 __ATTR(caps_start, 0644, spk_var_show, spk_var_store);
0037 static struct kobj_attribute caps_stop_attribute =
0038 __ATTR(caps_stop, 0644, spk_var_show, spk_var_store);
0039 static struct kobj_attribute pitch_attribute =
0040 __ATTR(pitch, 0644, spk_var_show, spk_var_store);
0041 static struct kobj_attribute punct_attribute =
0042 __ATTR(punct, 0644, spk_var_show, spk_var_store);
0043 static struct kobj_attribute rate_attribute =
0044 __ATTR(rate, 0644, spk_var_show, spk_var_store);
0045 static struct kobj_attribute tone_attribute =
0046 __ATTR(tone, 0644, spk_var_show, spk_var_store);
0047 static struct kobj_attribute vol_attribute =
0048 __ATTR(vol, 0644, spk_var_show, spk_var_store);
0049
0050 static struct kobj_attribute delay_time_attribute =
0051 __ATTR(delay_time, 0644, spk_var_show, spk_var_store);
0052 static struct kobj_attribute direct_attribute =
0053 __ATTR(direct, 0644, spk_var_show, spk_var_store);
0054 static struct kobj_attribute full_time_attribute =
0055 __ATTR(full_time, 0644, spk_var_show, spk_var_store);
0056 static struct kobj_attribute jiffy_delta_attribute =
0057 __ATTR(jiffy_delta, 0644, spk_var_show, spk_var_store);
0058 static struct kobj_attribute trigger_time_attribute =
0059 __ATTR(trigger_time, 0644, spk_var_show, spk_var_store);
0060
0061
0062
0063
0064
0065 static struct attribute *synth_attrs[] = {
0066 &caps_start_attribute.attr,
0067 &caps_stop_attribute.attr,
0068 &pitch_attribute.attr,
0069 &punct_attribute.attr,
0070 &rate_attribute.attr,
0071 &tone_attribute.attr,
0072 &vol_attribute.attr,
0073 &delay_time_attribute.attr,
0074 &direct_attribute.attr,
0075 &full_time_attribute.attr,
0076 &jiffy_delta_attribute.attr,
0077 &trigger_time_attribute.attr,
0078 NULL,
0079 };
0080
0081 static struct spk_synth synth_spkout = {
0082 .name = "spkout",
0083 .version = DRV_VERSION,
0084 .long_name = "Speakout",
0085 .init = "\005W1\005I2\005C3",
0086 .procspeech = PROCSPEECH,
0087 .clear = SYNTH_CLEAR,
0088 .delay = 500,
0089 .trigger = 50,
0090 .jiffies = 50,
0091 .full = 40000,
0092 .dev_name = SYNTH_DEFAULT_DEV,
0093 .startup = SYNTH_START,
0094 .checkval = SYNTH_CHECK,
0095 .vars = vars,
0096 .io_ops = &spk_ttyio_ops,
0097 .probe = spk_ttyio_synth_probe,
0098 .release = spk_ttyio_release,
0099 .synth_immediate = spk_ttyio_synth_immediate,
0100 .catch_up = spk_do_catch_up,
0101 .flush = synth_flush,
0102 .is_alive = spk_synth_is_alive_restart,
0103 .synth_adjust = NULL,
0104 .read_buff_add = NULL,
0105 .get_index = spk_synth_get_index,
0106 .indexing = {
0107 .command = "\x05[%c",
0108 .lowindex = 1,
0109 .highindex = 5,
0110 .currindex = 1,
0111 },
0112 .attributes = {
0113 .attrs = synth_attrs,
0114 .name = "spkout",
0115 },
0116 };
0117
0118 static void synth_flush(struct spk_synth *synth)
0119 {
0120 synth->io_ops->flush_buffer(synth);
0121 synth->io_ops->send_xchar(synth, SYNTH_CLEAR);
0122 }
0123
0124 module_param_named(ser, synth_spkout.ser, int, 0444);
0125 module_param_named(dev, synth_spkout.dev_name, charp, 0444);
0126 module_param_named(start, synth_spkout.startup, short, 0444);
0127
0128 MODULE_PARM_DESC(ser, "Set the serial port for the synthesizer (0-based).");
0129 MODULE_PARM_DESC(dev, "Set the device e.g. ttyUSB0, for the synthesizer.");
0130 MODULE_PARM_DESC(start, "Start the synthesizer once it is loaded.");
0131
0132 module_spk_synth(synth_spkout);
0133
0134 MODULE_AUTHOR("Kirk Reiser <kirk@braille.uwo.ca>");
0135 MODULE_AUTHOR("David Borowski");
0136 MODULE_DESCRIPTION("Speakup support for Speak Out synthesizers");
0137 MODULE_LICENSE("GPL");
0138 MODULE_VERSION(DRV_VERSION);
0139