Changeset 9d933f34d0845a0e2174fb91c2fc7809c83c0bdc
- Timestamp:
- 05/08/10 00:41:28 (2 years ago)
- Children:
- 4549db4ca6fda39655fd1888e95e5f415c1bf047
- Parents:
- 06c5c29de5c9c613c7ccb1995d2792ecaa925d68
- git-committer:
- Luper Rouch <flupke@…> (05/08/10 00:41:28)
- Location:
- pompilop
- Files:
-
- 1 added
- 4 edited
-
pompilop/__init__.py (modified) (1 diff)
-
pompilop/bin/pompicontrol.py (added)
-
pompilop/serial/__init__.py (modified) (4 diffs)
-
pompilop/tests/test_serial.py (modified) (1 diff)
-
setup.py (modified) (1 diff, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
pompilop/pompilop/__init__.py
r34b14fc r9d933f3 1 __version__ = "0.1_pre" -
pompilop/pompilop/serial/__init__.py
r34b14fc r9d933f3 56 56 CHANNEL_NAME = "CHN0" 57 57 58 COMMANDS_STRINGS = { 59 "METER": METER, 60 "MUTE": MUTE, 61 "MIX_GAIN": MIX_GAIN, 62 "SIGNAL_LEVEL": SIGNAL_LEVEL, 63 "SIGNAL_POLARITY": SIGNAL_POLARITY, 64 "SIGNAL_DELAY": SIGNAL_DELAY, 65 "EQ_TYPE": EQ_TYPE, 66 "EQ_FREQUENCY": EQ_FREQUENCY, 67 "EQ_LEVEL": EQ_LEVEL, 68 "EQ_BYPASS": EQ_BYPASS, 69 "GEQ_LEVEL": GEQ_LEVEL, 70 "GEQ_BYPASS": GEQ_BYPASS, 71 "CROSSOVER_TYPE": CROSSOVER_TYPE, 72 "CROSSOVER_FREQUENCY": CROSSOVER_FREQUENCY, 73 "CROSSOVER_SLOPE": CROSSOVER_SLOPE, 74 "FIR_TYPE": FIR_TYPE, 75 "FIR_FREQUENCY": FIR_FREQUENCY, 76 "COMPRESSOR_THRESHOLD": COMPRESSOR_THRESHOLD, 77 "COMPRESSOR_ATTACK": COMPRESSOR_ATTACK, 78 "COMPRESSOR_RELEASE": COMPRESSOR_RELEASE, 79 "COMPRESSOR_RATIO": COMPRESSOR_RATIO, 80 "LIMITER_THRESHOLD": LIMITER_THRESHOLD, 81 "LIMITER_ATTACK": LIMITER_ATTACK, 82 "LIMITER_RELEASE": LIMITER_RELEASE, 83 "MIXER": MIXER, 84 "CHANNEL_NAME": CHANNEL_NAME, 85 } 86 58 87 DEVICES_MAX = 16 59 88 CHANNELS_MAX = 8 60 89 AUX_MAX = 32 61 90 62 def __init__(self, command, input, channel, data, device=0):91 def __init__(self, command, input, channel, data, aux=None, device=0): 63 92 self.command = command 64 93 if device < 0 or device >= self.DEVICES_MAX: … … 72 101 self.channel = channel 73 102 self.data = data 103 self.aux = aux 74 104 75 105 def tolist(self): … … 97 127 return ret 98 128 129 @classmethod 130 def from_strings(cls, command, input, channel, data): 131 data = int(data) 132 return Command(cls.COMMANDS_STRINGS[command], input, channel, data) 133 99 134 100 135 def base96(value): 136 """ 137 Convert integer *value* to a string encoded in base 96, shifted by 0x20. 138 """ 101 139 bytes = [] 102 140 while value: … … 142 180 143 181 144 if __name__ == "__main__": 145 # Init serial connection 146 ser = serial.Serial("/dev/tty.usbserial", 115200) 147 182 def send_command(command, write=True, sender=DEFAULT_SENDER, 183 dev="/dev/tty.usbserial"): 184 """ 185 Send a single :class:`Command`. 186 """ 187 cmd_data = format_commands([command], write=write, sender=sender) 188 print cmd_data 189 #ser = serial.Serial(dev, 115200) 190 #ser.write(cmd_data) 191 #ser.close() -
pompilop/pompilop/tests/test_serial.py
r34b14fc r9d933f3 20 20 "\x01\x57\x7F\x03\x4D\x55\x54\x30\x08\x20\x09\x21\x0A" 21 21 "\x22\x10\x21\x1F\x2E\x02"), 22 (Command(Command.EQ_FREQUENCY, True, 3, aux=5), 23 "\x01\x57\x7F\x03\x45\x51\x46\x30\x08\x20\x09\x20\x0A" 24 "\x23\x0B\x25\x10\x21\x1F\x44\x02"), 22 25 ] 23 26 for cmd, expected in data: 24 27 assert_equal(format_commands([cmd]), expected) 25 26 -
pompilop/setup.py
- Property mode changed from 100644 to 100755
r34b14fc r9d933f3 1 #!/usr/bin/env python 2 3 from setuptools import setup, find_packages 4 from pompilop import __version__ 5 6 7 setup( 8 name = "pompilop", 9 version = __version__, 10 author = "Luper Rouch", 11 author_email = "luper.rouch@gmail.com", 12 maintainer = "Luper Rouch", 13 maintainer_email = "luper.rouch@gmail.com", 14 description = "Utilities to control Xilica processors.", 15 long_description = 16 """ 17 Xilica processors offer blablablabl 18 """, 19 setup_requires = ["nose"], 20 install_requires = ["pyserial"], 21 scripts = ["pompilop/bin/pompicontrol.py"], 22 packages = find_packages("."), 23 ) 24
Note: See TracChangeset
for help on using the changeset viewer.
