Compare commits

...

584 commits

Author SHA1 Message Date
Melissa LeBlanc-Williams
2364d94be2
Merge pull request #400 from luxarf/fix/rockpis-pins
Fix/rockpis pins
2021-01-27 08:00:06 -08:00
luxarf
c395d84ca3
fix copy paste error 2021-01-27 16:00:40 +01:00
luxarf
1dae37baa3
fix the erronous pin declarations 2021-01-27 15:55:57 +01:00
Limor "Ladyada" Fried
2572f684e6
Merge pull request #398 from makermelissa/master
Added NanoPi NEO Air Support
2021-01-20 17:56:57 -05:00
Melissa LeBlanc-Williams
cf7aecda03 Get I2C and SPI working 2021-01-20 14:54:17 -08:00
Melissa LeBlanc-Williams
5b7c6d66a8 Added NanoPi NEO Air support 2021-01-20 14:07:11 -08:00
Melissa LeBlanc-Williams
a3ae13407a
Merge pull request #397 from makermelissa/master
Add BeagleBone AI Support
2021-01-20 12:19:51 -08:00
Melissa LeBlanc-Williams
8273fc647a Add BeagleBone AI Support 2021-01-20 10:48:14 -08:00
Melissa LeBlanc-Williams
568c30950b
Merge pull request #395 from flyleaf91/master
Add support for LubanCat i.MX6ULL board
2021-01-15 09:46:37 -07:00
flyleaf
0849361858 fix for black check 2021-01-15 22:19:02 +08:00
flyleaf
68ddeb18d3 Add analog in example 2021-01-15 19:36:54 +08:00
flyleaf
8e86ab591f Add analogio support for LubanCat i.MX6ULL 2021-01-15 19:36:30 +08:00
flyleaf
35311d8f41 Add busio,pulseio support for LubanCat i.MX6ULL 2021-01-15 19:36:08 +08:00
flyleaf
e322c4735a add digital IO support for lubancat i.MX6ULL 2021-01-15 19:34:16 +08:00
Carter Nelson
540ca76e59
Merge pull request #394 from caternuson/iss391
Privitize `i2c_configure` in MCP2221 class
2021-01-14 19:43:28 -08:00
caternuson
a89095cf1f privitize i2c_configure 2021-01-14 16:53:22 -08:00
Carter Nelson
89ef03ef43
Merge pull request #393 from caternuson/i2c_clock
Change default I2C clock frequency
2021-01-14 14:10:04 -08:00
caternuson
1a0457524e change default i2c freq 2021-01-14 11:27:32 -08:00
Melissa LeBlanc-Williams
3d56974939
Merge pull request #392 from twa127/master
Add Support For Orange Pi Zero Plus Board
2021-01-14 09:26:58 -07:00
twa127
b8231c8307
Update __init__.py 2021-01-14 08:55:15 +00:00
twa127
3b57f98703
Create orangepizeroplus.py 2021-01-14 08:33:40 +00:00
twa127
bb34ccd22c
Update board.py 2021-01-14 08:29:44 +00:00
twa127
82a94cd5ba
Merge pull request #3 from adafruit/master
Merge pull request #385 from twa127/master
2021-01-14 08:26:09 +00:00
Melissa LeBlanc-Williams
084beca285
Merge pull request #385 from twa127/master
Support for Orange Pi Zero Plus2 H5
2021-01-04 09:57:39 -07:00
twa127
d07e69b47c
Update digitalio.py 2021-01-01 09:26:09 +00:00
twa127
36d7ba682b
Update digitalio.py 2021-01-01 08:22:01 +00:00
twa127
41de8f0b02
Update board.py 2020-12-31 18:09:13 +00:00
twa127
b5c2c19322
Merge pull request #2 from adafruit/master
Merge
2020-12-31 17:57:55 +00:00
Melissa LeBlanc-Williams
6c82519435
Merge pull request #383 from jamesrusso/deinit-when-pixel-count-changes
re-initalize the underlying ws2811 module if the lenght of the buffer…
2020-12-23 10:19:06 -07:00
Melissa LeBlanc-Williams
1639b90c94
Update neopixel.py
Fix line too long.
2020-12-23 09:15:54 -08:00
Melissa LeBlanc-Williams
9a2678c8a2
Update neopixel.py 2020-12-23 09:13:12 -08:00
Melissa LeBlanc-Williams
1775ade3bf
Merge pull request #384 from twa127/master
Board Definition file for Banana Pi
2020-12-21 18:01:39 -07:00
twa127
fd6b194d47
Create __init__.py 2020-12-19 20:22:03 +00:00
twa127
1a7e2819f8
Merge pull request #1 from adafruit/master
Merge
2020-12-19 20:16:06 +00:00
James Russo
bd1cf31128 re-initalize the underlying ws2811 module if the lenght of the buffer changes. 2020-12-17 00:56:47 +00:00
Melissa LeBlanc-Williams
72d4f20a19
Merge pull request #377 from scottamain/mini
Support pin names in RPI style for Coral boards
2020-12-09 13:01:34 -07:00
Scott Main
8137d6f95a reformat with 'black' 2020-12-08 10:45:38 -08:00
Scott Main
67df25c8ff Support pin names in RPI style for Coral boards
This should allow code compatibility across boards when using the
"D#" names, as per the Raspberry Pi header.

This also renames several pin names for the Mini so they actually match
the datasheet pin names. (Previously, I mistakenly used pin names
from the original Dev Board.) These renames are safe at this point
because the Dev Board Mini has not shipped yet.
2020-12-08 10:24:49 -08:00
Scott Main
e068d9bae4
Merge pull request #3 from scottamain/master
Sync to master
2020-12-07 16:42:09 -08:00
Scott Main
bb0f4840e3
Merge pull request #2 from adafruit/master
Sync to Blinka master
2020-12-07 16:40:10 -08:00
Melissa LeBlanc-Williams
344f7b9808
Merge pull request #374 from scottamain/mini
Add Coral Dev Board Mini support (MT8167)
2020-12-07 10:53:57 -07:00
Melissa LeBlanc-Williams
76c093908d
Merge pull request #373 from scottamain/docs
Add missing modules to API docs build.
2020-12-07 10:51:23 -07:00
Melissa LeBlanc-Williams
ec2711421f
Merge pull request #376 from mcauser/patch-1
Fix expired Discord link
2020-12-07 10:33:02 -07:00
Mike Causer
08d7ada8f6
Fix expired Discord link 2020-12-08 01:24:11 +11:00
Scott Main
5b7de464ad Fix formatting with 'black' 2020-12-06 12:58:06 -08:00
Scott Main
3b1ab02a14 fix pylint warning for 'sys' import 2020-12-05 22:46:42 -08:00
Scott Main
7e059ba8dc Add missing modules to API docs build.
Includes tweaks to Sphinx config and module files to help the docs build.

Reviewed the docs build with:
sphinx-build -E -W -b html . _build/html
2020-12-05 22:37:28 -08:00
Scott Main
122bbedb8b Add missing modules to API docs build.
Includes tweaks to Sphinx config and module files to help the docs build.

Reviewed the docs build with:
sphinx-build -E -W -b html . _build/html
2020-12-05 22:32:57 -08:00
Scott Main
85132dc280 Add missing modules to API docs build.
Includes tweaks to Sphinx config and module files to help the docs build.
2020-12-05 22:17:17 -08:00
Scott Main
3588271b3a Add Coral Dev Board Mini support (MT8167).
Also rename the other Coral board pin module for consistency.
2020-12-04 15:00:00 -08:00
Scott Main
b5919dcf36
Merge pull request #1 from scottamain/pwmbug
Merge pwmbug changes
2020-12-04 14:58:03 -08:00
Melissa LeBlanc-Williams
dcfb0393ba
Merge pull request #372 from scottamain/pwmbug
Add timout loop after exporting the PWM pin.
2020-12-04 15:48:39 -07:00
Scott Main
bdd86c7e4f Add timout loop after exporting the PWM pin.
This gives udev time to respond to the device event. Without this,
the subsequent attempts to modify pin properties will fail when
depending on udev rules to apply new user permissions.

This code is essentially copied from python-periphery, as was most
of this file (both MIT licenced). Although it appears sergeev added
this loop recently, compared to when this code was originally cloned.
2020-12-04 12:59:17 -08:00
Scott Main
021b4e28a4 Add timout loop after exporting the PWM pin.
This gives udev time to respond to the device event. Without this,
the subsequent attempts to modify pin properties will fail when
depending on udev rules to apply new user permissions.

This code is essentially copied from python-periphery, as was most
of this file (both MIT licenced). Although it appears sergeev added
this loop recently, compared to when this code was originally cloned.
2020-12-04 12:42:47 -08:00
Scott Main
dca4937cad Add timout loop after exporting the PWM pin.
This gives udev time to respond to the device event. Without this,
the subsequent attempts to modify pin properties will fail when
depending on udev rules to apply new user permissions.

This code is essentially copied from python-periphery, as was most
of this file (both MIT licenced). Although it appears sergeev added
this loop recently, compared to when this code was originally cloned.
2020-12-04 12:39:22 -08:00
Scott Main
11d2b8cca3 Add timout loop after exporting the PWM pin.
This gives udev time to respond to the device event. Without this,
the subsequent attempts to modify pin properties will fail when
depending on udev rules to apply new user permissions.

This code is essentially copied from python-periphery, as was most
of this file (both MIT licenced). Although it appears sergeev added
this loop recently, compared to when this code was originally cloned.
2020-12-04 12:35:56 -08:00
Scott Main
48a8b0cfe0 Add timout loop after exporting the PWM pin.
This gives udev time to respond to the device event. Without this,
the subsequent attempts to modify pin properties will fail when
depending on udev rules to apply new user permissions.

This code is essentially copied from python-periphery, as was most
of this file (both MIT licenced). Although it appears sergeev added
this loop recently, compared to when this code was originally cloned.
2020-12-04 12:09:22 -08:00
Melissa LeBlanc-Williams
e5b92aa5a7
Merge pull request #366 from SecT0uch/master
Added SoPine compatibility
2020-11-18 09:08:58 -07:00
Jordan ERNST
c4519b174b PycodeStyle: black pass 2020-11-18 10:04:33 +01:00
Jordan ERNST
222e7b7517 Added SoPine compatibility 2020-11-17 10:56:43 +01:00
Melissa LeBlanc-Williams
b6c24fde44
Merge pull request #360 from twa127/master
Support for Orange Pi Zero Plus2 H5
2020-11-02 08:46:02 -07:00
twa127
294537307c
Update bpim2zero.py
Support for pins PL2 and PL4
2020-11-02 14:42:08 +00:00
twa127
d53b0510d4
Update pin.py
Add support for Banana Pi M2 Zero pins PL2 and PL4
2020-11-02 14:29:07 +00:00
Melissa LeBlanc-Williams
15891fa3df
Merge pull request #322 from dmanla/master
Adding PineH64 SBC support
2020-11-01 10:49:03 -07:00
Melissa LeBlanc-Williams
b140479315
Merge pull request #359 from michaellass/remove_malicious_timeout
Do not prematurely stop waiting for an answer from the message queue
2020-11-01 10:47:38 -07:00
twa127
c7717c16ea
Add files via upload 2020-10-31 21:31:08 +00:00
twa127
7acbef54fa
Add files via upload 2020-10-31 21:30:20 +00:00
Melissa LeBlanc-Williams
75ee720cb2
Merge pull request #358 from twa127/master
Add Support for Banana Pi M2 Zero
2020-10-31 09:33:04 -06:00
twa127
16e37ce651
Delete bpim2zero.cpython-37.pyc 2020-10-31 08:35:22 +00:00
Michael Lass
4305b552ea Do not prematurely stop waiting for an answer from the message queue
When requesting data from libgpiod_pulsein via the message queue, we
always expect an answer. Prematurely stopping to wait for an answer can
only do harm. If we do not read the expected answer from the mq, it will
stay there and be read (falsely) as an answer to the following request.

Example:

* We request a pulse length by sending '^'.
* Due to high system load, libgpiod_pulsein does not send a response in
  time.
* We timeout with a RuntimeError. This is verly likely ignored by the
  calling code since RuntimeErrors are thrown with every invalid
  reading such that the calling code _has to_ ignore these errors.
* We trigger a new sensor reading (pause-clean-resume).
* We request the length of the pulse buffer by sending 'l'.
* We read from the message queue. The response we get now is the
  response to our original '^' request. Let this response be 100.
* We now assume 100 elements in the pulse buffer. This is of course
  wrong and will lead to all sorts of errors.

The only reason to timeout on an expected answer is probably during
initialization when we are not sure if the communication via message
queue has been successfully set up. In all other cases we should just
block and never timeout.
2020-10-31 00:24:25 +01:00
twa127
a8bd55cc42
Update board.py 2020-10-30 17:49:41 +00:00
twa127
ab388f5533
Add files via upload 2020-10-30 16:13:12 +00:00
twa127
43c1b03bba
Update board.py 2020-10-30 16:09:27 +00:00
Melissa LeBlanc-Williams
510aedeac6
Merge pull request #356 from carsonmcdonald/expose_mcp2221_retry_failure
If the number of retries is exceeded raise an error
2020-10-19 08:25:43 -06:00
Carson McDonald
b668b5c9a2 If the number of retries is exceeded raise an error 2020-10-18 10:18:22 -04:00
Limor "Ladyada" Fried
c9f3456d10
Merge pull request #354 from makermelissa/master
Update requirements for latest version of PureIO
2020-10-17 12:28:08 -04:00
Melissa LeBlanc-Williams
a125f690ad Update requirements for latest version of PureIO 2020-10-16 22:44:30 -06:00
Daniel Manla
ff230422c7
Fixed missing asterisk 2020-10-14 15:27:30 -04:00
Melissa LeBlanc-Williams
403d322054
Merge pull request #353 from makermelissa/master
Updated required PlatformDetect to latest
2020-10-13 10:19:58 -06:00
Melissa LeBlanc-Williams
77cdce0bc6 Updated required PlatformDetect to latest 2020-10-13 08:41:10 -06:00
Melissa LeBlanc-Williams
0bc5711e69
Merge pull request #352 from eteq/add-skip-reset
add option to skip reset on MCP2221
2020-10-12 08:39:51 -06:00
Erik Tollerud
98f22066ba add option to skip reset on MCP2221 2020-10-12 01:07:09 -04:00
Melissa LeBlanc-Williams
b901c0161f
Merge pull request #349 from simallaire/multiple_mcp
Enable support for multiple mcp2221
2020-10-08 08:27:06 -06:00
Simon-Pierre Allaire
e8e5f2752a Disable too-few-public-method checks 2020-10-07 14:59:26 -04:00
Simon-Pierre Allaire
ae22d0b266 Reorganize imports 2020-10-07 14:40:56 -04:00
Simon-Pierre Allaire
888b41c53a Add & Remove spaces to clean the syntax 2020-10-07 14:37:20 -04:00
Simon-Pierre Allaire
44a5eff6d0 Create and use mcp-i2c devices 2020-10-07 14:28:19 -04:00
Melissa LeBlanc-Williams
e812739ff6 Update requirements to latest PlatformDetect 2020-10-06 18:09:04 -06:00
Melissa LeBlanc-Williams
d2e5f1c73d
Merge pull request #348 from swarren/clara-agx-xavier
Add support for NVIDIA Clara AGX Xavier
2020-10-06 18:07:04 -06:00
Stephen Warren
283f57c033 Add support for NVIDIA Clara AGX Xavier 2020-10-05 11:49:03 -06:00
Simon-Pierre Allaire
bd66d6f572 Add redefined classes 2020-10-05 12:14:32 -04:00
Simon-Pierre Allaire
29f7058916 Duplicate pi_busio_i2c as starting point 2020-10-05 11:48:26 -04:00
Melissa LeBlanc-Williams
0b13559157
Merge pull request #345 from makermelissa/master
Updated requirements to use latest PureIO
2020-09-30 10:54:35 -06:00
Melissa LeBlanc-Williams
346f0b0713 Updated requirements to use latest PureIO 2020-09-30 10:49:08 -06:00
Melissa LeBlanc-Williams
c8d79678f1
Merge pull request #343 from makermelissa/stm32mp1
Initial STM32MP1 GPIO work
2020-09-10 20:59:52 -07:00
Melissa LeBlanc-Williams
49d059eeb6
Merge pull request #342 from makermelissa/master
Allow latest release of black to run
2020-09-10 20:59:33 -07:00
Melissa LeBlanc-Williams
cb2ad665e3 Merge branch 'master' into stm32mp1 2020-09-10 17:01:08 -07:00
Melissa LeBlanc-Williams
fa80f7d2ef Allow latest release of black to run 2020-09-10 16:53:49 -07:00
Melissa LeBlanc-Williams
ec8239878f Allow latest release of black to run 2020-09-10 16:51:20 -07:00
Melissa LeBlanc-Williams
de082d32a6 Black formatted 2020-09-10 16:45:11 -07:00
Melissa LeBlanc-Williams
7f741786de Initial STM32MP1 GPIO work 2020-09-10 16:43:22 -07:00
Melissa LeBlanc-Williams
6c6e58152c
Merge pull request #339 from makermelissa/stm32_rename
Updated for STM32->STM32F405 PlatformDetect chip rename
2020-09-07 18:07:57 -07:00
Melissa LeBlanc-Williams
f8a13c038c Updated for STM32->STM32F405 PlatformDetect rename 2020-09-04 10:21:40 -07:00
Melissa LeBlanc-Williams
d63da131bc
Merge pull request #338 from makermelissa/master
Move sysv_ipc to only install on Raspberry Pi
2020-09-03 16:36:45 -07:00
Melissa LeBlanc-Williams
623bb42818 Move sysv_ipc to only install on Raspberry Pi 2020-09-03 10:21:36 -07:00
Melissa LeBlanc-Williams
8a75cddf1b
Merge pull request #337 from makermelissa/master
Adjusted Pi 1 Model A to use Pi 1 B Rev 2 board def
2020-08-26 11:44:47 -07:00
Melissa LeBlanc-Williams
df5e872de6 Adjusted Pi 1 Model A to use Pi 1 B Rev 2 board def 2020-08-26 11:32:12 -07:00
Limor "Ladyada" Fried
de652f72b1
Merge pull request #336 from makermelissa/master
Added missing OneWire as NotImplemented stub
2020-08-25 19:31:53 -04:00
Melissa LeBlanc-Williams
d2e478aaa0 Linted new Pylint checks 2020-08-25 16:14:17 -07:00
Melissa LeBlanc-Williams
644968a5e7 Added missing OneWire as NotImplemented stub 2020-08-25 15:43:08 -07:00
Melissa LeBlanc-Williams
ad7c0ada00
Merge pull request #330 from zzts/master
Udoo x86 Ultra GPIO and i2c added
2020-08-17 14:38:03 -07:00
kent
f783eaa220 reformatted with black 2020-08-15 14:13:25 -07:00
kent
52ed0be9ab Merge branch 'udoo_x86' 2020-08-15 13:16:43 -07:00
kent
19e15050e2 i2c function verified. Documentation updated.
i2c functions using I2C0_SCL, I2C0_SDA or I2C1_SCL, I2C1_SDA as   SCl, SDA.  

USART pin removed.  According to documentation embeded linux should use pyserial not busio!

