diff options
author | Alan Aguiar <alanjas@hotmail.com> | 2013-03-03 19:48:39 (GMT) |
---|---|---|
committer | Alan Aguiar <alanjas@hotmail.com> | 2013-03-03 19:48:39 (GMT) |
commit | 3d65986ed32533933eb0f996107285027cc39a71 (patch) | |
tree | 137a3e714da79d2a7e753694136230b67ac61658 /pybot/drivers | |
parent | e54494fe25e5968175d719caab82c860b7afbbb7 (diff) |
add pybot
Diffstat (limited to 'pybot/drivers')
-rw-r--r-- | pybot/drivers/admin.py | 19 | ||||
-rw-r--r-- | pybot/drivers/butia.py | 19 | ||||
-rw-r--r-- | pybot/drivers/hackp.py | 40 | ||||
-rw-r--r-- | pybot/drivers/hotplug/button.py | 19 | ||||
-rw-r--r-- | pybot/drivers/hotplug/distanc.py | 19 | ||||
-rw-r--r-- | pybot/drivers/hotplug/grey.py | 19 | ||||
-rw-r--r-- | pybot/drivers/hotplug/led.py | 19 | ||||
-rw-r--r-- | pybot/drivers/hotplug/light.py | 19 | ||||
-rw-r--r-- | pybot/drivers/hotplug/res.py | 19 | ||||
-rw-r--r-- | pybot/drivers/hotplug/volt.py | 19 | ||||
-rw-r--r-- | pybot/drivers/lback.py | 19 | ||||
-rw-r--r-- | pybot/drivers/motors.py | 27 | ||||
-rw-r--r-- | pybot/drivers/pnp.py | 11 |
13 files changed, 268 insertions, 0 deletions
diff --git a/pybot/drivers/admin.py b/pybot/drivers/admin.py new file mode 100644 index 0000000..5e4e192 --- /dev/null +++ b/pybot/drivers/admin.py @@ -0,0 +1,19 @@ + +RESET = 0xFF +GET_FIRMWARE_VERSION = 0xFE + +f1 = { + 'name': 'reset', + 'call': RESET, + 'params': 0, + 'read': 0 +} + +f2 = { + 'name': 'getVersion', + 'call': GET_FIRMWARE_VERSION, + 'params': 0, + 'read': 1 +} + +FUNCTIONS = [f1, f2] diff --git a/pybot/drivers/butia.py b/pybot/drivers/butia.py new file mode 100644 index 0000000..74f6f0f --- /dev/null +++ b/pybot/drivers/butia.py @@ -0,0 +1,19 @@ + +RD_VERSION = 0x02 +GET_VOLT = 0x03 + +f1 = { + 'name': 'read_ver', + 'call': RD_VERSION, + 'params': 0, + 'read': 2 +} + +f2 = { + 'name': 'get_volt', + 'call': GET_VOLT, + 'params': 0, + 'read': 2 +} + +FUNCTIONS = [f1, f2] diff --git a/pybot/drivers/hackp.py b/pybot/drivers/hackp.py new file mode 100644 index 0000000..4e9c963 --- /dev/null +++ b/pybot/drivers/hackp.py @@ -0,0 +1,40 @@ + +RD_VERSION = 0x00 +SET_MODE = 0x01 +READ = 0x02 +WRITE = 0x03 +WRITE_PORT = 0x04 +PORT_IN = 0x05 +PORT_OUT = 0x06 + + +f1 = { + 'name': 'getVersion', + 'call': RD_VERSION, + 'params': 0, + 'read': 3 +} + +f2 = { + 'name': 'setMode', + 'call': SET_MODE, + 'params': 2, + 'read': 1 +} + +f3 = { + 'name': 'read', + 'call': READ, + 'params': 1, + 'read': 1 +} + +f4 = { + 'name': 'write', + 'call': WRITE, + 'params': 2, + 'read': 1 +} + +FUNCTIONS = [f1, f2, f3, f4] + diff --git a/pybot/drivers/hotplug/button.py b/pybot/drivers/hotplug/button.py new file mode 100644 index 0000000..f714ecf --- /dev/null +++ b/pybot/drivers/hotplug/button.py @@ -0,0 +1,19 @@ + +RD_VERSION = 0x00 +GET_VALUE = 0x01 + +f1 = { + 'name': 'getVersion', + 'call': RD_VERSION, + 'params': 0, + 'read': 3 +} + +f2 = { + 'name': 'getValue', + 'call': GET_VALUE, + 'params': 0, + 'read': 2 +} + +FUNCTIONS = [f1, f2] diff --git a/pybot/drivers/hotplug/distanc.py b/pybot/drivers/hotplug/distanc.py new file mode 100644 index 0000000..db7e1c1 --- /dev/null +++ b/pybot/drivers/hotplug/distanc.py @@ -0,0 +1,19 @@ + +RD_VERSION = 0x00 +GET_VALUE = 0x01 + +f1 = { + 'name': 'getVersion', + 'call': RD_VERSION, + 'params': 0, + 'read': 3 +} + +f2 = { + 'name': 'getValue', + 'call': GET_VALUE, + 'params': 0, + 'read': 3 +} + +FUNCTIONS = [f1, f2] diff --git a/pybot/drivers/hotplug/grey.py b/pybot/drivers/hotplug/grey.py new file mode 100644 index 0000000..db7e1c1 --- /dev/null +++ b/pybot/drivers/hotplug/grey.py @@ -0,0 +1,19 @@ + +RD_VERSION = 0x00 +GET_VALUE = 0x01 + +f1 = { + 'name': 'getVersion', + 'call': RD_VERSION, + 'params': 0, + 'read': 3 +} + +f2 = { + 'name': 'getValue', + 'call': GET_VALUE, + 'params': 0, + 'read': 3 +} + +FUNCTIONS = [f1, f2] diff --git a/pybot/drivers/hotplug/led.py b/pybot/drivers/hotplug/led.py new file mode 100644 index 0000000..0703d54 --- /dev/null +++ b/pybot/drivers/hotplug/led.py @@ -0,0 +1,19 @@ + +RD_VERSION = 0x00 +TURN = 0x01 + +f1 = { + 'name': 'getVersion', + 'call': RD_VERSION, + 'params': 0, + 'read': 3 +} + +f2 = { + 'name': 'turn', + 'call': TURN, + 'params': 1, + 'read': 1 +} + +FUNCTIONS = [f1, f2] diff --git a/pybot/drivers/hotplug/light.py b/pybot/drivers/hotplug/light.py new file mode 100644 index 0000000..db7e1c1 --- /dev/null +++ b/pybot/drivers/hotplug/light.py @@ -0,0 +1,19 @@ + +RD_VERSION = 0x00 +GET_VALUE = 0x01 + +f1 = { + 'name': 'getVersion', + 'call': RD_VERSION, + 'params': 0, + 'read': 3 +} + +f2 = { + 'name': 'getValue', + 'call': GET_VALUE, + 'params': 0, + 'read': 3 +} + +FUNCTIONS = [f1, f2] diff --git a/pybot/drivers/hotplug/res.py b/pybot/drivers/hotplug/res.py new file mode 100644 index 0000000..db7e1c1 --- /dev/null +++ b/pybot/drivers/hotplug/res.py @@ -0,0 +1,19 @@ + +RD_VERSION = 0x00 +GET_VALUE = 0x01 + +f1 = { + 'name': 'getVersion', + 'call': RD_VERSION, + 'params': 0, + 'read': 3 +} + +f2 = { + 'name': 'getValue', + 'call': GET_VALUE, + 'params': 0, + 'read': 3 +} + +FUNCTIONS = [f1, f2] diff --git a/pybot/drivers/hotplug/volt.py b/pybot/drivers/hotplug/volt.py new file mode 100644 index 0000000..db7e1c1 --- /dev/null +++ b/pybot/drivers/hotplug/volt.py @@ -0,0 +1,19 @@ + +RD_VERSION = 0x00 +GET_VALUE = 0x01 + +f1 = { + 'name': 'getVersion', + 'call': RD_VERSION, + 'params': 0, + 'read': 3 +} + +f2 = { + 'name': 'getValue', + 'call': GET_VALUE, + 'params': 0, + 'read': 3 +} + +FUNCTIONS = [f1, f2] diff --git a/pybot/drivers/lback.py b/pybot/drivers/lback.py new file mode 100644 index 0000000..859eedb --- /dev/null +++ b/pybot/drivers/lback.py @@ -0,0 +1,19 @@ + +RD_VERSION = 0x00 +SEND_DATA = 0x01 + +f1 = { + 'name': 'getVersion', + 'call': RD_VERSION, + 'params': 0, + 'read': 3 +} + +f2 = { + 'name': 'send', + 'call': SEND_DATA, + 'params': 1, + 'read': 1 +} + +FUNCTIONS = [f1, f2] diff --git a/pybot/drivers/motors.py b/pybot/drivers/motors.py new file mode 100644 index 0000000..02421d9 --- /dev/null +++ b/pybot/drivers/motors.py @@ -0,0 +1,27 @@ + +RD_VERSION = 0x00 +SET_VEL_2MTR = 0x01 +SET_VEL_MTR = 0x02 + +f1 = { + 'name': 'getVersion', + 'call': RD_VERSION, + 'params': 0, + 'read': 3 +} + +f2 = { + 'name': 'setvel2mtr', + 'call': SET_VEL_2MTR, + 'params': 6, + 'read': 1 +} + +f3 = { + 'name': 'setvelmtr', + 'call': SET_VEL_MTR, + 'params': 4, + 'read': 1 +} + +FUNCTIONS = [f1, f2, f3] diff --git a/pybot/drivers/pnp.py b/pybot/drivers/pnp.py new file mode 100644 index 0000000..3457126 --- /dev/null +++ b/pybot/drivers/pnp.py @@ -0,0 +1,11 @@ + +RD_VERSION = 0x00 + +f1 = { + 'name': 'getVersion', + 'call': RD_VERSION, + 'params': 0, + 'read': 3 +} + +FUNCTIONS = [f1] |