Commit 66278db Thomas Preston
committed
1 parent 9b4d862 commit 66278db Copy full SHA for 66278db
File tree 4 files changed +25
-8
lines changed
4 files changed +25
-8
lines changed Original file line number Diff line number Diff line change 1
1
Change Log
2
2
==========
3
3
4
+ v2.1.0
5
+ ------
6
+ - Added IODIR_FALLING_EDGE and IODIR_RISING_EDGE (pifacecommon v3.1.1).
7
+ - Added `bus` and `chip_select` optional arguments to init.
8
+
4
9
v2.0.3
5
10
------
6
- - Added support for interrupts from multiple boards.
11
+ - Interrupts now work for multiple boards.
7
12
8
13
v2.0.2
9
14
------
Original file line number Diff line number Diff line change 15
15
You should have received a copy of the GNU General Public License
16
16
along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
"""
18
- from pifacecommon .interrupts import (IODIR_ON , IODIR_OFF , IODIR_BOTH )
18
+ from pifacecommon .interrupts import (
19
+ IODIR_FALLING_EDGE ,
20
+ IODIR_RISING_EDGE ,
21
+ IODIR_ON ,
22
+ IODIR_OFF ,
23
+ IODIR_BOTH ,
24
+ )
19
25
from .core import *
Original file line number Diff line number Diff line change 5
5
import pifacecommon
6
6
7
7
# /dev/spidev<bus>.<chipselect>
8
- SPI_BUS = 0
9
- SPI_CHIP_SELECT = 0
8
+ DEFAULT_SPI_BUS = 0
9
+ DEFAULT_SPI_CHIP_SELECT = 0
10
10
11
11
# some easier to remember/read values
12
12
OUTPUT_PORT = pifacecommon .core .GPIOA
@@ -115,14 +115,20 @@ def __init__(self, board_num=0):
115
115
super (InputEventListener , self ).__init__ (INPUT_PORT , board_num )
116
116
117
117
118
- def init (init_board = True ):
118
+ def init (init_board = True ,
119
+ bus = DEFAULT_SPI_BUS ,
120
+ chip_select = DEFAULT_SPI_CHIP_SELECT ):
119
121
"""Initialises all PiFace Digital boards.
120
122
121
123
:param init_board: Initialise each board (default: True)
122
124
:type init_board: boolean
125
+ :param bus: SPI bus /dev/spidev<bus>.<chipselect> (default: {bus})
126
+ :type bus: int
127
+ :param chip_select: SPI bus /dev/spidev<bus>.<chipselect> (default: {chip})
128
+ :type chip_select: int
123
129
:raises: :class:`NoPiFaceDigitalDetectedError`
124
- """
125
- pifacecommon .core .init (SPI_BUS , SPI_CHIP_SELECT )
130
+ """ . format ( bus = DEFAULT_SPI_BUS , chip = DEFAULT_SPI_CHIP_SELECT )
131
+ pifacecommon .core .init (bus , chip_select )
126
132
127
133
if init_board :
128
134
# set up each board
Original file line number Diff line number Diff line change 1
- __version__ = '2.0.3 '
1
+ __version__ = '2.1.0 '
You can’t perform that action at this time.
0 commit comments