Skip to content

Commit

Permalink
moved to v4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Preston committed Oct 7, 2013
2 parents 0c29527 + d45fccf commit c149929
Show file tree
Hide file tree
Showing 10 changed files with 655 additions and 601 deletions.
21 changes: 5 additions & 16 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,11 @@ Change Log

v4.0.0
------
- `pifacecommon.core.DigitalPort` now accepts an optional `toggle` and `mask`. `toggle` describes
which bits are toggled before given to the user and `mask` describes which
bits are allowed through. `toggle` defaults to 0x00 and `mask` defaults to
0xff.
- `pifacecommon.core.DigitalItem` accepts an optional `toggle` argument which
defaults to 0.
- `pifacecommon.core.DigitalInputPort` and `pifacecommon.core.DigitalInputItem`
no longer default to toggling the inputs. The value is dependent on the
toggle and mask provided by the user.
**You now have to manually specify the toggle and mask if you want the bits
negated/masked.**
- `pifacecommon.interrupts.enable_interrupts` can be given a pin mask and a
list of board numbers to enable the interrupts rather than just enabling all
interrupts on all boards.
- Deactivating interrupts now waits for dispatcher process after calling
terminate. Dispatcher processes ignore KeyboardInterrupt (fix for pifacedigital issue #8).
- Ignored "Interrupted system call" error in `watch_port_events`.
- Rewrite main functions into chip specific (MCP23S17) class.
- GPIOInterruptDevice class replacing core GPIO enable/disable functions.
- SPIDevice class replacing spisend function. Can now add in spi_callback
function which is called before each SPI write.
- Updated installation instructions.


Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,3 @@ can be done with the lastest version of `raspi-config`. Run:
$ sudo raspi-config

Then navigate to `Advanced Options`, `SPI` and select `yes`.

You may need to reboot.
21 changes: 12 additions & 9 deletions docs/example.rst
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
6 changes: 2 additions & 4 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ Installation

Install
=======

apt-get
-------
Make sure you are using the lastest version of Raspbian::

$ sudo apt-get update
$ sudo apt-get upgrade

Automatically
-------------

Install ``pifacecommon`` (for Python 3 and 2) with the following command::

$ sudo apt-get install python{,3}-pifacecommon
Expand Down
14 changes: 14 additions & 0 deletions docs/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,22 @@ Core
.. automodule:: pifacecommon.core
:members:

**********
SPI
**********
.. automodule:: pifacecommon.spi
:members:

**********
Interrupts
**********
.. automodule:: pifacecommon.interrupts
:members:

**********
MCP23S17
**********
Consult the datasheet for more information.

.. automodule:: pifacecommon.mcp23s17
:members:
75 changes: 0 additions & 75 deletions pifacecommon/__init__.py
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]>
Expand All @@ -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,
# )
Loading

0 comments on commit c149929

Please sign in to comment.