pylint give a message for i2cPorts as not conforming to Capitalization standard, but this the same for all the other examples and the way the other programs expect it.
2020-08-15 13:11:48 -07:00
kent
8a3f42530b Udoo x86 Ultra II board GPIO defs
tested using blink and button and pylint
2020-08-14 10:44:12 -07:00
kent
e2bf5f8c78 Udoo x64 with Pentium N3710 (Braswell core) SOC
created pin, board files and added to board, digitoaio, pin and init.
2020-08-12 18:03:00 -07:00
Carter Nelson
e30741d369
Merge pull request #327 from caternuson/iss326
Fix FT232H SPI chunkification
2020-08-08 07:52:16 -07:00
caternuson
1f00f20cf6 fix FT232H SPI chunkification 2020-08-07 15:42:04 -07:00
Daniel Manla
903af5f46a
Added pineH64 to large elsif block 2020-08-05 14:55:31 -04:00
Daniel Manla
ce2c5ad1e0
Replace pineH64 with "black" formatted version 2020-07-28 14:35:23 -04:00
Daniel Manla
a0a6151d40
Adding "microcontroller" files for allwinner h6 2020-07-23 11:40:47 -04:00
Daniel Manla
750aa0f1b4
Adding pineH64 board file 2020-07-23 11:31:33 -04:00
Kattni
1c7e433546
Merge pull request #321 from makermelissa/master
Added installation instructions to Readme
2020-07-15 17:06:05 -04:00
Melissa LeBlanc-Williams
df96dea96e Fixed PyPI link 2020-07-15 14:01:00 -07:00
Melissa LeBlanc-Williams
ad309deabe Added installation instructions to Readme 2020-07-15 13:19:42 -07:00
Melissa LeBlanc-Williams
a6b34f7666
Merge pull request #319 from makermelissa/master
Fix threading issue that stopped Blinka from working on MicroPython
2020-07-15 10:39:45 -07:00
Melissa LeBlanc-Williams
5189fd3e50 Fix threading issue that stopped Blinka from working on MicroPython 2020-07-14 13:52:50 -07:00
Kattni
6a80505216
Merge pull request #317 from makermelissa/master
Fixed a PWM Bug for the Raspberry Pi
2020-07-10 16:12:42 -04:00
Melissa LeBlanc-Williams
21cee0d1ec Fixed a PWM Bug for the Raspberry Pi 2020-07-10 13:06:59 -07:00
Melissa LeBlanc-Williams
802860668b
Merge pull request #314 from makermelissa/master
Added PWMOut functionality for the Raspberry Pi
2020-07-01 15:43:33 -07:00
Melissa LeBlanc-Williams
71bf7896ed Added PWMOut functionality for the Raspberry Pi 2020-07-01 13:10:07 -07:00
Melissa LeBlanc-Williams
cd909fb3d1
Merge pull request #313 from binhollc/master
Binho Nova performance improvement, use new WHR command which consoli…
2020-06-29 16:35:36 -07:00
Francis Guevarra
62062074a5 Suppress too-many-locals and too-many-branches pylint for pre-existing API's 2020-06-29 09:22:40 -07:00
Francis Guevarra
d581f608ce Run black check with target-version=py35 2020-06-28 17:06:13 -07:00
Francis Guevarra
f73c450270 Binho Nova performance improvement, use new WHR command which consolidates multiple commands into one transaction 2020-06-28 15:53:10 -07:00
Melissa LeBlanc-Williams
0ab99d44db
Merge pull request #307 from luke-iqt/master
Correct the spiId for the Coral Board
2020-06-16 11:18:15 -07:00
Luke Berndt
5622ff8da7 Correct the spiId for the Coral Board
The spiId used for the Coral board changed with Day release of Mendel
2020-06-11 15:58:40 -04:00
Limor "Ladyada" Fried
6db3142005
Merge pull request #300 from makermelissa/master
Fixed pylint to check all files and linted
2020-05-29 14:15:40 -04:00
Melissa LeBlanc-Williams
0ed2c1b09e Fixed import order 2020-05-29 11:09:32 -07:00
Melissa LeBlanc-Williams
18bc57adc6 Fixed pylint to check all files and linted 2020-05-29 11:04:35 -07:00
Melissa LeBlanc-Williams
8072ee88e2
Merge pull request #298 from dnssoftware/master
Using SPI1 on Beaglebone Black
2020-05-28 10:26:09 -07:00
Carter Nelson
f5efceca66
Merge pull request #299 from caternuson/iss295
Update MCP2221
2020-05-27 10:39:29 -07:00
caternuson
8f24038e8a debug cleanup 2020-05-27 10:34:06 -07:00
caternuson
2381e9f34d update MCP2221 2020-05-27 10:09:41 -07:00
dnssoftware
35751fe3f3
Merge pull request #1 from dnssoftware/dnssoftware-patch-1
Update pin.py
2020-05-28 02:44:37 +10:00
dnssoftware
fb3a7c52bc
Update pin.py
On beaglebone black, the spi devices are spidev0.0, spidev0.1, spidev1.0, spidev1.1 and the existing code tries to open up spidev2.0 when using SPI1. Renumbering fixes this.
2020-05-28 02:43:40 +10:00
Melissa LeBlanc-Williams
5346e2eeee
Merge pull request #294 from hhk7734/odroid-xu4
ODROID-XU4: add support for Hardkernel Odroid XU4
2020-05-22 08:08:41 -07:00
Hyeonki Hong
f03eb7b98d ODROID-XU4: add support for Hardkernel Odroid XU4 2020-05-22 13:51:33 +09:00
Melissa LeBlanc-Williams
b64fb9de3d
Merge pull request #293 from makermelissa/master
Display message to linux user to use new Bitbang Library for now
2020-05-21 08:06:28 -07:00
Melissa LeBlanc-Williams
bb8f8b71f4 Display message to linux user to use new Bitbang Library for now 2020-05-21 08:02:42 -07:00
Hyeonki Hong
f96e673beb Exynos5422: add support for Samsung Exynos5422 2020-05-21 17:55:08 +09:00
Melissa LeBlanc-Williams
aa859c73e2 bumped requirements for release 2020-05-15 12:33:03 -07:00
Limor "Ladyada" Fried
6d1bf89081
Merge pull request #289 from makermelissa/master
Added GreatFET One Support
2020-05-15 15:24:13 -04:00
Melissa LeBlanc-Williams
61d0fc3e10 Black formatted 2020-05-14 10:03:09 -07:00
Melissa LeBlanc-Williams
98f4a43784 Added GreatFET One Support 2020-05-14 09:58:38 -07:00
Melissa LeBlanc-Williams
f3bc592818
Merge pull request #287 from makermelissa/libgpiod_pulsein
Updated libgpiod to reduce CPU Usage
2020-05-07 11:00:24 -07:00
Melissa LeBlanc-Williams
3f6a2b8d75 Clearer message 2020-05-07 09:37:42 -07:00
Melissa LeBlanc-Williams
63577fd6b7 Updated libgpiod to reduce CPU Usage 2020-05-07 09:33:09 -07:00
Melissa LeBlanc-Williams
8ad7245903
Merge pull request #285 from trainman419/master
Add Orange PI 2 constant (Attempt #2)
2020-05-04 11:08:36 -07:00
Limor "Ladyada" Fried
ce21899a15
Merge pull request #284 from makermelissa/github_Actions
Set checkout repo to V2 since it fixes an issue
2020-05-04 13:49:08 -04:00
Melissa LeBlanc-Williams
85fcfc9f69 Set checkout repo to V2 since it fixes an issue 2020-05-04 10:19:07 -07:00
trainman419
539962c4c3 Add Orange PI 2 constant 2020-05-03 02:39:00 +00:00
Melissa LeBlanc-Williams
079c1515b8
Merge pull request #279 from makermelissa/master
Added Rock Pi S
2020-04-29 08:53:54 -07:00
Melissa LeBlanc-Williams
eb3e8b6ba7 Added badge for Black to readme 2020-04-29 08:37:57 -07:00
Melissa LeBlanc-Williams
80a2f37a06 Added Rock Pi S 2020-04-29 08:35:56 -07:00
Melissa LeBlanc-Williams
a3770186a9
Merge pull request #276 from makermelissa/master
Pylinted, Black Formatted, and Actions Added
2020-04-22 08:00:50 -07:00
Melissa LeBlanc-Williams
82ffe24730 Linted examples 2020-04-21 16:59:45 -07:00
Melissa LeBlanc-Williams
d08345657d Removed files added by updating submodules 2020-04-21 16:49:14 -07:00
Melissa LeBlanc-Williams
a79e37b272 Massive pylinting session and added Github Actions 2020-04-21 16:41:37 -07:00
Melissa LeBlanc-Williams
85e40fd98d
Merge pull request #275 from hhk7734/meson-g12
Amlogic: integrate G12A, G12B, and SM1
2020-04-21 10:31:49 -07:00
Hyeonki Hong
c2eda22067 ODROID-N2: comment to compare with physical location 2020-04-21 14:29:24 +09:00
Hyeonki Hong
7f5891e146 ODROID-N2: set i2c bus number based on detection 2020-04-21 14:29:08 +09:00
Hyeonki Hong
9ba370bd6d ODROID-C4: set i2c bus number based on detection 2020-04-21 14:28:20 +09:00
Hyeonki Hong
0548bc42eb Amlogic: meson-g12: integrate busio for G12A, G12B, and SM1 2020-04-21 14:27:15 +09:00
Hyeonki Hong
bce35dbe37 Amlogic: meson-g12: integrate gpio-line for G12A, G12B, and SM1
Tested on ODROID-N2 and C4 in kernels 4.9 and 5.4.
2020-04-21 12:24:03 +09:00
Melissa LeBlanc-Williams
aa64c74fd9 Bumping requirements for release 2020-04-18 10:25:18 -07:00
Melissa LeBlanc-Williams
90390bc7eb
Merge pull request #273 from makermelissa/onion-omega
Added Onion Omega2+ Support
2020-04-17 20:37:35 -07:00
Melissa LeBlanc-Williams
9e3e74b111 Clean up a bit 2020-04-17 16:49:42 -07:00
Melissa LeBlanc-Williams
1e22972224 Merge branch 'master' into onion-omega 2020-04-17 15:40:00 -07:00
Melissa LeBlanc-Williams
c7e3b1b74d Bumping requirements for release 2020-04-16 08:38:35 -07:00
Melissa LeBlanc-Williams
51df1333e1 fix merge conflict in branch 2020-04-16 08:37:06 -07:00
Melissa LeBlanc-Williams
9f54be1eed
Merge pull request #270 from johalun/master
Add Clockwork Pi board
2020-04-16 08:32:35 -07:00
Johannes Lundberg
9e870e0ecb Add Clockwork Pi board 2020-04-13 17:34:38 -07:00
Melissa LeBlanc-Williams
2bb7cbf33c
Merge pull request #268 from makermelissa/master
Updates to Blinka to use the PureIO SPI library
2020-04-06 08:41:04 -07:00
Melissa LeBlanc-Williams
a902c58e07 Remove SpiDev from requirements 2020-04-05 10:08:31 -07:00
Melissa LeBlanc-Williams
7170cfb4b8 Updates to Blinka to use the PureIO SPI library 2020-04-03 14:12:06 -07:00
Melissa LeBlanc-Williams
770e016ef7
Merge pull request #267 from hhk7734/odroid-c4
ODROID-C4: remove pad names and add J7
2020-04-03 07:47:27 -07:00
Hyeonki Hong
3efa2cadf0 ODROID-C4: remove pad names and add J7 2020-04-02 18:26:31 +09:00
Hyeonki Hong
d7d53b105d S905X3: modify GPIO and bus pin number 2020-04-02 18:18:50 +09:00
Melissa LeBlanc-Williams
b00aa958d4
Merge pull request #265 from hhk7734/odroid-c4
Add support for Hardkernel Odroid C4
2020-03-23 08:55:56 -07:00
Hyeonki Hong
1aed617dd2 Add support for Hardkernel Odroid C4 2020-03-23 17:03:40 +09:00
Hyeonki Hong
e32430db5b Add support for amlogic s905x3 2020-03-23 16:44:45 +09:00
Melissa LeBlanc-Williams
dc7dc8d494
Merge pull request #256 from swarren/jetson-nx
Add support for NVIDIA Jetson NX
2020-02-24 12:13:24 -08:00
Melissa LeBlanc-Williams
53235694da
Merge pull request #247 from yeyeto2788/busio_fix
Fix busio board detection for Orange Pi boards.
2020-02-24 12:03:35 -08:00
Melissa LeBlanc-Williams
be0bb1456b
Merge pull request #255 from 123p10/master
Added Beaglebone Black Wireless as a device.
2020-02-24 12:02:07 -08:00
Stephen Warren
1427ab7f50 Add support for NVIDIA Jetson NX 2020-02-24 12:38:00 -07:00
Owen
838b5e223f Added Beaglebone Black Wireless as a device. 2020-02-22 10:59:51 -05:00
Scott Shawcroft
5c3bee52b3
Merge pull request #253 from tannewt/remove_bleio
Remove _bleio
2020-02-19 12:46:28 -08:00
Scott Shawcroft
70b891367f
Remove _bleio
`_bleio` is now provided by the [`adafruit-blinka-bleio`](
https://github.com/adafruit/Adafruit_Blinka_bleio) package.
2020-02-19 12:23:04 -08:00
Stephen Warren
62e559d1f5 Jetson TX2: Pin D7 isn't connected
The Jetson TX2 module does not connect baseboard GPIO expansion
connector pin D7 to anything. Remove the invalid value from the code.
2020-02-18 13:50:55 -07:00
yeyeto2788
c2d0c076eb Test the addition of some SPI1 pins 2020-02-17 21:57:04 +01:00
Melissa LeBlanc-Williams
2aa8db3251
Merge pull request #250 from makermelissa/master
Update Python required version to 3.5
2020-02-14 10:06:20 -08:00
Melissa LeBlanc-Williams
4777de8330 Update Python required version to 3.5 2020-02-14 09:56:36 -08:00
Limor "Ladyada" Fried
3e2e9b6def
Merge pull request #248 from caternuson/mcp2221_hid_tweak
MCP2221 delay tuning
2020-02-07 19:30:40 -05:00
caternuson
aa7b754969 MCP2221 delay tuning 2020-02-07 16:11:07 -08:00
yeyeto2788
fc9f166f3d Fix board detection and also check for the chip just in case future boards are added. 2020-02-05 22:11:39 +01:00
yeyeto2788
0f7431224c Fix busio board detection for Orange Pi boards. 2020-02-05 22:00:42 +01:00
Carter Nelson
bd7b612b3f
Merge pull request #244 from caternuson/win_hid_fix2
Change MCP2221 reset behavior
2020-02-04 15:39:15 -08:00
Carter Nelson
b5c457265c change MCP2221 reset behavior 2020-02-04 13:41:47 -08:00
Limor "Ladyada" Fried
f5a8e6d89f
Merge pull request #243 from caternuson/win_hid_fix
Add HID delay
2020-02-02 21:46:30 -05:00
Carter Nelson
f5900b8595 add HID delay 2020-02-02 15:14:52 -08:00
Melissa LeBlanc-Williams
a71e2db31b
Merge pull request #237 from pdp7/fix-bbg
add BeagleBone Green
2020-01-23 13:09:33 -08:00
Drew Fustini
3404422093 add BeagleBone Green
BeagleBone Green has same pin headers as Black
2020-01-23 21:05:18 +00:00
Melissa LeBlanc-Williams
5729000108
Merge pull request #220 from makermelissa/sifive
Partial work for adding hifive unleashed to Blinka (Second Attempt)
2020-01-22 10:18:14 -08:00
Melissa LeBlanc-Williams
a2a3e0abcb Merged master 2020-01-22 10:13:33 -08:00
Melissa LeBlanc-Williams
c723c064ab
Merge pull request #235 from anekimken/master
Changed FT232H search url
2020-01-22 10:05:30 -08:00
Melissa LeBlanc-Williams
0162c2e0b5
Merge pull request #230 from yeyeto2788/module_refactor
Module refactor
2020-01-22 09:28:42 -08:00
Juan Biondi
cedbfbb6ce
Merge pull request #2 from makermelissa/module_refactor
Rebase changes and point to latest Platform Detect
2020-01-22 18:26:00 +01:00
Melissa LeBlanc-Williams
2f5223f400 Point to latest PlatformDetect 2020-01-22 08:21:07 -08:00
Melissa LeBlanc-Williams
e009837d76 Merge branch 'master' of https://github.com/adafruit/Adafruit_Blinka into module_refactor 2020-01-22 08:20:02 -08:00
anekimken
e7d49e4694 Changed FT232H search url
By changing the search URL to ftdi://ftdi:ft232h/1, pyftdi will open the first ft232h it finds, rather than the first ftdi device it finds. This is useful when other usb-serial converters are in use in addition to the ft232h
2020-01-21 17:41:31 -08:00
Scott Shawcroft
1e8ffdb01b
Merge pull request #234 from tannewt/_bleio
Add PacketBuffer to _bleio stub for Apple Media Service library.
2020-01-21 16:09:55 -08:00
Scott Shawcroft
f1fc945c2c
Add PacketBuffer to _bleio stub for Apple Media Service library. 2020-01-21 16:06:54 -08:00
Melissa LeBlanc-Williams
cba0d7c7df
Merge pull request #232 from tannewt/_bleio
Stub out more of _bleio needed by pylint.
2020-01-21 14:49:19 -08:00
Melissa LeBlanc-Williams
11a1aa9404
Merge pull request #233 from makermelissa/master
Temporarily point to older platform detect
2020-01-21 14:46:51 -08:00
Melissa LeBlanc-Williams
35579e2e78 Temporarily point to older platform detect 2020-01-21 14:42:37 -08:00
Melissa LeBlanc-Williams
f8cfb17611 Merge branch 'master' of https://github.com/adafruit/Adafruit_Blinka into module_refactor 2020-01-21 14:40:25 -08:00
Scott Shawcroft
3315db0995
Stub out more of _bleio needed by pylint. 2020-01-21 14:36:00 -08:00
Scott Shawcroft
35b21e53ac
Merge pull request #231 from tannewt/_bleio
Stub out _bleio for use in CI only.
2020-01-21 13:51:18 -08:00
Scott Shawcroft
7fef76c707
Stub out _bleio for use in CI only. 2020-01-21 10:54:09 -08:00
yeyeto2788
26ae921894 Finally fix adafruit_platformdetect import error on microcontroller 2020-01-21 19:27:06 +01:00
yeyeto2788
296c710426 Fix adafruit_platformdetect import error on microcontroller 2020-01-21 19:24:28 +01:00
yeyeto2788
017545698d Fix adafruit_platformdetect import error on microcontroller 2020-01-21 19:22:48 +01:00
yeyeto2788
1fd47d6bae Delete Onion Omega board. 2020-01-21 17:42:34 +01:00
yeyeto2788
185317b1ae Change board module layout based by vendor. 2020-01-21 08:24:28 +01:00
yeyeto2788
cffea8ba1d Merge https://github.com/adafruit/Adafruit_Blinka into module_refactor 2020-01-20 21:13:40 +01:00
yeyeto2788
0b2acaef6b Apply new changes introduced by https://github.com/adafruit/Adafruit_Python_PlatformDetect/pull/56 2020-01-20 21:13:26 +01:00
Melissa LeBlanc-Williams
e2a087d9b1
Merge pull request #228 from yeyeto2788/orangepi
Add Orange Pi boards (One, Lite, PC Plus, Plus 2E)
2020-01-20 09:21:32 -08:00
yeyeto2788
d9b23f5e50 Add Orange Pi boards (One, Lite, PC Plus, Plus 2E) 2020-01-19 01:34:47 +01:00
Melissa LeBlanc-Williams
1c6cd98137
Merge pull request #225 from yeyeto2788/fix_it
Remove reduntant code.
2020-01-14 13:21:18 -08:00
yeyeto2788
2dd005fc67 Remove reduntant code. 2020-01-14 22:10:14 +01:00
yeyeto2788
47a2c58696 Add Onion Omega board into blinka 2020-01-13 18:02:07 +01:00
Melissa LeBlanc-Williams
3375e0d4fe Merge branch 'master' into sifive 2020-01-10 22:23:45 -08:00
Melissa LeBlanc-Williams
12b3e038ff
Merge pull request #223 from makermelissa/master
Changed pin names from GPIO to D because it feel better
2020-01-10 20:02:54 -08:00
Melissa LeBlanc-Williams
c2997be92c Changed pin names from GPIO to D because it feel better 2020-01-10 17:56:57 -08:00
Melissa LeBlanc-Williams
ff954c5a6e Resolving merge conflict 2020-01-10 14:04:35 -08:00
Melissa LeBlanc-Williams
f829cd29db
Merge pull request #222 from yeyeto2788/AllWinner_refactor
Provide the use of Pine64 device on blinka with busio and digitalio
2020-01-10 13:18:37 -08:00
Juan Biondi
93494ec17f
Merge pull request #1 from makermelissa/pine64
So sorry for the mistakes, I'll keep it in mind for future PRs.

Thanks for the help
2020-01-10 07:44:46 +01:00
Melissa LeBlanc-Williams
a774d91cac Added Pine64 Board and fixed Pin Definitions 2020-01-09 16:38:30 -08:00
Melissa LeBlanc-Williams
104bf0c9e9 Merge branch 'AllWinner_refactor' of https://github.com/yeyeto2788/Adafruit_Blinka into pine64 2020-01-09 15:29:36 -08:00
yeyeto2788
0247ac4c6e Add support for atheros9331 chip. 2020-01-09 22:11:59 +01:00
yeyeto2788
3339c0ad51 Fix error on microcontroller.pin when importing pin 2020-01-09 20:24:11 +01:00
yeyeto2788
86cf635264 Fix error on importing pin without pointing to the right module (allwinner.a64) 2020-01-09 20:19:52 +01:00
yeyeto2788
cbe6edb276 Provide the use of Pine64 device on blinka with busio and digitalio 2020-01-09 20:13:38 +01:00
Melissa LeBlanc-Williams
9a882d0125 Updated board/chip for finishing touches 2020-01-09 10:38:04 -08:00
Alvaro Figueroa
9bbe1795fb Adding board definition, fixing microcontroller pin names 2020-01-09 10:03:48 -08:00
Alvaro Figueroa
b5d5219e93 Erasing wrong file for riscv port 2020-01-09 10:03:48 -08:00
Alvaro Figueroa
9974b969b2 Initial work for adding hifive unleashed, bit lost from here 2020-01-09 10:03:48 -08:00
Alvaro Figueroa
a0f6cbc4e7 Adding board definition, fixing microcontroller pin names 2020-01-09 10:03:48 -08:00
Alvaro Figueroa
92f204a2a6 Erasing wrong file for riscv port 2020-01-09 10:03:48 -08:00
Alvaro Figueroa
acce5df66d Initial work for adding hifive unleashed, bit lost from here 2020-01-09 10:03:48 -08:00
Melissa LeBlanc-Williams
fa382db0f1 Rebase Try 3 2020-01-09 09:56:58 -08:00
Alvaro Figueroa
029237ed31 Adding board definition, fixing microcontroller pin names 2020-01-09 09:55:12 -08:00
Alvaro Figueroa
01b2c25ee1 Erasing wrong file for riscv port 2020-01-09 09:55:12 -08:00
Alvaro Figueroa
6f90e8bf17 Initial work for adding hifive unleashed, bit lost from here 2020-01-09 09:55:12 -08:00
Alvaro Figueroa
8c5b643fca Adding board definition, fixing microcontroller pin names 2020-01-09 09:54:47 -08:00
Alvaro Figueroa
0c03ed70fa Erasing wrong file for riscv port 2020-01-09 09:54:47 -08:00
Alvaro Figueroa
7aba6e53dc Initial work for adding hifive unleashed, bit lost from here 2020-01-09 09:54:47 -08:00
Melissa LeBlanc-Williams
db6967806d Merge branch 'master' of https://github.com/fede2cr/Adafruit_Blinka 2020-01-09 09:51:46 -08:00
Alvaro Figueroa
9cfdf08bd5 Adding board definition, fixing microcontroller pin names 2020-01-09 09:51:04 -08:00
Alvaro Figueroa
22dc03d4ea Erasing wrong file for riscv port 2020-01-09 09:51:04 -08:00
Alvaro Figueroa
3f9a3c8429 Initial work for adding hifive unleashed, bit lost from here 2020-01-09 09:51:04 -08:00
Melissa LeBlanc-Williams
82ff2f40b5 Rebasing due to this being old 2020-01-09 09:43:01 -08:00
Melissa LeBlanc-Williams
acd42dc865
Merge pull request #215 from yeyeto2788/AllWinner_refactor
Simple refactor to place all AllWinner boards within the same module
2020-01-09 09:29:05 -08:00
Carter Nelson
31ce09daee
Merge pull request #219 from caternuson/iss208_pt2
Update pyftdi version for pypi
2020-01-09 09:24:02 -08:00
caternuson
1eb4048cf6 update pyftdi version for pypi 2020-01-09 08:52:31 -08:00
Limor "Ladyada" Fried
e80aa09fdb
Merge pull request #218 from caternuson/iss208
FT232H updates for pyftdi API changes
2020-01-09 11:38:05 -05:00
caternuson
fbee79f774 updates for pyftdi 2020-01-08 14:41:26 -08:00
Carter Nelson
94b8f61cb2
Merge pull request #216 from binhollc/master
Fix merge error in i2c busio and add frequency to Nova i2c init
2020-01-08 10:20:46 -08:00
Francis Guevarra
beee1735fc Fix merge error in i2c busio and add frequency to Nova i2c init 2020-01-08 09:58:32 -08:00
yeyeto2788
5c0c8e17aa Add first commit for AllWinner A64 chip. 2020-01-08 16:00:19 +01:00
yeyeto2788
3306ddab1a Simple refactor to place all AllWinner boards within the same module 2020-01-08 09:57:12 +01:00
Melissa LeBlanc-Williams
df3fdc7b5c
Merge pull request #212 from makermelissa/master
Updated to not install spidev automatically on the mips platform
2020-01-02 15:57:17 -08:00
Melissa LeBlanc-Williams
45448a15aa Updated to not install spidev automatically on the mips platform 2020-01-02 15:35:14 -08:00
Melissa LeBlanc-Williams
09ef935976
Merge pull request #211 from makermelissa/master
Updated to not install sysv_ips on mips platform
2020-01-02 14:18:28 -08:00
Melissa LeBlanc-Williams
599f21f375 Updated to not install sysv_ips on mips platform 2020-01-02 13:59:34 -08:00
Carter Nelson
4f258c680c
Merge pull request #207 from caternuson/iss206
Additional PyPi and other things for new analogio module
2019-12-19 13:19:59 -08:00
caternuson
540bc6828f remove for now 2019-12-19 11:02:10 -08:00
caternuson
2b3753b9e5 fix api.rst 2019-12-19 10:43:29 -08:00
caternuson
8b62f3a780 additional items for analogio 2019-12-19 10:19:44 -08:00
Melissa LeBlanc-Williams
cac0d65a5a
Merge pull request #205 from makermelissa/master
removed hidapi altogether
2019-12-17 16:23:28 -08:00
Melissa LeBlanc-Williams
c9773de558 removed hidapi altogether 2019-12-17 16:20:03 -08:00
Melissa LeBlanc-Williams
32f25f5a75
Merge pull request #204 from makermelissa/master
Update setup.py to only install hidapi on non-CI environment
2019-12-17 16:13:14 -08:00
Melissa LeBlanc-Williams
d9b60d51d9 removed hidapi from requirements again 2019-12-17 15:53:44 -08:00
Melissa LeBlanc-Williams
d01c3ff0c9 Update setup.py to only install hidapi on non-CI environment 2019-12-17 15:37:24 -08:00
Limor "Ladyada" Fried
ef6cc4fb46
Merge pull request #203 from makermelissa/master
Removing hidapi from requirements to fix Travis
2019-12-16 21:24:48 -05:00
Melissa LeBlanc-Williams
3d560dbd63 Removing hidapi from requirements to fix Travis 2019-12-16 18:03:47 -08:00
Limor "Ladyada" Fried
b37fca8bab
Merge pull request #199 from caternuson/iss174
Add frequency for FT232H I2C
2019-12-16 13:45:29 -05:00
caternuson
d0f634a400 add freq for FT232H I2C 2019-12-16 10:33:54 -08:00
Limor "Ladyada" Fried
0deaef8349
Merge pull request #196 from caternuson/mcp2221_reqs
Update PyPi requirements for MCP2221
2019-12-09 16:08:36 -05:00
caternuson
6ebd41ca7f install libudev 2019-12-09 11:31:10 -08:00
caternuson
444e463111 change install order 2019-12-09 11:18:20 -08:00
caternuson
c447548b55 add libusb for travis 2019-12-09 11:11:22 -08:00
caternuson
dbdceb69b0 update pypi requirements 2019-12-09 10:17:06 -08:00
Limor "Ladyada" Fried
612427cab1
Merge pull request #195 from ladyada/master
fix mcp2221 i2c scan
2019-12-07 18:22:19 -05:00
Lady Ada
b7889ed694 fix i2c scan 2019-12-06 21:20:19 -05:00
Limor "Ladyada" Fried
069a670a4c
Merge pull request #184 from caternuson/mcp2221
Add MCP2221 support.
2019-12-06 21:15:09 -05:00
caternuson
887665d34a ladyada's awesome late night bunch-o-changes 2019-12-06 16:39:40 -08:00
Limor "Ladyada" Fried
1a8f73f1ae
Merge pull request #194 from adafruit/multibyteaddr
Multibyteaddr
2019-12-06 12:58:46 -05:00
Lady Ada
76728de104 Merge branch 'master' of github.com:adafruit/Adafruit_Blinka 2019-12-05 23:44:51 -05:00
Lady Ada
102ba2251d fix multibyte-write-then-read! 2019-12-05 23:44:28 -05:00
Melissa LeBlanc-Williams
77aca4cf9e
Merge pull request #193 from Gerdie/master
Add RX TX aliases for raspberry pi
2019-12-05 12:19:59 -08:00
caternuson
021c1242f9 updates 2019-12-05 12:10:11 -08:00
caternuson
c72b2913f8 initial working MCP2221 2019-12-05 12:10:11 -08:00
Gerdie
449de22b8a Add RX TX aliases for raspberry pi 2019-12-05 12:05:02 -08:00
Melissa LeBlanc-Williams
4376a296bd
Merge pull request #191 from binhollc/master
Add Binho Nova integration
2019-12-03 09:45:31 -08:00
Francis Guevarra
0926764617 Merge branch 'master' of https://github.com/binhollc/Adafruit_Blinka 2019-12-02 18:29:08 -08:00
Francis Guevarra
c228c4a5d5 Fix some pylint errors 2019-12-02 18:10:43 -08:00
Francis Guevarra
56a6f4cba2 Fix some SPI-related code to get BME280 example code working 2019-12-02 18:07:16 -08:00
Francis Guevarra
e3d5915646 Add a singleton Connection class to get the same object instance of the binho nova adapter 2019-12-02 18:04:28 -08:00
Francis Guevarra
44e8428184 Enable spi init and read 2019-12-02 17:54:46 -08:00
Francis Guevarra
94a57801c1 Initial Binho Nova plumbing 2019-12-02 17:43:35 -08:00
Francis Guevarra
be55fe4c51 Make sure to set spi's numericalbase to 10 2019-12-02 17:23:48 -08:00
Francis Guevarra
f813f1ef2d Adafuit uses 7-bit address, shift address to make it 8-bit for binho nova writeto_then_readfrom i2c 2019-12-02 17:23:47 -08:00
Francis Guevarra
4df933191e Shift address 1 bit to the left to support 7-bit addressing 2019-12-02 17:23:47 -08:00
Francis Guevarra
ffd3c408c9 Fix some SPI-related code to get BME280 example code working 2019-12-02 17:23:47 -08:00
Francis Guevarra
a6837a9dad Add uart interface 2019-12-02 17:23:47 -08:00
Francis Guevarra
990be458b9 Add a singleton Connection class to get the same object instance of the binho nova adapter 2019-12-02 17:23:47 -08:00
Francis Guevarra
9584ded68b Add pulseio support with nova pwmout 2019-12-02 17:23:47 -08:00
Francis Guevarra
28f9b9ec68 Add support for digitalio pins 2019-12-02 17:23:47 -08:00
Francis Guevarra
76cf829673 Comment out pin import for i2c for now to get it working, implement the rest of spi interfaces 2019-12-02 17:23:47 -08:00
Francis Guevarra
de61c37283 Enable spi init and read 2019-12-02 17:23:47 -08:00
Francis Guevarra
76c0534aa7 Fix some syntax errors and add binho nova to busio.py for i2c and spi 2019-12-02 17:23:47 -08:00
Jonathan Georgino
ff4752dfb4 First attempt at implementing I2C driver -- Untested. Committing to review with Francis 2019-12-02 17:23:47 -08:00
Francis Guevarra
881b18508a Silence pin stuff for now 2019-12-02 17:23:47 -08:00
Francis Guevarra
75639a87c5 Initial Binho Nova plumbing 2019-12-02 17:23:47 -08:00
Francis Guevarra
c0b17665b1 Fix some pylint errors 2019-12-02 17:16:04 -08:00
Melissa LeBlanc-Williams
a8662a122f
Merge pull request #192 from DonPancoe/bbb_industrial
Added BEAGLEBONE_BLACK_INDUSTRIAL to board.py
2019-12-02 17:03:15 -08:00
Melissa LeBlanc-Williams
f3a8911346
Merge pull request #190 from makermelissa/master
Blinka will now work with i2c-3 automatically
2019-12-02 17:01:16 -08:00
Don Pancoe
d9920ff157 Added BEAGLEBONE_BLACK_INDUSTRIAL to board.py. It still imports from
adafruit_blinka.board.beaglebone_black because it is otherwise
compatible except for the increased temperature range.
2019-12-02 19:31:36 -05:00
Francis Guevarra
76ebb04b49 Merge branch 'master' of https://github.com/binhollc/Adafruit_Blinka 2019-12-02 15:47:58 -08:00
Francis Guevarra
08c09ff9d4 Make sure to set spi's numericalbase to 10 2019-12-02 15:32:21 -08:00
Francis Guevarra
dfc9078e35 Adafuit uses 7-bit address, shift address to make it 8-bit for binho nova writeto_then_readfrom i2c 2019-12-02 15:32:21 -08:00
Francis Guevarra
f41e4ffee1 Shift address 1 bit to the left to support 7-bit addressing 2019-12-02 15:32:21 -08:00
Francis Guevarra
a4185d6881 Fix some SPI-related code to get BME280 example code working 2019-12-02 15:32:21 -08:00
Francis Guevarra
3b0f167719 Add uart interface 2019-12-02 15:32:21 -08:00
Francis Guevarra
f66f0884c2 Add a singleton Connection class to get the same object instance of the binho nova adapter 2019-12-02 15:32:21 -08:00
Francis Guevarra
65ce2c9ee4 Add pulseio support with nova pwmout 2019-12-02 15:32:21 -08:00
Francis Guevarra
1e9d6aaced Add support for digitalio pins 2019-12-02 15:32:21 -08:00
Francis Guevarra
8ab94af6ad Comment out pin import for i2c for now to get it working, implement the rest of spi interfaces 2019-12-02 15:32:21 -08:00
Francis Guevarra
82eaa9922d Enable spi init and read 2019-12-02 15:32:21 -08:00
Francis Guevarra
3395c53b23 Fix some syntax errors and add binho nova to busio.py for i2c and spi 2019-12-02 15:32:21 -08:00
Jonathan Georgino
d6f98c20c8 First attempt at implementing I2C driver -- Untested. Committing to review with Francis 2019-12-02 15:32:21 -08:00
Francis Guevarra
2e04dd7db9 Silence pin stuff for now 2019-12-02 15:32:21 -08:00
Francis Guevarra
7f1793b45c Initial Binho Nova plumbing 2019-12-02 15:32:21 -08:00
Melissa LeBlanc-Williams
2b4662736a Merge branch 'master' of https://github.com/adafruit/Adafruit_Blinka 2019-12-02 14:09:34 -08:00
Melissa LeBlanc-Williams
c12a47fcd8
Merge pull request #187 from crbn60/master
Duplicate Beaglebone Black for Green Wireless
2019-12-02 13:30:56 -08:00
Adam Sherman
a3be941f77
Reuse existing file instead of create a new one
As disscussed in PR #185.
2019-12-02 16:26:52 -05:00
Melissa LeBlanc-Williams
240cf176db Removed variable used for testing 2019-12-02 10:41:21 -08:00
Melissa LeBlanc-Williams
b3f89e9439 Blinka will work with i2c-3 enabled with no code changes! 2019-12-02 10:30:07 -08:00
Adam Sherman
99269b02e2
Duplicate Beaglebone Black for Green Wireless 2019-11-30 08:55:15 -05:00
Lady Ada
ca39fe22c8 fix mixed up idle state polarity, and extra first-pulse from idle 2019-11-27 15:37:45 -05:00
Francis Guevarra
fff2c1191a Make sure to set spi's numericalbase to 10 2019-11-26 15:54:55 -08:00
Francis Guevarra
3172479ec8 Adafuit uses 7-bit address, shift address to make it 8-bit for binho nova writeto_then_readfrom i2c 2019-11-26 13:41:14 -08:00
Francis Guevarra
be4461beb4 Shift address 1 bit to the left to support 7-bit addressing 2019-11-26 11:39:32 -08:00
Melissa LeBlanc-Williams
738d6d910c
Merge pull request #183 from theacodes/master
Add stubs for micropython.natve, viper, and asm_thumb
2019-11-26 08:58:38 -08:00
Thea Flowers
e89ea27c8b Add stubs for micropython.natve, viper, and asm_thumb 2019-11-25 18:07:14 -08:00
Francis Guevarra
bffc7f4883 Fix some SPI-related code to get BME280 example code working 2019-11-25 16:48:13 -08:00
Melissa LeBlanc-Williams
23217b2b16
Merge pull request #182 from makermelissa/master
Added spidev >= 3.4 in setup.py
2019-11-25 16:45:32 -08:00
Melissa LeBlanc-Williams
43e5a7eebb Added spidev >= 3.4 in setup.py 2019-11-25 15:34:07 -08:00
Melissa LeBlanc-Williams
5d1689e965
Merge pull request #170 from hamishmb/fix-thread-safety
Add a lock for thread safety when the I2C class is used in a with statement
2019-11-25 14:42:33 -08:00
Melissa LeBlanc-Williams
b6048fa532
Merge pull request #181 from adafruit/revert-175-patch-3
Revert "Update jetson_nano.py"
2019-11-25 14:38:58 -08:00
Melissa LeBlanc-Williams
8f602e5050
Revert "Update jetson_nano.py" 2019-11-25 14:36:48 -08:00
Melissa LeBlanc-Williams
a445da57a7
Merge pull request #180 from adafruit/revert-176-patch-2
Revert "Update pin.py"
2019-11-25 14:36:28 -08:00
Melissa LeBlanc-Williams
935bd66a7b
Revert "Update pin.py" 2019-11-25 14:33:57 -08:00
Melissa LeBlanc-Williams
8009b93320
Merge pull request #175 from tb5874/patch-3
Update jetson_nano.py
2019-11-25 14:30:43 -08:00
Melissa LeBlanc-Williams
61fc643d64
Merge pull request #176 from tb5874/patch-2
Update pin.py
2019-11-25 14:30:37 -08:00
Francis Guevarra
5c0fd36804 Add uart interface 2019-11-23 14:38:30 -08:00
tb5874
c15c344e74
Update jetson_nano.py
started by modify https://github.com/adafruit/Adafruit_Blinka/blob/master/src/adafruit_blinka/microcontroller/tegra/t210/pin.py
2019-11-22 14:19:33 +09:00
tb5874
5732569ec9
Update pin.py
https://www.jetsonhacks.com/nvidia-jetson-nano-j41-header-pinout/
https://docs.google.com/spreadsheets/d/1LsgtB-vEs6yJQ9URbp_P2XIVghCy400udUMC0MHWm5w/edit#gid=1812645714

SDA SCL 0 and SDA SCL 1 order modify
2019-11-22 14:09:04 +09:00
Francis Guevarra
8710bd63a4 Add a singleton Connection class to get the same object instance of the binho nova adapter 2019-11-21 16:23:37 -08:00
Francis Guevarra
b8ddd303bf Add pulseio support with nova pwmout 2019-11-20 22:02:06 -08:00
Francis Guevarra
6f36409bfa Add support for digitalio pins 2019-11-19 18:01:09 -08:00
Francis Guevarra
1b1794b488 Comment out pin import for i2c for now to get it working, implement the rest of spi interfaces 2019-11-18 23:30:13 -08:00
Francis Guevarra
bf74dc0324 Enable spi init and read 2019-11-17 22:29:30 -08:00
Francis Guevarra
2c6d236a71 Fix some syntax errors and add binho nova to busio.py for i2c and spi 2019-11-17 12:48:04 -08:00
Jonathan Georgino
5634db4de7 First attempt at implementing I2C driver -- Untested. Committing to review with Francis 2019-11-16 22:22:57 -08:00
Francis Guevarra
4825537d3e Silence pin stuff for now 2019-11-16 21:44:05 -08:00
Francis Guevarra
7c00bb4d52 Initial Binho Nova plumbing 2019-11-16 21:38:12 -08:00
Limor "Ladyada" Fried
8a4686cbc7
Merge pull request #173 from caternuson/iss172
Add SPI phase check to FT232H
2019-11-14 13:52:29 -05:00
caternuson
87673ef187 add SPI phase check to FT232H 2019-11-14 10:13:33 -08:00
Melissa LeBlanc-Williams
cf07b4274f
Merge pull request #168 from pdp7/master
Add PWMOut for PocketBeagle
2019-11-01 09:36:37 -07:00
Hamish McIntyre-Bhatty
76ca3e6a3c Add a lock for thread safety when the I2C class is used in a with statement 2019-10-31 14:38:40 +00:00
Melissa LeBlanc-Williams
d573afb20d
Merge pull request #169 from makermelissa/master
Changed error to more appropriate type
2019-10-29 16:06:30 -07:00
Melissa LeBlanc-Williams
65a43f8930 Changed error to more appropriate type 2019-10-29 10:04:24 -07:00
Drew Fustini
824d525493 Add PWMOut for PocketBeagle #159
Add PWMOut for PocketBeagle which has the AM3358 SoC.

Note that the generic linux PWMOut implementation will
not work as BeagleBoard.org kernel has a patch to allow
udev to be able to set the ownership and permissions
in /sys/class/pwm when channels are exported.  However,
this naming scheme is different than what is used in the
mainline kernel.

The PocketBeagle has these PWM outputs:

/sys/class/pwm/pwmchip0/pwm-0:0/period
/sys/class/pwm/pwmchip0/pwm-0:1/period
/sys/class/pwm/pwmchip2/pwm-2:0/period
/sys/class/pwm/pwmchip2/pwm-2:1/period
/sys/class/pwm/pwmchip4/pwm-4:0/period
/sys/class/pwm/pwmchip4/pwm-4:1/period

Here is the kernel patch that is being used:
https://github.com/RobertCNelson/bb-kernel/blob/am33x-v4.11/patches/drivers/pwm/0001-pwm-Create-device-class-for-pwm-channels.p$
2019-10-26 22:08:26 +02:00
Limor "Ladyada" Fried
cc3f8eccf2
Merge pull request #167 from makermelissa/master
Always pass on set_no_cs()
2019-10-19 11:51:46 -04:00
Melissa LeBlanc-Williams
1198b4bab3 Always pass on set_no_cs() 2019-10-19 08:36:58 -07:00
Melissa LeBlanc-Williams
24371e8c6b
Merge pull request #166 from lichttag/master
Fix missing attribute exception catch for 'SPI.chip' on RPi
2019-10-19 08:31:21 -07:00
lichttag
d77877bbb8 Fix missing attribute exception on RPi 2019-10-19 17:21:54 +02:00
Limor "Ladyada" Fried
8e938ca344
Merge pull request #164 from caternuson/spi_freq
Add SPI frequency property
2019-10-10 21:14:08 -04:00
caternuson
cbaee77564 add SPI frequency property 2019-10-10 17:43:13 -07:00
Limor "Ladyada" Fried
92493840e9
Merge pull request #162 from makermelissa/master
Fixes issue with SPI on Orange Pi Zero and R1
2019-10-04 21:17:20 -04:00
Melissa LeBlanc-Williams
b512639955 Fixes issue with SPI on Orange Pi Zero and R1 2019-10-04 18:11:31 -07:00
Limor "Ladyada" Fried
150f00e4e6
Update spi.py 2019-09-27 23:23:48 -04:00
Limor "Ladyada" Fried
81993c470d
Merge pull request #160 from caternuson/ft232h_chunky_spi_write
Chunkify FT232H SPI write
2019-09-26 14:01:14 -04:00
caternuson
b148cfd0ca chunkify ft232h spi write 2019-09-26 10:49:33 -07:00
Limor "Ladyada" Fried
bf49679028
Merge pull request #158 from caternuson/ft232h
Add basic FT232H support.
2019-09-20 22:56:58 -04:00
caternuson
10b0b4094a requirements update windows 2019-09-20 19:54:14 -07:00
caternuson
36a01e28d2 add i2c scan 2019-09-20 19:38:40 -07:00
caternuson
40e172cb06 add pyftdi to requirements 2019-09-20 10:46:41 -07:00
caternuson
2146f116d5 doc strings and misc cosmetic 2019-09-20 08:02:11 -07:00
caternuson
ecba441c03 initial working ft232h i2c/spi/gpio 2019-09-19 18:35:41 -07:00
Limor "Ladyada" Fried
93f393a931
Merge pull request #155 from makermelissa/master
Adds Raspberry Pi 1 Model A
2019-09-11 19:58:26 -04:00
Melissa LeBlanc-Williams
cb1be808d6 This should get the Pi 1 Model A working 2019-09-11 15:13:04 -07:00
Melissa LeBlanc-Williams
d01f39b87d Merge branch 'master' of https://github.com/adafruit/Adafruit_Blinka 2019-09-06 11:34:16 -07:00
Melissa LeBlanc-Williams
e9a8350d95
Merge pull request #152 from hansoostendorp/orangepizero
Orangepizero
2019-09-06 11:25:26 -07:00
Melissa LeBlanc-Williams
05efa3b9e3 Merge branch 'orangepizero' of https://github.com/hansoostendorp/Adafruit_Blinka 2019-09-06 10:20:51 -07:00
Hans Oostendorp
2660fec711 The AllWinner H2 SoC has the same pinout as the AllWinner H3 SoC, let the Orange Pi Zero board use that microcontroller to keep it more simple 2019-09-06 10:41:10 +02:00
Hans Oostendorp
49b6feff70 add SPI support for Orange Pi Zero 2019-09-06 10:26:25 +02:00
Melissa LeBlanc-Williams
2852c836b8
Merge pull request #151 from swarren/board-dependencies
setup.py: Runtime dependency determination
2019-09-05 14:32:54 -07:00
Hans Oostendorp
657b7f0781 add support for Orange Pi Zero board 2019-09-05 21:55:15 +02:00
Stephen Warren
d5c115ba24 setup.py: Runtime dependency determination
setup.py currently assumes that all ARMv6/7 platforms are an RPi, and all
AArch64 systems are a Jetson. This is untrue, since:

a) All recent ARM Linux systems are one of those types, and Blinka
supports plenty of Linux systems besides the Pi and Jetson.

b) Recent Pis are quite capable of running an AArch64 user-space, and
Jetson could run an ARMv7 user-spcae.

