-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into frequencycounter
- Loading branch information
Showing
37 changed files
with
496 additions
and
408 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ jobs: | |
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
python-version: [3.7, 3.8] | ||
python-version: [3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -85,19 +85,28 @@ jobs: | |
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- id: branch-name | ||
uses: tj-actions/[email protected] | ||
- name: Ensure we can checkout gh-pages | ||
- name: Get branch names | ||
id: branch-names | ||
uses: tj-actions/branch-names@v8 | ||
- name: Ensure we can checkout gh-pages for release (${{ steps.branch-names.outputs.tag }}) | ||
if: steps.branch-names.outputs.is_tag == 'true' | ||
run: | | ||
git checkout gh-pages | ||
git checkout ${{ steps.branch-name.outputs.current_branch }} | ||
git checkout ${{ steps.branch-names.outputs.tag }} | ||
- name: Ensure we can checkout gh-pages for pr (${{ steps.branch-names.outputs.current_branch }}) | ||
if: steps.branch-names.outputs.is_tag == 'false' | ||
run: | | ||
git checkout gh-pages | ||
git checkout ${{ steps.branch-names.outputs.current_branch }} | ||
- name: Setup Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies and generate docs | ||
run: | | ||
pip install poetry | ||
ls | ||
git status | ||
poetry install | ||
poetry run python docs_src/generate_docs.py | ||
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
Top level of MQTT IO package. | ||
""" | ||
|
||
VERSION = "2.3.0" | ||
VERSION = "2.5.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
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
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
""" | ||
Sunxi Board | ||
""" | ||
from typing import Optional | ||
from ...types import ConfigType, PinType | ||
from . import GenericGPIO, PinDirection, PinPUD | ||
|
||
REQUIREMENTS = ("pySUNXI",) | ||
|
||
class GPIO(GenericGPIO): | ||
""" | ||
Implementation of GPIO class for Sunxi native GPIO. | ||
""" | ||
def setup_module(self) -> None: | ||
# pylint: disable=import-outside-toplevel,import-error | ||
from pySUNXI import gpio # type: ignore | ||
|
||
self.io: gpio = gpio | ||
self.direction_map = {PinDirection.INPUT: gpio.INPUT, PinDirection.OUTPUT: gpio.OUTPUT} | ||
|
||
self.pullup_map = { | ||
PinPUD.OFF: gpio.PULLNONE, | ||
PinPUD.UP: gpio.PULLUP, | ||
PinPUD.DOWN: gpio.PULLDOWN, | ||
} | ||
gpio.init() | ||
|
||
def setup_pin( | ||
self, | ||
pin: PinType, | ||
direction: PinDirection, | ||
pullup: PinPUD, | ||
pin_config: ConfigType, | ||
initial: Optional[str] = None, | ||
) -> None: | ||
direction = self.direction_map[direction] | ||
|
||
if pullup is None: | ||
pullup = self.pullup_map[PinPUD.OFF] | ||
else: | ||
pullup = self.pullup_map[pullup] | ||
|
||
initial_state = {None: -1, "low": 0, "high": 1}[initial] | ||
#self.io.setup(pin, direction, pull_up_down=pullup, initial=initial) | ||
self.io.setcfg(pin, direction) | ||
self.io.pullup(pin, pullup) | ||
if direction==self.io.OUTPUT: | ||
self.io.output(pin, initial_state) | ||
|
||
def set_pin(self, pin: PinType, value: bool) -> None: | ||
self.io.output(pin, value) | ||
|
||
def get_pin(self, pin: PinType) -> bool: | ||
return bool(self.io.input(pin)) | ||
|
||
def cleanup(self) -> None: | ||
pass |
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
Oops, something went wrong.