Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from JuliaBerry:master #6

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
0b9c814
Update pi.jl (#16)
piotrek124-1 Sep 9, 2024
9f9b043
Delete appveyor.yml
ViralBShah Sep 9, 2024
1d152a8
Delete .travis.yml
ViralBShah Sep 9, 2024
2afe25b
Delete REQUIRE
ViralBShah Sep 9, 2024
eda1321
update docstring for set_mode
Alexander-Barth Sep 9, 2024
80a5a3f
Merge branch 'master' of github.com:JuliaBerry/PiGPIO.jl
Alexander-Barth Sep 9, 2024
fb68c49
fix indexing issue and update docstring for error_text
Alexander-Barth Sep 9, 2024
f84f1c7
update documentation
Alexander-Barth Sep 9, 2024
7bd7ecc
add missing comma
Alexander-Barth Sep 9, 2024
c97542f
markdown files are expected to be in docs/src
Alexander-Barth Sep 9, 2024
b9bf180
dos2unix
Alexander-Barth Sep 9, 2024
e1b86f4
explicit version for Sockets
Alexander-Barth Sep 9, 2024
931bf1c
document option to make the documentation without a Raspberry Pi
Alexander-Barth Sep 9, 2024
a7feab5
fix doc
Alexander-Barth Sep 9, 2024
c42e7d5
use markdown code fences
Alexander-Barth Sep 9, 2024
c37ffba
dos2unix
Alexander-Barth Sep 9, 2024
9e7cb9f
dos2unix
Alexander-Barth Sep 9, 2024
950c89c
use markdown code fences
Alexander-Barth Sep 9, 2024
d37395d
use backticks for parameters
Alexander-Barth Sep 9, 2024
8cb1b96
use backticks for parameters in spiSerial.jl
Alexander-Barth Sep 9, 2024
c2ffdee
use backticks for parameters
Alexander-Barth Sep 9, 2024
9c6626a
use markdown list for parameters
Alexander-Barth Sep 9, 2024
c2d069e
improve markdown formatting
Alexander-Barth Sep 9, 2024
2eaa943
use admonitions
Alexander-Barth Sep 9, 2024
74f2154
Update TagBot.yml
ViralBShah Sep 10, 2024
c71f694
specify namespace of unexported constants
Alexander-Barth Sep 23, 2024
33de949
add CI.yml
Alexander-Barth Nov 11, 2024
08af51c
use Test module
Alexander-Barth Nov 11, 2024
436c4ca
add test dependencies
Alexander-Barth Nov 11, 2024
d1a948e
bump verion number
Alexander-Barth Nov 11, 2024
981839f
deply docs
Alexander-Barth Nov 11, 2024
05463e9
add docs dev link
Alexander-Barth Nov 11, 2024
4863f05
remove unused Manifest.toml
Alexander-Barth Nov 12, 2024
c3c961d
add Aqua tests
Alexander-Barth Nov 12, 2024
e900c2d
Update README.md
Alexander-Barth Nov 12, 2024
9efb427
Update README.md
Alexander-Barth Nov 12, 2024
559e6ea
issue #3
Alexander-Barth Nov 12, 2024
78b63f7
Merge branch 'master' of github.com:JuliaBerry/PiGPIO.jl
Alexander-Barth Nov 12, 2024
17efccc
instantiate IOBuffer
Alexander-Barth Nov 12, 2024
849f3aa
avoid pack("I",...)
Alexander-Barth Nov 12, 2024
c80dd92
do not convert elements of extents to string
Alexander-Barth Nov 12, 2024
38d9a5b
use _SOCK_CMD_LEN=16 as in pigpio.py
Alexander-Barth Nov 12, 2024
4e115ce
use the same parsing of the return value as in the _pigpio_command (h…
Alexander-Barth Nov 12, 2024
b48be39
extent write
Alexander-Barth Dec 19, 2024
5dc9f08
cast bb_bits to Cuint if necessary
Alexander-Barth Dec 19, 2024
b91104c
add end for a if in the docstrings
Alexander-Barth Dec 19, 2024
3cb7be0
add end for an if in the docstrings
Alexander-Barth Dec 19, 2024
10850d2
Update README.md
Alexander-Barth Dec 19, 2024
34866ff
fix error messages #13
Dec 19, 2024
e34746d
Merge branch 'master' of github.com:JuliaBerry/PiGPIO.jl
Dec 19, 2024
4048e29
Merge branch 'master' into i2c
Alexander-Barth Dec 19, 2024
ea8de28
rxbuf requires two arguments (issue #19)
Alexander-Barth Dec 23, 2024
8c2cbf1
add missing u2i function (thanks @TheCedarPrince)
Alexander-Barth Dec 23, 2024
1b1a638
remove unnessary wrapping of output with IOBuffer
Alexander-Barth Dec 23, 2024
81a1347
formatting
Alexander-Barth Dec 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CI
on:
- push
- pull_request
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- 'lts'
- '1'
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@latest
- run: |
git config --global user.name Tester
git config --global user.email [email protected]
- uses: julia-actions/julia-runtest@latest
continue-on-error: ${{ matrix.version == 'nightly' }}
# - uses: julia-actions/julia-processcoverage@v1
# - uses: codecov/codecov-action@v4
# with:
# file: lcov.info
# token: ${{ secrets.CODECOV_TOKEN }}

docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1'
- run: |
git config --global user.name name
git config --global user.email email
git config --global github.user username
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
Pkg.build()'
- run: |
julia --project=docs -e '
using Documenter: doctest
using PiGPIO
doctest(PiGPIO)'
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
26 changes: 24 additions & 2 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
name: TagBot
on:
schedule:
- cron: 10 20 * * *
issue_comment:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: "3"
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Edit the following line to reflect the actual name of the GitHub Secret containing your private key
ssh: ${{ secrets.DOCUMENTER_KEY }}
# ssh: ${{ secrets.NAME_OF_MY_SSH_PRIVATE_KEY_SECRET }}
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

2 changes: 0 additions & 2 deletions Manifest.toml

This file was deleted.

28 changes: 19 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
name = "PiGPIO"
uuid = "bb151fc1-c6dc-5496-8ed6-07f94907e623"
version = "0.2.0"

[compat]
julia = "1"

[deps]
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
name = "PiGPIO"
uuid = "bb151fc1-c6dc-5496-8ed6-07f94907e623"
version = "0.2.1"

[compat]
Aqua = "0.8"
Sockets = "1"
Test = "1"
julia = "1"

[deps]
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Aqua", "Test"]
39 changes: 27 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#### Control GPIO pins on the Raspberry Pi from Julia

[![][docs-stable-img]][docs-stable-url]
[![documentation dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliaberry.github.io/PiGPIO.jl/dev/)

[docs-stable-img]: https://img.shields.io/badge/docs-stable-blue.svg
[docs-stable-url]: https://juliahub.com/docs/PiGPIO/
Expand Down Expand Up @@ -35,10 +36,20 @@ work is done by the daemon. One benefit of working this way is that you can
remotely access the pi over a network and multiple instances can be connected
to the daemon simultaneously.

## Launching the Daemon
## The daemon process `pigpiod`

Launching the daemon requires sudo privileges. Launch by typing `sudo pigpiod`
in the terminal.
On Raspberry Pi OS, the daemon `pigpiod` can be installed and launched by using the following shell commands:

```bash
# install pigpiod
sudo apt-get install pigpiod
# enable pigpiod via system D
sudo systemctl enable pigpiod
# start pigpiod now
sudo systemctl start pigpiod
```

The daemon can also be launched manually with `sudo pigpiod` in the terminal.

## Installation and Usage

Expand All @@ -48,20 +59,24 @@ Pkg.add("PiGPIO")

using PiGPIO

pi=Pi() #connect to pigpiod daemon on localhost
pi=Pi() # connect to the pigpiod daemon on localhost
```

## Example Usage

The `pin` number corresponds to the GPIO pins
(General Purpose Input/Output, aka "BCM" or "Broadcom") and not
to the physical pin numbers.

```julia
set_mode(p::Pi, pin::Int, mode)
get_mode(p::Pi, pin::Int)
# mode can be INPUT or OUTPUT
set_mode(pi::Pi, pin::Int, mode)
get_mode(pi::Pi, pin::Int)
# mode can be PiGPIO.INPUT or PiGPIO.OUTPUT

PiGPIO.read(p, pin)
PiGPIO.write(p, pin, state)
#state can be HIGH, LOW, ON, OFF
PiGPIO.read(pi, pin)
PiGPIO.write(pi, pin, state)
# state can be PiGPIO.HIGH, PiGPIO.LOW, PiGPIO.ON, PiGPIO.OFF

PiGPIO.set_PWM_dutycycle(p, pin, dutycyle)
#dutycyle defaults to a range 0-255
PiGPIO.set_PWM_dutycycle(pi, pin, dutycyle)
# dutycyle defaults to a range 0-255
```
1 change: 0 additions & 1 deletion REQUIRE

This file was deleted.

34 changes: 0 additions & 34 deletions appveyor.yml

This file was deleted.

14 changes: 7 additions & 7 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ makedocs(
sitename = "PiGPIO",
format = Documenter.HTML(),
modules = [PiGPIO],
# examples need to be run on a Raspberry Pi
doctest = false,
draft = true,
pages = [
"index.md",
"Tutorial" => "tutorial.md"
"Tutorial" => "tutorial.md",
"API Docs" => "api.md",
"Examples" => [
"Blink Once" => "examples/01_blink.md",
Expand All @@ -22,9 +25,6 @@ makedocs(
]
)

# Documenter can also automatically deploy documentation to gh-pages.
# See "Hosting Documentation" and deploydocs() in the Documenter manual
# for more information.
#=deploydocs(
repo = "<repository url>"
)=#
deploydocs(;
repo="github.com/JuliaBerry/PiGPIO.jl",
)
File renamed without changes.
1 change: 1 addition & 0 deletions src/PiGPIO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module PiGPIO

export Pi

import Base: run, write
using Sockets

include("constants.jl")
Expand Down
2 changes: 2 additions & 0 deletions src/constants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ WAVE_MODE_REPEAT_SYNC =3
WAVE_NOT_FOUND = 9998 # Transmitted wave not found.
NO_TX_WAVE = 9999 # No wave being transmitted.

_SOCK_CMD_LEN = 16

# pigpio command numbers

_PI_CMD_MODES= 0
Expand Down
Loading