Private
Public Access
2
0

C++: Change enum types to be shorter in C++

* This changes the swig interface so Python/Node APIs change slightly

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-05-19 09:49:30 +01:00
parent 5d9fc39ae9
commit 3731263752
7 changed files with 36 additions and 72 deletions

View File

@@ -57,7 +57,7 @@ int main (int argc, char **argv)
if (gpio == NULL) {
return MAA_ERROR_UNSPECIFIED;
}
int response = gpio->dir(MAA_GPIO_OUT);
int response = gpio->dir(maa::DIR_OUT);
if (response != MAA_SUCCESS)
maa_result_print((maa_result_t) MAA_SUCCESS);

View File

@@ -26,7 +26,7 @@ import pymaa as maa
import time
x = maa.Gpio(8)
x.dir(maa.MAA_GPIO_OUT)
x.dir(maa.DIR_OUT)
while True:
x.write(1)

View File

@@ -25,4 +25,3 @@
import pymaa
x = pymaa.Gpio(13)
print(x.pin)

View File

@@ -6,5 +6,5 @@ def test():
print("wooo")
x = maa.Gpio(6)
x.dir(maa.MAA_GPIO_IN)
x.isr(maa.MAA_GPIO_EDGE_BOTH, test)
x.dir(maa.DIR_IN)
x.isr(maa.EDGE_BOTH, test)

View File

@@ -1,32 +0,0 @@
#!/usr/bin/env python
# Author: Brendan Le Foll <brendan.le.foll@intel.com>
# Copyright (c) 2014 Intel Corporation.
#
# 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.
import pymaa as maa
x = maa.I2c()
x.address(0x62)
y= " "
ret = x.read(y, 2)
print(y)