Solve this by enhancing setup.py to detect which specific system it's
running on, using the device tree compatible value. (Other mechanisms
could be used for other types of system in the future if required.) The
active dependency list is calculated based on this information.

There have been some bugs reported[1] that could only have occurred if
the previous platform limitations in setup.py's install_requires were not
correctly implemented, or people were running non-default user-space.
This change will ensure only the expected libraries are installed in
those cases.

[1]
https://github.com/NVIDIA/jetson-gpio/issues/19
https://github.com/adafruit/Adafruit_Blinka/issues/149

I have tested this on one Jetson system. I have not tested it on a Pi,
nor other systems supported by Blinka. However, I have confirmed the Pi
compatible values match those used by:

- The upstream Linux kernel.

- The latest Pi Foundation kernel.

- Pi Foundation kernel 4.8, from around Jan 2017.
  4.7 used different compatible values.
2019-08-26 12:53:29 -06:00
Melissa LeBlanc-Williams
a322e55fdb
Merge pull request #145 from makermelissa/master
Update requirements for SpiDev >= 3.4
2019-08-23 11:08:17 -07:00
Alvaro Figueroa
fafe6bc929 Adding board definition, fixing microcontroller pin names 2019-08-15 19:31:18 -06:00
Melissa LeBlanc-Williams
83696cab4a
Merge pull request #148 from swarren/jetson-spi
Jetson SPI support and Jetson.GPIO requirement
2019-08-15 09:43:46 -07:00
Stephen Warren
0a8ed0be0f Require Jetson.GPIO on aarch64
The Tegra pin.py files depend on the Jetson.GPIO library. Currently, they
assume the library is installed in /opt/nvidia/jetson-gpio and hard-code
this path. This doesn't work well when someone has installed an upgraded
version, e.g. via PYTHONPATH or pip. To solve this, remove the
hard-coding of Jetson.GPIO's installation path, and update setup.py and
requirements.txt to ensure that Jetson.GPIO is available. Note that
Jetson.GPIO is now available via PyPi, but may not have been when initial
Jetson support was added to Blinka.
2019-08-15 10:21:09 -06:00
Stephen Warren
f454d3a956 Add SPI controller support for Jetson boards
Add spiPorts[] to each Tegra's pin.py, and add SPI pin names to each
Jetson's board definition file.

Every Jetson board supports the regular SPI port on the 40-pin GPIO
expansion connector. Jetson Nano also supports a second SPI port.

Note: The user must still take manual action to:

1) Reprogram Jetson's pinmux to route the SPI signals to the 40-pin GPIO
expansion connector; by default these pins are configured as GPIO.
Documentation on this topic is available on the Jetson download site.

2) Instantiate an spidev device in device tree, which will then trigger
the creation of the /dev/spidevN.0 device node file. Future versions of
L4T will do this by default.

3) Set permissions on the /dev/spidevN.0 device node file to allow
regular users to access the file. The udev rules file in the latest
version of Jetson.GPIO includes rules for this purpose.

Without taking these actions, SPI functionality will not work.
2019-08-15 10:16:34 -06:00
Stephen Warren
b9413fc299 Jetson TX2: Add missing D7 pin definition 2019-08-15 09:56:17 -06:00
Alvaro Figueroa
1b2ea6f955 Erasing wrong file for riscv port 2019-08-13 15:35:12 -06:00
Alvaro Figueroa
ce4be6a395 Initial work for adding hifive unleashed, bit lost from here 2019-08-13 15:32:40 -06:00
Melissa LeBlanc-Williams
12a576f51b
Merge pull request #146 from paulcrawford/master
Adding Odroid N2
2019-08-06 16:03:45 -07:00
Melissa LeBlanc-Williams
5189e2d75d PR Changes, organized mc, removed duplicates 2019-08-06 15:47:48 -07:00
Melissa LeBlanc-Williams
8f13ca9766 Shorted version number just in case ;) 2019-08-05 14:04:47 -07:00
Melissa LeBlanc-Williams
fe2e855197 Undo previous commit, just changed requirements 2019-08-05 09:30:17 -07:00
Melissa LeBlanc-Williams
c4584b6146 Use writebytes as fallback if we have an older spidev 2019-08-05 09:15:18 -07:00
paulcrawford
aaa44944ff
Update pin.py 2019-08-05 10:56:11 -04:00
paulcrawford
e7f1835cfa
Update __init__.py 2019-08-05 10:53:48 -04:00
paulcrawford
d70ea3bf4d
Update odroidn2.py 2019-08-05 10:35:50 -04:00
paulcrawford
0cb9e9b989
Update odroidn2.py 2019-08-05 10:17:43 -04:00
paulcrawford
d29e815f8a
Update pin.py 2019-08-05 10:11:05 -04:00
paulcrawford
9c964de681
Update board.py 2019-08-04 17:06:24 -04:00
paulcrawford
2fd866e9f2
Update board.py 2019-08-04 16:55:05 -04:00
paulcrawford
a16a662e6f
Update board.py 2019-08-04 16:35:09 -04:00
paulcrawford
34848455e4
Update board.py 2019-08-04 13:19:53 -04:00
paulcrawford
5ea80f2276
Update pin.py 2019-08-04 13:03:16 -04:00
paulcrawford
41e943ab29
Update board.py 2019-08-03 11:28:33 -04:00
paulcrawford
f0069bad6b
Update board.py 2019-08-03 09:48:03 -04:00
paulcrawford
a1630f67d3
Update odroidn2.py 2019-08-02 21:24:45 -04:00
paulcrawford
7e80afdafb
Update board.py 2019-08-02 17:48:44 -04:00
paulcrawford
e74f5cd9dd
Update board.py 2019-08-02 17:44:58 -04:00
paulcrawford
05b9efc122
Update board.py 2019-08-02 17:38:48 -04:00
paulcrawford
6558bfd141
Update board.py 2019-08-02 17:30:22 -04:00
paulcrawford
a00f734e8d
Update digitalio.py 2019-08-02 17:11:58 -04:00
paulcrawford
2a77f95745
Update board.py 2019-08-02 17:08:33 -04:00
paulcrawford
0e2dc89dc9
Update odroidn2.py 2019-08-02 17:04:40 -04:00
paulcrawford
159dfdf5dc
Update odroidn2.py 2019-08-02 15:56:16 -04:00
paulcrawford
ec5c8562f5
Create odroidn2.py 2019-08-02 15:40:23 -04:00
Melissa LeBlanc-Williams
54bbb49af6
Merge pull request #142 from makermelissa/master
Update writebytes to writebytes2 for long buffers
2019-08-02 11:27:54 -07:00
Melissa LeBlanc-Williams
9b432b0734 Update writebytes to writebytes2 for long buffers 2019-08-02 11:13:50 -07:00
paulcrawford
641a3ddb81
Update pin.py 2019-07-30 22:07:26 -04:00
paulcrawford
672c3c9b02
Update pin.py 2019-07-30 17:59:10 -04:00
paulcrawford
b650fd0ef7
Update pin.py 2019-07-30 13:07:31 -04:00
paulcrawford
134de36517
Update pin.py 2019-07-30 12:16:16 -04:00
paulcrawford
75c6520992
Create __init__.py 2019-07-30 12:13:31 -04:00
paulcrawford
9eefb44141
Create pin.py 2019-07-30 12:12:19 -04:00
paulcrawford
99ca49e38e
Delete s922x 2019-07-30 12:11:37 -04:00
paulcrawford
e44c78efb8
Create s922x 2019-07-30 11:52:50 -04:00
Melissa LeBlanc-Williams
a7bcbc4bc8
Merge pull request #139 from makermelissa/master
Added Raspberry Pi Compute Module Support
2019-07-19 14:15:44 -07:00
Melissa LeBlanc-Williams
a25d8090c8 Added Raspberry Pi Compute Module 2019-07-19 14:05:48 -07:00
Melissa LeBlanc-Williams
fd244650a0
Merge pull request #137 from makermelissa/master
Added some Pin-onyms
2019-06-26 15:22:59 -07:00
Melissa LeBlanc-Williams
d8ae080562 Exposed both sets of I2C ports 2019-06-26 15:21:31 -07:00
Melissa LeBlanc-Williams
44b924f726 Added some Pin-onyms 2019-06-26 15:17:24 -07:00
Limor "Ladyada" Fried
6c1002e28a
Merge pull request #136 from makermelissa/master
SPI fix for DragonBoard410c
2019-06-21 02:18:39 -04:00
Melissa LeBlanc-Williams
2b20109539 SPI fix for DragonBoard410c 2019-06-20 16:11:03 -07:00
Limor "Ladyada" Fried
48f5328f9f
Merge pull request #135 from makermelissa/master
Initial Dragonboard 410c Addition to Blinka
2019-06-20 18:13:23 -04:00
Melissa LeBlanc-Williams
53959329dd Linted 2019-06-20 12:14:16 -07:00
Melissa LeBlanc-Williams
ff45bec4c6 Merge branch 'master' of https://github.com/adafruit/Adafruit_Blinka 2019-06-20 12:09:52 -07:00
Melissa LeBlanc-Williams
40d5678000 Initial Dragonboard 410c Addition 2019-06-20 12:09:46 -07:00
Limor "Ladyada" Fried
f02d248811
Merge pull request #133 from makermelissa/master
SPI fixes for a couple boards
2019-06-12 01:38:43 -04:00
Melissa LeBlanc-Williams
22277bfa78 SPI fixes for a couple boards 2019-06-11 21:07:03 -07:00
Limor "Ladyada" Fried
3395c82189
Merge pull request #132 from makermelissa/master
Added init file to amlogic folder
2019-06-10 22:04:46 -04:00
Melissa LeBlanc-Williams
a71eed7406 Added init file to amlogic folder 2019-06-10 18:23:55 -07:00
Melissa LeBlanc-Williams
d256bff874
Merge pull request #131 from satmandu/patch-1
Allows Raspberry Pi boards on arm64 to work w/ BLINKA_FORCEBOARD
2019-06-09 19:50:17 -07:00
satmandu
7518159b47
Allows Raspberry Pi boards on arm64 to work w/ BLINKA_FORCEBOARD
Fixes issue in https://github.com/adafruit/Adafruit_Blinka/issues/130 for RPI boards running ubuntu/arm64 if using, for instance BLINKA_FORCEBOARD=RASPBERRY_PI_3B_PLUS and BLINKA_FORCECHIP=BCM2XXX to bypass board detection failure.
2019-06-07 21:39:42 -04:00
Melissa LeBlanc-Williams
d21a7c54ef
Merge pull request #129 from makermelissa/master
Removed Odroid C2 from pulseio
2019-06-06 16:36:00 -07:00
Melissa LeBlanc-Williams
dce152a287 Removed Odroid C2 from pulseio 2019-06-06 16:01:34 -07:00
Limor "Ladyada" Fried
ba7ff5ed3d
Merge pull request #128 from makermelissa/master
Added Odroid C2
2019-06-06 17:16:23 -04:00
Melissa LeBlanc-Williams
3e3bb11471 linting 2019-06-06 14:09:09 -07:00
Melissa LeBlanc-Williams
3678f1e186 Added Odroid C2 2019-06-06 14:03:16 -07:00
Melissa LeBlanc-Williams
64b83c2f5a Merge branch 'master' of https://github.com/adafruit/Adafruit_Blinka 2019-06-06 13:50:46 -07:00
Melissa LeBlanc-Williams
310cae1bc3
Merge pull request #126 from brentru/fix-period-property
Add property to period method
2019-06-06 13:47:40 -07:00
Melissa LeBlanc-Williams
8a62a97b54
Merge pull request #127 from Groboards/master
Fix PB7 Linux pin number for SAMA5
2019-06-06 13:39:44 -07:00
Christopher Alessandro
f26df231ba Fix PB7/PWM3 pin number
Pin PB7 is linux pin number 39 not 38
2019-06-06 13:17:09 -07:00
Melissa LeBlanc-Williams
0de62bd1a6 Merge branch 'master' of https://github.com/adafruit/Adafruit_Blinka 2019-06-04 16:59:18 -07:00
brentrubell
61d13d919e
Merge pull request #124 from Groboards/master
Add SAMA5 to set_no_cs to allow SPI device to setup.
2019-06-04 15:17:17 -04:00
brentrubell
6c3b6d116a
Merge pull request #121 from sommersoft/pwmout_deinit
Add 'deinit()' Function To PWMOut
2019-06-03 18:12:56 -04:00
sommersoft
b781b3d304 keep from chaining ValueErrors 2019-06-03 17:06:59 -05:00
brentru
7a1bd2ff2d add property to period methods 2019-06-03 17:27:34 -04:00
sommersoft
f24cd41e8d add '_is_deinited()' to guard against reads/writes on an inactive pin. 2019-06-03 16:05:11 -05:00
sommersoft
e3dc1b9e23 Merge branch 'master' of https://github.com/adafruit/Adafruit_Blinka into pwmout_deinit 2019-06-03 15:28:37 -05:00
Christopher Alessandro
5f2c3fb5ad Add SAMA5 to set_no_cs 2019-06-03 10:31:04 -07:00
brentrubell
1835dbc434
Merge pull request #117 from Groboards/master
Fix for sysfs PWM `Invalid argument` write error when trying to setup the device.
2019-06-03 11:59:15 -04:00
Melissa LeBlanc-Williams
9691d8101f Merge branch 'master' of https://github.com/adafruit/Adafruit_Blinka 2019-06-01 00:20:47 -07:00
sommersoft
8fe9bc8bda replace 'close()' with 'deinit()' 2019-05-31 18:20:31 -05:00
sommersoft
9c06591f47 add 'deinit()' function 2019-05-31 15:17:29 -05:00
Melissa LeBlanc-Williams
b8336372c7
Merge pull request #115 from kouliss/orangepi_r1
Change PINs to OrangePI R1 spec
2019-05-22 21:17:38 -07:00
Melissa LeBlanc-Williams
d3e13f5511
Removed unnecessary file 2019-05-22 21:14:55 -07:00
Melissa LeBlanc-Williams
0591c8b9e0
Added second SPI port 2019-05-22 21:14:20 -07:00
Melissa LeBlanc-Williams
71ae054f5f Fixed Pins for Orange Pi R1 2019-05-22 21:09:21 -07:00
Melissa LeBlanc-Williams
6b3d427cab Merge branch 'orangepi_r1' of https://github.com/kouliss/Adafruit_Blinka 2019-05-21 21:34:05 -07:00
Martin Volek
0bbb2072fa Add OrangePI R1 detetion 2019-05-22 06:30:36 +02:00
Martin Volek
f1bad7c21f Add OrangePI R1 detetion 2019-05-20 06:44:02 +02:00
Christopher Alessandro
e9a63ce0eb This line also causes a similar write error 2019-05-19 14:06:27 -07:00
Melissa LeBlanc-Williams
62ec1c2cb3 Merge branch 'orangepi_r1' of https://github.com/kouliss/Adafruit_Blinka 2019-05-19 13:37:02 -07:00
Martin Volek
26aa82ba6a Add OrangePI R1 detetion 2019-05-19 20:55:32 +02:00
Christopher Alessandro
5949e5c39d This line causes a write error when setting up the sysfs device. 2019-05-19 07:11:26 -07:00
Melissa LeBlanc-Williams
9547963191 Merge branch 'orangepi_r1' of https://github.com/kouliss/Adafruit_Blinka 2019-05-18 22:51:00 -07:00
Limor "Ladyada" Fried
5e19dab4dd
Merge pull request #116 from Groboards/master
Update Giant Board alt pins names and add sysfs pwm support
2019-05-18 22:16:18 -04:00
Christopher Alessandro
34520b4477 Revert "Commenting these out gets rid of errors and allows the pwm to export."
This reverts commit f599d177e9.
2019-05-18 19:00:20 -07:00
Christopher Alessandro
f599d177e9 Commenting these out gets rid of errors and allows the pwm to export.
Commenting out these lines seems to fix my import errors and I'm now able to successfully use pusleio.
2019-05-17 17:13:31 -07:00
Christopher Alessandro
5d2dc04c0d Update Giant Board Alt Pins and add sysfs PWM support 2019-05-17 17:03:30 -07:00
Martin Volek
565b39d41b Change PINs to OrangePI R1 spec 2019-05-16 23:27:47 +02:00
Martin Volek
64ad0980a2 Change PINs to OrangePI R1 spec 2019-05-16 23:18:10 +02:00
Martin Volek
b7608603f3 Change PINs to OrangePI R1 spec 2019-05-16 22:56:53 +02:00
Limor "Ladyada" Fried
124b166a7e
Merge pull request #113 from ladyada/master
fix some sysfs complaints on init or freq change
2019-05-12 18:15:05 -04:00
ladyada
d1402cafbd fix some sysfs complaints on init or freq change, and clean up when we close 2019-05-12 18:06:16 -04:00
Limor "Ladyada" Fried
bef832218d
Merge pull request #112 from ladyada/master
add a periphery-based sysfs pwmout object - tested with LED and servo
2019-05-12 16:57:13 -04:00
ladyada
0b9e819a62 add a periphery-based sysfs pwmout object - tested with LED and servo 2019-05-12 16:28:25 -04:00
Limor "Ladyada" Fried
ceb9335735
Merge pull request #111 from ladyada/master
Google Coral support for the i2c, spi, and GPIO pins.
2019-05-12 13:16:52 -04:00
ladyada
e1a58c650c Google Coral support for the i2c, spi, and GPIO pins. uart #3 not available and remaining pins are I2S or PWM 2019-05-12 04:10:00 -04:00
Limor "Ladyada" Fried
b4a2b3bf7d
Merge pull request #107 from pdp7/issue106
change SPI index for BeagleBone/PocketBeagle #106
2019-04-14 12:48:34 -04:00
Drew Fustini
636a602fb0
change SPI index for BeagleBone/PocketBeagle #106
Change SPI port index because SPI0 is /dev/spidev1.x and SPI1 is /dev/spidev2.x on both:
* the current recommended BeagleBoard.org Debian image: Debian 9.5 (Stretch) from 2018-10-07
* the newest Debian 9.8 (Strecth) snapshot from 2019-04-07

This change is to fix issue #106: inconsistent spidev index on AM335x-based boards like BeagleBone Black and PocketBeagle.
2019-04-14 12:17:47 +02:00
Drew Fustini
42d260d7f2
Merge pull request #105 from pdp7/issue104
do not set SPI_NO_CS bit when chip is AM3358 #104
2019-04-12 19:22:08 +02:00
Drew Fustini
16ec072493 remove debug output from SPI class 2019-04-12 12:52:07 +00:00
Drew Fustini
d7709fa4de do not set SPI_NO_CS bit when chip is AM3358 #104
Avoid trying to set SPI_NO_CS mode bit when the chip is AM3358 as this
will always fail as Linux kernel driver omap2_mcspi does not support it.

This applies to the BeagleBone Black and PocketBeagle.

For testing, BME280 was wired to SPI0 peripheral on BeagleBone Black.

Run these commands to make sure the pins are in the correct mode:

config-pin p9.13 gpio     # GPIO used for CS
config-pin p9.18 spi      # SPI0_D1 (MOSI)
config-pin p9.21 spi      # SPI0_D0 (MISO)
config-pin p9.22 spi_sclk # SPI0_SCLK

