Skip to content

Commit

Permalink
Closing out Issue #68 by adding 3 CHIP Pro pins able to be used as in…
Browse files Browse the repository at this point in the history
…terrupts
  • Loading branch information
xtacocorex committed May 3, 2017
1 parent d4b1d8a commit 6ddd0e0
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.5.8
---
* Added 3 pins for the CHIP Pro as allowable for setting callbacks and edge detection to close out Issue #68

0.5.7
---
* Added the I2S pins on the CHIP Pro as GPIO capable
Expand Down
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
chip-io (0.5.8-1) unstable; urgency=low

* Added 3 pins for the CHIP Pro as allowable for setting callbacks and edge
detection to close out Issue #68

-- Robert Wolterman <[email protected]> Tue, 02 May 2017 22:43:00 -0600

chip-io (0.5.7-1) unstable; urgency=low

* Added the I2S pins on the CHIP Pro as GPIO capable
Expand Down
4 changes: 2 additions & 2 deletions debian/files
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python-chip-io_0.5.6-1_armhf.deb python optional
python3-chip-io_0.5.6-1_armhf.deb python optional
python-chip-io_0.5.7-1_armhf.deb python optional
python3-chip-io_0.5.7-1_armhf.deb python optional
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'Topic :: System :: Hardware']

setup(name = 'CHIP_IO',
version = '0.5.7',
version = '0.5.8',
author = 'Robert Wolterman',
author_email = '[email protected]',
description = 'A module to control CHIP IO channels',
Expand Down
2 changes: 1 addition & 1 deletion source/constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ void define_constants(PyObject *module)
bcm = Py_BuildValue("i", BCM);
PyModule_AddObject(module, "BCM", bcm);

version = Py_BuildValue("s", "0.5.7");
version = Py_BuildValue("s", "0.5.8");
PyModule_AddObject(module, "VERSION", version);
}
12 changes: 12 additions & 0 deletions source/py_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,9 @@ static PyObject *py_add_event_callback(PyObject *self, PyObject *args, PyObject
// check to ensure gpio is one of the allowed pins
if (gpio != lookup_gpio_by_name("AP-EINT3")
&& gpio != lookup_gpio_by_name("AP-EINT1")
&& gpio != lookup_gpio_by_name("I2S-MCLK") // CHIP PRO
&& gpio != lookup_gpio_by_name("I2S-DI") // CHIP PRO
&& gpio != lookup_gpio_by_name("PWM1") // CHIP PRO
&& !(gpio >= lookup_gpio_by_name("XIO-P0") && gpio <= lookup_gpio_by_name("XIO-P7"))) {
PyErr_SetString(PyExc_ValueError, "Callbacks currently available on AP-EINT1, AP-EINT3, and XIO-P0 to XIO-P7 only");
return NULL;
Expand Down Expand Up @@ -665,6 +668,9 @@ static PyObject *py_add_event_detect(PyObject *self, PyObject *args, PyObject *k
// check to ensure gpio is one of the allowed pins
if (gpio != lookup_gpio_by_name("AP-EINT3")
&& gpio != lookup_gpio_by_name("AP-EINT1")
&& gpio != lookup_gpio_by_name("I2S-MCLK") // CHIP PRO
&& gpio != lookup_gpio_by_name("I2S-DI") // CHIP PRO
&& gpio != lookup_gpio_by_name("PWM1") // CHIP PRO
&& !(gpio >= lookup_gpio_by_name("XIO-P0") && gpio <= lookup_gpio_by_name("XIO-P7"))) {
PyErr_SetString(PyExc_ValueError, "Edge Detection currently available on AP-EINT1, AP-EINT3, and XIO-P0 to XIO-P7 only");
return NULL;
Expand Down Expand Up @@ -741,6 +747,9 @@ static PyObject *py_remove_event_detect(PyObject *self, PyObject *args)
// check to ensure gpio is one of the allowed pins
if (gpio != lookup_gpio_by_name("AP-EINT3")
&& gpio != lookup_gpio_by_name("AP-EINT1")
&& gpio != lookup_gpio_by_name("I2S-MCLK") // CHIP PRO
&& gpio != lookup_gpio_by_name("I2S-DI") // CHIP PRO
&& gpio != lookup_gpio_by_name("PWM1") // CHIP PRO
&& !(gpio >= lookup_gpio_by_name("XIO-P0") && gpio <= lookup_gpio_by_name("XIO-P7"))) {
PyErr_SetString(PyExc_ValueError, "Edge Detection currently available on AP-EINT1, AP-EINT3, and XIO-P0 to XIO-P7 only");
return NULL;
Expand Down Expand Up @@ -845,6 +854,9 @@ static PyObject *py_wait_for_edge(PyObject *self, PyObject *args)
// check to ensure gpio is one of the allowed pins
if (gpio != lookup_gpio_by_name("AP-EINT3")
&& gpio != lookup_gpio_by_name("AP-EINT1")
&& gpio != lookup_gpio_by_name("I2S-MCLK") // CHIP PRO
&& gpio != lookup_gpio_by_name("I2S-DI") // CHIP PRO
&& gpio != lookup_gpio_by_name("PWM1") // CHIP PRO
&& !(gpio >= lookup_gpio_by_name("XIO-P0") && gpio <= lookup_gpio_by_name("XIO-P7"))) {
PyErr_SetString(PyExc_ValueError, "Edge Detection currently available on AP-EINT1, AP-EINT3, and XIO-P0 to XIO-P7 only");
return NULL;
Expand Down

0 comments on commit 6ddd0e0

Please sign in to comment.