-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
655 additions
and
601 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
####### | ||
Example | ||
####### | ||
Here are some examples of how to use pifacecommon:: | ||
Here are some examples of how to use pifacecommon. | ||
|
||
$ python3 | ||
>>> import pifacecommon | ||
>>> pifacecommon.core.init() | ||
>>> pifacecommon.core.write(0xAA, pifacecommon.core.GPIOA) | ||
>>> pifacecommon.core.read(pifacecommon.core.GPIOA) | ||
0xAA | ||
>>> pifacecommon.core.write_bit(1, 0, pifacecommon.core.GPIOA) | ||
>>> pifacecommon.core.read_bit(0, pifacecommon.core.GPIOA) | ||
MCP23S17 | ||
======== | ||
|
||
:: | ||
|
||
>>> import pifacecommon.mcp23s17 | ||
>>> mcp = pifacecommon.mcp23s17.MCP23S17() | ||
>>> mcp.gpioa.value = 0xAA | ||
>>> mcp.gpioa.value | ||
170 | ||
>>> mcp.gpioa.bits[3].value | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Provides common I/O methods for interfacing with PiFace Products | ||
Copyright (C) 2013 Thomas Preston <[email protected]> | ||
|
@@ -15,77 +14,3 @@ | |
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
""" | ||
# import sys | ||
|
||
# constants | ||
# from .core import ( | ||
# MAX_BOARDS, | ||
# IODIRA, | ||
# IODIRB, | ||
# IPOLA, | ||
# IPOLB, | ||
# GPINTENA, | ||
# GPINTENB, | ||
# DEFVALA, | ||
# DEFVALB, | ||
# INTCONA, | ||
# INTCONB, | ||
# IOCON, | ||
# GPPUA, | ||
# GPPUB, | ||
# INTFA, | ||
# INTFB, | ||
# INTCAPA, | ||
# INTCAPB, | ||
# GPIOA, | ||
# GPIOB, | ||
# BANK_OFF, | ||
# BANK_ON, | ||
# INT_MIRROR_ON, | ||
# INT_MIRROR_OFF, | ||
# SEQOP_OFF, | ||
# SEQOP_ON, | ||
# DISSLW_ON, | ||
# DISSLW_OFF, | ||
# HAEN_ON, | ||
# HAEN_OFF, | ||
# ODR_ON, | ||
# ODR_OFF, | ||
# INTPOL_HIGH, | ||
# INTPOL_LOW, | ||
# ) | ||
|
||
# classes | ||
# from .core import ( | ||
# DigitalPort, | ||
# DigitalInputPort, | ||
# DigitalOutputPort, | ||
# DigitalItem, | ||
# DigitalInputItem, | ||
# DigitalOutputItem, | ||
# ) | ||
|
||
# from .interrupts import ( | ||
# InputFunctionMap, | ||
# ) | ||
|
||
# functions | ||
# from .core import ( | ||
# init, | ||
# deinit, | ||
# get_bit_mask, | ||
# get_bit_num, | ||
# read_bit, | ||
# write_bit, | ||
# read, | ||
# write, | ||
# spisend, | ||
# sleep_microseconds, | ||
# ) | ||
|
||
# from .interrupts import ( | ||
# wait_for_interrupt, | ||
# clear_interrupts, | ||
# enable_interrupts, | ||
# disable_interrupts, | ||
# ) |
Oops, something went wrong.