SPI0 was accessed via /dev/spidev0.0
2019-04-12 12:36:36 +00:00
Drew Fustini
1d32b1f741
Merge pull request #102 from s-light/PocketBeagle2
Pocket beagle2
2019-04-02 12:14:41 +01:00
s-light
a4da48ebb1
[busio] try fix SPI for all beagles* 2019-04-02 11:05:53 +02:00
s-light
2a3db5e5ad
BBB refine pin namings 2019-04-02 02:59:26 +02:00
s-light
e9fa25d10e
refine pin namings 2019-04-02 02:50:20 +02:00
s-light
9c86483850
[am335x/pin] added spiPorts 2019-04-02 02:02:38 +02:00
s-light
ca0464a7cb
[am335x/pin] added i2cPorts, spiPorts, uartPorts 2019-04-02 01:43:36 +02:00
s-light
3dcba681e1
[board pocketbeagle] add SDA & SCL aliases 2019-04-02 00:33:58 +02:00
s-light
d75169ff76
add USB1 V_EN comment 2019-04-01 23:57:22 +02:00
s-light
22c95860ea
change comment names to be based on common.c
[common.c](https://github.com/adafruit/adafruit-beaglebone-io-python/blob/master/source/common.c#L73)
2019-04-01 23:53:01 +02:00
s-light
3a970aeed2
added GPIO_n as comments 2019-04-01 21:50:09 +02:00
s-light
c9a4871284
[board/beagle*] added NonGPIO pins & GPIO_NN numbers as comments 2019-04-01 21:33:29 +02:00
s-light
97c59ec580
[examples] added python3 env 2019-04-01 21:00:11 +02:00
s-light
498d8fb1e9
[examples] make executable 2019-04-01 20:50:41 +02:00
s-light
f74cf67e17
[am335x] added NonGPIO pins as comments 2019-04-01 12:03:45 +02:00
Drew Fustini
a8b87ecacf
Fix pylint error in PocketBeagle example 2019-04-01 00:28:46 +01:00
Drew Fustini
6eaaf3282e
add PocketBeagle example to blink LED
add PocketBeagle example to blink LED

Note: Python programs using Blinka on PocketBeagle and BeagleBone need to use `sudo`.  Refer to this issue for more information:
https://github.com/adafruit/Adafruit_Python_PlatformDetect/issues/20 

Here is the output of this program running OK on a PocketBeagle:
debian@beaglebone:~/Adafruit_Blinka/examples$ sudo python3 pb_digitalio.py 
[sudo] password for debian: 
hello blinky!
2019-04-01 00:20:45 +01:00
Drew Fustini
006d3af59f
Add P2_25 pin to fix error on PocketBeagle
Add P2_25 pin to fix error on PocketBeagle.  This is the error that occurs without this fix:
```
Traceback (most recent call last):
  File "examples/bbb_digitalio.py", line 10, in <module>
    import board
  File "/usr/local/lib/python3.5/dist-packages/Adafruit_Blinka-1.2.9.dev5+gcbfa2eb.d20190330-py3.5.egg/board.py", line 59, in <module>
    from adafruit_blinka.board.beaglebone_pocketbeagle import *
  File "/usr/local/lib/python3.5/dist-packages/Adafruit_Blinka-1.2.9.dev5+gcbfa2eb.d20190330-py3.5.egg/adafruit_blinka/board/beaglebone_pocketbeagle.py", line 114, in <module>
    MOSI_1 = pin.P2_25
AttributeError: module 'adafruit_blinka.microcontroller.am335x.pin' has no attribute 'P2_25'
```
Refer to comments in PR #101
2019-03-31 23:43:42 +01:00
Drew Fustini
9fceae3ffb
Merge pull request #101 from s-light/PocketBeagle
PocketBeagle support by @s-light
2019-03-31 23:36:35 +01:00
s-light
cbfa2eb4cc
[board PocketBeagle] update pin assignments 2019-03-29 20:18:57 +01:00
s-light
6a728ed07f
Merge branch 'BBB_pinFixes' into PocketBeagle 2019-03-29 20:06:29 +01:00
s-light
41571b65a7
[BBB] move special function pin-names to board definition file 2019-03-29 20:05:01 +01:00
s-light
02f6cd6160
[am335x] tried to prepared pins 2019-03-28 23:52:27 +01:00
s-light
2b1c154295
[board] added pocketbeagle defaults
(based on beaglebone_black)
2019-03-28 23:38:36 +01:00
Limor "Ladyada" Fried
917313bfea
Merge pull request #98 from NVIDIA-AI-IOT-private/jetson
Jetson
2019-03-25 20:29:48 -04:00
Limor "Ladyada" Fried
b1791118aa
Merge pull request #97 from MatthewWilkes/master
Allow installation on Windows
2019-03-25 18:24:54 -04:00
Andy
a8bd0c058b Merge remote-tracking branch 'ada/master' into jetson 2019-03-25 15:04:38 -07:00
Andy
fe2eaf883f added jetson nano 2019-03-25 14:56:04 -07:00
Matthew Wilkes
81790ff48c
Limit sysv_ipc to non-Windows installs
This dependency is compatible with "most (all?) Unixes", Windows support
is unofficial and only under Cygwin. Cygwin and WSL Python installs have
values of `platform.system()` other than Windows, therefore this prevents
installlation of `sysv_ipc` under standard Windows. This will cause `PulseIn`
to generate import errors on Windows, but as there is no Windows driver this
is likely not a problem. It will, however, allow for dependency resolution
and packaging to work on Windows.
2019-03-25 19:53:20 +00:00
Limor "Ladyada" Fried
cca1d6aa65
Merge pull request #95 from ladyada/master
add I2C and SPI singletons for some drivers
2019-03-22 12:45:44 -04:00
ladyada
50c34129cf add I2C and SPI singletons for some drivers 2019-03-22 12:42:59 -04:00
Limor "Ladyada" Fried
c8052d0b60
Merge pull request #92 from cpforbes/cpf-91
Include adafruit_blinka.microcontroller.bcm283x.pulseio in package
2019-03-18 14:48:14 -04:00
Craig Forbes
a27980cb38 Add package_data to install libgpiod_pulsein.
Clarified why py_modules is needed.
2019-03-18 12:13:10 -05:00
Craig Forbes
b3f05c0616 Add __init__.py for adafruit_blinka.microcontroller.bcm283x.pulseio package 2019-03-18 12:05:57 -05:00
Limor "Ladyada" Fried
49fca60d04
Update README.rst 2019-03-15 11:49:05 -04:00
Limor "Ladyada" Fried
b459cd119e
Merge pull request #88 from NVIDIA-AI-IOT-private/jetson
Jetson Integration
2019-03-14 14:23:29 -04:00
Andy
0871344b5b merge t210 chip defs into one 2019-03-14 11:06:39 -07:00
Andy
60a0754b73 Remove unused board import 2019-03-13 15:21:34 -07:00
Andy
2a9fbc820b Cleanup whitespace 2019-03-13 14:58:42 -07:00
Andy
88fea48836 Updated chip definitions 2019-03-12 18:07:05 -07:00
Andy
31e8ce37f3 Added individual jetson board and tegra chip integration 2019-03-12 14:25:31 -07:00
Andy
830fcdc559 added i2c 2019-03-08 11:51:13 -08:00
Limor "Ladyada" Fried
a97887fedc
Merge pull request #85 from gbrown128/write_value_support
Ensure that the write_value passed into readinto is actually used
2019-02-25 14:29:34 -05:00
George Brown
58519a70ce Ensure that the write_value passed into readinto is actually used, at least in busio. 2019-02-25 19:14:50 +00:00
Andy
678dd7bad7 fix cleanup fcn 2019-02-22 11:23:23 -08:00
Andy
3da8771eba jetson integration 2019-02-21 15:34:44 -08:00
Limor "Ladyada" Fried
e54aad88cc
Update README.rst
fix travis url
2019-01-29 23:59:57 -05:00
Carter Nelson
1fa1c964b2
Merge pull request #83 from ladyada/master
fix for first pi's
2019-01-29 12:37:51 -08:00
ladyada
72b5d1f78a fix for first pi's 2019-01-29 12:44:14 -05:00
202 changed files with 10040 additions and 825 deletions

50
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,50 @@
name: Build CI
on: [pull_request, push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Translate Repo Name For Build Tools filename_prefix
id: repo-name
run: echo ::set-output name=repo-name::Adafruit-Blinka
- name: Set up Python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.6
- name: Versions
run: |
python3 --version
- name: Checkout Current Repo
uses: actions/checkout@v2
with:
submodules: true
- name: Checkout tools repo
uses: actions/checkout@v2
with:
repository: adafruit/actions-ci-circuitpython-libs
path: actions-ci
- name: Install dependencies
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
run: |
source actions-ci/install.sh
- name: Pip install pylint, black, & Sphinx
run: |
pip install --force-reinstall pylint black Sphinx sphinx-rtd-theme
- name: Library version
run: git describe --dirty --always --tags
- name: Check formatting
run: |
black --check --target-version=py35 .
- name: PyLint
run: |
pylint $( find src -name '*.py' )
([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" ))
- name: Build docs
working-directory: docs
run: sphinx-build -E -W -b html . _build/html

33
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,33 @@
name: Release Actions
on:
release:
types: [published]
jobs:
upload-pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Check For setup.py
id: need-pypi
run: |
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
- name: Set up Python
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
env:
TWINE_USERNAME: ${{ secrets.pypi_username }}
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
python setup.py sdist
twine upload dist/*

1
.gitignore vendored
View file

@ -4,7 +4,6 @@ __pycache__
_build
*.pyc
.env
build*
bundles
*.DS_Store
.eggs

View file

@ -3,7 +3,7 @@
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=
extension-pkg-whitelist=hid
# Add files or directories to the blacklist. They should be base names, not
# paths.
@ -52,7 +52,7 @@ confidence=
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
# disable=import-error,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error,bad-continuation,invalid-name
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option

View file

@ -1,26 +0,0 @@
dist: trusty
sudo: false
language: python
python:
- "3.6"
cache:
pip: true
deploy:
- provider: pypi
user: adafruit-travis
password:
secure: UHEnpdeuxFrqSrrSKheh5fB8M5LA7JKmKkAgTy5YHvk/y3sTHHST5cgHg5s5zYSLG3WRrQgnUcf8ISEs6Sb22wtCi81nIhFfML97o/TD+lUSU+lMmbXiLvkMWhkVjGI6P8f5vXc655XYU0W84z9tI4aTKFVKC4pI4qY4XIDe3X7kvQoeRZdTZX35gCWBw9Hshhfc5AENJvRiQqOK/RXiZN4PS+jVFIG0MjSNZ1oO8/Bks//AGHacZuI+5sl3XTbeefiXLmbKsxqEir754GGs04ZgP7OAY4DHgQC2aigdXfnZEcWoWkfU+Hpz4FicFwYqsKfESVwN0Y/Dx4J06YISPEAagUtm0W63qmZ2GSxLmwWBNZ8hDiLaaVEmK9T6q+iw3CPTicC5/35gL+wab2P7thlCA7GHDYg9QfjthcT35Wc0cS+/iQ1w8uOA3aydjXMgiuzydqpViB+r7GmTxHp8qIwAQIYuy6GIY/tqgUUWZ5sjlkmBZTvtbqXYndQk4uvKifsqdbGJxvZh27+BPGSnAe3fIdxAGvGyLH2Ic58NANHrcV3iXMKkhEG3u7pka78uuZJbTnN1KUvk8XgrTv3Xk3gM5ZIn5HCadcXT6i6VMr0ELZCRmR1cng7d03NsXPFFz3LwjWr4MH34ON5HdQuk/X4bhF/IWxSZvxfSZW8C5mE=
on:
tags: true
install:
- pip install -r requirements.txt
- pip install --force-reinstall pylint==1.9.2
- pip install circuitpython-build-tools Sphinx sphinx-rtd-theme
script:
- pylint src/**/*.py
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace examples/*.py)
- cd docs && sphinx-build -E -W -b html . _build/html && cd ..

View file

@ -6,34 +6,66 @@ Introduction
:alt: Documentation Status
.. image:: https://img.shields.io/discord/327254708534116352.svg
:target: https://discord.gg/nBQh6qu
:target: https://adafru.it/discord
:alt: Discord
.. image:: https://travis-ci.org/adafruit/Adafruit_Blinka.svg?branch=master
:target: https://travis-ci.org/adafruit/Adafruit_Blinka
.. image:: https://travis-ci.com/adafruit/Adafruit_Blinka.svg?branch=master
:target: https://travis-ci.com/adafruit/Adafruit_Blinka
:alt: Build Status
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code Style: Black
This repository contains a selection of packages mirroring the CircuitPython API
on hosts running micropython. Working code exists to emulate the CircuitPython packages;
* **board** - breakout-specific pin identities
* **microcontroller** - chip-specific pin identities
* **analogio** - analog input/output pins, using pin identities from board+microcontroller packages
* **digitalio** - digital input/output pins, using pin identities from board+microcontroller packages
* **bitbangio** - software-driven interfaces for I2C, SPI
* **busio** - hardware-driven interfaces for I2C, SPI, UART
* **time** * - substitute functions monkey-patched to time module
* **pulseio** - contains classes that provide access to basic pulse IO (PWM)
For details, see the `Blinka API reference
<https://circuitpython.readthedocs.io/projects/blinka/en/latest/index.html>`_.
Dependencies
=============
The Micropython compatibility layers described above are intended to provide a CircuitPython-like API for devices which
are running Micropython. Since corresponding packages should be built-in to any standard
are running CPython or Micropython. Since corresponding packages should be built-in to any standard
CircuitPython image, they have no value on a device already running CircuitPython and would likely conflict in unhappy ways.
The test suites in the test/src folder under **testing.universal** are by design
intended to run on *either* CircuitPython *or* Micropython+compatibility layer to prove conformance.
Installing from PyPI
=====================
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
PyPI <https://pypi.org/project/Adafruit-Blinka/>`_. To install for current user:
.. code-block:: shell
pip3 install Adafruit-Blinka
To install system-wide (this may be required in some cases):
.. code-block:: shell
sudo pip3 install Adafruit-Blinka
To install in a virtual environment in your current project:
.. code-block:: shell
mkdir project-name && cd project-name
python3 -m venv .env
source .env/bin/activate
pip3 install Adafruit-Blinka
Usage Example
=============
@ -47,7 +79,6 @@ the following sequence runs through some basic testing of the digitalio compatib
An example log from running the suites is `here <https://github.com/cefn/Adafruit_Micropython_Blinka/issues/2#issuecomment-366713394>`_ .
Contributing
============
@ -68,7 +99,7 @@ install dependencies (feel free to reuse the virtual environment from above):
python3 -m venv .env
source .env/bin/activate
pip install Sphinx sphinx-rtd-theme
pip install Sphinx sphinx-rtd-theme Adafruit-PlatformDetect
Now, once you have the virtual environment activated:

View file

@ -24,3 +24,14 @@
.. automodule:: digitalio
:members:
.. automodule:: analogio
:members:
.. automodule:: pulseio
:members:
.. automodule:: neopixel_write
:members:

View file

@ -2,7 +2,8 @@
import os
import sys
sys.path.insert(0, os.path.abspath('../src'))
sys.path.insert(0, os.path.abspath("../src"))
# -- General configuration ------------------------------------------------
@ -10,40 +11,49 @@ sys.path.insert(0, os.path.abspath('../src'))
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
]
# Uncomment the below if you use native CircuitPython modules such as
# digitalio, micropython and busio. List the modules you use. Without it, the
# autodoc module docs will fail to generate with a warning.
autodoc_mock_imports = ["machine", "Adafruit_GPIO"]
autodoc_mock_imports = [
"machine",
"Adafruit_GPIO",
"RPi",
"RPi.GPIO",
"hid",
"sysv_ipc",
]
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),
'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
intersphinx_mapping = {
"python": ("https://docs.python.org/3.4", None),
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
}
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]
source_suffix = '.rst'
source_suffix = ".rst"
# The master toctree document.
master_doc = 'index'
master_doc = "index"
# General information about the project.
project = u'Adafruit Blinka Library'
copyright = u'2017 cefn'
author = u'cefn'
project = "Adafruit Blinka Library"
copyright = "2017 cefn"
author = "cefn"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u'1.0.0'
version = "1.0.0"
# The full version, including alpha/beta/rc tags.
release = u'1.0.0'
release = "1.0.0"
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@ -55,7 +65,7 @@ language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.env', 'CODE_OF_CONDUCT.md']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".env", "CODE_OF_CONDUCT.md"]
# The reST default role (used for this markup: `text`) to use for all
# documents.
@ -67,7 +77,7 @@ default_role = "any"
add_function_parentheses = True
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
@ -81,53 +91,56 @@ todo_emit_warnings = True
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
if not on_rtd: # only import and set the theme if we're building docs locally
try:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
except:
html_theme = 'default'
html_theme_path = ['.']
html_theme = "default"
html_theme_path = ["."]
else:
html_theme_path = ['.']
html_theme_path = ["."]
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]
# Output file base name for HTML help builder.
htmlhelp_basename = 'AdafruitBlinkaLibrarydoc'
htmlhelp_basename = "AdafruitBlinkaLibrarydoc"
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'AdafruitBlinkaLibrary.tex', u'AdafruitBlinka Library Documentation',
author, 'manual'),
(
master_doc,
"AdafruitBlinkaLibrary.tex",
"AdafruitBlinka Library Documentation",
author,
"manual",
),
]
# -- Options for manual page output ---------------------------------------
@ -135,8 +148,13 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'AdafruitBlinkalibrary', u'Adafruit Blinka Library Documentation',
[author], 1)
(
master_doc,
"AdafruitBlinkalibrary",
"Adafruit Blinka Library Documentation",
[author],
1,
)
]
# -- Options for Texinfo output -------------------------------------------
@ -145,7 +163,13 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'AdafruitBlinkaLibrary', u'Adafruit Blinka Library Documentation',
author, 'AdafruitBlinkaLibrary', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"AdafruitBlinkaLibrary",
"Adafruit Blinka Library Documentation",
author,
"AdafruitBlinkaLibrary",
"One line description of project.",
"Miscellaneous",
),
]

15
examples/analog_in.py Normal file
View file

@ -0,0 +1,15 @@
"""Analog in demo"""
import time
import board
from analogio import AnalogIn
analog_in = AnalogIn(board.A1)
def get_voltage(pin):
return (pin.value * 3.3) / 4096
while True:
print((get_voltage(analog_in),))
time.sleep(0.1)

13
examples/bbb_digitalio.py Normal file → Executable file
View file

@ -1,3 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Example of blinking LED on BeagleBone Black
# https://www.adafruit.com/product/1876
#
@ -5,6 +8,16 @@
# 1) connect anode (+) lead of LED to P9.12 pin
# 2) connect cathode (-) lead to 1K Ohm resistor
# 3) connect that 1K Ohm resistor to DGND (P9.1)
#
# NOTE: the pin mode can be verified with the command line
# utility config-pin on the BeagleBoard.org Debian image
#
# To verify the pin is in GPIO mode:
# debian@beaglebone:~$ config-pin -q p9.12
# P9_12 Mode: gpio Direction: out Value: 0
#
# To set pin to GPIO mode:
# $ config-pin p9.12 gpio
import time
import board

57
examples/mcps_busio_i2c.py Executable file
View file

@ -0,0 +1,57 @@
import time
import hid
import busio
from adafruit_blinka.microcontroller.mcp2221.mcp2221 import mcp2221 as _mcp2221
from adafruit_blinka.microcontroller.mcp2221.mcp2221 import MCP2221 as _MCP2221
from adafruit_blinka.microcontroller.mcp2221.i2c import I2C as _MCP2221I2C
MLXADDR = 0x33
ADDRID1 = 0x2407
class MCP2221(_MCP2221): # pylint: disable=too-few-public-methods
def __init__(self, address):
self._hid = hid.device()
self._hid.open_path(address)
print("Connected to " + str(address))
self._gp_config = [0x07] * 4 # "don't care" initial value
for pin in range(4):
self.gp_set_mode(pin, self.GP_GPIO) # set to GPIO mode
self.gpio_set_direction(pin, 1) # set to INPUT
class MCP2221I2C(_MCP2221I2C): # pylint: disable=too-few-public-methods
def __init__(self, mcp2221, *, frequency=100000):
self._mcp2221 = mcp2221
self._mcp2221.i2c_configure(frequency)
class I2C(busio.I2C): # pylint: disable=too-few-public-methods
def __init__(self, mcp2221_i2c):
self._i2c = mcp2221_i2c
addresses = [mcp["path"] for mcp in hid.enumerate(0x04D8, 0x00DD)]
i2c_devices = []
i2c_devices.append(I2C(MCP2221I2C(_mcp2221)))
for addr in addresses:
try:
i2c_device = I2C(MCP2221I2C(MCP2221(addr)))
i2c_devices.append(i2c_device)
except OSError:
print("Device path: " + str(addr) + " is used")
while True:
for i2c in i2c_devices:
addrbuf = bytearray(2)
addrbuf[0] = ADDRID1 >> 8
addrbuf[1] = ADDRID1 & 0xFF
inbuf = bytearray(6)
i2c.writeto_then_readfrom(MLXADDR, addrbuf, inbuf)
print("Device " + str(i2c_devices.index(i2c)) + ": ")
print(inbuf)
time.sleep(0.5)

35
examples/pb_digitalio.py Executable file
View file

@ -0,0 +1,35 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Example of blinking LED on PocketBeagle
# https://www.adafruit.com/product/4179
#
# Wire the circuit as follows:
# 1) connect anode (+) lead of LED to P1_33 pin
# 2) connect cathode (-) lead to 1K Ohm resistor
# 3) connect that 1K Ohm resistor to GND
#
# NOTE: the pin mode can be verified with the command line
# utility config-pin on the BeagleBoard.org Debian image
#
# To verify the pin is in GPIO mode:
# debian@beaglebone:~$ config-pin -q p1.33
# P1_33 Mode: gpio Direction: out Value: 0
#
# To set pin to GPIO mode:
# $ config-pin p1.33 gpio
import time
import board
import digitalio
print("hello blinky!")
led = digitalio.DigitalInOut(board.P1_33)
led.direction = digitalio.Direction.OUTPUT
while True:
led.value = True
time.sleep(0.5)
led.value = False
time.sleep(0.5)

View file

@ -1,4 +1,5 @@
import time
import sys
import board
import busio
@ -10,7 +11,8 @@ print("I2C devices found: ", [hex(i) for i in i2c.scan()])
if not 0x18 in i2c.scan():
print("Didn't find MCP9808")
exit()
sys.exit()
def temp_c(data):
value = data[0] << 8 | data[1]
@ -19,6 +21,7 @@ def temp_c(data):
temp -= 256.0
return temp
while True:
i2c.writeto(0x18, bytes([0x05]), stop=False)
result = bytearray(2)

View file

@ -9,5 +9,5 @@ spi.configure(baudrate=16000000)
spi.unlock()
while True:
spi.write(bytes([x for x in range(64)]))
spi.write(bytes(range(64)))
time.sleep(0.1)

View file

@ -1,16 +1,18 @@
import sys
import time
from adafruit_blinka.agnostic import board as agnostic_board
import adafruit_blinka.agnostic as agnostic
import board
import digitalio
#from Adafruit_GPIO import Platform
#print("Platform = ", Platform.platform_detect(), Platform.pi_version())
# from Adafruit_GPIO import Platform
# print("Platform = ", Platform.platform_detect(), Platform.pi_version())
print("hello blinka!")
print("Found system type: %s (sys.plaform %s implementation %s) " %
(agnostic_board, sys.platform, sys.implementation.name))
print(
"Found system type: %s (sys.platform %s implementation %s) "
% (agnostic.board_id, sys.platform, sys.implementation.name)
)
print("board contents: ", dir(board))

View file

@ -1,6 +1,8 @@
Adafruit-PlatformDetect
Adafruit-PureIO
Adafruit-PlatformDetect>=2.18.1
Adafruit-PureIO>=1.1.7
Jetson.GPIO; platform_machine=='aarch64'
RPi.GPIO; platform_machine=='armv7l' or platform_machine=='armv6l'
rpi_ws281x>=4.0.0; platform_machine=='armv7l' or platform_machine=='armv6l'
spidev; sys_platform == 'linux'
sysv_ipc
sysv_ipc; sys_platform == 'linux' and platform_machine!='mips'
pyftdi>=0.40.0
binho-host-adapter>=0.1.6

View file

@ -14,41 +14,65 @@ here = os.path.abspath(os.path.dirname(__file__))
# Import the README and use it as the long-description.
# Note: this will only work if 'README.md' is present in your MANIFEST.in file!
with io.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = '\n' + f.read()
with io.open(os.path.join(here, "README.rst"), encoding="utf-8") as f:
long_description = "\n" + f.read()
board_reqs = []
if os.path.exists("/proc/device-tree/compatible"):
with open("/proc/device-tree/compatible", "rb") as f:
compat = f.read()
if b"nvidia,tegra" in compat:
board_reqs = ["Jetson.GPIO"]
if (
b"brcm,bcm2835" in compat
or b"brcm,bcm2836" in compat
or b"brcm,bcm2837" in compat
or b"brcm,bcm2838" in compat
):
board_reqs = ["RPi.GPIO", "rpi_ws281x>=4.0.0", "sysv_ipc"]
setup(
name='Adafruit-Blinka',
name="Adafruit-Blinka",
use_scm_version=True,
setup_requires=["setuptools_scm"],
description='CircuitPython APIs for non-CircuitPython versions of Python such as CPython on Linux and MicroPython.',
description="CircuitPython APIs for non-CircuitPython versions of Python such as CPython on Linux and MicroPython.",
long_description=long_description,
long_description_content_type='text/x-rst',
author='Adafruit Industries',
author_email='circuitpython@adafruit.com',
python_requires='>=3.4.0',
url='https://github.com/adafruit/Adafruit_Blinka',
package_dir={'': 'src'},
long_description_content_type="text/x-rst",
author="Adafruit Industries",
author_email="circuitpython@adafruit.com",
python_requires=">=3.5.0",
url="https://github.com/adafruit/Adafruit_Blinka",
package_dir={"": "src"},
packages=find_packages("src"),
# This seems to override find_packages above - I suspect but don't know for sure that
# we're doing this for a reason -- bpb 2019-01-15:
py_modules=['bitbangio', 'board', 'busio', 'digitalio', 'micropython', 'pulseio', 'neopixel_write'],
install_requires=[
"Adafruit-PlatformDetect",
"Adafruit-PureIO",
"RPi.GPIO; platform_machine=='armv7l' or platform_machine=='armv6l'",
"rpi_ws281x>=4.0.0; platform_machine=='armv7l' or platform_machine=='armv6l'",
"spidev; sys_platform=='linux'",
"sysv_ipc"
# py_modules lists top-level single file packages to include.
# find_packages only finds packages in directories with __init__.py files.
py_modules=[
"analogio",
"bitbangio",
"board",
"busio",
"digitalio",
"micropython",
"pulseio",
"neopixel_write",
],
license='MIT',
package_data={
"adafruit_blinka.microcontroller.bcm283x.pulseio": ["libgpiod_pulsein"]
},
install_requires=[
"Adafruit-PlatformDetect>=2.18.1",
"Adafruit-PureIO>=1.1.7",
"pyftdi>=0.40.0",
]
+ board_reqs,
license="MIT",
classifiers=[
# Trove classifiers
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: Implementation :: MicroPython',
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: Implementation :: MicroPython",
],
)

View file

@ -1,3 +1,4 @@
"""Return the current version"""
VERSION = (1, 0, 0)
__version__ = '.'.join(map(str, VERSION))
__version__ = ".".join(map(str, VERSION))

View file

@ -5,10 +5,11 @@
* Author(s): cefn
"""
class Enum():
class Enum:
"""
Object supporting CircuitPython-style of static symbols
as seen with Direction.OUTPUT, Pull.UP
Object supporting CircuitPython-style of static symbols
as seen with Direction.OUTPUT, Pull.UP
"""
def __repr__(self):
@ -26,8 +27,8 @@ class Enum():
@classmethod
def iteritems(cls):
"""
Inspects attributes of the class for instances of the class
and returns as key,value pairs mirroring dict#iteritems
Inspects attributes of the class for instances of the class
and returns as key,value pairs mirroring dict#iteritems
"""
for key in dir(cls):
val = getattr(cls, key)
@ -37,6 +38,7 @@ class Enum():
class ContextManaged:
"""An object that automatically deinitializes hardware with a context manager."""
def __enter__(self):
return self
@ -47,11 +49,13 @@ class ContextManaged:
def deinit(self):
"""Free any hardware used by the object."""
return
# pylint: enable=no-self-use
class Lockable(ContextManaged):
"""An object that must be locked to prevent collisions on a microcontroller resource."""
_locked = False
def try_lock(self):
@ -68,8 +72,13 @@ class Lockable(ContextManaged):
else:
raise ValueError("Not locked")
def patch_system():
"""Patch modules that may be different due to the platform."""
# pylint: disable=import-outside-toplevel
import sys
from adafruit_blinka.agnostic import time
sys.modules['time'] = time
# pylint: enable=import-outside-toplevel
sys.modules["time"] = time

View file

@ -12,28 +12,60 @@ elif agnostic.implementation == "micropython":
from utime import sleep
from ucollections import namedtuple
_struct_time = namedtuple("struct_time", ("tm_year", "tm_mon", "tm_mday",
"tm_hour", "tm_min", "tm_sec",
"tm_wday", "tm_yday", "tm_isdst"))
#pylint: disable=too-many-arguments
def _marshal_time(tm_year, tm_mon, tm_mday, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=-1,
tm_yday=-1, tm_isdst=-1):
_struct_time = namedtuple(
"struct_time",
(
"tm_year",
"tm_mon",
"tm_mday",
"tm_hour",
"tm_min",
"tm_sec",
"tm_wday",
"tm_yday",
"tm_isdst",
),
)
# pylint: disable=too-many-arguments
def _marshal_time(
tm_year,
tm_mon,
tm_mday,
tm_hour=0,
tm_min=0,
tm_sec=0,
tm_wday=-1,
tm_yday=-1,
tm_isdst=-1,
):
"""Construct struct_time with default values."""
_struct_time(tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec, tm_wday, tm_yday, tm_isdst)
_struct_time(
tm_year,
tm_mon,
tm_mday,
tm_hour,
tm_min,
tm_sec,
tm_wday,
tm_yday,
tm_isdst,
)
def struct_time(time_tuple):
"""Create a struct_time"""
return _marshal_time(*time_tuple)
#pylint: disable=invalid-name
# pylint: disable=invalid-name
_total_ms = 0
_prev_ticks_ms = utime.ticks_ms()
def monotonic():
"""A monotonically increasing time in seconds. No defined start time."""
# Assumes that monotonic is called more frequently than the wraparound of micropython's
# utime.ticks_ms()
global _prev_ticks_ms, _total_ms #pylint: disable=global-statement
global _prev_ticks_ms, _total_ms # pylint: disable=global-statement
ticks_ms = utime.ticks_ms()
_total_ms += utime.ticks_diff(ticks_ms, _prev_ticks_ms)
_prev_ticks_ms = ticks_ms

View file

@ -0,0 +1 @@
"""Boards definition from Banana Pi"""

View file

@ -0,0 +1,79 @@
"""Pin definitions for the Banana Pi M2 Zero."""
# The Banana Pi M2 Zero uses the AllWinner H2 SoC, but pins
# are the same as the AllWinner H3 SoC, so we import those
from adafruit_blinka.microcontroller.allwinner.h3 import pin
PA12 = pin.PA12
SDA = pin.PA12
PA11 = pin.PA11
SCL = pin.PA11
PA6 = pin.PA6
PWM1 = pin.PA6
PA1 = pin.PA1
UART2_RX = pin.PA1
PA0 = pin.PA0
UART2_TX = pin.PA0
PA3 = pin.PA3
UART2_CTS = pin.PA3
PA10 = pin.PA10
PA12 = pin.PA12
SDA = pin.PA12
PA11 = pin.PA11
SCL = pin.PA11
PA6 = pin.PA6
PWM1 = pin.PA6
PA1 = pin.PA1
UART2_RX = pin.PA1
PA0 = pin.PA0
UART2_TX = pin.PA0
PA3 = pin.PA3
UART2_CTS = pin.PA3
PA7 = pin.PA7
PA8 = pin.PA8
PA9 = pin.PA9
PA10 = pin.PA10
PA17 = pin.PA17
PA18 = pin.PA18
PA19 = pin.PA19
PA20 = pin.PA20
PA21 = pin.PA21
PC0 = pin.PC0
PC1 = pin.PC1
PC2 = pin.PC2
PC3 = pin.PC3
PC4 = pin.PC4
PC7 = pin.PC7
PA13 = pin.PA13
SPI1_CS = pin.PA13
PA14 = pin.PA14
SPI1_CLK = pin.PA14
PA2 = pin.PA2
UART2_RTS = pin.PA2
PA18 = pin.PA18
TWI1_SCK = pin.PA18
PL2 = pin.PL2
PL4 = pin.PL4
SCLK = pin.PA14
MOSI = pin.PA15
MISO = pin.PA16
PA13 = pin.PA13
SPI1_CS = pin.PA13
PA14 = pin.PA14
SPI1_CLK = pin.PA14
PA2 = pin.PA2
UART2_RTS = pin.PA2
PA18 = pin.PA18
TWI1_SCK = pin.PA18
PG6 = pin.PG6
UART1_TX = pin.PG6
PG7 = pin.PG7
UART1_RX = pin.PG7
SCLK = pin.PA14
MOSI = pin.PA15
MISO = pin.PA16

View file

@ -0,0 +1 @@
"""Boards definition from BeagleBoard"""

View file

@ -0,0 +1,140 @@
"""Pin definitions for the Beaglebone Black."""
from adafruit_blinka.microcontroller.dra74x import pin
# initial pins, to mimic bonescript demo
# BeagleBone Black
# P8_1 = DGND # DGND
# P8_2 = DGND # DGND
P8_3 = pin.P8_3 # GPIO1_6 - GPIO_38
P8_4 = pin.P8_4 # GPIO1_7 - GPIO_39
P8_5 = pin.P8_5 # GPIO1_2 - GPIO_34
P8_6 = pin.P8_6 # GPIO1_3 - GPIO_35
P8_7 = pin.P8_7 # TIMER4 - GPIO_66
P8_8 = pin.P8_8 # TIMER7 - GPIO_67
P8_9 = pin.P8_9 # TIMER5 - GPIO_69
P8_10 = pin.P8_10 # TIMER6 - GPIO_68
P8_11 = pin.P8_11 # GPIO1_13 - GPIO_45
P8_12 = pin.P8_12 # GPIO1_12 - GPIO_44
P8_13 = pin.P8_13 # EHRPWM2B - GPIO_23
P8_14 = pin.P8_14 # GPIO0_26 - GPIO_26
P8_15 = pin.P8_15 # GPIO1_15 - GPIO_47
P8_16 = pin.P8_16 # GPIO1_14 - GPIO_46
P8_17 = pin.P8_17 # GPIO0_27 - GPIO_27
P8_18 = pin.P8_18 # GPIO2_1 - GPIO_65
P8_19 = pin.P8_19 # EHRPWM2A - GPIO_22
P8_20 = pin.P8_20 # GPIO1_31 - GPIO_63
P8_21 = pin.P8_21 # GPIO1_30 - GPIO_62
P8_22 = pin.P8_22 # GPIO1_5 - GPIO_37
P8_23 = pin.P8_23 # GPIO1_4 - GPIO_36
P8_24 = pin.P8_24 # GPIO1_1 - GPIO_33
P8_25 = pin.P8_25 # GPIO1_0 - GPIO_32
P8_26 = pin.P8_26 # GPIO1_29 - GPIO_61
P8_27 = pin.P8_27 # GPIO2_22 - GPIO_86
P8_28 = pin.P8_28 # GPIO2_24 - GPIO_88
P8_29 = pin.P8_29 # GPIO2_23 - GPIO_87
P8_30 = pin.P8_30 # GPIO2_25 - GPIO_89
P8_31 = pin.P8_31 # UART5_CTSN - GPIO_10
P8_32 = pin.P8_32 # UART5_RTSN - GPIO_11
P8_33 = pin.P8_33 # UART4_RTSN - GPIO_9
P8_34 = pin.P8_34 # UART3_RTSN - GPIO_81
P8_35 = pin.P8_35 # UART4_CTSN - GPIO_8
P8_36 = pin.P8_36 # UART3_CTSN - GPIO_80
P8_37 = pin.P8_37 # UART5_TXD - GPIO_78
P8_38 = pin.P8_38 # UART5_RXD - GPIO_79
P8_39 = pin.P8_39 # GPIO2_12 - GPIO_76
P8_40 = pin.P8_40 # GPIO2_13 - GPIO_77
P8_41 = pin.P8_41 # GPIO2_10 - GPIO_74
P8_42 = pin.P8_42 # GPIO2_11 - GPIO_75
P8_43 = pin.P8_43 # GPIO2_8 - GPIO_72
P8_44 = pin.P8_44 # GPIO2_9 - GPIO_73
P8_45 = pin.P8_45 # GPIO2_6 - GPIO_70
P8_46 = pin.P8_46 # GPIO2_7 - GPIO_71
# P9_1 = DGND # DGND
# P9_2 = DGND # DGND
# P9_3 = VDD_3V3 # VDD_3V3
# P9_4 = VDD_3V3 # VDD_3V3
# P9_5 = VDD_5V # VDD_5V
# P9_6 = VDD_5V # VDD_5V
# P9_7 = SYS_5V # SYS_5V
# P9_8 = SYS_5V # SYS_5V
# P9_9 = PWR_BUT # PWR_BUT
# P9_10 = SYS_RESETN # SYS_RESETn
P9_11 = pin.P9_11 # UART4_RXD - GPIO_30
P9_12 = pin.P9_12 # GPIO1_28 - GPIO_60
P9_13 = pin.P9_13 # UART4_TXD - GPIO_31
P9_14 = pin.P9_14 # EHRPWM1A - GPIO_50
P9_15 = pin.P9_15 # GPIO1_16 - GPIO_48
P9_16 = pin.P9_16 # EHRPWM1B - GPIO_51
P9_17 = pin.P9_17 # I2C1_SCL - GPIO_5
P9_18 = pin.P9_18 # I2C1_SDA - GPIO_4
P9_19 = pin.P9_19 # I2C2_SCL - GPIO_13
P9_20 = pin.P9_20 # I2C2_SDA - GPIO_12
P9_21 = pin.P9_21 # UART2_TXD - GPIO_3
P9_22 = pin.P9_22 # UART2_RXD - GPIO_2
P9_23 = pin.P9_23 # GPIO1_17 - GPIO_49
P9_24 = pin.P9_24 # UART1_TXD - GPIO_15
P9_25 = pin.P9_25 # GPIO3_21 - GPIO_117
P9_26 = pin.P9_26 # UART1_RXD - GPIO_14
P9_27 = pin.P9_27 # GPIO3_19 - GPIO_115
P9_28 = pin.P9_28 # SPI1_CS0 - GPIO_113
P9_29 = pin.P9_29 # SPI1_D0 - GPIO_111
P9_30 = pin.P9_30 # SPI1_D1 - GPIO_112
P9_31 = pin.P9_31 # SPI1_SCLK - GPIO_110
# P9_32 = VDD_ADC # VDD_ADC
# P9_33 = AIN4 # AIN4
# P9_34 = GNDA_ADC # GNDA_ADC
# P9_35 = AIN6 # AIN6
# P9_36 = AIN5 # AIN5
# P9_37 = AIN2 # AIN2
# P9_38 = AIN3 # AIN3
# P9_39 = AIN0 # AIN0
# P9_40 = AIN1 # AIN1
P9_41 = pin.P9_41 # CLKOUT2 - GPIO_20
P9_42 = pin.P9_42 # GPIO0_7 - GPIO_7
# P9_43 = DGND # DGND
# P9_44 = DGND # DGND
# P9_45 = DGND # DGND
# P9_46 = DGND # DGND
# common to all beagles
LED_USR0 = pin.USR0
LED_USR1 = pin.USR1
LED_USR2 = pin.USR2
LED_USR3 = pin.USR3
LED_USR4 = pin.USR4
# I2C and SPI pins from:
# src/adafruit_blinka/board/raspi_40pin.py
# SDA = pin.SDA
# SCL = pin.SCL
# CE1 = pin.D7
# CE0 = pin.D8
# MISO = pin.D9
# MOSI = pin.D10
# SCLK = pin.D11
# SCK = pin.D11
# TXD = pin.D14
# RXD = pin.D15
# MISO_1 = pin.D19
# MOSI_1 = pin.D20
# SCLK_1 = pin.D21
# SCK_1 = pin.D21
SDA = pin.I2C4_SDA # P9_19
SCL = pin.I2C4_SCL # P9_20
# Pins for SPI
#
# To enable SPI and an additional I2C port, add the following line to /boot/uEnv.txt:
# dtb=am5729-beagleboneai-roboticscape.dtb
#
# You can verify the dtb file exists by checking the /boot/dtbs/{kernel_version}/ folder
#
CE0 = pin.SPI1_CS0 # P9_28
CE1 = pin.SPI1_CS1 # P9_42
MOSI = pin.SPI1_D1 # P9_29
MISO = pin.SPI1_D0 # P9_30
SCLK = pin.SPI1_SCLK # P9_31
# CircuitPython naming convention for SPI Clock
SCK = SCLK

View file

@ -0,0 +1,176 @@
"""Pin definitions for the Beaglebone Black."""
from adafruit_blinka.microcontroller.am335x import pin
# initial pins, to mimic bonescript demo
# BeagleBone Black
# P8_1 = DGND # DGND
# P8_2 = DGND # DGND
P8_3 = pin.P8_3 # GPIO1_6 - GPIO_38
P8_4 = pin.P8_4 # GPIO1_7 - GPIO_39
P8_5 = pin.P8_5 # GPIO1_2 - GPIO_34
P8_6 = pin.P8_6 # GPIO1_3 - GPIO_35
P8_7 = pin.P8_7 # TIMER4 - GPIO_66
P8_8 = pin.P8_8 # TIMER7 - GPIO_67
P8_9 = pin.P8_9 # TIMER5 - GPIO_69
P8_10 = pin.P8_10 # TIMER6 - GPIO_68
P8_11 = pin.P8_11 # GPIO1_13 - GPIO_45
P8_12 = pin.P8_12 # GPIO1_12 - GPIO_44
P8_13 = pin.P8_13 # EHRPWM2B - GPIO_23
P8_14 = pin.P8_14 # GPIO0_26 - GPIO_26
P8_15 = pin.P8_15 # GPIO1_15 - GPIO_47
P8_16 = pin.P8_16 # GPIO1_14 - GPIO_46
P8_17 = pin.P8_17 # GPIO0_27 - GPIO_27
P8_18 = pin.P8_18 # GPIO2_1 - GPIO_65
P8_19 = pin.P8_19 # EHRPWM2A - GPIO_22
P8_20 = pin.P8_20 # GPIO1_31 - GPIO_63
P8_21 = pin.P8_21 # GPIO1_30 - GPIO_62
P8_22 = pin.P8_22 # GPIO1_5 - GPIO_37
P8_23 = pin.P8_23 # GPIO1_4 - GPIO_36
P8_24 = pin.P8_24 # GPIO1_1 - GPIO_33
P8_25 = pin.P8_25 # GPIO1_0 - GPIO_32
P8_26 = pin.P8_26 # GPIO1_29 - GPIO_61
P8_27 = pin.P8_27 # GPIO2_22 - GPIO_86
P8_28 = pin.P8_28 # GPIO2_24 - GPIO_88
P8_29 = pin.P8_29 # GPIO2_23 - GPIO_87
P8_30 = pin.P8_30 # GPIO2_25 - GPIO_89
P8_31 = pin.P8_31 # UART5_CTSN - GPIO_10
P8_32 = pin.P8_32 # UART5_RTSN - GPIO_11
P8_33 = pin.P8_33 # UART4_RTSN - GPIO_9
P8_34 = pin.P8_34 # UART3_RTSN - GPIO_81
P8_35 = pin.P8_35 # UART4_CTSN - GPIO_8
P8_36 = pin.P8_36 # UART3_CTSN - GPIO_80
P8_37 = pin.P8_37 # UART5_TXD - GPIO_78
P8_38 = pin.P8_38 # UART5_RXD - GPIO_79
P8_39 = pin.P8_39 # GPIO2_12 - GPIO_76
P8_40 = pin.P8_40 # GPIO2_13 - GPIO_77
P8_41 = pin.P8_41 # GPIO2_10 - GPIO_74
P8_42 = pin.P8_42 # GPIO2_11 - GPIO_75
P8_43 = pin.P8_43 # GPIO2_8 - GPIO_72
P8_44 = pin.P8_44 # GPIO2_9 - GPIO_73
P8_45 = pin.P8_45 # GPIO2_6 - GPIO_70
P8_46 = pin.P8_46 # GPIO2_7 - GPIO_71
# P9_1 = DGND # DGND
# P9_2 = DGND # DGND
# P9_3 = VDD_3V3 # VDD_3V3
# P9_4 = VDD_3V3 # VDD_3V3
# P9_5 = VDD_5V # VDD_5V
# P9_6 = VDD_5V # VDD_5V
# P9_7 = SYS_5V # SYS_5V
# P9_8 = SYS_5V # SYS_5V
# P9_9 = PWR_BUT # PWR_BUT
# P9_10 = SYS_RESETN # SYS_RESETn
P9_11 = pin.P9_11 # UART4_RXD - GPIO_30
P9_12 = pin.P9_12 # GPIO1_28 - GPIO_60
P9_13 = pin.P9_13 # UART4_TXD - GPIO_31
P9_14 = pin.P9_14 # EHRPWM1A - GPIO_50
P9_15 = pin.P9_15 # GPIO1_16 - GPIO_48
P9_16 = pin.P9_16 # EHRPWM1B - GPIO_51
P9_17 = pin.P9_17 # I2C1_SCL - GPIO_5
P9_18 = pin.P9_18 # I2C1_SDA - GPIO_4
P9_19 = pin.P9_19 # I2C2_SCL - GPIO_13
P9_20 = pin.P9_20 # I2C2_SDA - GPIO_12
P9_21 = pin.P9_21 # UART2_TXD - GPIO_3
P9_22 = pin.P9_22 # UART2_RXD - GPIO_2
P9_23 = pin.P9_23 # GPIO1_17 - GPIO_49
P9_24 = pin.P9_24 # UART1_TXD - GPIO_15
P9_25 = pin.P9_25 # GPIO3_21 - GPIO_117
P9_26 = pin.P9_26 # UART1_RXD - GPIO_14
P9_27 = pin.P9_27 # GPIO3_19 - GPIO_115
P9_28 = pin.P9_28 # SPI1_CS0 - GPIO_113
P9_29 = pin.P9_29 # SPI1_D0 - GPIO_111
P9_30 = pin.P9_30 # SPI1_D1 - GPIO_112
P9_31 = pin.P9_31 # SPI1_SCLK - GPIO_110
# P9_32 = VDD_ADC # VDD_ADC
# P9_33 = AIN4 # AIN4
# P9_34 = GNDA_ADC # GNDA_ADC
# P9_35 = AIN6 # AIN6
# P9_36 = AIN5 # AIN5
# P9_37 = AIN2 # AIN2
# P9_38 = AIN3 # AIN3
# P9_39 = AIN0 # AIN0
# P9_40 = AIN1 # AIN1
P9_41 = pin.P9_41 # CLKOUT2 - GPIO_20
P9_42 = pin.P9_42 # GPIO0_7 - GPIO_7
# P9_43 = DGND # DGND
# P9_44 = DGND # DGND
# P9_45 = DGND # DGND
# P9_46 = DGND # DGND
# common to all beagles
LED_USR0 = pin.USR0
LED_USR1 = pin.USR1
LED_USR2 = pin.USR2
LED_USR3 = pin.USR3
# I2C and SPI pins from:
# src/adafruit_blinka/board/raspi_40pin.py
# SDA = pin.SDA
# SCL = pin.SCL
# CE1 = pin.D7
# CE0 = pin.D8
# MISO = pin.D9
# MOSI = pin.D10
# SCLK = pin.D11
# SCK = pin.D11
# TXD = pin.D14
# RXD = pin.D15
# MISO_1 = pin.D19
# MOSI_1 = pin.D20
# SCLK_1 = pin.D21
# SCK_1 = pin.D21
SDA = pin.I2C2_SDA # P9_19
SCL = pin.I2C2_SCL # P9_20
# Refer to header default pin modes
# http://beagleboard.org/static/images/cape-headers.png
#
# P9_17 (SPI0_CSO => CE0) enables peripheral device
# P9_18 (SPI0_D1 => MOSI) outputs data to peripheral device
# P9_21 (SPIO_DO => MISO) receives data from peripheral device
# P9_22 (SPI0_SCLK => SCLK) outputs clock signal
#
# Use config-pin to set pin mode for SPI pins
# https://github.com/beagleboard/bb.org-overlays/tree/master/tools/beaglebone-universal-io
# config-pin p9.17 spi_cs
# config-pin p9.18 spi
# config-pin p9.21 spi
# config-pin p9.22 spi_sclk
#
CE0 = pin.SPI0_CS0 # P9_17
MOSI = pin.SPI0_D1 # P9_18
MISO = pin.SPI0_D0 # P9_21
SCLK = pin.SPI0_SCLK # P9_22
# CircuitPython naming convention for SPI Clock
SCK = SCLK
# Pins for SPI1
# refer to:
# http://beagleboard.org/static/images/cape-headers-spi.png
#
# CE1 P9.28 SPI1_CS0
# MISO_1 P9.29 SPI1_D0
# MOSI_1 P9.30 SPI1_D1
# SCLK_1 P9.31 SPI_SCLK
#
# SPI1 conflicts with HDMI Audio (McASP)
#
# Refer to:
# https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
#
# To Disable HDMI AUDIO, uncomment this line in /boot/uEnv.txt:
# disable_uboot_overlay_audio=1
#
# Set pin modes for SPI1 with:
#
# config-pin p9.28 spi1_cs
# config-pin p9.29 spi1
# config-pin p9.30 spi1
# config-pin p9.31 spi_sclk
CE1 = pin.SPI1_CS0 # P9_28
MOSI_1 = pin.SPI1_D0 # P9_29
MISO_1 = pin.SPI1_D1 # P9_30
SCLK_1 = pin.SPI1_SCLK # P9_31
# CircuitPython naming convention for SPI Clock
SCK_1 = SCLK_1

View file

@ -0,0 +1,138 @@
"""
Pin definitions for the Beaglebone PocketBeagle.
based on
https://github.com/beagleboard/pocketbeagle/wiki/System-Reference-Manual#figure-42-expansion-header-popular-functions---color-coded
"""
from adafruit_blinka.microcontroller.am335x import pin
# initial pins, to mimic bonescript demo
# PocketBeagle
# P1_1 = SYS VIN # VIN_AC
P1_2 = pin.P1_2 # GPIO2_23 - GPIO_87
P1_3 = pin.P1_3 # USB1_VBUS_OUT - (silkscreen: USB1 V_EN)
P1_4 = pin.P1_4 # GPIO2_25 - GPIO_89
# P1_5 = USB VBUS # USB1_VBUS_IN
P1_6 = pin.P1_6 # SPI0_CS0 - GPIO_5
# P1_7 = USB VIN # VIN-USB
P1_8 = pin.P1_8 # SPI0_SCLK - GPIO_2
# P1_9 = USB1 DN # USB1-DN
P1_10 = pin.P1_10 # SPI0_D0 - GPIO_3
# P1_11 = USB1 DP # USB1-DP
P1_12 = pin.P1_12 # SPI0_D1 - GPIO_4
# P1_13 = USB1 ID # USB1-ID
# P1_14 = SYS 3.3V # VOUT-3.3V
# P1_15 = SYS GND # GND
# P1_16 = SYS GND # GND
# P1_17 = AIN 1.8V REF- # VREFN
# P1_18 = AIN 1.8V REF+ # VREFP
P1_19 = pin.P1_19 # AIN0
P1_20 = pin.P1_20 # GPIO0_20 - GPIO_20
P1_21 = pin.P1_21 # AIN1
# P1_22 = SYS GND # GND
P1_23 = pin.P1_23 # AIN2
# P1_22 = SYS VOUT # VOUT-5V
P1_25 = pin.P1_25 # AIN3
P1_26 = pin.P1_26 # I2C2_SDA - GPIO_12
P1_27 = pin.P1_27 # AIN4
P1_28 = pin.P1_28 # I2C2_SCL - GPIO_13
P1_29 = pin.P1_29 # GPIO3_21 - GPIO_117
P1_30 = pin.P1_30 # UART0_TXD - GPIO_43
P1_31 = pin.P1_31 # GPIO3_18 - GPIO_114
P1_32 = pin.P1_32 # UART0_RXD - GPIO_42
P1_33 = pin.P1_33 # GPIO3_15 - GPIO_111 - EHRPWM0B (ehrpwm.0:1)
P1_34 = pin.P1_34 # GPIO0_26 - GPIO_26
P1_35 = pin.P1_35 # GPIO2_24 - GPIO_88
P1_36 = pin.P1_36 # EHRPWM0A - GPIO_110 - EHRPWM0A (ehrpwm.0:0)
P2_1 = pin.P2_1 # EHRPWM1A - GPIO_50
P2_2 = pin.P2_2 # GPIO1_27 - GPIO_59
P2_3 = pin.P2_3 # GPIO0_23 - GPIO_23
P2_4 = pin.P2_4 # GPIO1_26 - GPIO_58
P2_5 = pin.P2_5 # UART4_RXD - GPIO_30
P2_6 = pin.P2_6 # GPIO1_25 - GPIO_57
P2_7 = pin.P2_7 # UART4_TXD - GPIO_31
P2_8 = pin.P2_8 # GPIO1_28 - GPIO_60
P2_9 = pin.P2_9 # I2C1_SCL - GPIO_15
P2_10 = pin.P2_10 # GPIO1_20 - GPIO_52
P2_11 = pin.P2_11 # I2C1_SDA - GPIO_14
# P2_12 = SYS PWR BTN # POWER_BUTTON
# P2_13 = SYS VOUT # VOUT-5V
# P2_14 = BAT VIN # BAT-VIN
# P2_15 = SYS GND # GND
# P2_16 = BAT TEMP # BAT-TEMP
P2_17 = pin.P2_17 # GPIO2_1 - GPIO_65
P2_18 = pin.P2_18 # GPIO1_15 - GPIO_47
P2_19 = pin.P2_19 # GPIO0_27 - GPIO_27
P2_20 = pin.P2_20 # GPIO2_0 - GPIO_64
# P2_21 = SYS GND # GND
P2_22 = pin.P2_22 # GPIO1_14 - GPIO_46
# P2_23 = SYS 3.3V # VOUT-3.3V
P2_24 = pin.P2_24 # GPIO1_12 - GPIO_44
P2_25 = pin.P2_25 # SPI1_CS0 - GPIO_41
# P2_26 = SYS NRST # RESET#
P2_27 = pin.P2_27 # SPI1_D0 - GPIO_40
P2_28 = pin.P2_28 # GPIO3_20 - GPIO_116
P2_29 = pin.P2_29 # SPI1_SCLK - GPIO_7
P2_30 = pin.P2_30 # GPIO3_17 - GPIO_113
P2_31 = pin.P2_31 # SPI1_CS1 - GPIO_19
P2_32 = pin.P2_32 # GPIO3_16 - GPIO_112
P2_33 = pin.P2_33 # GPIO1_13 - GPIO_45
P2_34 = pin.P2_34 # GPIO3_19 - GPIO_115
P2_35 = pin.P2_35 # GPIO2_22 - GPIO_86
P2_36 = pin.P2_36 # AIN7
# common to all beagles
LED_USR0 = pin.USR0
LED_USR1 = pin.USR1
LED_USR2 = pin.USR2
LED_USR3 = pin.USR3
##########
# Refer to header default pin modes
# https://raw.githubusercontent.com/wiki/beagleboard/pocketbeagle/images/PocketBeagle_pinout.png
# I2C1 pins
SDA_1 = pin.I2C1_SDA # P2_11 data signal
SCL_1 = pin.I2C1_SCL # P2_9 clock signal
# for example compatibility we create a alias
SDA = SDA_1
SCL = SCL_1
# I2C2 pins
SDA_2 = pin.I2C2_SDA # P1_26 data signal
SCL_2 = pin.I2C2_SCL # P1_28 clock signal
# SPI0 pins
CE0 = pin.SPI0_CS0 # P1_6 - enables peripheral device
SCLK = pin.SPI0_SCLK # P1_12 - outputs data to peripheral device
MOSI = pin.SPI0_D1 # P1_10 - receives data from peripheral device
MISO = pin.SPI0_D0 # P1_8 - outputs clock signal
# CircuitPython naming convention for SPI Clock
SCK = SCLK
# SPI1 pins
CE0_1 = pin.SPI1_CS1 # P2_31 - enables peripheral device
SCLK_1 = pin.SPI1_SCLK # P2_25 - outputs data to peripheral device
MOSI_1 = pin.SPI1_D1 # P2_27 - receives data from peripheral device
MISO_1 = pin.SPI1_D0 # P2_29 - outputs clock signal
# CircuitPython naming convention for SPI Clock
SCK_1 = SCLK_1
# UART0
TX_0 = pin.UART0_TXD # P1_30
RX_0 = pin.UART0_RXD # P1_32
# create alias for most of the examples
TX = TX_0
RX = RX_0
# UART2
# pins already in use by SPI0
# TX_2 = pin.UART2_TXD # P1_8
# RX_2 = pin.UART2_RXD # P1_10
# UART4
TX_4 = pin.UART4_TXD # P2_7
RX_4 = pin.UART4_RXD # P2_5

View file

@ -1,118 +0,0 @@
"""Pin definitions for the Beaglebone Black."""
from adafruit_blinka.microcontroller.am335x import pin
# initial pins, to mimic bonescript demo
P8_3 = pin.P8_3
P8_4 = pin.P8_4
P8_5 = pin.P8_5
P8_6 = pin.P8_6
P8_7 = pin.P8_7
P8_8 = pin.P8_8
P8_9 = pin.P8_9
P8_10 = pin.P8_10
P8_11 = pin.P8_11
P8_12 = pin.P8_12
P8_13 = pin.P8_13
P8_14 = pin.P8_14
P8_15 = pin.P8_15
P8_16 = pin.P8_16
P8_17 = pin.P8_17
P8_18 = pin.P8_18
P8_19 = pin.P8_19
P8_20 = pin.P8_20
P8_21 = pin.P8_21
P8_22 = pin.P8_22
P8_23 = pin.P8_23
P8_24 = pin.P8_24
P8_25 = pin.P8_25
P8_26 = pin.P8_26
P8_27 = pin.P8_27
P8_28 = pin.P8_28
P8_29 = pin.P8_29
P8_30 = pin.P8_30
P8_31 = pin.P8_31
P8_32 = pin.P8_32
P8_33 = pin.P8_33
P8_34 = pin.P8_34
P8_35 = pin.P8_35
P8_36 = pin.P8_36
P8_37 = pin.P8_37
P8_38 = pin.P8_38
P8_39 = pin.P8_39
P8_40 = pin.P8_40
P8_41 = pin.P8_41
P8_42 = pin.P8_42
P8_43 = pin.P8_43
P8_44 = pin.P8_44
P8_45 = pin.P8_45
P8_46 = pin.P8_46
P9_11 = pin.P9_11
P9_12 = pin.P9_12
P9_13 = pin.P9_13
P9_14 = pin.P9_14
P9_15 = pin.P9_15
P9_16 = pin.P9_16
P9_17 = pin.P9_17
P9_18 = pin.P9_18
P9_19 = pin.P9_19
P9_20 = pin.P9_20
P9_21 = pin.P9_21
P9_22 = pin.P9_22
P9_23 = pin.P9_23
P9_24 = pin.P9_24
P9_25 = pin.P9_25
P9_26 = pin.P9_26
P9_27 = pin.P9_27
P9_28 = pin.P9_28
P9_29 = pin.P9_29
P9_30 = pin.P9_30
P9_31 = pin.P9_31
P9_41 = pin.P9_41
P9_42 = pin.P9_42
LED_USR0 = pin.USR0
LED_USR1 = pin.USR1
LED_USR2 = pin.USR2
LED_USR3 = pin.USR3
# I2C and SPI pins from:
# src/adafruit_blinka/board/raspi_40pin.py
# SDA = pin.SDA
# SCL = pin.SCL
# CE1 = pin.D7
# CE0 = pin.D8
# MISO = pin.D9
# MOSI = pin.D10
# SCLK = pin.D11
# SCK = pin.D11
# TXD = pin.D14
# RXD = pin.D15
# MISO_1 = pin.D19
# MOSI_1 = pin.D20
# SCLK_1 = pin.D21
# SCK_1 = pin.D21
SDA = pin.SDA
SCL = pin.SCL
# Refer to header default pin modes
# http://beagleboard.org/static/images/cape-headers.png
# P9_17 (SPI0_CSO => CE0) enables peripheral device
# P9_18 (SPI0_D1 => MOSI) outputs data to peripheral device
# P9_21 (SPIO_DO => MISO) receives data from peripheral device
# P9_22 (SPI0_SCLK => SCLK) outputs clock signal
CE0 = pin.CE0
MOSI = pin.MOSI
MISO = pin.MISO
SCLK = pin.SCLK
#CircuitPython naming convention for SPI Clock
SCK = pin.SCK
# SPI1 pins
# http://beagleboard.org/static/images/cape-headers-spi.png
CE1 = pin.CE1
MOSI_1 = pin.MOSI_1
MISO_1 = pin.MISO_1
SCLK_1 = pin.SCLK_1
#CircuitPython naming convention for SPI Clock
SCK_1 = pin.SCK_1

View file

@ -0,0 +1,21 @@
"""Pin definitions for the Binho Nova"""
from adafruit_blinka.microcontroller.nova import pin
IO0 = pin.IO0
IO1 = pin.IO1
IO2 = pin.IO2
IO3 = pin.IO3
IO4 = pin.IO4
TX = IO4
RX = IO3
SDA = pin.SDA
SCL = pin.SCL
SCK = pin.SCK
SCLK = pin.SCLK
MOSI = pin.MOSI
MISO = pin.MISO
SS0 = pin.SS0
SS1 = pin.SS1

View file

@ -0,0 +1,33 @@
"""Pin definitions for the Clockwork Pi (CPI3) board."""
from adafruit_blinka.microcontroller.allwinner.a33 import pin
# Clockwork Pi GPIO port (DEBUG section in datasheet)
# Type Pin # (ext.) Pin # (Package) Function 1 Function 2 Pin # (sysfs) Color
# 3V0 1 blue
# GPIO 2 PB0 UART0/2_TX PB-EINT0 32 green
# GPIO 3 PB1 UART0/2_RX PB-EINT1 33 yellow
# GND 4 white
# GPIO 5 PH5 I2C1-SDA 229 red
# GPIO 6 PH4 I2C1-SCL 228 brown
# GND 7 black
# GPIO 8 PH6 UART3-TX SPI0-CS 230 blue
# GPIO 9 PH7 UART3-RX SPI0-CLK 231 green
# GPIO 10 PH9 UART3-CTS SPI0-MISO 233 yellow
# GPIO 11 PH8 UART3-RTS SPI0-MOSI 232 white
# GND 12 red
# 5V0 13 brown
# 5V0 14 black
PB0 = pin.PB0
PB1 = pin.PB1
TX = PB0
RX = PB1
SCL = pin.PH4
SDA = pin.PH5
SCLK = pin.PH7
MOSI = pin.PH8
MISO = pin.PH9

View file

@ -0,0 +1,24 @@
"""Pin definitions for the Coral Dev Board."""
from adafruit_blinka.microcontroller.nxp_imx8m import pin
# Board name = RPI name [= alias] = pin name
I2C2_SDA = D2 = SDA = pin.I2C2_SDA
I2C2_SCL = D3 = SCL = pin.I2C2_SCL
PWM1 = D12 = pin.PWM1
PWM2 = D13 = pin.PWM2
PWM3 = D22 = pin.PWM3
GPIO_P13 = D27 = pin.GPIO6
GPIO_P16 = D23 = pin.GPIO73
GPIO_P18 = D24 = pin.GPIO138
GPIO_P29 = D5 = pin.GPIO7
GPIO_P31 = D6 = pin.GPIO8
GPIO_P36 = D16 = pin.GPIO141
GPIO_P37 = D26 = pin.GPIO77
ECSPI1_MISO = D9 = MISO = pin.ECSPI1_MISO
ECSPI1_MOSI = D10 = MOSI = pin.ECSPI1_MOSI
ECSPI1_SCLK = D11 = SCLK = SCK = pin.ECSPI1_SCLK
ECSPI1_SS0 = D8 = SS0 = pin.ECSPI1_SS0

View file

@ -0,0 +1,38 @@
"""Pin definitions for the Coral Dev Board Mini."""
from adafruit_blinka.microcontroller.mt8167 import pin
# Board name = RPI name [= alias] = pin name
GPIO22 = D4 = pin.GPIO22 # Pin 7
GPIO9 = D17 = pin.GPIO9 # Pin 11
GPIO36 = D18 = pin.GPIO36 # Pin 12
GPIO10 = D27 = pin.GPIO10 # Pin 13
GPIO0 = D23 = pin.GPIO0 # Pin 16
GPIO1 = D24 = pin.GPIO1 # Pin 18
GPIO7 = D25 = pin.GPIO7 # Pin 22
GPIO8 = D7 = pin.GPIO8 # Pin 26
GPIO37 = D19 = pin.GPIO37 # Pin 35
GPIO13 = D16 = pin.GPIO13 # Pin 36
GPIO45 = D26 = pin.GPIO45 # Pin 37
GPIO38 = D20 = pin.GPIO38 # Pin 38
GPIO39 = D21 = pin.GPIO39 # Pin 40
I2C1_SDA = D2 = SDA1 = pin.I2C1_SDA # Pin 3
I2C1_SCL = D3 = SCL1 = pin.I2C1_SCL # Pin 5
I2C2_SDA = D0 = SDA2 = pin.I2C2_SDA # Pin 27
I2C2_SCL = D1 = SCL2 = pin.I2C2_SCL # Pin 28
PWM_A = D12 = pin.PWM_A # Pin 32
PWM_B = D13 = pin.PWM_B # Pin 33
PWM_C = D22 = pin.PWM_C # Pin 15
SPI_MO = D10 = MOSI = pin.SPI_MO # Pin 19
SPI_MI = D9 = MISO = pin.SPI_MI # Pin 21
SPI_CLK = D11 = SCLK = pin.SPI_CLK # Pin 23
SPI_CSB = D8 = CS0 = pin.SPI_CSB # Pin 24
# UART currently not supported
GPIO63 = D14 = pin.GPIO63 # UART0_TX, Pin 8
GPIO62 = D15 = pin.GPIO62 # UART0_RX, Pin 10
GPIO65 = D5 = pin.GPIO65 # UART1_TX, Pin 29
GPIO64 = D6 = pin.GPIO64 # UART1_RX, Pin 31

View file

@ -0,0 +1,42 @@
"""Pin definitions for the Dragonboard 410c."""
from adafruit_blinka.microcontroller.snapdragon.apq8016 import pin
GPIO_A = pin.GPIO_36
GPIO_B = pin.GPIO_12
GPIO_C = pin.GPIO_13
GPIO_D = pin.GPIO_69
GPIO_E = pin.GPIO_115
GPIO_F = pin.PM_MPP_4
GPIO_G = pin.GPIO_24
GPIO_H = pin.GPIO_25
GPIO_I = pin.GPIO_35
GPIO_J = pin.GPIO_34
GPIO_K = pin.GPIO_28
GPIO_L = pin.GPIO_33
GPIO_36 = pin.GPIO_36
GPIO_12 = pin.GPIO_12
GPIO_13 = pin.GPIO_13
GPIO_69 = pin.GPIO_69
GPIO_115 = pin.GPIO_115
GPIO_4 = pin.PM_MPP_4
GPIO_24 = pin.GPIO_24
GPIO_25 = pin.GPIO_25
GPIO_35 = pin.GPIO_35
GPIO_34 = pin.GPIO_34
GPIO_28 = pin.GPIO_28
GPIO_33 = pin.GPIO_33
SDA = pin.I2C0_SDA
SCL = pin.I2C0_SCL
I2C0_SDA = pin.I2C0_SDA
I2C0_SCL = pin.I2C0_SCL
I2C1_SDA = pin.I2C1_SDA
I2C1_SCL = pin.I2C1_SCL
SCLK = pin.SPI0_SCLK
MOSI = pin.SPI0_MOSI
MISO = pin.SPI0_MISO
SPI_CS = pin.SPI0_CS

View file

@ -0,0 +1,23 @@
"""Pin definitions for the FTDI FT232H"""
from adafruit_blinka.microcontroller.ft232h import pin
D4 = pin.D4
D5 = pin.D5
D6 = pin.D6
D7 = pin.D7
C0 = pin.C0
C1 = pin.C1
C2 = pin.C2
C3 = pin.C3
C4 = pin.C4
C5 = pin.C5
C6 = pin.C6
C7 = pin.C7
SDA = pin.SDA
SCL = pin.SCL
SCK = pin.SCK
SCLK = pin.SCLK
MOSI = pin.MOSI
MISO = pin.MISO

View file

@ -1,11 +1,18 @@
"""Pin definitions for the Giant Board"""
from adafruit_blinka.microcontroller.sama5 import pin
PD23 = pin.PD23
AD4 = pin.PD23
PD21 = pin.PD21
AD2 = pin.PD21
PD20 = pin.PD20
AD1 = pin.PD20
PD24 = pin.PD24
AD5 = pin.PD24
PD22 = pin.PD22
AD3 = pin.PD22
PD19 = pin.PD19
AD0 = pin.PD19
PA14 = pin.PA14
SCK = pin.PA14
SCLK = pin.PA14
@ -21,9 +28,13 @@ TX = pin.PD3
PD13 = pin.PD13
PD31 = pin.PD31
PB0 = pin.PB0
PWM1 = pin.PB0
PB7 = pin.PB7
PWM3 = pin.PB7
PB1 = pin.PB1
PWML1 = pin.PB1
PB5 = pin.PB5
PWM2 = pin.PB5
PB3 = pin.PB3
PC0 = pin.PC0
SCL = pin.PC0

View file

@ -0,0 +1,94 @@
"""Pin definitions for the GreatFET One"""
from adafruit_blinka.microcontroller.nxp_lpc4330 import pin
J1_P3 = pin.J1_P3
J1_P4 = pin.J1_P4
J1_P5 = pin.J1_P5
J1_P6 = pin.J1_P6
J1_P7 = pin.J1_P7
J1_P8 = pin.J1_P8
J1_P9 = pin.J1_P9
J1_P10 = pin.J1_P10
J1_P12 = pin.J1_P12
J1_P13 = pin.J1_P13
J1_P14 = pin.J1_P14
J1_P15 = pin.J1_P15
J1_P16 = pin.J1_P16
J1_P17 = pin.J1_P17
J1_P18 = pin.J1_P18
J1_P19 = pin.J1_P19
J1_P20 = pin.J1_P20
J1_P21 = pin.J1_P21
J1_P22 = pin.J1_P22
J1_P23 = pin.J1_P23
J1_P24 = pin.J1_P24
J1_P25 = pin.J1_P25
J1_P26 = pin.J1_P26
J1_P27 = pin.J1_P27
J1_P28 = pin.J1_P28
J1_P29 = pin.J1_P29
J1_P30 = pin.J1_P30
J1_P31 = pin.J1_P31
J1_P32 = pin.J1_P32
J1_P33 = pin.J1_P33
J1_P34 = pin.J1_P34
J1_P35 = pin.J1_P35
J1_P37 = pin.J1_P37
J1_P39 = pin.J1_P39
J1_P40 = pin.J1_P40
# J2 Header Pins
J2_P3 = pin.J2_P3
J2_P4 = pin.J2_P4
J2_P5 = pin.J2_P5
J2_P6 = pin.J2_P6
J2_P7 = pin.J2_P7
J2_P8 = pin.J2_P8
J2_P9 = pin.J2_P9
J2_P10 = pin.J2_P10
J2_P13 = pin.J2_P13
J2_P14 = pin.J2_P14
J2_P15 = pin.J2_P15
J2_P16 = pin.J2_P16
J2_P18 = pin.J2_P18
J2_P19 = pin.J2_P19
J2_P20 = pin.J2_P20
J2_P22 = pin.J2_P22
J2_P23 = pin.J2_P23
J2_P24 = pin.J2_P24
J2_P25 = pin.J2_P25
J2_P27 = pin.J2_P27
J2_P28 = pin.J2_P28
J2_P29 = pin.J2_P29
J2_P30 = pin.J2_P30
J2_P31 = pin.J2_P31
J2_P33 = pin.J2_P33
J2_P34 = pin.J2_P34
J2_P35 = pin.J2_P35
J2_P36 = pin.J2_P36
J2_P37 = pin.J2_P37
J2_P38 = pin.J2_P38
# Bonus Row Pins
J7_P2 = pin.J7_P2
J7_P3 = pin.J7_P3
J7_P6 = pin.J7_P6
J7_P7 = pin.J7_P7
J7_P8 = pin.J7_P8
J7_P13 = pin.J7_P13
J7_P14 = pin.J7_P14
J7_P15 = pin.J7_P15
J7_P16 = pin.J7_P16
J7_P17 = pin.J7_P17
J7_P18 = pin.J7_P18
SDA = pin.SDA
SCL = pin.SCL
SCK = pin.SCK
SCLK = SCK
MOSI = pin.MOSI
MISO = pin.MISO
TX = pin.TX
RX = pin.RX

View file

@ -0,0 +1 @@
"""Boards definition from HardKernel"""

View file

@ -0,0 +1,80 @@
"""Pin definitions for the Odroid C2."""
from adafruit_blinka.microcontroller.amlogic.s905 import pin
GPIOX_0 = pin.GPIO228
GPIOX_1 = pin.GPIO229
GPIOX_2 = pin.GPIO230
GPIOX_3 = pin.GPIO231
GPIOX_4 = pin.GPIO232
GPIOX_5 = pin.GPIO233
GPIOX_6 = pin.GPIO234
GPIOX_7 = pin.GPIO235
GPIOX_8 = pin.GPIO236
GPIOX_9 = pin.GPIO237
GPIOX_10 = pin.GPIO238
GPIOX_11 = pin.GPIO239
GPIOX_12 = pin.GPIO240
GPIOX_13 = pin.GPIO241
GPIOX_19 = pin.GPIO247
GPIOX_21 = pin.GPIO249
GPIODV_24 = pin.GPIO205
GPIODV_25 = pin.GPIO206
GPIODV_26 = pin.GPIO207
GPIODV_27 = pin.GPIO208
GPIODV_28 = pin.GPIO209
GPIODV_29 = pin.GPIO210
GPIOY_0 = pin.GPIO211
GPIOY_1 = pin.GPIO212
GPIOY_3 = pin.GPIO214
GPIOY_7 = pin.GPIO218
GPIOY_8 = pin.GPIO219
GPIOY_12 = pin.GPIO223
GPIOY_13 = pin.GPIO224
GPIOY_14 = pin.GPIO225
GPIOA0_0 = pin.GPIO122
GPIOA0_1 = pin.GPIO123
GPIOA0_2 = pin.GPIO124
GPIOA0_3 = pin.GPIO125
GPIOA0_4 = pin.GPIO126
GPIOA0_5 = pin.GPIO127
GPIOA0_6 = pin.GPIO128
GPIOA0_7 = pin.GPIO129
GPIOA0_8 = pin.GPIO130
GPIOA0_9 = pin.GPIO131
GPIOA0_10 = pin.GPIO132
GPIOA0_11 = pin.GPIO133
GPIOA0_12 = pin.GPIO134
GPIOA0_13 = pin.GPIO135
SDA = pin.I2C0_SDA
SCL = pin.I2C0_SCL
SCLK = pin.SPI0_SCLK
MOSI = pin.SPI0_MOSI
MISO = pin.SPI0_MISO
SPI_CS0 = pin.GPIO229
SPI_CS1 = pin.GPIO225
D0 = GPIOX_19
D1 = GPIOX_10
D2 = GPIOX_11
D3 = GPIOX_9
D4 = GPIOX_8
D5 = GPIOX_5
D6 = GPIOX_3
D7 = GPIOX_21
D10 = GPIOX_1
D11 = GPIOY_14
D12 = GPIOX_7
D13 = GPIOX_4
D14 = GPIOX_2
D21 = GPIOX_0
D22 = GPIOY_8
D23 = GPIOX_6
D24 = GPIOY_3
D26 = GPIOY_13
D27 = GPIOY_7

View file

@ -0,0 +1,51 @@
"""Pin definitions for the Odroid C4."""
from adafruit_blinka.microcontroller.amlogic.s905x3 import pin
for it in pin.i2cPorts:
globals()["SCL" + str(it[0])] = it[1]
globals()["SDA" + str(it[0])] = it[2]
SCL = pin.i2cPorts[0][1]
SDA = pin.i2cPorts[0][2]
SCLK = pin.SPI0_SCLK
MOSI = pin.SPI0_MOSI
MISO = pin.SPI0_MISO
SPI_CS0 = pin.SPI0_CS0
"""J2: physical pin number"""
D3 = pin.GPIOX_17
D5 = pin.GPIOX_18
D7 = pin.GPIOX_5
D8 = pin.GPIOX_12
D10 = pin.GPIOX_13
D11 = pin.GPIOX_3
D12 = pin.GPIOX_16
D13 = pin.GPIOX_4
D15 = pin.GPIOX_7
D16 = pin.GPIOX_0
D18 = pin.GPIOX_1
D19 = pin.GPIOX_8
D21 = pin.GPIOX_9
D22 = pin.GPIOX_2
D23 = pin.GPIOX_11
D24 = pin.GPIOX_10
D26 = pin.GPIOH_6
D27 = pin.GPIOA_14
D28 = pin.GPIOA_15
D29 = pin.GPIOX_14
D31 = pin.GPIOX_15
D32 = pin.GPIOH_7
D33 = pin.GPIOX_6
D35 = pin.GPIOX_19
D36 = pin.GPIOH_5
"""J7: physical pin number"""
D42 = pin.GPIOAO_10
D44 = pin.GPIOAO_9
D45 = pin.GPIOAO_7
D46 = pin.GPIOAO_8
D47 = pin.GPIOAO_4

View file

@ -0,0 +1,91 @@
"""Pin definitions for the Odroid N2."""
from adafruit_blinka.microcontroller.amlogic.s922x import pin
GPIOX_0 = pin.GPIO476
GPIOX_1 = pin.GPIO477
GPIOX_2 = pin.GPIO478
GPIOX_3 = pin.GPIO479
GPIOX_4 = pin.GPIO480
GPIOX_5 = pin.GPIO481
GPIOX_6 = pin.GPIO482
GPIOX_7 = pin.GPIO483
GPIOX_8 = pin.GPIO484
GPIOX_9 = pin.GPIO485
GPIOX_10 = pin.GPIO486
GPIOX_11 = pin.GPIO487
GPIOX_12 = pin.GPIO488
GPIOX_13 = pin.GPIO489
GPIOX_14 = pin.GPIO490
GPIOX_15 = pin.GPIO491
GPIOX_16 = pin.GPIO492
GPIOX_17 = pin.GPIO493
GPIOX_18 = pin.GPIO494
GPIOX_19 = pin.GPIO495
GPIODV_24 = pin.GPIO493
GPIODV_25 = pin.GPIO494
GPIODV_26 = pin.GPIO474
GPIODV_27 = pin.GPIO475
GPIOA_4 = pin.GPIO464
GPIOA_12 = pin.GPIO472
GPIOA_13 = pin.GPIO473
GPIOA_14 = pin.GPIO474
GPIOA_15 = pin.GPIO475
GPIOA0_0 = pin.GPIO496
GPIOA0_1 = pin.GPIO497
GPIOA0_2 = pin.GPIO498
GPIOA0_3 = pin.GPIO499
GPIOA0_4 = pin.GPIO500
GPIOA0_5 = pin.GPIO501
GPIOA0_6 = pin.GPIO502
GPIOA0_7 = pin.GPIO503
GPIOA0_8 = pin.GPIO504
GPIOA0_9 = pin.GPIO505
GPIOA0_10 = pin.GPIO506
GPIOA0_11 = pin.GPIO507
GPIOA0_12 = pin.GPIO508
GPIOA0_13 = pin.GPIO509
GPIOA0_14 = pin.GPIO510
GPIOA0_15 = pin.GPIO511
for it in pin.i2cPorts:
globals()["SCL" + str(it[0])] = it[1]
globals()["SDA" + str(it[0])] = it[2]
# Set second i2c bus as default for backward compatibility.
SCL = pin.i2cPorts[1][1]
SDA = pin.i2cPorts[1][2]
SCLK = pin.SPI0_SCLK
MOSI = pin.SPI0_MOSI
MISO = pin.SPI0_MISO
SPI_CS0 = pin.GPIO486
D0 = GPIOX_3 # PIN_11
D1 = GPIOX_16 # PIN_12
D2 = GPIOX_4 # PIN_13
D3 = GPIOX_7 # PIN_15
D4 = GPIOX_0 # PIN_16
D5 = GPIOX_1 # PIN_18
D6 = GPIOX_2 # PIN_22
D7 = GPIOA_13 # PIN_7
D8 = GPIOX_17 # PIN_3
D9 = GPIOX_18 # PIN_5
D10 = GPIOX_10 # PIN_24
D11 = GPIOA_4 # PIN_26
D12 = GPIOX_8 # PIN_19
D13 = GPIOX_9 # PIN_21
D14 = GPIOX_11 # PIN_23
D15 = GPIOX_12 # PIN_8
D16 = GPIOX_13 # PIN_10
D21 = GPIOX_14 # PIN_29
D22 = GPIOX_15 # PIN_31
D23 = GPIOX_5 # PIN_33
D24 = GPIOX_6 # PIN_35
D26 = GPIOA_12 # PIN_32
D27 = GPIOX_19 # PIN_36
D30 = GPIOA_14 # PIN_27
D31 = GPIOA_15 # PIN_28

View file

@ -0,0 +1,40 @@
"""Pin definitions for the Odroid XU4."""
from adafruit_blinka.microcontroller.samsung.exynos5422 import pin
SDA = SDA1 = pin.I2C1_SDA
SCL = SCL1 = pin.I2C1_SCL
SDA5 = pin.I2C5_SDA
SCL5 = pin.I2C5_SCL
SCLK = pin.SPI1_SCLK
MOSI = pin.SPI1_MOSI
MISO = pin.SPI1_MISO
SPI_CS0 = pin.SPI1_CS0
"""physical pin number(XU4 Shifter Shield)"""
D3 = pin.GPIOB3_2
D5 = pin.GPIOB3_3
D7 = pin.GPIOX1_2
D8 = pin.GPIOA0_1
D10 = pin.GPIOA0_0
D11 = pin.GPIOA0_3
D12 = pin.GPIOA0_2
D13 = pin.GPIOX1_5
D15 = pin.GPIOX1_6
D16 = pin.GPIOX1_3
D18 = pin.GPIOX1_7
D19 = pin.GPIOA2_7
D21 = pin.GPIOA2_6
D22 = pin.GPIOX2_0
D23 = pin.GPIOA2_4
D24 = pin.GPIOA2_5
D26 = pin.GPIOX2_1
D27 = pin.GPIOA2_2
D28 = pin.GPIOA2_4
D29 = pin.GPIOX2_4
D31 = pin.GPIOX2_6
D32 = pin.GPIOX2_5
D33 = pin.GPIOX2_7
D36 = pin.GPIOX3_1

View file

@ -0,0 +1,37 @@
"""Pin definitions for the Hifive Unleashed."""
from adafruit_blinka.microcontroller.hfu540 import pin
GPIO_A = pin.GPIO0
GPIO_B = pin.GPIO1
GPIO_C = pin.GPIO2
GPIO_D = pin.GPIO3
GPIO_E = pin.GPIO4
GPIO_F = pin.GPIO5
GPIO_G = pin.GPIO6
GPIO_H = pin.GPIO7
GPIO_I = pin.GPIO8
GPIO_J = pin.GPIO9
GPIO_K = pin.GPIO15
UART0_TXD = pin.UART0_TXD
UART0_RXD = pin.UART0_RXD
SPI0_SCLK = pin.SPI0_SCLK
SPI0_DIN = pin.SPI0_DIN
UART1_TXD = pin.UART1_TXD
SPI0_CS = pin.SPI0_CS
UART1_RXD = pin.UART1_RXD
SPI0_DOUT = pin.SPI0_DOUT
I2C0_SCL = pin.I2C0_SCL
I2C0_SDA = pin.I2C0_SDA
SDA = pin.I2C0_SDA
SCL = pin.I2C0_SCL
I2C0_SDA = pin.I2C0_SDA
I2C0_SCL = pin.I2C0_SCL
SCLK = pin.SPI0_SCLK
MOSI = pin.SPI0_DOUT
MISO = pin.SPI0_DIN
SPI_CS = pin.SPI0_CS

View file

@ -0,0 +1 @@
"""Boards definition from LubanCat"""

View file

@ -0,0 +1,51 @@
"""Pin definitions for the LubanCat IMX6ULL."""
from adafruit_blinka.microcontroller.nxp_imx6ull import pin
# Pro board pin header CN4 named GPIO_PAx, pin header CN5 named GPIO_PBx
# Mini board pin header CN3 named GPIO_PCx, pin header CN4 named GPIO_PDx
# Board pin name [= alias] = RPI name [= alias] = pin name
GPIO_PC3 = I2C2_SDA = D2 = SDA = pin.I2C2_SDA
GPIO_PC5 = I2C2_SCL = D3 = SCL = pin.I2C2_SCL
GPIO_PC7 = D4 = pin.GPIO27
GPIO_PC8 = D14 = TXD = pin.UART3_TXD
GPIO_PC10 = D15 = RXD = pin.UART3_RXD
GPIO_PC11 = ADC_IN3 = A3 = D17 = pin.GPIO3
GPIO_PC12 = D18 = pin.GPIO112
GPIO_PC13 = ADC_IN2 = A2 = D27 = pin.GPIO2
GPIO_PC15 = ADC_IN0 = A0 = D22 = pin.GPIO0
GPIO_PC16 = D23 = pin.GPIO119
GPIO_PC18 = D24 = pin.GPIO114
GPIO_PC19 = ECSPI3_MOSI = D10 = MOSI = pin.ECSPI3_MOSI
GPIO_PC21 = ECSPI3_MISO = D9 = MISO = pin.ECSPI3_MISO
GPIO_PC22 = D25 = pin.GPIO27
GPIO_PC23 = ECSPI3_SCLK = D11 = SCLK = SCK = pin.ECSPI3_SCLK
GPIO_PC24 = ECSPI3_SS0 = D8 = SS0 = pin.ECSPI3_SS0
GPIO_PC26 = ECSPI3_SS1 = D7 = SS1 = pin.ECSPI3_SS1
GPIO_PC27 = I2C3_SDA = D0 = pin.I2C3_SDA
GPIO_PC28 = I2C3_SCL = D1 = pin.I2C3_SCL
GPIO_PC29 = D5 = pin.GPIO117
GPIO_PC31 = D6 = pin.GPIO118
GPIO_PC32 = LED_D6 = D12 = pin.GPIO115
GPIO_PC33 = LED_D5 = D13 = pin.GPIO116
# Board pwm channel = RPI PWM Channel = pin name
PWM_C7 = PWM1 = pin.GPIO115
PWM_C8 = PWM2 = pin.GPIO116
GPIO_PC35 = D19 = pin.GPIO121
GPIO_PC36 = D16 = pin.GPIO120
GPIO_PC37 = D26 = pin.GPIO26
GPIO_PC38 = D20 = pin.GPIO123
GPIO_PC40 = D21 = pin.GPIO124
# Mini header CN4
GPIO_PD9 = ADC_IN1 = A1 = pin.GPIO1
GPIO_PD4 = LED_D4 = PWM_C3 = pin.GPIO4
GPIO_PD17 = BUTTON2 = pin.GPIO129

View file

@ -0,0 +1,10 @@
"""Pin definitions for the MicroChip MCP2221"""
from adafruit_blinka.microcontroller.mcp2221 import pin
G0 = pin.G0
G1 = pin.G1
G2 = pin.G2
G3 = pin.G3
SCL = pin.SCL
SDA = pin.SDA

View file

@ -0,0 +1 @@
"""Board definitions from NanoPi"""

View file

@ -0,0 +1,49 @@
"""Pin definitions for the NanoPi NEO Air."""
# Enable I2C0, UART1, and SPI by adding the following lines to /boot/armbianEnv.txt
# overlays=usbhost2 usbhost3 spi-spidev uart1 i2c0
# param_spidev_spi_bus=0
from adafruit_blinka.microcontroller.allwinner.h3 import pin
# Left GPIOs
D2 = pin.PA12
D3 = pin.PA11
D4 = pin.PG11
D17 = pin.PA0
D27 = pin.PA2
D22 = pin.PA3
D10 = pin.PC0
D9 = pin.PC1
D11 = pin.PC2
# Right GPIOs
D14 = pin.PG6
D15 = pin.PG7
D18 = pin.PA6
D23 = pin.PG8
D24 = pin.PG9
D25 = pin.PA1
D8 = pin.PC3
# I2C
SDA = D2
SCL = D3
# SPI
SCLK = D11
MOSI = D10
MISO = D9
CE0 = D8
SCK = SCLK
# Serial UART
UART1_TX = D14
UART1_RX = D15
UART2_RX = D8
UART2_TX = D17
UART2_RTS = D27
UART2_CTS = D22
# PWM
PWM1 = D4

View file

@ -0,0 +1 @@
"""Boards definition from NVIDIA"""

View file

@ -0,0 +1,38 @@
"""Pin definitions for Clara AGX Xavier."""
from adafruit_blinka.microcontroller.tegra.t194 import pin
SDA = pin.SDA
SCL = pin.SCL
SDA_1 = pin.SDA_1
SCL_1 = pin.SCL_1
D4 = pin.Q06
D5 = pin.AA03
D6 = pin.AA02
D7 = pin.Z07
D8 = pin.Z06
D9 = pin.Z04
D10 = pin.Z05
D11 = pin.Z03
D12 = pin.BB01
D13 = pin.AA00
D16 = pin.R05
D17 = pin.R04
D18 = pin.H07
D19 = pin.I02
D20 = pin.I01
D21 = pin.I00
D22 = pin.N01
D23 = pin.BB00
D24 = pin.H00
D25 = pin.Q01
D26 = pin.AA01
D27 = pin.P04
CE1 = D7
CE0 = D8
MISO = D9
MOSI = D10
SCLK = D11
SCK = D11

View file

@ -0,0 +1,45 @@
"""Pin definitions for Jetson Nano."""
from adafruit_blinka.microcontroller.tegra.t210 import pin
SDA = pin.SDA_1
SCL = pin.SCL_1
SDA_1 = pin.SDA
SCL_1 = pin.SCL
D4 = pin.BB00
D5 = pin.S05
D6 = pin.Z00
D7 = pin.C04
D8 = pin.C03
D9 = pin.C01
D10 = pin.C00
D11 = pin.C02
D12 = pin.V00
D13 = pin.E06
D16 = pin.G03
D17 = pin.G02
D18 = pin.J07
D19 = pin.J04
D20 = pin.J05
D21 = pin.J06
D22 = pin.Y02
D23 = pin.DD00
D24 = pin.B07
D25 = pin.B05
D26 = pin.B04
D27 = pin.B06
CE1 = D7
CE0 = D8
MISO = D9
MOSI = D10
SCLK = D11
SCK = D11
CE1_1 = D23
CE0_1 = D24
MISO_1 = D25
MOSI_1 = D26
SCLK_1 = D27
SCK_1 = D27

View file

@ -0,0 +1,38 @@
"""Pin definitions for Jetson NX."""
from adafruit_blinka.microcontroller.tegra.t194 import pin
SDA = pin.SDA
SCL = pin.SCL
SDA_1 = pin.SDA_1
SCL_1 = pin.SCL_1
D4 = pin.S04
D5 = pin.Q05
D6 = pin.Q06
D7 = pin.Z07
D8 = pin.Z06
D9 = pin.Z04
D10 = pin.Z05
D11 = pin.Z03
D12 = pin.R00
D13 = pin.N01
D16 = pin.R05
D17 = pin.R04
D18 = pin.T05
D19 = pin.U00
D20 = pin.T07
D21 = pin.T06
D22 = pin.CC04
D23 = pin.Y04
D24 = pin.Y03
D25 = pin.Y01
D26 = pin.Y02
D27 = pin.Y00
CE1 = D7
CE0 = D8
MISO = D9
MOSI = D10
SCLK = D11
SCK = D11

View file

@ -0,0 +1,38 @@
"""Pin definitions for Jetson TX1."""
from adafruit_blinka.microcontroller.tegra.t210 import pin
SDA = pin.SDA
SCL = pin.SCL
SDA_1 = pin.SDA_1
SCL_1 = pin.SCL_1
D4 = pin.BB00
D5 = pin.BB03
D6 = pin.X02
D7 = pin.C04
D8 = pin.C03
D9 = pin.C01
D10 = pin.C00
D11 = pin.C02
D12 = pin.E04
D13 = pin.H07
D16 = pin.U03
D17 = pin.U02
D18 = pin.B03
D19 = pin.B00
D20 = pin.B01
D21 = pin.B02
D22 = pin.P17
D23 = pin.E05
D24 = pin.X00
D25 = pin.P16
D26 = pin.X03
D27 = pin.E06
CE1 = D7
CE0 = D8
MISO = D9
MOSI = D10
SCLK = D11
SCK = D11

View file

@ -0,0 +1,38 @@
"""Pin definitions for Jetson TX2."""
from adafruit_blinka.microcontroller.tegra.t186 import pin
SDA = pin.SDA
SCL = pin.SCL
SDA_1 = pin.SDA_1
SCL_1 = pin.SCL_1
D4 = pin.J04
D5 = pin.J06
D6 = pin.AA02
D7 = None
D8 = pin.N06
D9 = pin.N04
D10 = pin.N05
D11 = pin.N03
D12 = pin.AA01
D13 = pin.I05
D16 = pin.T03
D17 = pin.T02
D18 = pin.J00
D19 = pin.J03
D20 = pin.J02
D21 = pin.J01
D22 = pin.P17
D23 = pin.AA00
D24 = pin.Y01
D25 = pin.P16
D26 = pin.I04
D27 = pin.J05
CE1 = None
CE0 = D8
MISO = D9
MOSI = D10
SCLK = D11
SCK = D11

View file

@ -0,0 +1,38 @@
"""Pin definitions for Jetson XAVIER."""
from adafruit_blinka.microcontroller.tegra.t194 import pin
SDA = pin.SDA
SCL = pin.SCL
SDA_1 = pin.SDA_1
SCL_1 = pin.SCL_1
D4 = pin.Q06
D5 = pin.AA03
D6 = pin.AA02
D7 = pin.Z07
D8 = pin.Z06
D9 = pin.Z04
D10 = pin.Z05
D11 = pin.Z03
D12 = pin.BB01
D13 = pin.AA00
D16 = pin.R05
D17 = pin.R04
D18 = pin.H07
D19 = pin.I02
D20 = pin.I01
D21 = pin.I00
D22 = pin.N01
D23 = pin.BB00
D24 = pin.H00
D25 = pin.Q01
D26 = pin.AA01
D27 = pin.R00
CE1 = D7
CE0 = D8
MISO = D9
MOSI = D10
SCLK = D11
SCK = D11

View file

@ -0,0 +1 @@
"""Boards definition from Onion"""

View file

@ -0,0 +1,34 @@
"""Pin definitions for the Onion Omega2+ Expansion Dock."""
from adafruit_blinka.microcontroller.mips24kec import pin
D0 = pin.GPIO0
D1 = pin.GPIO1
D2 = pin.GPIO2
D3 = pin.GPIO3
D4 = pin.GPIO4
D5 = pin.GPIO5
D6 = pin.GPIO6
D7 = pin.GPIO7
D8 = pin.GPIO8
D9 = pin.GPIO9
D11 = pin.GPIO11
D15 = pin.GPIO15 # RGB LED Blue
D16 = pin.GPIO16 # RGB LED Green
D17 = pin.GPIO17 # RGB LED Red
D18 = pin.GPIO18
D19 = pin.GPIO19
SDA = pin.I2C0_SDA
SCL = pin.I2C0_SCL
SCLK = pin.SPI0_SCLK
MOSI = pin.SPI0_MOSI
MISO = pin.SPI0_MISO
CS = pin.SPI0_CS
SCK = SCLK
UART_TX = pin.UART1_TX
UART_RX = pin.UART1_RX

View file

@ -0,0 +1 @@
"""Boards definition from Xunlong Orange Pi"""

View file

@ -1,6 +1,6 @@
"""Pin definitions for the Orange Pi PC."""
from adafruit_blinka.microcontroller.allwinner_h3 import pin
from adafruit_blinka.microcontroller.allwinner.h3 import pin
PA12 = pin.PA12
SDA = pin.PA12
@ -12,10 +12,12 @@ PA0 = pin.PA0
PA3 = pin.PA3
PC0 = pin.PC0
MOSI = pin.PC0
MOSI1 = pin.SPI1_MOSI
PC1 = pin.PC1
MISO = pin.PC1
PC2 = pin.PC2
SCK = pin.PC2
SCK1 = pin.SPI1_SCLK
SCLK = pin.PC2
PA19 = pin.PA19
PA7 = pin.PA7

View file

@ -0,0 +1,37 @@
"""Pin definitions for the Orange Pi R1."""
from adafruit_blinka.microcontroller.allwinner.h3 import pin
PA12 = pin.PA12
SDA = pin.PA12
PA11 = pin.PA11
SCL = pin.PA11
PA6 = pin.PA6
PWM1 = pin.PA6
PA1 = pin.PA1
UART2_RX = pin.PA1
PA0 = pin.PA0
UART2_TX = pin.PA0
PA3 = pin.PA3
UART2_CTS = pin.PA3
PA19 = pin.PA19
TWI1_SDA = pin.PA19
PA7 = pin.PA7
PA10 = pin.PA10
PA13 = pin.PA13
SPI1_CS = pin.PA13
PA14 = pin.PA14
SPI1_CLK = pin.PA14
PA2 = pin.PA2
UART2_RTS = pin.PA2
PA18 = pin.PA18
TWI1_SCK = pin.PA18
PG6 = pin.PG6
UART1_TX = pin.PG6
PG7 = pin.PG7
UART1_RX = pin.PG7
SCLK = pin.PA14
MOSI = pin.PA15
MISO = pin.PA16

View file

@ -0,0 +1,36 @@
"""Pin definitions for the Orange Pi Zero."""
# The Orange Pi Zero uses the AllWinner H2 SoC, but pins
# are the same as the AllWinner H3 SoC, so we import those
from adafruit_blinka.microcontroller.allwinner.h3 import pin
PA12 = pin.PA12
SDA = pin.PA12
PA11 = pin.PA11
SCL = pin.PA11
PA6 = pin.PA6
PWM1 = pin.PA6
PA1 = pin.PA1
UART2_RX = pin.PA1
PA0 = pin.PA0
UART2_TX = pin.PA0
PA3 = pin.PA3
UART2_CTS = pin.PA3
PA10 = pin.PA10
PA13 = pin.PA13
SPI1_CS = pin.PA13
PA14 = pin.PA14
SPI1_CLK = pin.PA14
PA2 = pin.PA2
UART2_RTS = pin.PA2
PA18 = pin.PA18
TWI1_SCK = pin.PA18
PG6 = pin.PG6
UART1_TX = pin.PG6
PG7 = pin.PG7
UART1_RX = pin.PG7
SCLK = pin.PA14
MOSI = pin.PA15
MISO = pin.PA16

View file

@ -0,0 +1,38 @@
"""Pin definitions for the Orange Pi Zero Plus."""
from adafruit_blinka.microcontroller.allwinner.h5 import pin
PA12 = pin.PA12
SDA = pin.PA12
PA11 = pin.PA11
SCL = pin.PA11
PA6 = pin.PA6
PWM1 = pin.PA6
PA1 = pin.PA1
UART2_RX = pin.PA1
PA0 = pin.PA0
UART2_TX = pin.PA0
PA3 = pin.PA3
UART2_CTS = pin.PA3
PA15 = pin.PA15
PA16 = pin.PA16
PA14 = pin.PA14
SPI1_CLK = pin.PA14
PG6 = pin.PG6
UART1_TX = pin.PG6
PG7 = pin.PG7
UART1_RX = pin.PG7
PA7 = pin.PA7
PA19 = pin.PA19
TWI1_SDA = pin.PA19
PA18 = pin.PA18
TWI1_SCK = pin.PA18
PA2 = pin.PA2
UART2_RTS = pin.PA2
PA13 = pin.PA13
SPI1_CS = pin.PA13
PA10 = pin.PA10
SCLK = pin.PA14
MOSI = pin.PA15
MISO = pin.PA16

View file

@ -0,0 +1,34 @@
"""Pin definitions for the Orange Pi Zero Plus 2 H5."""
from adafruit_blinka.microcontroller.allwinner.h5 import pin
PA12 = pin.PA12
SDA = pin.PA12
PA11 = pin.PA11
SCL = pin.PA11
PA6 = pin.PA6
PWM1 = pin.PA6
PA1 = pin.PA1
UART2_RX = pin.PA1
PA0 = pin.PA0
UART2_TX = pin.PA0
PA3 = pin.PA3
UART2_CTS = pin.PA3
PD14 = pin.PD14
PL0 = pin.PL0
PL1 = pin.PL1
PA13 = pin.PA13
SPI1_CS = pin.PA13
PA14 = pin.PA14
SPI1_CLK = pin.PA14
PA2 = pin.PA2
UART2_RTS = pin.PA2
PA18 = pin.PA18
TWI1_SCK = pin.PA18
PA19 = pin.PA19
TWI1_SDA = pin.PA19
SCLK = pin.PA14
MOSI = pin.PA15
MISO = pin.PA16

View file

@ -0,0 +1,51 @@
"""Pin definitions for the Pine64."""
from adafruit_blinka.microcontroller.allwinner.a64 import pin
D2 = pin.PH3
D3 = pin.PH2
D4 = pin.PL10
D5 = pin.PH5
D6 = pin.PH6
D7 = pin.PH7
D8 = pin.PC3
D9 = pin.PC1
D10 = pin.PC0
D11 = pin.PC2
D12 = pin.PC4
D13 = pin.PC5
D14 = pin.PB0
D15 = pin.PB1
D16 = pin.PC6
D17 = pin.PC7
D18 = pin.PC8
D19 = pin.PC9
D20 = pin.PC10
D21 = pin.PC11
D22 = pin.PC12
D23 = pin.PC13
D24 = pin.PC14
D25 = pin.PC15
D26 = pin.PC16
D27 = pin.PH9
SDA = D2
SCL = D3
SCL2 = pin.PL8
SDA2 = pin.PL9
SCLK = D11
MOSI = D10
MISO = D9
CS = D8
SCK = SCLK
UART_TX = D14
UART_RX = D15
UART3_TX = pin.PD0
UART3_RX = pin.PD1
UART4_TX = pin.PD2
UART4_RX = pin.PD3

View file

@ -0,0 +1,41 @@
"""Pin definitions for the PineH64."""
from adafruit_blinka.microcontroller.allwinner.h6 import pin
D2 = pin.PD26
D3 = pin.PD25
D4 = pin.PL8
D5 = pin.PH2
D6 = pin.PG14
D7 = pin.PC16
D8 = pin.PH3
D9 = pin.PH6
D10 = pin.PH5
D11 = pin.PH4
D12 = pin.PD22
D13 = pin.PD21
D14 = pin.PD19
D15 = pin.PD20
D16 = pin.PD24
D17 = pin.PL9
D18 = pin.PG11
D19 = pin.PG10
D21 = pin.PG12
D22 = pin.PG13
D23 = pin.PD16
D24 = pin.PD17
D25 = pin.PD18
D26 = pin.PD23
D27 = pin.PD14
SDA = D2
SCL = D3
SCLK = D11
MOSI = D10
MISO = D9
CS = D8
SCK = SCLK
UART_TX = D14
UART_RX = D15

View file

@ -1,6 +1,6 @@
"""PyBoard pin names"""
from adafruit_blinka.microcontroller.stm32 import pin
from adafruit_blinka.microcontroller.stm32.stm32f405 import pin
X1 = pin.A0
X2 = pin.A1

View file

@ -0,0 +1 @@
"""Rock Pi Boards definition from Radxa"""

View file

@ -0,0 +1,55 @@
"""Pin definitions for the Rock Pi S."""
from adafruit_blinka.microcontroller.rockchip.rk3308 import pin
D2 = pin.GPIO0_B3
D3 = pin.GPIO0_B4
D4 = pin.GPIO2_A4
D8 = pin.GPIO1_D1
D9 = pin.GPIO1_C6
D10 = pin.GPIO1_C7
D11 = pin.GPIO1_D0
D14 = pin.GPIO2_A1
D15 = pin.GPIO2_A0
D17 = pin.GPIO0_B7
D18 = pin.GPIO2_A5
D22 = pin.GPIO0_C1
D23 = pin.GPIO2_B2
D24 = pin.GPIO2_B1
D25 = pin.GPIO2_A7
D27 = pin.GPIO0_C0
SDA0 = pin.I2C0_SDA
SCL0 = pin.I2C0_SCL
SDA1 = pin.I2C1_SDA
SCL1 = pin.I2C1_SCL
SCL2 = pin.I2C2_SCL
SDA2 = pin.I2C2_SDA
SCL3 = pin.I2C3_SCL
SDA3 = pin.I2C3_SDA
SDA = SDA1
SCL = SCL1
SCLK = pin.SPI2_SCLK
MOSI = pin.SPI2_MOSI
MISO = pin.SPI2_MISO
CS = pin.SPI2_CS
SCK = SCLK
UART_TX = pin.UART0_TX
UART_RX = pin.UART0_RX
UART1_TX = pin.UART1_TX
UART1_RX = pin.UART1_RX
UART2_TX = pin.UART2_TX
UART2_RX = pin.UART2_RX
PWM2 = pin.PWM2
PWM3 = pin.PWM3
ADC_IN0 = pin.ADC_IN0

View file

@ -0,0 +1 @@
"""Boards definition from Raspberry Pi"""

View file

@ -24,6 +24,9 @@ D14 = pin.D14
TXD = pin.D14
D15 = pin.D15
RXD = pin.D15
# create alias for most of the examples
TX = pin.D14
RX = pin.D15
D17 = pin.D17
D18 = pin.D18

View file

@ -24,6 +24,9 @@ D14 = pin.D14
TXD = pin.D14
D15 = pin.D15
RXD = pin.D15
# create alias for most of the examples
TX = pin.D14
RX = pin.D15
D17 = pin.D17
D18 = pin.D18

View file

@ -2,6 +2,9 @@
from adafruit_blinka.microcontroller.bcm283x import pin
D0 = pin.D0
D1 = pin.D1
D2 = pin.D2
SDA = pin.SDA
D3 = pin.D3
@ -30,6 +33,9 @@ D14 = pin.D14
TXD = pin.D14
D15 = pin.D15
RXD = pin.D15
# create alias for most of the examples
TX = pin.D14
RX = pin.D15
D16 = pin.D16
D17 = pin.D17

View file

@ -0,0 +1,74 @@
"""Pin definitions for Raspberry Pi Compute Modules."""
from adafruit_blinka.microcontroller.bcm283x import pin
D2 = pin.D2
SDA = pin.SDA
D3 = pin.D3
SCL = pin.SCL
D4 = pin.D4
D5 = pin.D5
D6 = pin.D6
D7 = pin.D7
CE1 = pin.D7
D8 = pin.D8
CE0 = pin.D8
D9 = pin.D9
MISO = pin.D9
D10 = pin.D10
MOSI = pin.D10
D11 = pin.D11
SCLK = pin.D11
SCK = pin.D11
D12 = pin.D12
D13 = pin.D13
D14 = pin.D14
TXD = pin.D14
D15 = pin.D15
RXD = pin.D15
# create alias for most of the examples
TX = pin.D14
RX = pin.D15
D16 = pin.D16
D17 = pin.D17
D18 = pin.D18
D19 = pin.D19
MISO_1 = pin.D19
D20 = pin.D20
MOSI_1 = pin.D20
D21 = pin.D21
SCLK_1 = pin.D21
SCK_1 = pin.D21
D22 = pin.D22
D23 = pin.D23
D24 = pin.D24
D25 = pin.D25
D26 = pin.D26
D27 = pin.D27
D28 = pin.D28
D29 = pin.D29
D30 = pin.D30
D31 = pin.D31
D32 = pin.D32
D33 = pin.D33
D34 = pin.D34
D35 = pin.D35
D36 = pin.D36
D37 = pin.D37
D38 = pin.D38
D39 = pin.D39
D40 = pin.D40
MISO_2 = pin.D40
D41 = pin.D41
MOSI_2 = pin.D41
D42 = pin.D42
SCLK_2 = pin.D42
SCK_2 = pin.D43
D43 = pin.D43
D44 = pin.D44
D45 = pin.D45

View file

@ -0,0 +1,51 @@
"""Pin definitions for the SoPine."""
from adafruit_blinka.microcontroller.allwinner.a64 import pin
D2 = pin.PH3
D3 = pin.PH2
D4 = pin.PL10
D5 = pin.PH5
D6 = pin.PH6
D7 = pin.PH7
D8 = pin.PC3
D9 = pin.PC1
D10 = pin.PC0
D11 = pin.PC2
D12 = pin.PC4
D13 = pin.PC5
D14 = pin.PB0
D15 = pin.PB1
D16 = pin.PC6
D17 = pin.PC7
D18 = pin.PC8
D19 = pin.PC9
D20 = pin.PC10
D21 = pin.PC11
D22 = pin.PC12
D23 = pin.PC13
D24 = pin.PC14
D25 = pin.PC15
D26 = pin.PC16
D27 = pin.PH9
SDA = D2
SCL = D3
SCL2 = pin.PL8
SDA2 = pin.PL9
SCLK = D11
MOSI = D10
MISO = D9
CS = D8
SCK = SCLK
UART_TX = D14
UART_RX = D15
UART3_TX = pin.PD0
UART3_RX = pin.PD1
UART4_TX = pin.PD2
UART4_RX = pin.PD3

View file

@ -0,0 +1 @@
"""Boards definition from STM32"""

View file

@ -0,0 +1,49 @@
"""Pin definitions for the STM32MP157C Development Kit 2."""
from adafruit_blinka.microcontroller.stm32.stm32mp157 import pin
D2 = pin.PA12
D3 = pin.PA11
D4 = pin.PA8
D5 = pin.PG2
D6 = pin.PH11
D7 = pin.PF3
D8 = pin.PF6
D9 = pin.PF8
D10 = pin.PF9
D11 = pin.PF7
D12 = pin.PD13
D13 = pin.PC7
D14 = pin.PB10
D15 = pin.PB12
D16 = pin.PB13
D17 = pin.PG8
D18 = pin.PI5
D19 = pin.PI7
D20 = pin.PI6
D21 = pin.PF11
D22 = pin.PG15
D23 = pin.PF1
D24 = pin.PF0
D25 = pin.PF4
D26 = pin.PF5
D27 = pin.PD7
SDA = D2
SCL = D3
SDA1 = pin.PF15
SCL1 = pin.PD12
SCLK = D11
MOSI = D10
MISO = D9
CE0 = D8
CE1 = D7
CS = CE0
SCK = SCLK
UART_TX = D14
UART_RX = D15

View file

@ -1,6 +1,6 @@
"""Pin definitions for the Tritium H3."""
from adafruit_blinka.microcontroller.allwinner_h3 import pin
from adafruit_blinka.microcontroller.allwinner.h3 import pin
PA12 = pin.PA12
SDA = pin.PA12

View file

@ -0,0 +1,70 @@
"""Pin definitions for Udoo x86 Ultra
(should work for Ultra and Ultra II)
There are 2 naming systems. A Digital Pin system which includes
the arduino chip (Leonardo or 101). The Braswell #s start at 16 and
is documented in the diagram and text for linux version later than 4.15 in:
https://www.udoo.org/docs-x86II/Introduction/Introduction.html
The other is based on the hardware manual:
https://udoo.org/download/files/UDOO_X86/Doc/UDOO_X86II_MANUAL.pdf
This will use the D system based on the diagram in the user guide
i2c use i2c(board.I2C0_SCL, board_I2C0_SDA) or i2c(board.I2C1_SCL, board_I2C1_SDA)
for the i2c(board.SCL, board.SCL) in the examples
UART use pyserial not busio
"""
from adafruit_blinka.microcontroller.pentium.n3710 import pin
# Connector CN15
D16 = pin.UART1_RTS
D17 = pin.UART1_CTS
D18 = pin.UART1_TXD
D19 = pin.UART1_RXD
D20 = pin.UART2_RTS
D21 = pin.UART2_CTS
D22 = pin.UART2_TXD
D23 = pin.UART2_RXD
# Connector CN13 LPC interface
D24 = pin.GPIO_275
D25 = pin.GPIO_280
D26 = pin.GPIO_273
D27 = pin.GPIO_278
D28 = pin.GPIO_276
D29 = pin.GPIO_279
D30 = pin.GPIO_307
# Connector CN14
D34 = pin.I2C0_SCL
D35 = pin.I2C0_SDA
D36 = pin.GPIO_492
D37 = pin.GPIO_490
D38 = pin.I2C1_SCL
D39 = pin.I2C1_SDA
# Connector CN12 SDIO SD/MMC interfaces
D40 = pin.GPIO_358
D41 = pin.GPIO_243
D42 = pin.GPIO_249
D43 = pin.GPIO_246
D44 = pin.GPIO_253
D45 = pin.GPIO_250
D46 = pin.GPIO_247
# aliases
UART1_RX = D19
UART1_TX = D18
UART2_RX = D23
UART2_TX = D22
I2C0_SCL = D34 # labeled on diagram as I2C1, hardware manual port 0
I2C0_SDA = D35 # i2cdetect-l lists it as i2c-0
I2C1_SCL = D38 # Labeled on diagram as I2C2, hardware manual port 5
I2C1_SCL = D39 # i2cdetect lists it as i2c-1

View file

@ -0,0 +1 @@
"""Definition of all Allwinner chips"""

View file

@ -0,0 +1 @@
"""Definition for the AllWinner A33 chip"""

View file

@ -0,0 +1,47 @@
"""Allwinner A33 pin names"""
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
PB0 = Pin(32) # PB0/UART2_TX/UART0_TX/PB_EINT0
UART2_TX = PB0
PB1 = Pin(33) # PB1/UART2_RX/UART0_RX/PB_EINT1
UART2_RX = PB1
PC0 = Pin(64) # PC0/ND_WE/SPI0_MOSI
PC1 = Pin(65) # PC1/ND_ALE/SPI0_MISO
PC2 = Pin(66) # PC2/ND_CLE/SPI0_CLK
PH4 = Pin(228) # PH4/TWI1_SCK
TWI1_SCL = PH4
PH5 = Pin(229) # PH5/TWI1_SDA
TWI1_SDA = PH5
PH6 = Pin(230) # PH6/SPI0_CS/UART3_TX
UART3_TX = PH6
SPI0_CS = PH6
PH7 = Pin(231) # PH7/SPI0_CLK/UART3_RX
UART3_RX = PH7
SPI0_SCLK = PH7
PH8 = Pin(232) # PH8/SPI0_MOSI/UART3_RTS
UART3_RTS = PH8
SPI0_MOSI = PH8
PH9 = Pin(233) # PH9/SPI0_MISO/UART3_CTS
UART3_CTS = PH9
SPI0_MISO = PH9
# ordered as i2cId, sclId, sdaId
i2cPorts = ((0, TWI1_SCL, TWI1_SDA),)
# ordered as spiId, sckId, mosiId, misoId
spiPorts = ((0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO),)
# ordered as uartId, txId, rxId
uartPorts = (
(2, UART2_TX, UART2_RX),
(3, UART3_TX, UART3_RX),
)

View file

@ -0,0 +1 @@
"""Definition for the AllWinner A64 chip"""

View file

@ -0,0 +1,88 @@
"""Allwinner A64 pin names"""
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
PB0 = Pin((1, 32))
UART2_TX = PB0
PB1 = Pin((1, 33))
UART2_RX = PB1
PB2 = Pin((1, 34))
PB3 = Pin((1, 35))
PB4 = Pin((1, 36))
PB5 = Pin((1, 37))
PB6 = Pin((1, 38))
PB7 = Pin((1, 39))
PC0 = Pin((1, 64))
SPI0_MOSI = PC0
PC1 = Pin((1, 65))
SPI0_MISO = PC1
PC2 = Pin((1, 66))
SPI0_SCLK = PC2
PC3 = Pin((1, 67))
SPI0_CS = PC3
PC4 = Pin((1, 68))
PC5 = Pin((1, 69))
PC6 = Pin((1, 70))
PC7 = Pin((1, 71))
PC8 = Pin((1, 72))
PC9 = Pin((1, 73))
PC10 = Pin((1, 74))
PC11 = Pin((1, 75))
PC12 = Pin((1, 76))
PC13 = Pin((1, 77))
PC14 = Pin((1, 78))
PC15 = Pin((1, 79))
PC16 = Pin((1, 80))
PD0 = Pin((1, 96))
UART3_TX = PD0
SPI1_CS = PD0
PD1 = Pin((1, 97))
SPI1_SCLK = PD1
UART3_RX = PD1
PD2 = Pin((1, 98))
UART4_TX = PD2
SPI1_MOSI = PD2
PD3 = Pin((1, 99))
UART4_RX = PD3
SPI1_MISO = PD3
PD4 = Pin((1, 100))
PD5 = Pin((1, 101))
PD6 = Pin((1, 102))
PE14 = Pin((1, 142))
TWI2_SCL = PE14
PE15 = Pin((1, 143))
TWI2_SDA = PE15
PH2 = Pin((1, 226))
TWI1_SCL = PH2
PH3 = Pin((1, 227))
TWI1_SDA = PH3
PH4 = Pin((1, 228))
PH5 = Pin((1, 229))
PH6 = Pin((1, 230))
PH7 = Pin((1, 231))
PH8 = Pin((1, 232))
PH9 = Pin((1, 233))
PL2 = Pin((0, 2))
PL3 = Pin((0, 3))
PL8 = Pin((0, 8))
PL9 = Pin((0, 9))
PL10 = Pin((0, 10))
# ordered as i2cId, sclId, sdaId
i2cPorts = ((1, TWI1_SCL, TWI1_SDA), (2, TWI2_SCL, TWI2_SDA))
# ordered as spiId, sckId, mosiId, misoId
spiPorts = (
(0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO),
(1, SPI1_SCLK, SPI1_MOSI, SPI1_MISO),
)
# ordered as uartId, txId, rxId
uartPorts = (
(2, UART2_TX, UART2_RX),
(3, UART3_TX, UART3_RX),
(4, UART4_TX, UART4_RX),
)

View file

@ -0,0 +1 @@
"""Definition for the AllWinner H3 chip"""

View file

@ -1,3 +1,4 @@
"""Allwinner H3 pin names"""
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
PA0 = Pin(0)
@ -19,8 +20,11 @@ PA13 = Pin(13)
UART3_TX = PA13
PA14 = Pin(14)
UART3_RX = PA14
SPI1_SCLK = PA14
PA15 = Pin(15)
SPI1_MOSI = PA15
PA16 = Pin(16)
SPI1_MISO = PA16
PA17 = Pin(17)
PA18 = Pin(18)
PA19 = Pin(19)
@ -51,9 +55,14 @@ PG11 = Pin(203)
PG12 = Pin(204)
PG13 = Pin(205)
PL2 = Pin((1, 2))
PL4 = Pin((1, 4))
i2cPorts = ( (0, TWI0_SCL, TWI0_SDA), )
i2cPorts = ((0, TWI0_SCL, TWI0_SDA),)
# ordered as spiId, sckId, mosiId, misoId
spiPorts = ( (0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO), )
spiPorts = (
(0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO),
(1, SPI1_SCLK, SPI1_MOSI, SPI1_MISO),
)
# ordered as uartId, txId, rxId
uartPorts = ( (3, UART3_TX, UART3_RX), )
uartPorts = ((3, UART3_TX, UART3_RX),)

View file

@ -0,0 +1 @@
"""Definition for the AllWinner H5 chip"""

View file

@ -0,0 +1,68 @@
"""Allwinner H5 pin names"""
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
PA0 = Pin((1, 0))
UART2_TX = PA0
PA1 = Pin((1, 1))
UART2_RX = PA1
PA2 = Pin((1, 2))
PA3 = Pin((1, 3))
PA6 = Pin((1, 6))
PA7 = Pin((1, 7))
PA8 = Pin((1, 8))
PA9 = Pin((1, 9))
PA10 = Pin((1, 10))
PA11 = Pin((1, 11))
TWI0_SCL = PA11
PA12 = Pin((1, 12))
TWI0_SDA = PA12
PA13 = Pin((1, 13))
UART3_TX = PA13
PA14 = Pin((1, 14))
UART3_RX = PA14
SPI1_SCLK = PA14
PA15 = Pin((1, 15))
SPI1_MOSI = PA15
PA16 = Pin((1, 16))
SPI1_MISO = PA16
PA17 = Pin((1, 17))
PA18 = Pin((1, 18))
PA19 = Pin((1, 19))
PA20 = Pin((1, 20))
PA21 = Pin((1, 21))
PC0 = Pin((1, 64))
SPI0_MOSI = PC0
PC1 = Pin((1, 65))
SPI0_MISO = PC1
PC2 = Pin((1, 66))
SPI0_SCLK = PC2
PC3 = Pin((1, 67))
SPI0_CS = PC3
PC4 = Pin((1, 68))
PC7 = Pin((1, 71))
PD14 = Pin((1, 110))
PG6 = Pin((1, 198))
UART1_TX = PG6
PG7 = Pin((1, 199))
UART1_RX = PG7
PG8 = Pin((1, 200))
PG9 = Pin((1, 201))
PG10 = Pin((1, 202))
PG11 = Pin((1, 203))
PG12 = Pin((1, 204))
PG13 = Pin((1, 205))
PL0 = Pin((0, 0))
PL1 = Pin((0, 1))
i2cPorts = ((0, TWI0_SCL, TWI0_SDA),)
# ordered as spiId, sckId, mosiId, misoId
spiPorts = (
(0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO),
(1, SPI1_SCLK, SPI1_MOSI, SPI1_MISO),
)
# ordered as uartId, txId, rxId
uartPorts = ((3, UART3_TX, UART3_RX),)

View file

@ -0,0 +1 @@
"""Definition for the AllWinner H6 chip"""

View file

@ -0,0 +1,47 @@
"""Allwinner H6 Pin Names"""
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
PC16 = Pin((1, 79))
PD14 = Pin((1, 110))
PD15 = Pin((1, 111))
PD16 = Pin((1, 112))
PD17 = Pin((1, 113))
PD18 = Pin((1, 114))
PD19 = Pin((1, 115))
UART2_TX = PD19
PD20 = Pin((1, 116))
UART2_RX = PD20
PD21 = Pin((1, 117))
PD22 = Pin((1, 118))
PD23 = Pin((1, 119))
PD24 = Pin((1, 120))
PD25 = Pin((1, 121))
TWI0_SCL = PD25
PD26 = Pin((1, 122))
TWI0_SDA = PD26
PG10 = Pin((1, 202))
PG11 = Pin((1, 203))
PG12 = Pin((1, 204))
PG13 = Pin((1, 205))
PG14 = Pin((1, 206))
PH2 = Pin((1, 226))
PH3 = Pin((1, 227))
SPI1_CS = PH3
PH4 = Pin((1, 228))
SPI1_SCLK = PH4
PH5 = Pin((1, 229))
SPI1_MOSI = PH5
PH6 = Pin((1, 230))
SPI1_MISO = PH6
PH8 = Pin((1, 230))
PH9 = Pin((1, 231))
PL8 = Pin((1, 360))
PL9 = Pin((1, 361))
i2cPorts = ((0, TWI0_SCL, TWI0_SDA),)
spiPorts = ((0, SPI1_SCLK, SPI1_MOSI, SPI1_MISO),)
uartPorts = ((2, UART2_TX, UART2_RX),)

View file

@ -1,7 +1,10 @@
"""AM335x pin names"""
import Adafruit_BBIO.GPIO as GPIO
# Pins dont exist in CPython so...lets make our own!
class Pin:
"""Pins dont exist in CPython so...lets make our own!"""
IN = 0
OUT = 1
LOW = 0
@ -9,11 +12,11 @@ class Pin:
PULL_NONE = 0
PULL_UP = 1
PULL_DOWN = 2
id = None
_value = LOW
_mode = IN
def __init__(self, pin_name):
self.id = pin_name
@ -24,7 +27,8 @@ class Pin:
return self.id == other
def init(self, mode=IN, pull=None):
if mode != None:
"""Initialize the Pin"""
if mode is not None:
if mode == self.IN:
self._mode = self.IN
GPIO.setup(self.id, GPIO.IN)
@ -33,7 +37,7 @@ class Pin:
GPIO.setup(self.id, GPIO.OUT)
else:
raise RuntimeError("Invalid mode for pin: %s" % self.id)
if pull != None:
if pull is not None:
if self._mode != self.IN:
raise RuntimeError("Cannot set pull resistor on output")
if pull == self.PULL_UP:
@ -41,10 +45,11 @@ class Pin:
elif pull == self.PULL_DOWN:
GPIO.setup(self.id, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
else:
raise RuntimeError("Invalid pull for pin: %s" % self.id)
raise RuntimeError("Invalid pull for pin: %s" % self.id)
def value(self, val=None):
if val != None:
"""Set or return the Pin Value"""
if val is not None:
if val == self.LOW:
self._value = val
GPIO.output(self.id, val)
@ -53,146 +58,300 @@ class Pin:
GPIO.output(self.id, val)
else:
raise RuntimeError("Invalid value for pin")
else:
return GPIO.input(self.id)
return None
return GPIO.input(self.id)
P8_3 = Pin('P8_3')
P8_4 = Pin('P8_4')
P8_5 = Pin('P8_5')
P8_6 = Pin('P8_6')
P8_7 = Pin('P8_7')
P8_8 = Pin('P8_8')
P8_9 = Pin('P8_9')
P8_10 = Pin('P8_10')
P8_11 = Pin('P8_11')
P8_12 = Pin('P8_12')
P8_13 = Pin('P8_13')
P8_14 = Pin('P8_14')
P8_15 = Pin('P8_15')
P8_16 = Pin('P8_16')
P8_17 = Pin('P8_17')
P8_18 = Pin('P8_18')
P8_19 = Pin('P8_19')
P8_20 = Pin('P8_20')
P8_21 = Pin('P8_21')
P8_22 = Pin('P8_22')
P8_23 = Pin('P8_23')
P8_24 = Pin('P8_24')
P8_25 = Pin('P8_25')
P8_26 = Pin('P8_26')
P8_27 = Pin('P8_27')
P8_28 = Pin('P8_28')
P8_29 = Pin('P8_29')
P8_30 = Pin('P8_30')
P8_31 = Pin('P8_31')
P8_32 = Pin('P8_32')
P8_33 = Pin('P8_33')
P8_34 = Pin('P8_34')
P8_35 = Pin('P8_35')
P8_36 = Pin('P8_36')
P8_37 = Pin('P8_37')
P8_38 = Pin('P8_38')
P8_39 = Pin('P8_39')
P8_40 = Pin('P8_40')
P8_41 = Pin('P8_41')
P8_42 = Pin('P8_42')
P8_43 = Pin('P8_43')
P8_44 = Pin('P8_44')
P8_45 = Pin('P8_45')
P8_46 = Pin('P8_46')
P9_11 = Pin('P9_11')
P9_12 = Pin('P9_12')
P9_13 = Pin('P9_13')
P9_14 = Pin('P9_14')
P9_15 = Pin('P9_15')
P9_16 = Pin('P9_16')
P9_17 = Pin('P9_17')
P9_18 = Pin('P9_18')
P9_19 = Pin('P9_19')
P9_20 = Pin('P9_20')
P9_21 = Pin('P9_21')
P9_22 = Pin('P9_22')
P9_23 = Pin('P9_23')
P9_24 = Pin('P9_24')
P9_25 = Pin('P9_25')
P9_26 = Pin('P9_26')
P9_27 = Pin('P9_27')
P9_28 = Pin('P9_28')
P9_29 = Pin('P9_29')
P9_30 = Pin('P9_30')
P9_31 = Pin('P9_31')
P9_41 = Pin('P9_41')
P9_42 = Pin('P9_42')
USR0 = Pin('USR0')
USR1 = Pin('USR1')
USR2 = Pin('USR2')
USR3 = Pin('USR3')
# names in comments copied from
# https://github.com/adafruit/adafruit-beaglebone-io-python/blob/master/source/common.c#L73
SCL = Pin('P9_19')
SDA = Pin('P9_20')
# PocketBeagle
# P1_1 = SYS VIN # VIN_AC
P1_2 = Pin("P1_2") # GPIO2_23 - GPIO_87
P1_3 = Pin("P1_3") # USB1_VBUS_OUT - (silkscreen: USB1 V_EN)
P1_4 = Pin("P1_4") # GPIO2_25 - GPIO_89
# P1_5 = USB VBUS # USB1_VBUS_IN
P1_6 = Pin("P1_6") # SPI0_CS0 - GPIO_5
# P1_7 = USB VIN # VIN-USB
P1_8 = Pin("P1_8") # SPI0_SCLK - GPIO_2
# P1_9 = USB1 DN # USB1-DN
P1_10 = Pin("P1_10") # SPI0_D0 - GPIO_3
# P1_11 = USB1 DP # USB1-DP
P1_12 = Pin("P1_12") # SPI0_D1 - GPIO_4
# P1_13 = USB1 ID # USB1-ID
# P1_14 = SYS 3.3V # VOUT-3.3V
# P1_15 = SYS GND # GND
# P1_16 = SYS GND # GND
# P1_17 = AIN 1.8V REF- # VREFN
# P1_18 = AIN 1.8V REF+ # VREFP
P1_19 = Pin("P1_19") # AIN0
P1_20 = Pin("P1_20") # GPIO0_20 - GPIO_20
P1_21 = Pin("P1_21") # AIN1
# P1_22 = SYS GND # GND
P1_23 = Pin("P1_23") # AIN2
# P1_22 = SYS VOUT # VOUT-5V
P1_25 = Pin("P1_25") # AIN3
P1_26 = Pin("P1_26") # I2C2_SDA - GPIO_12
P1_27 = Pin("P1_27") # AIN4
P1_28 = Pin("P1_28") # I2C2_SCL - GPIO_13
P1_29 = Pin("P1_29") # GPIO3_21 - GPIO_117
P1_30 = Pin("P1_30") # UART0_TXD - GPIO_43
P1_31 = Pin("P1_31") # GPIO3_18 - GPIO_114
P1_32 = Pin("P1_32") # UART0_RXD - GPIO_42
P1_33 = Pin("P1_33") # GPIO3_15 - GPIO_111
P1_34 = Pin("P1_34") # GPIO0_26 - GPIO_26
P1_35 = Pin("P1_35") # GPIO2_24 - GPIO_88
P1_36 = Pin("P1_36") # EHRPWM0A - GPIO_110
# Refer to header default pin modes
# http://beagleboard.org/static/images/cape-headers.png
#
# P9_17 (SPI0_CSO => CE0) enables peripheral device
# P9_18 (SPI0_D1 => MOSI) outputs data to peripheral device
# P9_21 (SPIO_DO => MISO) receives data from peripheral device
# P9_22 (SPI0_SCLK => SCLK) outputs clock signal
#
# Use config-pin to set pin mode for SPI pins
# https://github.com/beagleboard/bb.org-overlays/tree/master/tools/beaglebone-universal-io
# config-pin p9.17 spi_cs
# config-pin p9.18 spi
# config-pin p9.21 spi
# config-pin p9.22 spi_sclk
#
CE0 = Pin('P9_17')
MOSI = Pin('P9_18')
MISO = Pin('P9_21')
SCLK = Pin('P9_22')
#CircuitPython naming convention for SPI Clock
SCK = Pin('P9_22')
# Pins for SPI1
# refer to:
# http://beagleboard.org/static/images/cape-headers-spi.png
#
# CE1 P9.28 SPI1_CS0
# MISO_1 P9.29 SPI1_D0
# MOSI_1 P9.30 SPI1_D1
# SCLK_1 P9.31 SPI_SCLK
#
# SPI1 conflicts with HDMI Audio (McASP)
#
# Refer to:
# https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
#
# To Disable HDMI AUDIO, uncomment this line in /boot/uEnv.txt:
# disable_uboot_overlay_audio=1
#
# Set pin modes for SPI1 with:
#
# config-pin p9.28 spi1_cs
# config-pin p9.29 spi1
# config-pin p9.30 spi1
# config-pin p9.31 spi_sclk
CE1 = Pin('P9_28')
MOSI_1 = Pin('P9_29')
MISO_1 = Pin('P9_30')
SCLK_1 = Pin('P9_31')
#CircuitPython naming convention for SPI Clock
SCK_1 = Pin('P9_31')
P2_1 = Pin("P2_1") # EHRPWM1A - GPIO_50
P2_2 = Pin("P2_2") # GPIO1_27 - GPIO_59
P2_3 = Pin("P2_3") # GPIO0_23 - GPIO_23
P2_4 = Pin("P2_4") # GPIO1_26 - GPIO_58
P2_5 = Pin("P2_5") # UART4_RXD - GPIO_30
P2_6 = Pin("P2_6") # GPIO1_25 - GPIO_57
P2_7 = Pin("P2_7") # UART4_TXD - GPIO_31
P2_8 = Pin("P2_8") # GPIO1_28 - GPIO_60
P2_9 = Pin("P2_9") # I2C1_SCL - GPIO_15
P2_10 = Pin("P2_10") # GPIO1_20 - GPIO_52
P2_11 = Pin("P2_11") # I2C1_SDA - GPIO_14
# P2_12 = SYS PWR BTN # POWER_BUTTON
# P2_13 = SYS VOUT # VOUT-5V
# P2_14 = BAT VIN # BAT-VIN
# P2_15 = SYS GND # GND
# P2_16 = BAT TEMP # BAT-TEMP
P2_17 = Pin("P2_17") # GPIO2_1 - GPIO_65
P2_18 = Pin("P2_18") # GPIO1_15 - GPIO_47
P2_19 = Pin("P2_19") # GPIO0_27 - GPIO_27
P2_20 = Pin("P2_20") # GPIO2_0 - GPIO_64
# P2_21 = SYS GND # GND
P2_22 = Pin("P2_22") # GPIO1_14 - GPIO_46
# P2_23 = SYS 3.3V # VOUT-3.3V
P2_24 = Pin("P2_24") # GPIO1_12 - GPIO_44
P2_25 = Pin("P2_25") # SPI1_D1 - GPIO_41
# P2_26 = SYS NRST # RESET#
P2_27 = Pin("P2_27") # SPI1_D0 - GPIO_40
P2_28 = Pin("P2_28") # GPIO3_20 - GPIO_116
P2_29 = Pin("P2_29") # SPI1_SCLK - GPIO_7
P2_30 = Pin("P2_30") # GPIO3_17 - GPIO_113
P2_31 = Pin("P2_31") # SPI1_CS1 - GPIO_19
P2_32 = Pin("P2_32") # GPIO3_16 - GPIO_112
P2_33 = Pin("P2_33") # GPIO1_13 - GPIO_45
P2_34 = Pin("P2_34") # GPIO3_19 - GPIO_115
P2_35 = Pin("P2_35") # GPIO2_22 - GPIO_86
P2_36 = Pin("P2_36") # AIN7
# BeagleBone Black
# P8_1 = DGND # DGND - GPIO_0
# P8_2 = DGND # DGND - GPIO_0
P8_3 = Pin("P8_3") # GPIO1_6 - GPIO_38
P8_4 = Pin("P8_4") # GPIO1_7 - GPIO_39
P8_5 = Pin("P8_5") # GPIO1_2 - GPIO_34
P8_6 = Pin("P8_6") # GPIO1_3 - GPIO_35
P8_7 = Pin("P8_7") # TIMER4 - GPIO_66
P8_8 = Pin("P8_8") # TIMER7 - GPIO_67
P8_9 = Pin("P8_9") # TIMER5 - GPIO_69
P8_10 = Pin("P8_10") # TIMER6 - GPIO_68
P8_11 = Pin("P8_11") # GPIO1_13 - GPIO_45
P8_12 = Pin("P8_12") # GPIO1_12 - GPIO_44
P8_13 = Pin("P8_13") # EHRPWM2B - GPIO_23
P8_14 = Pin("P8_14") # GPIO0_26 - GPIO_26
P8_15 = Pin("P8_15") # GPIO1_15 - GPIO_47
P8_16 = Pin("P8_16") # GPIO1_14 - GPIO_46
P8_17 = Pin("P8_17") # GPIO0_27 - GPIO_27
P8_18 = Pin("P8_18") # GPIO2_1 - GPIO_65
P8_19 = Pin("P8_19") # EHRPWM2A - GPIO_22
P8_20 = Pin("P8_20") # GPIO1_31 - GPIO_63
P8_21 = Pin("P8_21") # GPIO1_30 - GPIO_62
P8_22 = Pin("P8_22") # GPIO1_5 - GPIO_37
P8_23 = Pin("P8_23") # GPIO1_4 - GPIO_36
P8_24 = Pin("P8_24") # GPIO1_1 - GPIO_33
P8_25 = Pin("P8_25") # GPIO1_0 - GPIO_32
P8_26 = Pin("P8_26") # GPIO1_29 - GPIO_61
P8_27 = Pin("P8_27") # GPIO2_22 - GPIO_86
P8_28 = Pin("P8_28") # GPIO2_24 - GPIO_88
P8_29 = Pin("P8_29") # GPIO2_23 - GPIO_87
P8_30 = Pin("P8_30") # GPIO2_25 - GPIO_89
P8_31 = Pin("P8_31") # UART5_CTSN - GPIO_10
P8_32 = Pin("P8_32") # UART5_RTSN - GPIO_11
P8_33 = Pin("P8_33") # UART4_RTSN - GPIO_9
P8_34 = Pin("P8_34") # UART3_RTSN - GPIO_81
P8_35 = Pin("P8_35") # UART4_CTSN - GPIO_8
P8_36 = Pin("P8_36") # UART3_CTSN - GPIO_80
P8_37 = Pin("P8_37") # UART5_TXD - GPIO_78
P8_38 = Pin("P8_38") # UART5_RXD - GPIO_79
P8_39 = Pin("P8_39") # GPIO2_12 - GPIO_76
P8_40 = Pin("P8_40") # GPIO2_13 - GPIO_77
P8_41 = Pin("P8_41") # GPIO2_10 - GPIO_74
P8_42 = Pin("P8_42") # GPIO2_11 - GPIO_75
P8_43 = Pin("P8_43") # GPIO2_8 - GPIO_72
P8_44 = Pin("P8_44") # GPIO2_9 - GPIO_73
P8_45 = Pin("P8_45") # GPIO2_6 - GPIO_70
P8_46 = Pin("P8_46") # GPIO2_7 - GPIO_71
# P9_1 = DGND # DGND - GPIO_0
# P9_2 = DGND # DGND - GPIO_0
# P9_3 = VDD_3V3 # VDD_3V3 - GPIO_0
# P9_4 = VDD_3V3 # VDD_3V3 - GPIO_0
# P9_5 = VDD_5V # VDD_5V - GPIO_0
# P9_6 = VDD_5V # VDD_5V - GPIO_0
# P9_7 = SYS_5V # SYS_5V - GPIO_0
# P9_8 = SYS_5V # SYS_5V - GPIO_0
# P9_9 = PWR_BUT # PWR_BUT - GPIO_0
# P9_10 = SYS_RESETN # SYS_RESETn - GPIO_0
P9_11 = Pin("P9_11") # UART4_RXD - GPIO_30
P9_12 = Pin("P9_12") # GPIO1_28 - GPIO_60
P9_13 = Pin("P9_13") # UART4_TXD - GPIO_31
P9_14 = Pin("P9_14") # EHRPWM1A - GPIO_50
P9_15 = Pin("P9_15") # GPIO1_16 - GPIO_48
P9_16 = Pin("P9_16") # EHRPWM1B - GPIO_51
P9_17 = Pin("P9_17") # I2C1_SCL - GPIO_5
P9_18 = Pin("P9_18") # I2C1_SDA - GPIO_4
P9_19 = Pin("P9_19") # I2C2_SCL - GPIO_13
P9_20 = Pin("P9_20") # I2C2_SDA - GPIO_12
P9_21 = Pin("P9_21") # UART2_TXD - GPIO_3
P9_22 = Pin("P9_22") # UART2_RXD - GPIO_2
P9_23 = Pin("P9_23") # GPIO1_17 - GPIO_49
P9_24 = Pin("P9_24") # UART1_TXD - GPIO_15
P9_25 = Pin("P9_25") # GPIO3_21 - GPIO_117
P9_26 = Pin("P9_26") # UART1_RXD - GPIO_14
P9_27 = Pin("P9_27") # GPIO3_19 - GPIO_115
P9_28 = Pin("P9_28") # SPI1_CS0 - GPIO_113
P9_29 = Pin("P9_29") # SPI1_D0 - GPIO_111
P9_30 = Pin("P9_30") # SPI1_D1 - GPIO_112
P9_31 = Pin("P9_31") # SPI1_SCLK - GPIO_110
# P9_32 = VDD_ADC # VDD_ADC - GPIO_0
# P9_33 = AIN4 # AIN4 - GPIO_0
# P9_34 = GNDA_ADC # GNDA_ADC - GPIO_0
# P9_35 = AIN6 # AIN6 - GPIO_0
# P9_36 = AIN5 # AIN5 - GPIO_0
# P9_37 = AIN2 # AIN2 - GPIO_0
# P9_38 = AIN3 # AIN3 - GPIO_0
# P9_39 = AIN0 # AIN0 - GPIO_0
# P9_40 = AIN1 # AIN1 - GPIO_0
P9_41 = Pin("P9_41") # CLKOUT2 - GPIO_20
P9_42 = Pin("P9_42") # GPIO0_7 - GPIO_7
# P9_43 = DGND # DGND - GPIO_0
# P9_44 = DGND # DGND - GPIO_0
# P9_45 = DGND # DGND - GPIO_0
# P9_46 = DGND # DGND - GPIO_0
##########################################
# common to all beagles
USR0 = Pin("USR0") # USR0 - GPIO_53
USR1 = Pin("USR1") # USR1 - GPIO_54
USR2 = Pin("USR2") # USR2 - GPIO_55
USR3 = Pin("USR3") # USR3 - GPIO_56
##########################################
# specials
# analog input
AIN0 = Pin("AIN0")
AIN1 = Pin("AIN1")
AIN2 = Pin("AIN2")
AIN3 = Pin("AIN3")
AIN4 = Pin("AIN4")
AIN5 = Pin("AIN5")
AIN6 = Pin("AIN6")
AIN7 = Pin("AIN7")
# PWM
EHRPWM0A = Pin("EHRPWM0A")
EHRPWM0B = Pin("EHRPWM0B")
EHRPWM1A = Pin("EHRPWM1A")
EHRPWM1B = Pin("EHRPWM1B")
EHRPWM2A = Pin("EHRPWM2A")
EHRPWM2B = Pin("EHRPWM2B")
ECAPPWM0 = Pin("ECAPPWM0")
ECAPPWM2 = Pin("ECAPPWM2")
TIMER4 = Pin("TIMER4")
TIMER5 = Pin("TIMER5")
TIMER6 = Pin("TIMER6")
TIMER7 = Pin("TIMER7")
# I2C1
I2C1_SDA = Pin("I2C1_SDA")
I2C1_SCL = Pin("I2C1_SCL")
# I2C2
I2C2_SDA = Pin("I2C2_SDA")
I2C2_SCL = Pin("I2C2_SCL")
# SPI0
SPI0_CS0 = Pin("SPI0_CS0")
SPI0_SCLK = Pin("SPI0_SCLK")
SPI0_D1 = Pin("SPI0_D1")
SPI0_D0 = Pin("SPI0_D0")
# SPI1
SPI1_CS0 = Pin("SPI1_CS0")
SPI1_CS1 = Pin("SPI1_CS1")
SPI1_SCLK = Pin("SPI1_SCLK")
SPI1_D1 = Pin("SPI1_D1")
SPI1_D0 = Pin("SPI1_D0")
# UART0
UART0_TXD = Pin("UART0_TXD")
UART0_RXD = Pin("UART0_RXD")
# UART1
UART1_TXD = Pin("UART1_TXD")
UART1_RXD = Pin("UART1_RXD")
UART1_RTSn = Pin("UART1_RTSn")
UART1_CTSn = Pin("UART1_CTSn")
# UART2
UART2_TXD = Pin("UART2_TXD")
UART2_RXD = Pin("UART2_RXD")
# UART3
UART3_TXD = Pin("UART3_TXD")
UART3_RXD = Pin("UART3_RXD")
UART3_RTSn = Pin("UART3_RTSn")
UART3_CTSn = Pin("UART3_CTSn")
# UART4
UART4_TXD = Pin("UART4_TXD")
UART4_RXD = Pin("UART4_RXD")
UART4_RTSn = Pin("UART4_RTSn")
UART4_CTSn = Pin("UART4_CTSn")
# UART5
UART5_TXD = Pin("UART5_TXD")
UART5_RXD = Pin("UART5_RXD")
UART5_RTSn = Pin("UART5_RTSn")
UART5_CTSn = Pin("UART5_CTSn")
# ordered as spiId, sckId, mosiId, misoId
spiPorts = ((0, SCLK, MOSI, MISO), (1, SCLK_1, MOSI_1, MISO_1))
spiPorts = (
(0, SPI0_SCLK, SPI0_D1, SPI0_D0),
(1, SPI1_SCLK, SPI1_D1, SPI1_D0),
)
# ordered as uartId, txId, rxId
uartPorts = (
(),
# (0, UART0_TXD, UART0_RXD),
# (1, UART1_TXD, UART1_RXD),
# (2, UART2_TXD, UART2_RXD),
# (4, UART4_TXD, UART4_RXD),
# (5, UART5_TXD, UART5_RXD),
)
# ordered as i2cId, SCL, SDA
i2cPorts = (
(2, SCL, SDA),
(1, I2C1_SCL, I2C1_SDA),
(2, I2C2_SCL, I2C2_SDA),
)
PWM1 = P1_36
PWM2 = P1_33
PWM3 = P2_1
PWM4 = P2_3
pwmOuts = (((0, 0), PWM1), ((0, 1), PWM2), ((2, 0), PWM3), ((4, 1), PWM4))

View file

@ -0,0 +1,330 @@
"""
Much code from https://github.com/vsergeev/python-periphery/blob/master/periphery/pwm.py
Copyright (c) 2015-2016 vsergeev / Ivan (Vanya) A. Sergeev
License: MIT
"""
import os
try:
from microcontroller.pin import pwmOuts
except ImportError:
raise RuntimeError("No PWM outputs defined for this board") from ImportError
# pylint: disable=unnecessary-pass
class PWMError(IOError):
"""Base class for PWM errors."""
pass
# pylint: enable=unnecessary-pass
class PWMOut:
"""Pulse Width Modulation Output Class"""
# Sysfs paths
_sysfs_path = "/sys/class/pwm/"
_channel_path = "pwmchip{}"
# Channel paths
_export_path = "export"
_unexport_path = "unexport"
_pin_path = "pwm-{}:{}"
# Pin attribute paths
_pin_period_path = "period"
_pin_duty_cycle_path = "duty_cycle"
_pin_polarity_path = "polarity"
_pin_enable_path = "enable"
def __init__(self, pin, *, frequency=500, duty_cycle=0, variable_frequency=False):
"""Instantiate a PWM object and open the sysfs PWM corresponding to the
specified channel and pin.
Args:
pin (Pin): CircuitPython Pin object to output to
duty_cycle (int) : The fraction of each pulse which is high. 16-bit
frequency (int) : target frequency in Hertz (32-bit)
variable_frequency (bool) : True if the frequency will change over time
Returns:
PWMOut: PWMOut object.
Raises:
PWMError: if an I/O or OS error occurs.
TypeError: if `channel` or `pin` types are invalid.
ValueError: if PWM channel does not exist.
"""
self._pwmpin = None
self._channel = None
self._period = 0
self._open(pin, duty_cycle, frequency, variable_frequency)
def __del__(self):
self.deinit()
def __enter__(self):
return self
def __exit__(self, t, value, traceback):
self.deinit()
def _open(self, pin, duty=0, freq=500, variable_frequency=False):
self._channel = None
for pwmpair in pwmOuts:
if pwmpair[1] == pin:
self._channel = pwmpair[0][0]
self._pwmpin = pwmpair[0][1]
self._pin = pin
if self._channel is None:
raise RuntimeError("No PWM channel found for this Pin")
if variable_frequency:
print("Variable Frequency is not supported, continuing without it...")
channel_path = os.path.join(
self._sysfs_path, self._channel_path.format(self._channel)
)
if not os.path.isdir(channel_path):
raise ValueError(
"PWM channel does not exist, check that the required modules are loaded."
)
pin_path = os.path.join(
channel_path, self._pin_path.format(self._channel, self._pwmpin)
)
if not os.path.isdir(pin_path):
try:
with open(
os.path.join(channel_path, self._export_path), "w"
) as f_export:
f_export.write("%d\n" % self._pwmpin)
except IOError as e:
raise PWMError(e.errno, "Exporting PWM pin: " + e.strerror) from IOError
# Look up the period, for fast duty cycle updates
self._period = self._get_period()
# set frequency
self.frequency = freq
# set duty
self.duty_cycle = duty
self._set_enabled(True)
def deinit(self):
"""Deinit the sysfs PWM."""
# pylint: disable=broad-except
try:
channel_path = os.path.join(
self._sysfs_path, self._channel_path.format(self._channel)
)
if self._channel is not None:
# self.duty_cycle = 0
self._set_enabled(False) # make to disable before unexport
try:
# unexport_path = os.path.join(channel_path, self._unexport_path)
with open(
os.path.join(channel_path, self._unexport_path), "w"
) as f_unexport:
f_unexport.write("%d\n" % self._pwmpin)
except IOError as e:
raise PWMError(
e.errno, "Unexporting PWM pin: " + e.strerror
) from IOError
except Exception as e:
# due to a race condition for which I have not yet been
# able to find the root cause, deinit() often fails
# but it does not effect future usage of the pwm pin
print(
"warning: failed to deinitialize pwm pin {0}:{1} due to: {2}\n".format(
self._channel, self._pwmpin, type(e).__name__
)
)
finally:
self._channel = None
self._pwmpin = None
# pylint: enable=broad-except
def _is_deinited(self):
if self._pwmpin is None:
raise ValueError(
"Object has been deinitialize and can no longer "
"be used. Create a new object."
)
def _write_pin_attr(self, attr, value):
# Make sure the pin is active
self._is_deinited()
path = os.path.join(
self._sysfs_path,
self._channel_path.format(self._channel),
self._pin_path.format(self._channel, self._pwmpin),
attr,
)
with open(path, "w") as f_attr:
f_attr.write(value + "\n")
def _read_pin_attr(self, attr):
# Make sure the pin is active
self._is_deinited()
path = os.path.join(
self._sysfs_path,
self._channel_path.format(self._channel),
self._pin_path.format(self._channel, self._pwmpin),
attr,
)
with open(path, "r") as f_attr:
return f_attr.read().strip()
# Mutable properties
def _get_period(self):
period_ns = self._read_pin_attr(self._pin_period_path)
try:
period_ns = int(period_ns)
except ValueError:
raise PWMError(
None, 'Unknown period value: "%s"' % period_ns
) from ValueError
# Convert period from nanoseconds to seconds
period = period_ns / 1e9
# Update our cached period
self._period = period
return period
def _set_period(self, period):
if not isinstance(period, (int, float)):
raise TypeError("Invalid period type, should be int or float.")
# Convert period from seconds to integer nanoseconds
period_ns = int(period * 1e9)
self._write_pin_attr(self._pin_period_path, "{}".format(period_ns))
# Update our cached period
self._period = float(period)
period = property(_get_period, _set_period)
"""Get or set the PWM's output period in seconds.
Raises:
PWMError: if an I/O or OS error occurs.
TypeError: if value type is not int or float.
:type: int, float
"""
def _get_duty_cycle(self):
duty_cycle_ns = self._read_pin_attr(self._pin_duty_cycle_path)
try:
duty_cycle_ns = int(duty_cycle_ns)
except ValueError:
raise PWMError(
None, 'Unknown duty cycle value: "%s"' % duty_cycle_ns
) from ValueError
# Convert duty cycle from nanoseconds to seconds
duty_cycle = duty_cycle_ns / 1e9
# Convert duty cycle to ratio from 0.0 to 1.0
duty_cycle = duty_cycle / self._period
# convert to 16-bit
duty_cycle = int(duty_cycle * 65535)
return duty_cycle
def _set_duty_cycle(self, duty_cycle):
if not isinstance(duty_cycle, (int, float)):
raise TypeError("Invalid duty cycle type, should be int or float.")
# convert from 16-bit
duty_cycle /= 65535.0
if not 0.0 <= duty_cycle <= 1.0:
raise ValueError("Invalid duty cycle value, should be between 0.0 and 1.0.")
# Convert duty cycle from ratio to seconds
duty_cycle = duty_cycle * self._period
# Convert duty cycle from seconds to integer nanoseconds
duty_cycle_ns = int(duty_cycle * 1e9)
self._write_pin_attr(self._pin_duty_cycle_path, "{}".format(duty_cycle_ns))
duty_cycle = property(_get_duty_cycle, _set_duty_cycle)
"""Get or set the PWM's output duty cycle as a ratio from 0.0 to 1.0.
Raises:
PWMError: if an I/O or OS error occurs.
TypeError: if value type is not int or float.
ValueError: if value is out of bounds of 0.0 to 1.0.
:type: int, float
"""
def _get_frequency(self):
return 1.0 / self._get_period()
def _set_frequency(self, frequency):
if not isinstance(frequency, (int, float)):
raise TypeError("Invalid frequency type, should be int or float.")
self._set_period(1.0 / frequency)
frequency = property(_get_frequency, _set_frequency)
"""Get or set the PWM's output frequency in Hertz.
Raises:
PWMError: if an I/O or OS error occurs.
TypeError: if value type is not int or float.
:type: int, float
"""
def _get_enabled(self):
enabled = self._read_pin_attr(self._pin_enable_path)
if enabled == "1":
return True
if enabled == "0":
return False
raise PWMError(None, 'Unknown enabled value: "%s"' % enabled)
def _set_enabled(self, value):
"""Get or set the PWM's output enabled state.
Raises:
PWMError: if an I/O or OS error occurs.
TypeError: if value type is not bool.
:type: bool
"""
if not isinstance(value, bool):
raise TypeError("Invalid enabled type, should be string.")
self._write_pin_attr(self._pin_enable_path, "1" if value else "0")
# String representation
def __str__(self):
return "PWM%d, pin %s (freq=%f Hz, duty_cycle=%f%%)" % (
self._channel,
self._pin,
self.frequency,
self.duty_cycle * 100,
)

View file

@ -0,0 +1,139 @@
"""
G12A, G12B, and SM1 Common Definitions
Ref:
Linux kernel 4.9.y (hardkernel)
linux/include/dt-bindings/gpio/meson-g12a-gpio.h
Linux kernel 5.4.y (mainline)
linux/include/dt-bindings/gpio/meson-g12a-gpio.h
linux/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
"""
import re
import gpiod
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
chip0 = gpiod.Chip("0")
chip1 = gpiod.Chip("1")
if chip0.num_lines() < 20:
aobus = 0
periphs = 1
periphs_offset = chip1.num_lines() - 85
else:
aobus = 1
periphs = 0
periphs_offset = chip0.num_lines() - 85
chip0.close()
chip1.close()
GPIOAO_0 = GPIO496 = Pin((aobus, 0))
GPIOAO_1 = GPIO497 = Pin((aobus, 1))
GPIOAO_2 = GPIO498 = Pin((aobus, 2))
GPIOAO_3 = GPIO499 = Pin((aobus, 3))
GPIOAO_4 = GPIO500 = Pin((aobus, 4))
GPIOAO_5 = GPIO501 = Pin((aobus, 5))
GPIOAO_6 = GPIO502 = Pin((aobus, 6))
GPIOAO_7 = GPIO503 = Pin((aobus, 7))
GPIOAO_8 = GPIO504 = Pin((aobus, 8))
GPIOAO_9 = GPIO505 = Pin((aobus, 9))
GPIOAO_10 = GPIO506 = Pin((aobus, 10))
GPIOAO_11 = GPIO507 = Pin((aobus, 11))
GPIOE_0 = GPIO508 = Pin((aobus, 12))
GPIOE_1 = GPIO509 = Pin((aobus, 13))
GPIOE_2 = GPIO510 = Pin((aobus, 14))
GPIO_TEST_N = GPIO511 = Pin((aobus, 15))
GPIOH_0 = GPIO427 = Pin((periphs, 16 + periphs_offset))
GPIOH_1 = GPIO428 = Pin((periphs, 17 + periphs_offset))
GPIOH_2 = GPIO429 = Pin((periphs, 18 + periphs_offset))
GPIOH_3 = GPIO430 = Pin((periphs, 19 + periphs_offset))
GPIOH_4 = GPIO431 = Pin((periphs, 20 + periphs_offset))
GPIOH_5 = GPIO432 = Pin((periphs, 21 + periphs_offset))
GPIOH_6 = GPIO433 = Pin((periphs, 22 + periphs_offset))
GPIOH_7 = GPIO434 = Pin((periphs, 23 + periphs_offset))
GPIOH_8 = GPIO435 = Pin((periphs, 24 + periphs_offset))
GPIOA_0 = GPIO460 = Pin((periphs, 49 + periphs_offset))
GPIOA_1 = GPIO461 = Pin((periphs, 50 + periphs_offset))
GPIOA_2 = GPIO462 = Pin((periphs, 51 + periphs_offset))
GPIOA_3 = GPIO463 = Pin((periphs, 52 + periphs_offset))
GPIOA_4 = GPIO464 = Pin((periphs, 53 + periphs_offset))
GPIOA_5 = GPIO465 = Pin((periphs, 54 + periphs_offset))
GPIOA_6 = GPIO466 = Pin((periphs, 55 + periphs_offset))
GPIOA_7 = GPIO467 = Pin((periphs, 56 + periphs_offset))
GPIOA_8 = GPIO468 = Pin((periphs, 57 + periphs_offset))
GPIOA_9 = GPIO469 = Pin((periphs, 58 + periphs_offset))
GPIOA_10 = GPIO470 = Pin((periphs, 59 + periphs_offset))
GPIOA_11 = GPIO471 = Pin((periphs, 60 + periphs_offset))
GPIOA_12 = GPIO472 = Pin((periphs, 61 + periphs_offset))
GPIOA_13 = GPIO473 = Pin((periphs, 62 + periphs_offset))
GPIOA_14 = GPIO474 = Pin((periphs, 63 + periphs_offset))
GPIOA_15 = GPIO475 = Pin((periphs, 64 + periphs_offset))
GPIOX_0 = GPIO476 = Pin((periphs, 65 + periphs_offset))
GPIOX_1 = GPIO477 = Pin((periphs, 66 + periphs_offset))
GPIOX_2 = GPIO478 = Pin((periphs, 67 + periphs_offset))
GPIOX_3 = GPIO479 = Pin((periphs, 68 + periphs_offset))
GPIOX_4 = GPIO480 = Pin((periphs, 69 + periphs_offset))
GPIOX_5 = GPIO481 = Pin((periphs, 70 + periphs_offset))
GPIOX_6 = GPIO482 = Pin((periphs, 71 + periphs_offset))
GPIOX_7 = GPIO483 = Pin((periphs, 72 + periphs_offset))
GPIOX_8 = GPIO484 = Pin((periphs, 73 + periphs_offset))
GPIOX_9 = GPIO485 = Pin((periphs, 74 + periphs_offset))
GPIOX_10 = GPIO486 = Pin((periphs, 75 + periphs_offset))
GPIOX_11 = GPIO487 = Pin((periphs, 76 + periphs_offset))
GPIOX_12 = GPIO488 = Pin((periphs, 77 + periphs_offset))
GPIOX_13 = GPIO489 = Pin((periphs, 78 + periphs_offset))
GPIOX_14 = GPIO490 = Pin((periphs, 79 + periphs_offset))
GPIOX_15 = GPIO491 = Pin((periphs, 80 + periphs_offset))
GPIOX_16 = GPIO492 = Pin((periphs, 81 + periphs_offset))
GPIOX_17 = GPIO493 = Pin((periphs, 82 + periphs_offset))
GPIOX_18 = GPIO494 = Pin((periphs, 83 + periphs_offset))
GPIOX_19 = GPIO495 = Pin((periphs, 84 + periphs_offset))
SPI0_SCLK = GPIOX_11
SPI0_MISO = GPIOX_9
SPI0_MOSI = GPIOX_8
SPI0_CS0 = GPIOX_10
# ordered as spiId, sckId, mosiId, misoId
spiPorts = ((0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO),)
UART1_TX = GPIOX_12
UART1_RX = GPIOX_13
# ordered as uartId, txId, rxId
uartPorts = ((1, UART1_TX, UART1_RX),)
def get_dts_alias(device: str) -> str:
"""Get the Device Tree Alias"""
uevent_path = "/sys/bus/platform/devices/" + device + "/uevent"
with open(uevent_path, "r") as fd:
pattern = r"^OF_ALIAS_0=(.*)$"
uevent = fd.read().split("\n")
for line in uevent:
match = re.search(pattern, line)
if match:
return match.group(1).upper()
return None
# ordered as i2cId, sclId, sdaId
i2cPorts = []
alias = get_dts_alias("ffd1d000.i2c")
if alias is not None:
globals()[alias + "_SCL"] = GPIOX_18
globals()[alias + "_SDA"] = GPIOX_17
i2cPorts.append((int(alias[3]), GPIOX_18, GPIOX_17))
alias = get_dts_alias("ffd1c000.i2c")
if alias is not None:
globals()[alias + "_SCL"] = GPIOA_15
globals()[alias + "_SDA"] = GPIOA_14
i2cPorts.append((int(alias[3]), GPIOA_15, GPIOA_14))
i2cPorts = tuple(i2cPorts)

View file

@ -0,0 +1,90 @@
"""AmLogic s905 pin names"""
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
GPIO122 = Pin((0, 0))
GPIO123 = Pin((0, 1))
GPIO124 = Pin((0, 2))
GPIO125 = Pin((0, 3))
GPIO126 = Pin((0, 4))
GPIO127 = Pin((0, 5))
GPIO128 = Pin((0, 6))
GPIO129 = Pin((0, 7))
GPIO130 = Pin((0, 8))
GPIO131 = Pin((0, 9))
GPIO132 = Pin((0, 10))
GPIO133 = Pin((0, 11))
GPIO134 = Pin((0, 12))
GPIO135 = Pin((0, 13))
GPIO205 = Pin((1, 69))
GPIO206 = Pin((1, 70))
GPIO207 = Pin((1, 71))
GPIO208 = Pin((1, 72))
GPIO209 = Pin((1, 73))
GPIO210 = Pin((1, 74))
GPIO211 = Pin((1, 75))
GPIO212 = Pin((1, 76))
GPIO213 = Pin((1, 77))
GPIO214 = Pin((1, 78))
GPIO215 = Pin((1, 79))
GPIO216 = Pin((1, 80))
GPIO217 = Pin((1, 81))
GPIO218 = Pin((1, 82))
GPIO219 = Pin((1, 83))
GPIO220 = Pin((1, 84))
GPIO221 = Pin((1, 85))
GPIO222 = Pin((1, 86))
GPIO223 = Pin((1, 87))
GPIO224 = Pin((1, 88))
GPIO225 = Pin((1, 89))
GPIO226 = Pin((1, 90))
GPIO227 = Pin((1, 91))
GPIO228 = Pin((1, 92))
GPIO229 = Pin((1, 93))
GPIO230 = Pin((1, 94))
GPIO231 = Pin((1, 95))
GPIO232 = Pin((1, 96))
GPIO233 = Pin((1, 97))
GPIO234 = Pin((1, 98))
GPIO235 = Pin((1, 99))
GPIO236 = Pin((1, 100))
GPIO237 = Pin((1, 101))
GPIO238 = Pin((1, 102))
GPIO239 = Pin((1, 103))
GPIO240 = Pin((1, 104))
GPIO241 = Pin((1, 105))
GPIO242 = Pin((1, 106))
GPIO243 = Pin((1, 107))
GPIO247 = Pin((1, 111))
GPIO248 = Pin((1, 112))
GPIO249 = Pin((1, 113))
I2C0_SDA = GPIO205
I2C0_SCL = GPIO206
I2C1_SDA = GPIO207
I2C1_SCL = GPIO208
I2C2_SDA = GPIO209
I2C2_SCL = GPIO210
UART1_TX = GPIO240
UART1_RX = GPIO241
UART2_TX = GPIO205
UART2_RX = GPIO206
SPI0_SCLK = GPIO230
SPI0_MISO = GPIO232
SPI0_MOSI = GPIO235
i2cPorts = (
(0, I2C0_SCL, I2C0_SDA),
(1, I2C1_SCL, I2C1_SDA),
)
# ordered as spiId, sckId, mosiId, misoId
spiPorts = ((0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO),)
# ordered as uartId, txId, rxId
uartPorts = (
(1, UART1_TX, UART1_RX),
(2, UART2_TX, UART2_RX),
)

View file

@ -0,0 +1,3 @@
"""AmLogic s905x3 pin names"""
# pylint: disable=wildcard-import,unused-wildcard-import
from adafruit_blinka.microcontroller.amlogic.meson_g12_common.pin import *

View file

@ -0,0 +1,3 @@
"""AmLogic s922x pin names"""
# pylint: disable=wildcard-import,unused-wildcard-import
from adafruit_blinka.microcontroller.amlogic.meson_g12_common.pin import *

Some files were not shown because too many files have changed in this diff Show more