mer filer

This commit is contained in:
Jonathan 2024-10-28 20:07:01 +01:00
parent d05964b09a
commit 3e6ee7553b
3409 changed files with 515197 additions and 0 deletions

Binary file not shown.

240
hjul.py Normal file
View file

@ -0,0 +1,240 @@
import board
import neopixel
import pygame
import time
import os
import RPi.GPIO as GPIO
# Initiera Pygame
pygame.init()
# https://electropeak.com/learn/tutorial-raspberry-pi-gpio-programming-using-python-full-guide/
#initiera LED-strip med 300 led
num_of_pixels = 300
pixels = neopixel.NeoPixel(board.D21, num_of_pixels)
#resetta alla IO
GPIO.setmode(GPIO.BCM)
GPIO.setup(21, GPIO.OUT)
GPIO.output(21, 0)
GPIO.setmode(GPIO.BCM)
GPIO.setup(40, GPIO.OUT)
GPIO.output(40, 0)
#slå på nr 0,1,299 led
pixels.fill((0,0,0)) # stäng av alla LED
pixels.show() # stäng av alla LED
def setpixel(r,g,b,nr):
pixels[nr] = (r,g,b)
pixels.show()
def spela_ljud(filnamn):
pygame.mixer.init()
pygame.mixer.music.load(filnamn)
pygame.mixer.music.set_volume(1.0)
pygame.mixer.music.play()
pygame.mixer.init()
pygame.mixer.music.load("ljud.mp3")
pygame.mixer.music.set_volume(1.0)
pygame.mixer.music.play()
# Initiera joystickar
pygame.joystick.init()
# Kontrollera antalet anslutna joystickar
joystick_count = pygame.joystick.get_count()
if joystick_count < 2:
print("Mindre än två joystickar anslutna. Kontrollera anslutningarna.")
pygame.quit()
exit()
# Anslut till de första två joystickarna
joystickB = pygame.joystick.Joystick(0)
joystickC = pygame.joystick.Joystick(1)
joystickA = pygame.joystick.Joystick(2)
joystickA.init()
joystickB.init()
joystickC.init()
spela_ljud("ljud.mp3")
pixels.fill((0,0,0)) # stäng av alla LED
pixels.show() # stäng av alla LED
#definiera en funktion per knapp
def JB_knapp_0():
print ("Joystick B, Knapp 1")
setpixel(255,255,255,10)
setpixel(255,255,255,11)
def JB_knapp_1():
print ("Joystick B, Knapp 2")
setpixel(255,255,255,14)
setpixel(255,255,255,15)
def JB_knapp_2():
print ("Joystick B, Knapp 3")
setpixel(255,255,255,18)
setpixel(255,255,255,19)
def JB_knapp_3():
print ("Joystick B, Knapp 4")
def JB_knapp_4():
print ("Joystick B, Knapp 5")
def JB_knapp_5():
print ("Joystick B, Knapp 6")
def JB_knapp_6():
print ("Joystick B, Knapp 7")
def JB_knapp_7():
print ("Joystick B, Knapp 8")
pixels.fill((0,0,0)) # stäng av alla LED
pixels.show() # stäng av alla LED
def JB_knapp_8():
print ("Joystick B, Knapp 9")
def JB_knapp_9():
print ("Joystick B, Knapp 10")
def JB_knapp_10():
print ("Joystick B, Knapp 11")
def JB_knapp_11():
print ("Joystick B, Knapp 12")
def JA_knapp_0():
print ("Joystick A, Knapp 1")
def JA_knapp_1():
print ("Joystick A, Knapp 2")
def JA_knapp_2():
print ("Joystick A, Knapp 3")
def JA_knapp_3():
print ("Joystick A, Knapp 4")
def JA_knapp_4():
print ("Joystick A, Knapp 5")
def JA_knapp_5():
print ("Joystick A, Knapp 6")
def JA_knapp_6():
print ("Joystick A, Knapp 7")
def JA_knapp_7():
print ("Joystick A, Knapp 8")
def JA_knapp_8():
print ("Joystick A, Knapp 9")
def JA_knapp_9():
print ("Joystick A, Knapp 10")
def JA_knapp_10():
print ("Joystick A, Knapp 11")
def JA_knapp_11():
print ("Joystick A, Knapp 12")
def JC_knapp_0():
print ("Joystick C, Knapp 1")
def JC_knapp_1():
print ("Joystick C, Knapp 2")
def JC_knapp_2():
print ("Joystick C, Knapp 3")
def JC_knapp_3():
print ("Joystick C, Knapp 4")
def JC_knapp_4():
print ("Joystick C, Knapp 5")
def JC_knapp_5():
print ("Joystick C, Knapp 6")
def JC_knapp_6():
print ("Joystick C, Knapp 7")
def JC_knapp_7():
print ("Joystick C, Knapp 8")
def JC_knapp_8():
print ("Joystick C, Knapp 9")
def JC_knapp_9():
print ("Joystick C, Knapp 10")
def JC_knapp_10():
print ("Joystick C, Knapp 11")
def JC_knapp_11():
print ("Joystick C, Knapp 12")
#knappfunktioner
knappfunktioner_JA = [JA_knapp_0,JA_knapp_1,JA_knapp_2,JA_knapp_3,JA_knapp_4,JA_knapp_5,JA_knapp_6,JA_knapp_7,JA_knapp_8,JA_knapp_9,JA_knapp_10,JA_knapp_11]
knappfunktioner_JB = [JB_knapp_0,JB_knapp_1,JB_knapp_2,JB_knapp_3,JB_knapp_4,JB_knapp_5,JB_knapp_6,JB_knapp_7,JB_knapp_8,JB_knapp_9,JB_knapp_10,JB_knapp_11]
knappfunktioner_JC = [JC_knapp_0,JC_knapp_1,JC_knapp_2,JC_knapp_3,JC_knapp_4,JC_knapp_5,JC_knapp_6,JC_knapp_7,JC_knapp_8,JC_knapp_9,JC_knapp_10,JC_knapp_11]
try:
while True:
# Hämta alla händelser
for event in pygame.event.get():
if event.type == pygame.JOYBUTTONDOWN:
if event.joy == 0:
knapp = event.button
print(f"Joystick B ,- Knapp {event.button} trycks ned.")
knappfunktioner_JB[knapp]()
if event.type == pygame.JOYBUTTONDOWN:
if event.joy == 1:
knapp = event.button
print(f"Joystick C - Knapp {event.button} trycks ned.")
knappfunktioner_JC[knapp]()
if event.type == pygame.JOYBUTTONDOWN:
if event.joy == 2:
knapp = event.button
print(f"Joystick A - Knapp {event.button} trycks ned.")
knappfunktioner_JA[knapp]()
# Pausa lite för att inte överbelasta processorn
time.sleep(0.01)
except KeyboardInterrupt:
print("Avslutar programmet.")
finally:
#Terminering
pixels.fill((0,0,0)) # stäng av alla LED
pixels.show() # stäng av alla LED
pygame.quit()

BIN
ljud.mp3 Normal file

Binary file not shown.

247
venv/bin/Activate.ps1 Normal file
View file

@ -0,0 +1,247 @@
<#
.Synopsis
Activate a Python virtual environment for the current PowerShell session.
.Description
Pushes the python executable for a virtual environment to the front of the
$Env:PATH environment variable and sets the prompt to signify that you are
in a Python virtual environment. Makes use of the command line switches as
well as the `pyvenv.cfg` file values present in the virtual environment.
.Parameter VenvDir
Path to the directory that contains the virtual environment to activate. The
default value for this is the parent of the directory that the Activate.ps1
script is located within.
.Parameter Prompt
The prompt prefix to display when this virtual environment is activated. By
default, this prompt is the name of the virtual environment folder (VenvDir)
surrounded by parentheses and followed by a single space (ie. '(.venv) ').
.Example
Activate.ps1
Activates the Python virtual environment that contains the Activate.ps1 script.
.Example
Activate.ps1 -Verbose
Activates the Python virtual environment that contains the Activate.ps1 script,
and shows extra information about the activation as it executes.
.Example
Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv
Activates the Python virtual environment located in the specified location.
.Example
Activate.ps1 -Prompt "MyPython"
Activates the Python virtual environment that contains the Activate.ps1 script,
and prefixes the current prompt with the specified string (surrounded in
parentheses) while the virtual environment is active.
.Notes
On Windows, it may be required to enable this Activate.ps1 script by setting the
execution policy for the user. You can do this by issuing the following PowerShell
command:
PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
For more information on Execution Policies:
https://go.microsoft.com/fwlink/?LinkID=135170
#>
Param(
[Parameter(Mandatory = $false)]
[String]
$VenvDir,
[Parameter(Mandatory = $false)]
[String]
$Prompt
)
<# Function declarations --------------------------------------------------- #>
<#
.Synopsis
Remove all shell session elements added by the Activate script, including the
addition of the virtual environment's Python executable from the beginning of
the PATH variable.
.Parameter NonDestructive
If present, do not remove this function from the global namespace for the
session.
#>
function global:deactivate ([switch]$NonDestructive) {
# Revert to original values
# The prior prompt:
if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) {
Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt
Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT
}
# The prior PYTHONHOME:
if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) {
Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME
Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME
}
# The prior PATH:
if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) {
Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH
Remove-Item -Path Env:_OLD_VIRTUAL_PATH
}
# Just remove the VIRTUAL_ENV altogether:
if (Test-Path -Path Env:VIRTUAL_ENV) {
Remove-Item -Path env:VIRTUAL_ENV
}
# Just remove VIRTUAL_ENV_PROMPT altogether.
if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) {
Remove-Item -Path env:VIRTUAL_ENV_PROMPT
}
# Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether:
if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) {
Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force
}
# Leave deactivate function in the global namespace if requested:
if (-not $NonDestructive) {
Remove-Item -Path function:deactivate
}
}
<#
.Description
Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the
given folder, and returns them in a map.
For each line in the pyvenv.cfg file, if that line can be parsed into exactly
two strings separated by `=` (with any amount of whitespace surrounding the =)
then it is considered a `key = value` line. The left hand string is the key,
the right hand is the value.
If the value starts with a `'` or a `"` then the first and last character is
stripped from the value before being captured.
.Parameter ConfigDir
Path to the directory that contains the `pyvenv.cfg` file.
#>
function Get-PyVenvConfig(
[String]
$ConfigDir
) {
Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg"
# Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue).
$pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue
# An empty map will be returned if no config file is found.
$pyvenvConfig = @{ }
if ($pyvenvConfigPath) {
Write-Verbose "File exists, parse `key = value` lines"
$pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath
$pyvenvConfigContent | ForEach-Object {
$keyval = $PSItem -split "\s*=\s*", 2
if ($keyval[0] -and $keyval[1]) {
$val = $keyval[1]
# Remove extraneous quotations around a string value.
if ("'""".Contains($val.Substring(0, 1))) {
$val = $val.Substring(1, $val.Length - 2)
}
$pyvenvConfig[$keyval[0]] = $val
Write-Verbose "Adding Key: '$($keyval[0])'='$val'"
}
}
}
return $pyvenvConfig
}
<# Begin Activate script --------------------------------------------------- #>
# Determine the containing directory of this script
$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
$VenvExecDir = Get-Item -Path $VenvExecPath
Write-Verbose "Activation script is located in path: '$VenvExecPath'"
Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)"
Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)"
# Set values required in priority: CmdLine, ConfigFile, Default
# First, get the location of the virtual environment, it might not be
# VenvExecDir if specified on the command line.
if ($VenvDir) {
Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values"
}
else {
Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir."
$VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/")
Write-Verbose "VenvDir=$VenvDir"
}
# Next, read the `pyvenv.cfg` file to determine any required value such
# as `prompt`.
$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir
# Next, set the prompt from the command line, or the config file, or
# just use the name of the virtual environment folder.
if ($Prompt) {
Write-Verbose "Prompt specified as argument, using '$Prompt'"
}
else {
Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value"
if ($pyvenvCfg -and $pyvenvCfg['prompt']) {
Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'"
$Prompt = $pyvenvCfg['prompt'];
}
else {
Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)"
Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
$Prompt = Split-Path -Path $venvDir -Leaf
}
}
Write-Verbose "Prompt = '$Prompt'"
Write-Verbose "VenvDir='$VenvDir'"
# Deactivate any currently active virtual environment, but leave the
# deactivate function in place.
deactivate -nondestructive
# Now set the environment variable VIRTUAL_ENV, used by many tools to determine
# that there is an activated venv.
$env:VIRTUAL_ENV = $VenvDir
if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) {
Write-Verbose "Setting prompt to '$Prompt'"
# Set the prompt to include the env name
# Make sure _OLD_VIRTUAL_PROMPT is global
function global:_OLD_VIRTUAL_PROMPT { "" }
Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT
New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt
function global:prompt {
Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) "
_OLD_VIRTUAL_PROMPT
}
$env:VIRTUAL_ENV_PROMPT = $Prompt
}
# Clear PYTHONHOME
if (Test-Path -Path Env:PYTHONHOME) {
Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME
Remove-Item -Path Env:PYTHONHOME
}
# Add the venv to the PATH
Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH
$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

69
venv/bin/activate Normal file
View file

@ -0,0 +1,69 @@
# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly
deactivate () {
# reset old environment variables
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
PATH="${_OLD_VIRTUAL_PATH:-}"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r 2> /dev/null
fi
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
PS1="${_OLD_VIRTUAL_PS1:-}"
export PS1
unset _OLD_VIRTUAL_PS1
fi
unset VIRTUAL_ENV
unset VIRTUAL_ENV_PROMPT
if [ ! "${1:-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
}
# unset irrelevant variables
deactivate nondestructive
VIRTUAL_ENV="/home/vbytes/vbytes/venv"
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
# unset PYTHONHOME if set
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
# could use `if (set -u; : $PYTHONHOME) ;` in bash
if [ -n "${PYTHONHOME:-}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
unset PYTHONHOME
fi
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1:-}"
PS1="(venv) ${PS1:-}"
export PS1
VIRTUAL_ENV_PROMPT="(venv) "
export VIRTUAL_ENV_PROMPT
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r 2> /dev/null
fi

26
venv/bin/activate.csh Normal file
View file

@ -0,0 +1,26 @@
# This file must be used with "source bin/activate.csh" *from csh*.
# You cannot run it directly.
# Created by Davide Di Blasi <davidedb@gmail.com>.
# Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com>
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate'
# Unset irrelevant variables.
deactivate nondestructive
setenv VIRTUAL_ENV "/home/vbytes/vbytes/venv"
set _OLD_VIRTUAL_PATH="$PATH"
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
set _OLD_VIRTUAL_PROMPT="$prompt"
if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
set prompt = "(venv) $prompt"
setenv VIRTUAL_ENV_PROMPT "(venv) "
endif
alias pydoc python -m pydoc
rehash

69
venv/bin/activate.fish Normal file
View file

@ -0,0 +1,69 @@
# This file must be used with "source <venv>/bin/activate.fish" *from fish*
# (https://fishshell.com/); you cannot run it directly.
function deactivate -d "Exit virtual environment and return to normal shell environment"
# reset old environment variables
if test -n "$_OLD_VIRTUAL_PATH"
set -gx PATH $_OLD_VIRTUAL_PATH
set -e _OLD_VIRTUAL_PATH
end
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
set -e _OLD_VIRTUAL_PYTHONHOME
end
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
set -e _OLD_FISH_PROMPT_OVERRIDE
# prevents error when using nested fish instances (Issue #93858)
if functions -q _old_fish_prompt
functions -e fish_prompt
functions -c _old_fish_prompt fish_prompt
functions -e _old_fish_prompt
end
end
set -e VIRTUAL_ENV
set -e VIRTUAL_ENV_PROMPT
if test "$argv[1]" != "nondestructive"
# Self-destruct!
functions -e deactivate
end
end
# Unset irrelevant variables.
deactivate nondestructive
set -gx VIRTUAL_ENV "/home/vbytes/vbytes/venv"
set -gx _OLD_VIRTUAL_PATH $PATH
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
# Unset PYTHONHOME if set.
if set -q PYTHONHOME
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
set -e PYTHONHOME
end
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
# fish uses a function instead of an env var to generate the prompt.
# Save the current fish_prompt function as the function _old_fish_prompt.
functions -c fish_prompt _old_fish_prompt
# With the original prompt function renamed, we can override with our own.
function fish_prompt
# Save the return status of the last command.
set -l old_status $status
# Output the venv prompt; color taken from the blue of the Python logo.
printf "%s%s%s" (set_color 4B8BBE) "(venv) " (set_color normal)
# Restore the return status of the previous command.
echo "exit $old_status" | .
# Output the original/"old" prompt.
_old_fish_prompt
end
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
set -gx VIRTUAL_ENV_PROMPT "(venv) "
end

192
venv/bin/ftconf.py Executable file
View file

@ -0,0 +1,192 @@
#!/home/vbytes/vbytes/venv/bin/python3
"""Simple FTDI EEPROM configurator.
"""
# Copyright (c) 2019-2024, Emmanuel Blot <emmanuel.blot@free.fr>
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
from argparse import ArgumentParser, FileType
from io import StringIO
from logging import Formatter, StreamHandler, DEBUG, ERROR
from sys import exit as sys_exit, modules, stderr, stdout
from textwrap import fill
from traceback import format_exc
from pyftdi import FtdiLogger
from pyftdi.eeprom import FtdiEeprom
from pyftdi.ftdi import Ftdi
from pyftdi.misc import add_custom_devices, hexdump
# pylint: disable=too-many-locals
# pylint: disable=too-many-branches
# pylint: disable=too-many-statements
def main():
"""Main routine"""
debug = False
try:
argparser = ArgumentParser(description=modules[__name__].__doc__)
argparser.add_argument('device', nargs='?', default='ftdi:///?',
help='serial port device name')
files = argparser.add_argument_group(title='Files')
files.add_argument('-i', '--input', type=FileType('rt'),
help='input ini file to load EEPROM content')
files.add_argument('-l', '--load', default='all',
choices=('all', 'raw', 'values'),
help='section(s) to load from input file')
files.add_argument('-o', '--output',
help='output ini file to save EEPROM content')
files.add_argument('-V', '--virtual', type=FileType('r'),
help='use a virtual device, specified as YaML')
device = argparser.add_argument_group(title='Device')
device.add_argument('-P', '--vidpid', action='append',
help='specify a custom VID:PID device ID '
'(search for FTDI devices)')
device.add_argument('-M', '--eeprom',
help='force an EEPROM model')
device.add_argument('-S', '--size', type=int,
choices=FtdiEeprom.eeprom_sizes,
help='force an EEPROM size')
fmt = argparser.add_argument_group(title='Format')
fmt.add_argument('-x', '--hexdump', action='store_true',
help='dump EEPROM content as ASCII')
fmt.add_argument('-X', '--hexblock', type=int,
help='dump EEPROM as indented hexa blocks')
config = argparser.add_argument_group(title='Configuration')
config.add_argument('-s', '--serial-number',
help='set serial number')
config.add_argument('-m', '--manufacturer',
help='set manufacturer name')
config.add_argument('-p', '--product',
help='set product name')
config.add_argument('-c', '--config', action='append',
help='change/configure a property as key=value '
'pair')
config.add_argument('--vid', type=lambda x: int(x, 16),
help='shortcut to configure the USB vendor ID')
config.add_argument('--pid', type=lambda x: int(x, 16),
help='shortcut to configure the USB product ID')
action = argparser.add_argument_group(title='Action')
action.add_argument('-e', '--erase', action='store_true',
help='erase the whole EEPROM content')
action.add_argument('-E', '--full-erase', action='store_true',
default=False,
help='erase the whole EEPROM content, including '
'the CRC')
action.add_argument('-u', '--update', action='store_true',
help='perform actual update, use w/ care')
extra = argparser.add_argument_group(title='Extras')
extra.add_argument('-v', '--verbose', action='count', default=0,
help='increase verbosity')
extra.add_argument('-d', '--debug', action='store_true',
help='enable debug mode')
args = argparser.parse_args()
debug = args.debug
if not args.device:
argparser.error('Serial device not specified')
loglevel = max(DEBUG, ERROR - (10 * args.verbose))
loglevel = min(ERROR, loglevel)
if debug:
formatter = Formatter('%(asctime)s.%(msecs)03d %(name)-20s '
'%(message)s', '%H:%M:%S')
else:
formatter = Formatter('%(message)s')
FtdiLogger.set_formatter(formatter)
FtdiLogger.set_level(loglevel)
FtdiLogger.log.addHandler(StreamHandler(stderr))
if args.virtual:
# pylint: disable=import-outside-toplevel
from pyftdi.usbtools import UsbTools
# Force PyUSB to use PyFtdi test framework for USB backends
UsbTools.BACKENDS = ('pyftdi.tests.backend.usbvirt', )
# Ensure the virtual backend can be found and is loaded
backend = UsbTools.find_backend()
loader = backend.create_loader()()
loader.load(args.virtual)
try:
add_custom_devices(Ftdi, args.vidpid, force_hex=True)
except ValueError as exc:
argparser.error(str(exc))
eeprom = FtdiEeprom()
eeprom.open(args.device, size=args.size, model=args.eeprom)
if args.erase or args.full_erase:
eeprom.erase()
if args.input:
eeprom.load_config(args.input, args.load)
if args.serial_number:
eeprom.set_serial_number(args.serial_number)
if args.manufacturer:
eeprom.set_manufacturer_name(args.manufacturer)
if args.product:
eeprom.set_product_name(args.product)
for conf in args.config or []:
if conf in ('?', 'help'):
helpstr = ', '.join(sorted(eeprom.properties))
print(fill(helpstr, initial_indent=' ',
subsequent_indent=' '))
sys_exit(1)
for sep in ':=':
if sep in conf:
name, value = conf.split(sep, 1)
if not value:
argparser.error(f'Configuration {conf} without value')
if value == 'help':
value = '?'
helpio = StringIO()
eeprom.set_property(name, value, helpio)
helpstr = helpio.getvalue()
if helpstr:
print(fill(helpstr, initial_indent=' ',
subsequent_indent=' '))
sys_exit(1)
break
else:
argparser.error(f'Missing name:value separator in {conf}')
if args.vid:
eeprom.set_property('vendor_id', args.vid)
if args.pid:
eeprom.set_property('product_id', args.pid)
if args.hexdump:
print(hexdump(eeprom.data))
if args.hexblock is not None:
indent = ' ' * args.hexblock
for pos in range(0, len(eeprom.data), 16):
hexa = ' '.join([f'{x:02x}' for x in eeprom.data[pos:pos+16]])
print(indent, hexa, sep='')
if args.update:
if eeprom.commit(False, no_crc=args.full_erase):
eeprom.reset_device()
if args.verbose > 0:
eeprom.dump_config()
if args.output:
if args.output == '-':
eeprom.save_config(stdout)
else:
with open(args.output, 'wt') as ofp:
eeprom.save_config(ofp)
except (ImportError, IOError, NotImplementedError, ValueError) as exc:
print(f'\nError: {exc}', file=stderr)
if debug:
print(format_exc(chain=False), file=stderr)
sys_exit(1)
except KeyboardInterrupt:
sys_exit(2)
if __name__ == '__main__':
main()

74
venv/bin/ftdi_urls.py Executable file
View file

@ -0,0 +1,74 @@
#!/home/vbytes/vbytes/venv/bin/python3
# Copyright (c) 2019-2024, Emmanuel Blot <emmanuel.blot@free.fr>
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
"""List valid FTDI device URLs and descriptors."""
from argparse import ArgumentParser, FileType
from logging import Formatter, StreamHandler, DEBUG, ERROR
from sys import exit as sys_exit, modules, stderr
from traceback import format_exc
from pyftdi import FtdiLogger
from pyftdi.ftdi import Ftdi
from pyftdi.misc import add_custom_devices
def main():
"""Entry point."""
debug = False
try:
argparser = ArgumentParser(description=modules[__name__].__doc__)
argparser.add_argument('-P', '--vidpid', action='append',
help='specify a custom VID:PID device ID, '
'may be repeated')
argparser.add_argument('-V', '--virtual', type=FileType('r'),
help='use a virtual device, specified as YaML')
argparser.add_argument('-v', '--verbose', action='count', default=0,
help='increase verbosity')
argparser.add_argument('-d', '--debug', action='store_true',
help='enable debug mode')
args = argparser.parse_args()
debug = args.debug
loglevel = max(DEBUG, ERROR - (10 * args.verbose))
loglevel = min(ERROR, loglevel)
if debug:
formatter = Formatter('%(asctime)s.%(msecs)03d %(name)-20s '
'%(message)s', '%H:%M:%S')
else:
formatter = Formatter('%(message)s')
FtdiLogger.set_formatter(formatter)
FtdiLogger.set_level(loglevel)
FtdiLogger.log.addHandler(StreamHandler(stderr))
if args.virtual:
# pylint: disable=import-outside-toplevel
from pyftdi.usbtools import UsbTools
# Force PyUSB to use PyFtdi test framework for USB backends
UsbTools.BACKENDS = ('pyftdi.tests.backend.usbvirt', )
# Ensure the virtual backend can be found and is loaded
backend = UsbTools.find_backend()
loader = backend.create_loader()()
loader.load(args.virtual)
try:
add_custom_devices(Ftdi, args.vidpid, force_hex=True)
except ValueError as exc:
argparser.error(str(exc))
Ftdi.show_devices()
except (ImportError, IOError, NotImplementedError, ValueError) as exc:
print(f'\nError: {exc}', file=stderr)
if debug:
print(format_exc(chain=False), file=stderr)
sys_exit(1)
except KeyboardInterrupt:
sys_exit(2)
if __name__ == '__main__':
main()

155
venv/bin/i2cscan.py Executable file
View file

@ -0,0 +1,155 @@
#!/home/vbytes/vbytes/venv/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2018-2024, Emmanuel Blot <emmanuel.blot@free.fr>
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
"""Tiny I2C bus scanner."""
# pylint: disable=broad-except
from argparse import ArgumentParser, FileType
from logging import Formatter, StreamHandler, getLogger, DEBUG, ERROR
from sys import exit as sys_exit, modules, stderr
from traceback import format_exc
from pyftdi import FtdiLogger
from pyftdi.ftdi import Ftdi
from pyftdi.i2c import I2cController, I2cNackError
from pyftdi.misc import add_custom_devices
class I2cBusScanner:
"""Scan I2C bus to find slave.
Emit the I2C address message, but no data. Detect any ACK on each valid
address.
"""
SMB_READ_RANGE = list(range(0x30, 0x38)) + list(range(0x50, 0x60))
HIGHEST_I2C_SLAVE_ADDRESS = 0x78
@classmethod
def scan(cls, url: str, smb_mode: bool = True, force: bool = False) \
-> None:
"""Scan an I2C bus to detect slave device.
:param url: FTDI URL
:param smb_mode: whether to use SMBbus restrictions or regular I2C
mode.
"""
i2c = I2cController()
slaves = []
getLogger('pyftdi.i2c').setLevel(ERROR)
try:
i2c.set_retry_count(1)
i2c.force_clock_mode(force)
i2c.configure(url)
for addr in range(cls.HIGHEST_I2C_SLAVE_ADDRESS+1):
port = i2c.get_port(addr)
if smb_mode:
try:
if addr in cls.SMB_READ_RANGE:
port.read(0)
slaves.append('R')
else:
port.write([])
slaves.append('W')
except I2cNackError:
slaves.append('.')
else:
try:
port.read(0)
slaves.append('R')
continue
except I2cNackError:
pass
try:
port.write([])
slaves.append('W')
except I2cNackError:
slaves.append('.')
finally:
i2c.terminate()
columns = 16
row = 0
print(' ', ''.join(f' {col:01X} ' for col in range(columns)))
while True:
chunk = slaves[row:row+columns]
if not chunk:
break
print(f' {row//columns:01X}:', ' '.join(chunk))
row += columns
def main():
"""Entry point."""
debug = False
try:
argparser = ArgumentParser(description=modules[__name__].__doc__)
argparser.add_argument('device', nargs='?', default='ftdi:///?',
help='serial port device name')
argparser.add_argument('-S', '--no-smb', action='store_true',
default=False,
help='use regular I2C mode vs. SMBbus scan')
argparser.add_argument('-P', '--vidpid', action='append',
help='specify a custom VID:PID device ID, '
'may be repeated')
argparser.add_argument('-V', '--virtual', type=FileType('r'),
help='use a virtual device, specified as YaML')
argparser.add_argument('-v', '--verbose', action='count', default=0,
help='increase verbosity')
argparser.add_argument('-d', '--debug', action='store_true',
help='enable debug mode')
argparser.add_argument('-F', '--force', action='store_true',
help='force clock mode (for FT2232D)')
args = argparser.parse_args()
debug = args.debug
if not args.device:
argparser.error('Serial device not specified')
loglevel = max(DEBUG, ERROR - (10 * args.verbose))
loglevel = min(ERROR, loglevel)
if debug:
formatter = Formatter('%(asctime)s.%(msecs)03d %(name)-20s '
'%(message)s', '%H:%M:%S')
else:
formatter = Formatter('%(message)s')
FtdiLogger.log.addHandler(StreamHandler(stderr))
FtdiLogger.set_formatter(formatter)
FtdiLogger.set_level(loglevel)
if args.virtual:
# pylint: disable=import-outside-toplevel
from pyftdi.usbtools import UsbTools
# Force PyUSB to use PyFtdi test framework for USB backends
UsbTools.BACKENDS = ('pyftdi.tests.backend.usbvirt', )
# Ensure the virtual backend can be found and is loaded
backend = UsbTools.find_backend()
loader = backend.create_loader()()
loader.load(args.virtual)
try:
add_custom_devices(Ftdi, args.vidpid, force_hex=True)
except ValueError as exc:
argparser.error(str(exc))
I2cBusScanner.scan(args.device, not args.no_smb, args.force)
except (ImportError, IOError, NotImplementedError, ValueError) as exc:
print(f'\nError: {exc}', file=stderr)
if debug:
print(format_exc(chain=False), file=stderr)
sys_exit(1)
except KeyboardInterrupt:
sys_exit(2)
if __name__ == '__main__':
try:
main()
except Exception as _exc:
print(str(_exc), file=stderr)

8
venv/bin/pip Executable file
View file

@ -0,0 +1,8 @@
#!/home/vbytes/vbytes/venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

8
venv/bin/pip3 Executable file
View file

@ -0,0 +1,8 @@
#!/home/vbytes/vbytes/venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

8
venv/bin/pip3.11 Executable file
View file

@ -0,0 +1,8 @@
#!/home/vbytes/vbytes/venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

8
venv/bin/pyserial-miniterm Executable file
View file

@ -0,0 +1,8 @@
#!/home/vbytes/vbytes/venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from serial.tools.miniterm import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

8
venv/bin/pyserial-ports Executable file
View file

@ -0,0 +1,8 @@
#!/home/vbytes/vbytes/venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from serial.tools.list_ports import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

367
venv/bin/pyterm.py Executable file
View file

@ -0,0 +1,367 @@
#!/home/vbytes/vbytes/venv/bin/python3
"""Simple Python serial terminal
"""
# Copyright (c) 2010-2024, Emmanuel Blot <emmanuel.blot@free.fr>
# Copyright (c) 2016, Emmanuel Bouaziz <ebouaziz@free.fr>
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
# pylint: disable=broad-except
# pylint: disable=wrong-import-position
from argparse import ArgumentParser, FileType
from atexit import register
from collections import deque
from logging import Formatter, StreamHandler, DEBUG, ERROR
from os import environ, linesep, stat
from re import search
from sys import exit as sys_exit, modules, platform, stderr, stdout
from time import sleep
from threading import Event, Thread
from traceback import format_exc
from _thread import interrupt_main
# pylint: disable=import-error
# pylint: disable=import-outside-toplevel
from pyftdi import FtdiLogger
from pyftdi.ftdi import Ftdi
from pyftdi.misc import to_bps, add_custom_devices
from pyftdi.term import Terminal
class MiniTerm:
"""A mini serial terminal to demonstrate pyserial extensions"""
DEFAULT_BAUDRATE = 115200
def __init__(self, device, baudrate=None, parity=None, rtscts=False,
debug=False):
self._terminal = Terminal()
self._device = device
self._baudrate = baudrate or self.DEFAULT_BAUDRATE
self._port = self._open_port(self._device, self._baudrate, parity,
rtscts, debug)
self._resume = False
self._silent = False
self._rxq = deque()
self._rxe = Event()
self._debug = debug
register(self._cleanup)
def run(self, fullmode=False, loopback=False, silent=False,
localecho=False, autocr=False):
"""Switch to a pure serial terminal application"""
self._terminal.init(fullmode)
print(f'Entering minicom mode @ { self._port.baudrate} bps')
stdout.flush()
self._resume = True
# start the reader (target to host direction) within a dedicated thread
args = [loopback]
if self._device.startswith('ftdi://'):
# with pyftdi/pyusb/libusb stack, there is no kernel buffering
# which means that a UART source with data burst may overflow the
# FTDI HW buffer while the SW stack is dealing with formatting
# and console output. Use an intermediate thread to pop out data
# out from the HW as soon as it is made available, and use a deque
# to serve the actual reader thread
args.append(self._get_from_source)
sourcer = Thread(target=self._sourcer, daemon=True)
sourcer.start()
else:
# regular kernel buffered device
args.append(self._get_from_port)
reader = Thread(target=self._reader, args=tuple(args), daemon=True)
reader.start()
# start the writer (host to target direction)
self._writer(fullmode, silent, localecho, autocr)
def _sourcer(self):
try:
while self._resume:
data = self._port.read(4096)
if not data:
continue
self._rxq.append(data)
self._rxe.set()
except Exception as ex:
self._resume = False
print(str(ex), file=stderr)
interrupt_main()
def _get_from_source(self):
while not self._rxq and self._resume:
if self._rxe.wait(0.1):
self._rxe.clear()
break
if not self._rxq:
return bytearray()
return self._rxq.popleft()
def _get_from_port(self):
try:
return self._port.read(4096)
except OSError as ex:
self._resume = False
print(str(ex), file=stderr)
interrupt_main()
return bytearray()
except Exception as ex:
print(str(ex), file=stderr)
return bytearray()
def _reader(self, loopback, getfunc):
"""Loop forever, processing received serial data in terminal mode"""
try:
# Try to read as many bytes as possible at once, and use a short
# timeout to avoid blocking for more data
self._port.timeout = 0.050
while self._resume:
if self._silent:
sleep(0.25)
continue
data = getfunc()
if data:
stdout.write(data.decode('utf8', errors='replace'))
stdout.flush()
if loopback:
self._port.write(data)
except KeyboardInterrupt:
return
except Exception as exc:
print(f'Exception: {exc}')
if self._debug:
print(format_exc(chain=False), file=stderr)
interrupt_main()
def _writer(self, fullmode, silent, localecho, crlf=0):
"""Loop and copy console->serial until EOF character is found"""
while self._resume:
try:
char = self._terminal.getkey()
if fullmode and ord(char) == 0x2: # Ctrl+B
self._cleanup(True)
return
if self._terminal.IS_MSWIN:
if ord(char) in (0, 224):
char = self._terminal.getkey()
self._port.write(self._terminal.getch_to_escape(char))
continue
if ord(char) == 0x3: # Ctrl+C
raise KeyboardInterrupt('Ctrl-C break')
if silent:
if ord(char) == 0x6: # Ctrl+F
self._silent = True
print('Silent\n')
continue
if ord(char) == 0x7: # Ctrl+G
self._silent = False
print('Reg\n')
continue
if localecho:
stdout.write(char.decode('utf8', errors='replace'))
stdout.flush()
if crlf:
if char == b'\n':
self._port.write(b'\r')
if crlf > 1:
continue
self._port.write(char)
except KeyError:
continue
except KeyboardInterrupt:
if fullmode:
if self._terminal.IS_MSWIN:
self._port.write(b'\x03')
continue
self._cleanup(True)
def _cleanup(self, *args):
"""Cleanup resource before exiting"""
if args and args[0]:
print(f'{linesep}Aborting...')
try:
self._resume = False
if self._port:
# wait till the other thread completes
sleep(0.5)
try:
rem = self._port.inWaiting()
except IOError:
# maybe a bug in underlying wrapper...
rem = 0
# consumes all the received bytes
for _ in range(rem):
self._port.read()
self._port.close()
self._port = None
print('Bye.')
except Exception as ex:
print(str(ex), file=stderr)
finally:
if self._terminal:
self._terminal.reset()
self._terminal = None
@staticmethod
def _open_port(device, baudrate, parity, rtscts, debug=False):
"""Open the serial communication port"""
try:
from serial.serialutil import SerialException
from serial import PARITY_NONE
except ImportError as exc:
raise ImportError("Python serial module not installed") from exc
try:
from serial import serial_for_url, VERSION as serialver
# use a simple regex rather than adding a new dependency on the
# more complete 'packaging' module
vmo = search(r'^(\d+)\.(\d+)', serialver)
if not vmo:
# unable to parse version
raise ValueError()
if tuple(int(x) for x in vmo.groups()) < (3, 0):
# pysrial version is too old
raise ValueError()
except (ValueError, IndexError, ImportError) as exc:
raise ImportError("pyserial 3.0+ is required") from exc
# the following import enables serial protocol extensions
if device.startswith('ftdi:'):
try:
from pyftdi import serialext
serialext.touch()
except ImportError as exc:
raise ImportError("PyFTDI module not installed") from exc
try:
port = serial_for_url(device,
baudrate=baudrate,
parity=parity or PARITY_NONE,
rtscts=rtscts,
timeout=0)
if not port.is_open:
port.open()
if not port.is_open:
raise IOError(f"Cannot open port '{device}'")
if debug:
backend = port.BACKEND if hasattr(port, 'BACKEND') else '?'
print(f"Using serial backend '{backend}'")
return port
except SerialException as exc:
raise IOError(str(exc)) from exc
def get_default_device() -> str:
"""Return the default comm device, depending on the host/OS."""
envdev = environ.get('FTDI_DEVICE', '')
if envdev:
return envdev
if platform == 'win32':
device = 'COM1'
elif platform == 'darwin':
device = '/dev/cu.usbserial'
elif platform == 'linux':
device = '/dev/ttyS0'
else:
device = ''
try:
stat(device)
except OSError:
device = 'ftdi:///1'
return device
def main():
"""Main routine"""
debug = False
try:
default_device = get_default_device()
argparser = ArgumentParser(description=modules[__name__].__doc__)
argparser.add_argument('-f', '--fullmode', dest='fullmode',
action='store_true',
help='use full terminal mode, exit with '
'[Ctrl]+B')
argparser.add_argument('device', nargs='?', default=default_device,
help=f'serial port device name '
f'(default: {default_device}')
argparser.add_argument('-b', '--baudrate',
default=str(MiniTerm.DEFAULT_BAUDRATE),
help=f'serial port baudrate '
f'(default: {MiniTerm.DEFAULT_BAUDRATE})')
argparser.add_argument('-w', '--hwflow',
action='store_true',
help='hardware flow control')
argparser.add_argument('-e', '--localecho',
action='store_true',
help='local echo mode (print all typed chars)')
argparser.add_argument('-r', '--crlf',
action='count', default=0,
help='prefix LF with CR char, use twice to '
'replace all LF with CR chars')
argparser.add_argument('-l', '--loopback',
action='store_true',
help='loopback mode (send back all received '
'chars)')
argparser.add_argument('-s', '--silent', action='store_true',
help='silent mode')
argparser.add_argument('-P', '--vidpid', action='append',
help='specify a custom VID:PID device ID, '
'may be repeated')
argparser.add_argument('-V', '--virtual', type=FileType('r'),
help='use a virtual device, specified as YaML')
argparser.add_argument('-v', '--verbose', action='count',
help='increase verbosity')
argparser.add_argument('-d', '--debug', action='store_true',
help='enable debug mode')
args = argparser.parse_args()
debug = args.debug
if not args.device:
argparser.error('Serial device not specified')
loglevel = max(DEBUG, ERROR - (10 * (args.verbose or 0)))
loglevel = min(ERROR, loglevel)
if debug:
formatter = Formatter('%(asctime)s.%(msecs)03d %(name)-20s '
'%(message)s', '%H:%M:%S')
else:
formatter = Formatter('%(message)s')
FtdiLogger.set_formatter(formatter)
FtdiLogger.set_level(loglevel)
FtdiLogger.log.addHandler(StreamHandler(stderr))
if args.virtual:
from pyftdi.usbtools import UsbTools
# Force PyUSB to use PyFtdi test framework for USB backends
UsbTools.BACKENDS = ('pyftdi.tests.backend.usbvirt', )
# Ensure the virtual backend can be found and is loaded
backend = UsbTools.find_backend()
loader = backend.create_loader()()
loader.load(args.virtual)
try:
add_custom_devices(Ftdi, args.vidpid, force_hex=True)
except ValueError as exc:
argparser.error(str(exc))
miniterm = MiniTerm(device=args.device,
baudrate=to_bps(args.baudrate),
parity='N',
rtscts=args.hwflow,
debug=args.debug)
miniterm.run(args.fullmode, args.loopback, args.silent, args.localecho,
args.crlf)
except (IOError, ValueError) as exc:
print(f'\nError: {exc}', file=stderr)
if debug:
print(format_exc(chain=False), file=stderr)
sys_exit(1)
except KeyboardInterrupt:
sys_exit(2)
if __name__ == '__main__':
main()

1
venv/bin/python Symbolic link
View file

@ -0,0 +1 @@
python3

1
venv/bin/python3 Symbolic link
View file

@ -0,0 +1 @@
/usr/bin/python3

1
venv/bin/python3.11 Symbolic link
View file

@ -0,0 +1 @@
python3

View file

@ -0,0 +1,21 @@
#define NO_PYGAME_C_API
#include "_surface.h"
/* The structure passed to the low level blit functions */
typedef struct {
int width;
int height;
Uint8 *s_pixels;
int s_pxskip;
int s_skip;
Uint8 *d_pixels;
int d_pxskip;
int d_skip;
SDL_PixelFormat *src;
SDL_PixelFormat *dst;
Uint8 src_blanket_alpha;
int src_has_colorkey;
Uint32 src_colorkey;
SDL_BlendMode src_blend;
SDL_BlendMode dst_blend;
} SDL_BlitInfo;

View file

@ -0,0 +1,26 @@
/*
pygame - Python Game Library
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _CAMERA_H
#define _CAMERA_H
#include "_pygame.h"
#include "camera.h"
#endif

View file

@ -0,0 +1,374 @@
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
/* This will use PYGAMEAPI_EXTERN_SLOTS instead
* of PYGAMEAPI_DEFINE_SLOTS for base modules.
*/
#ifndef _PYGAME_INTERNAL_H
#define _PYGAME_INTERNAL_H
#include "pgplatform.h"
/*
If PY_SSIZE_T_CLEAN is defined before including Python.h, length is a
Py_ssize_t rather than an int for all # variants of formats (s#, y#, etc.)
*/
#define PY_SSIZE_T_CLEAN
#include <Python.h>
/* Ensure PyPy-specific code is not in use when running on GraalPython (PR
* #2580) */
#if defined(GRAALVM_PYTHON) && defined(PYPY_VERSION)
#undef PYPY_VERSION
#endif
#include <SDL.h>
/* SDL 1.2 constants removed from SDL 2 */
typedef enum {
SDL_HWSURFACE = 0,
SDL_RESIZABLE = SDL_WINDOW_RESIZABLE,
SDL_ASYNCBLIT = 0,
SDL_OPENGL = SDL_WINDOW_OPENGL,
SDL_OPENGLBLIT = 0,
SDL_ANYFORMAT = 0,
SDL_HWPALETTE = 0,
SDL_DOUBLEBUF = 0,
SDL_FULLSCREEN = SDL_WINDOW_FULLSCREEN,
SDL_HWACCEL = 0,
SDL_SRCCOLORKEY = 0,
SDL_RLEACCELOK = 0,
SDL_SRCALPHA = 0,
SDL_NOFRAME = SDL_WINDOW_BORDERLESS,
SDL_GL_SWAP_CONTROL = 0,
TIMER_RESOLUTION = 0
} PygameVideoFlags;
/* the wheel button constants were removed from SDL 2 */
typedef enum {
PGM_BUTTON_LEFT = SDL_BUTTON_LEFT,
PGM_BUTTON_RIGHT = SDL_BUTTON_RIGHT,
PGM_BUTTON_MIDDLE = SDL_BUTTON_MIDDLE,
PGM_BUTTON_WHEELUP = 4,
PGM_BUTTON_WHEELDOWN = 5,
PGM_BUTTON_X1 = SDL_BUTTON_X1 + 2,
PGM_BUTTON_X2 = SDL_BUTTON_X2 + 2,
PGM_BUTTON_KEEP = 0x80
} PygameMouseFlags;
typedef enum {
/* Any SDL_* events here are for backward compatibility. */
SDL_NOEVENT = 0,
SDL_ACTIVEEVENT = SDL_USEREVENT,
SDL_VIDEORESIZE,
SDL_VIDEOEXPOSE,
PGE_MIDIIN,
PGE_MIDIOUT,
PGE_KEYREPEAT, /* Special internal pygame event, for managing key-presses
*/
/* DO NOT CHANGE THE ORDER OF EVENTS HERE */
PGE_WINDOWSHOWN,
PGE_WINDOWHIDDEN,
PGE_WINDOWEXPOSED,
PGE_WINDOWMOVED,
PGE_WINDOWRESIZED,
PGE_WINDOWSIZECHANGED,
PGE_WINDOWMINIMIZED,
PGE_WINDOWMAXIMIZED,
PGE_WINDOWRESTORED,
PGE_WINDOWENTER,
PGE_WINDOWLEAVE,
PGE_WINDOWFOCUSGAINED,
PGE_WINDOWFOCUSLOST,
PGE_WINDOWCLOSE,
PGE_WINDOWTAKEFOCUS,
PGE_WINDOWHITTEST,
PGE_WINDOWICCPROFCHANGED,
PGE_WINDOWDISPLAYCHANGED,
/* Here we define PGPOST_* events, events that act as a one-to-one
* proxy for SDL events (and some extra events too!), the proxy is used
* internally when pygame users use event.post()
*
* At a first glance, these may look redundant, but they are really
* important, especially with event blocking. If proxy events are
* not there, blocked events dont make it to our event filter, and
* that can break a lot of stuff.
*
* IMPORTANT NOTE: Do not post events directly with these proxy types,
* use the appropriate functions from event.c, that handle these proxy
* events for you.
* Proxy events are for internal use only */
PGPOST_EVENTBEGIN, /* mark start of proxy-events */
PGPOST_ACTIVEEVENT = PGPOST_EVENTBEGIN,
PGPOST_APP_TERMINATING,
PGPOST_APP_LOWMEMORY,
PGPOST_APP_WILLENTERBACKGROUND,
PGPOST_APP_DIDENTERBACKGROUND,
PGPOST_APP_WILLENTERFOREGROUND,
PGPOST_APP_DIDENTERFOREGROUND,
PGPOST_AUDIODEVICEADDED,
PGPOST_AUDIODEVICEREMOVED,
PGPOST_CLIPBOARDUPDATE,
PGPOST_CONTROLLERAXISMOTION,
PGPOST_CONTROLLERBUTTONDOWN,
PGPOST_CONTROLLERBUTTONUP,
PGPOST_CONTROLLERDEVICEADDED,
PGPOST_CONTROLLERDEVICEREMOVED,
PGPOST_CONTROLLERDEVICEREMAPPED,
PGPOST_CONTROLLERTOUCHPADDOWN,
PGPOST_CONTROLLERTOUCHPADMOTION,
PGPOST_CONTROLLERTOUCHPADUP,
PGPOST_CONTROLLERSENSORUPDATE,
PGPOST_DOLLARGESTURE,
PGPOST_DOLLARRECORD,
PGPOST_DROPFILE,
PGPOST_DROPTEXT,
PGPOST_DROPBEGIN,
PGPOST_DROPCOMPLETE,
PGPOST_FINGERMOTION,
PGPOST_FINGERDOWN,
PGPOST_FINGERUP,
PGPOST_KEYDOWN,
PGPOST_KEYMAPCHANGED,
PGPOST_KEYUP,
PGPOST_JOYAXISMOTION,
PGPOST_JOYBALLMOTION,
PGPOST_JOYHATMOTION,
PGPOST_JOYBUTTONDOWN,
PGPOST_JOYBUTTONUP,
PGPOST_JOYDEVICEADDED,
PGPOST_JOYDEVICEREMOVED,
PGPOST_LOCALECHANGED,
PGPOST_MIDIIN,
PGPOST_MIDIOUT,
PGPOST_MOUSEMOTION,
PGPOST_MOUSEBUTTONDOWN,
PGPOST_MOUSEBUTTONUP,
PGPOST_MOUSEWHEEL,
PGPOST_MULTIGESTURE,
PGPOST_NOEVENT,
PGPOST_QUIT,
PGPOST_RENDER_TARGETS_RESET,
PGPOST_RENDER_DEVICE_RESET,
PGPOST_SYSWMEVENT,
PGPOST_TEXTEDITING,
PGPOST_TEXTINPUT,
PGPOST_VIDEORESIZE,
PGPOST_VIDEOEXPOSE,
PGPOST_WINDOWSHOWN,
PGPOST_WINDOWHIDDEN,
PGPOST_WINDOWEXPOSED,
PGPOST_WINDOWMOVED,
PGPOST_WINDOWRESIZED,
PGPOST_WINDOWSIZECHANGED,
PGPOST_WINDOWMINIMIZED,
PGPOST_WINDOWMAXIMIZED,
PGPOST_WINDOWRESTORED,
PGPOST_WINDOWENTER,
PGPOST_WINDOWLEAVE,
PGPOST_WINDOWFOCUSGAINED,
PGPOST_WINDOWFOCUSLOST,
PGPOST_WINDOWCLOSE,
PGPOST_WINDOWTAKEFOCUS,
PGPOST_WINDOWHITTEST,
PGPOST_WINDOWICCPROFCHANGED,
PGPOST_WINDOWDISPLAYCHANGED,
PGE_USEREVENT, /* this event must stay in this position only */
PG_NUMEVENTS =
SDL_LASTEVENT /* Not an event. Indicates end of user events. */
} PygameEventCode;
/* SDL1 ACTIVEEVENT state attribute can take the following values */
/* These constant values are directly picked from SDL1 source */
#define SDL_APPMOUSEFOCUS 0x01
#define SDL_APPINPUTFOCUS 0x02
#define SDL_APPACTIVE 0x04
/* Surface flags: based on SDL 1.2 flags */
typedef enum {
PGS_SWSURFACE = 0x00000000,
PGS_HWSURFACE = 0x00000001,
PGS_ASYNCBLIT = 0x00000004,
PGS_ANYFORMAT = 0x10000000,
PGS_HWPALETTE = 0x20000000,
PGS_DOUBLEBUF = 0x40000000,
PGS_FULLSCREEN = 0x80000000,
PGS_SCALED = 0x00000200,
PGS_OPENGL = 0x00000002,
PGS_OPENGLBLIT = 0x0000000A,
PGS_RESIZABLE = 0x00000010,
PGS_NOFRAME = 0x00000020,
PGS_SHOWN = 0x00000040, /* Added from SDL 2 */
PGS_HIDDEN = 0x00000080, /* Added from SDL 2 */
PGS_HWACCEL = 0x00000100,
PGS_SRCCOLORKEY = 0x00001000,
PGS_RLEACCELOK = 0x00002000,
PGS_RLEACCEL = 0x00004000,
PGS_SRCALPHA = 0x00010000,
PGS_PREALLOC = 0x01000000
} PygameSurfaceFlags;
// TODO Implement check below in a way that does not break CI
/* New buffer protocol (PEP 3118) implemented on all supported Py versions.
#if !defined(Py_TPFLAGS_HAVE_NEWBUFFER)
#error No support for PEP 3118/Py_TPFLAGS_HAVE_NEWBUFFER. Please use a
supported Python version. #endif */
#define RAISE(x, y) (PyErr_SetString((x), (y)), NULL)
#define DEL_ATTR_NOT_SUPPORTED_CHECK(name, value) \
do { \
if (!value) { \
PyErr_Format(PyExc_AttributeError, "Cannot delete attribute %s", \
name); \
return -1; \
} \
} while (0)
#define DEL_ATTR_NOT_SUPPORTED_CHECK_NO_NAME(value) \
do { \
if (!value) { \
PyErr_SetString(PyExc_AttributeError, "Cannot delete attribute"); \
return -1; \
} \
} while (0)
/*
* Initialization checks
*/
#define VIDEO_INIT_CHECK() \
if (!SDL_WasInit(SDL_INIT_VIDEO)) \
return RAISE(pgExc_SDLError, "video system not initialized")
#define JOYSTICK_INIT_CHECK() \
if (!SDL_WasInit(SDL_INIT_JOYSTICK)) \
return RAISE(pgExc_SDLError, "joystick system not initialized")
/* thread check */
#ifdef WITH_THREAD
#define PG_CHECK_THREADS() (1)
#else /* ~WITH_THREAD */
#define PG_CHECK_THREADS() \
(RAISE(PyExc_NotImplementedError, "Python built without thread support"))
#endif /* ~WITH_THREAD */
#define PyType_Init(x) (((x).ob_type) = &PyType_Type)
/* CPython 3.6 had initial and undocumented FASTCALL support, but we play it
* safe by not relying on implementation details */
#if PY_VERSION_HEX < 0x03070000
/* Macro for naming a pygame fastcall wrapper function */
#define PG_FASTCALL_NAME(func) _##func##_fastcall_wrap
/* used to forward declare compat functions */
#define PG_DECLARE_FASTCALL_FUNC(func, self_type) \
static PyObject *PG_FASTCALL_NAME(func)(self_type * self, PyObject * args)
/* Using this macro on a function defined with the FASTCALL calling convention
* adds a wrapper definition that uses regular python VARARGS convention.
* Since it is guaranteed that the 'args' object is a tuple, we can directly
* call PySequence_Fast_ITEMS and PyTuple_GET_SIZE on it (which are macros that
* assume the same, and don't do error checking) */
#define PG_WRAP_FASTCALL_FUNC(func, self_type) \
PG_DECLARE_FASTCALL_FUNC(func, self_type) \
{ \
return func(self, (PyObject *const *)PySequence_Fast_ITEMS(args), \
PyTuple_GET_SIZE(args)); \
}
#define PG_FASTCALL METH_VARARGS
#else /* PY_VERSION_HEX >= 0x03070000 */
/* compat macros are no-op on python versions that support fastcall */
#define PG_FASTCALL_NAME(func) func
#define PG_DECLARE_FASTCALL_FUNC(func, self_type)
#define PG_WRAP_FASTCALL_FUNC(func, self_type)
#define PG_FASTCALL METH_FASTCALL
#endif /* PY_VERSION_HEX >= 0x03070000 */
/*
* event module internals
*/
struct pgEventObject {
PyObject_HEAD int type;
PyObject *dict;
};
/*
* surflock module internals
*/
typedef struct {
PyObject_HEAD PyObject *surface;
PyObject *lockobj;
PyObject *weakrefs;
} pgLifetimeLockObject;
/*
* surface module internals
*/
struct pgSubSurface_Data {
PyObject *owner;
int pixeloffset;
int offsetx, offsety;
};
/*
* color module internals
*/
struct pgColorObject {
PyObject_HEAD Uint8 data[4];
Uint8 len;
};
/*
* include public API
*/
#include "include/_pygame.h"
/* Slot counts.
* Remember to keep these constants up to date.
*/
#define PYGAMEAPI_RECT_NUMSLOTS 5
#define PYGAMEAPI_JOYSTICK_NUMSLOTS 2
#define PYGAMEAPI_DISPLAY_NUMSLOTS 2
#define PYGAMEAPI_SURFACE_NUMSLOTS 4
#define PYGAMEAPI_SURFLOCK_NUMSLOTS 8
#define PYGAMEAPI_RWOBJECT_NUMSLOTS 6
#define PYGAMEAPI_PIXELARRAY_NUMSLOTS 2
#define PYGAMEAPI_COLOR_NUMSLOTS 5
#define PYGAMEAPI_MATH_NUMSLOTS 2
#define PYGAMEAPI_BASE_NUMSLOTS 27
#define PYGAMEAPI_EVENT_NUMSLOTS 6
#endif /* _PYGAME_INTERNAL_H */

View file

@ -0,0 +1,30 @@
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
Copyright (C) 2007 Marcus von Appen
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
#ifndef _SURFACE_H
#define _SURFACE_H
#include "_pygame.h"
#include "surface.h"
#endif

View file

@ -0,0 +1,218 @@
#ifndef CAMERA_H
#define CAMERA_H
/*
pygame - Python Game Library
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "pygame.h"
#include "pgcompat.h"
#include "doc/camera_doc.h"
#if defined(__unix__)
#include <structmember.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <fcntl.h> /* low-level i/o */
#include <unistd.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
/* on freebsd there is no asm/types */
#ifdef __linux__
#include <asm/types.h> /* for videodev2.h */
#include <linux/videodev2.h>
#endif
/* on openbsd and netbsd we need to include videoio.h */
#if defined(__OpenBSD__) || defined(__NetBSD__)
#include <sys/videoio.h>
#endif
#ifdef __FreeBSD__
#include <linux/videodev2.h>
#endif
#endif /* defined(__unix__) */
#if defined(__WIN32__)
#ifdef __MINGW32__
#undef WINVER
/** _WIN32_WINNT_WINBLUE sets minimum platform SDK to Windows 8.1. */
#define WINVER _WIN32_WINNT_WINBLUE
#endif
#include <mfapi.h>
#include <mfobjects.h>
#include <mfidl.h>
#include <mfreadwrite.h>
#include <combaseapi.h>
#include <mftransform.h>
#endif
/* some constants used which are not defined on non-v4l machines. */
#ifndef V4L2_PIX_FMT_RGB24
#define V4L2_PIX_FMT_RGB24 'RGB3'
#endif
#ifndef V4L2_PIX_FMT_RGB444
#define V4L2_PIX_FMT_RGB444 'R444'
#endif
#ifndef V4L2_PIX_FMT_YUYV
#define V4L2_PIX_FMT_YUYV 'YUYV'
#endif
#ifndef V4L2_PIX_FMT_XBGR32
#define V4L2_PIX_FMT_XBGR32 'XR24'
#endif
#define CLEAR(x) memset(&(x), 0, sizeof(x))
#define SAT(c) \
if (c & (~255)) { \
if (c < 0) \
c = 0; \
else \
c = 255; \
}
#define SAT2(c) ((c) & (~255) ? ((c) < 0 ? 0 : 255) : (c))
#define DEFAULT_WIDTH 640
#define DEFAULT_HEIGHT 480
#define RGB_OUT 1
#define YUV_OUT 2
#define HSV_OUT 4
#define CAM_V4L \
1 /* deprecated. the incomplete support in pygame was removed */
#define CAM_V4L2 2
struct buffer {
void *start;
size_t length;
};
#if defined(__unix__)
typedef struct pgCameraObject {
PyObject_HEAD char *device_name;
int camera_type;
unsigned long pixelformat;
unsigned int color_out;
struct buffer *buffers;
unsigned int n_buffers;
int width;
int height;
int size;
int hflip;
int vflip;
int brightness;
int fd;
} pgCameraObject;
#else
/* generic definition.
*/
typedef struct pgCameraObject {
PyObject_HEAD char *device_name;
int camera_type;
unsigned long pixelformat;
unsigned int color_out;
struct buffer *buffers;
unsigned int n_buffers;
int width;
int height;
int size;
int hflip;
int vflip;
int brightness;
int fd;
} pgCameraObject;
#endif
/* internal functions for colorspace conversion */
void
colorspace(SDL_Surface *src, SDL_Surface *dst, int cspace);
void
rgb24_to_rgb(const void *src, void *dst, int length, SDL_PixelFormat *format);
void
bgr32_to_rgb(const void *src, void *dst, int length, SDL_PixelFormat *format);
void
rgb444_to_rgb(const void *src, void *dst, int length, SDL_PixelFormat *format);
void
rgb_to_yuv(const void *src, void *dst, int length, unsigned long source,
SDL_PixelFormat *format);
void
rgb_to_hsv(const void *src, void *dst, int length, unsigned long source,
SDL_PixelFormat *format);
void
yuyv_to_rgb(const void *src, void *dst, int length, SDL_PixelFormat *format);
void
yuyv_to_yuv(const void *src, void *dst, int length, SDL_PixelFormat *format);
void
uyvy_to_rgb(const void *src, void *dst, int length, SDL_PixelFormat *format);
void
uyvy_to_yuv(const void *src, void *dst, int length, SDL_PixelFormat *format);
void
sbggr8_to_rgb(const void *src, void *dst, int width, int height,
SDL_PixelFormat *format);
void
yuv420_to_rgb(const void *src, void *dst, int width, int height,
SDL_PixelFormat *format);
void
yuv420_to_yuv(const void *src, void *dst, int width, int height,
SDL_PixelFormat *format);
#if defined(__unix__)
/* internal functions specific to v4l2 */
char **
v4l2_list_cameras(int *num_devices);
int
v4l2_get_control(int fd, int id, int *value);
int
v4l2_set_control(int fd, int id, int value);
PyObject *
v4l2_read_raw(pgCameraObject *self);
int
v4l2_xioctl(int fd, int request, void *arg);
int
v4l2_process_image(pgCameraObject *self, const void *image, int buffer_size,
SDL_Surface *surf);
int
v4l2_query_buffer(pgCameraObject *self);
int
v4l2_read_frame(pgCameraObject *self, SDL_Surface *surf, int *errno_code);
int
v4l2_stop_capturing(pgCameraObject *self);
int
v4l2_start_capturing(pgCameraObject *self);
int
v4l2_uninit_device(pgCameraObject *self);
int
v4l2_init_mmap(pgCameraObject *self);
int
v4l2_init_device(pgCameraObject *self);
int
v4l2_close_device(pgCameraObject *self);
int
v4l2_open_device(pgCameraObject *self);
#endif
#endif /* !CAMERA_H */

View file

@ -0,0 +1,15 @@
#ifndef PGFONT_INTERNAL_H
#define PGFONT_INTERNAL_H
#include <SDL_ttf.h>
/* test font initialization */
#define FONT_INIT_CHECK() \
if (!(*(int *)PyFONT_C_API[2])) \
return RAISE(pgExc_SDLError, "font system not initialized")
#include "include/pygame_font.h"
#define PYGAMEAPI_FONT_NUMSLOTS 3
#endif /* ~PGFONT_INTERNAL_H */

View file

@ -0,0 +1,114 @@
/*
pygame - Python Game Library
Copyright (C) 2009 Vicent Marti
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _PYGAME_FREETYPE_INTERNAL_H_
#define _PYGAME_FREETYPE_INTERNAL_H_
#include "pgcompat.h"
#include "pgplatform.h"
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_CACHE_H
#include FT_XFREE86_H
#include FT_TRIGONOMETRY_H
/**********************************************************
* Global module constants
**********************************************************/
/* Render styles */
#define FT_STYLE_NORMAL 0x00
#define FT_STYLE_STRONG 0x01
#define FT_STYLE_OBLIQUE 0x02
#define FT_STYLE_UNDERLINE 0x04
#define FT_STYLE_WIDE 0x08
#define FT_STYLE_DEFAULT 0xFF
/* Bounding box modes */
#define FT_BBOX_EXACT FT_GLYPH_BBOX_SUBPIXELS
#define FT_BBOX_EXACT_GRIDFIT FT_GLYPH_BBOX_GRIDFIT
#define FT_BBOX_PIXEL FT_GLYPH_BBOX_TRUNCATE
#define FT_BBOX_PIXEL_GRIDFIT FT_GLYPH_BBOX_PIXELS
/* Rendering flags */
#define FT_RFLAG_NONE (0)
#define FT_RFLAG_ANTIALIAS (1 << 0)
#define FT_RFLAG_AUTOHINT (1 << 1)
#define FT_RFLAG_VERTICAL (1 << 2)
#define FT_RFLAG_HINTED (1 << 3)
#define FT_RFLAG_KERNING (1 << 4)
#define FT_RFLAG_TRANSFORM (1 << 5)
#define FT_RFLAG_PAD (1 << 6)
#define FT_RFLAG_ORIGIN (1 << 7)
#define FT_RFLAG_UCS4 (1 << 8)
#define FT_RFLAG_USE_BITMAP_STRIKES (1 << 9)
#define FT_RFLAG_DEFAULTS \
(FT_RFLAG_HINTED | FT_RFLAG_USE_BITMAP_STRIKES | FT_RFLAG_ANTIALIAS)
#define FT_RENDER_NEWBYTEARRAY 0x0
#define FT_RENDER_NEWSURFACE 0x1
#define FT_RENDER_EXISTINGSURFACE 0x2
/**********************************************************
* Global module types
**********************************************************/
typedef struct _scale_s {
FT_UInt x, y;
} Scale_t;
typedef FT_Angle Angle_t;
struct fontinternals_;
struct freetypeinstance_;
typedef struct {
FT_Long font_index;
FT_Open_Args open_args;
} pgFontId;
typedef struct {
PyObject_HEAD pgFontId id;
PyObject *path;
int is_scalable;
int is_bg_col_set;
Scale_t face_size;
FT_Int16 style;
FT_Int16 render_flags;
double strength;
double underline_adjustment;
FT_UInt resolution;
Angle_t rotation;
FT_Matrix transform;
FT_Byte fgcolor[4];
FT_Byte bgcolor[4];
struct freetypeinstance_ *freetype; /* Personal reference */
struct fontinternals_ *_internals;
} pgFontObject;
#define pgFont_IS_ALIVE(o) (((pgFontObject *)(o))->_internals != 0)
/* import public API */
#include "include/pygame_freetype.h"
#define PYGAMEAPI_FREETYPE_NUMSLOTS 2
#endif /* ~_PYGAME_FREETYPE_INTERNAL_H_ */

View file

@ -0,0 +1,949 @@
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
#ifndef _PYGAME_H
#define _PYGAME_H
/** This header file includes all the definitions for the
** base pygame extensions. This header only requires
** Python includes (and SDL.h for functions that use SDL types).
** The reason for functions prototyped with #define's is
** to allow for maximum Python portability. It also uses
** Python as the runtime linker, which allows for late binding.
'' For more information on this style of development, read
** the Python docs on this subject.
** http://www.python.org/doc/current/ext/using-cobjects.html
**
** If using this to build your own derived extensions,
** you'll see that the functions available here are mainly
** used to help convert between python objects and SDL objects.
** Since this library doesn't add a lot of functionality to
** the SDL library, it doesn't need to offer a lot either.
**
** When initializing your extension module, you must manually
** import the modules you want to use. (this is the part about
** using python as the runtime linker). Each module has its
** own import_xxx() routine. You need to perform this import
** after you have initialized your own module, and before
** you call any routines from that module. Since every module
** in pygame does this, there are plenty of examples.
**
** The base module does include some useful conversion routines
** that you are free to use in your own extension.
**/
#include "pgplatform.h"
#include <Python.h>
/* version macros (defined since version 1.9.5) */
#define PG_MAJOR_VERSION 2
#define PG_MINOR_VERSION 6
#define PG_PATCH_VERSION 0
#define PG_VERSIONNUM(MAJOR, MINOR, PATCH) \
(1000 * (MAJOR) + 100 * (MINOR) + (PATCH))
#define PG_VERSION_ATLEAST(MAJOR, MINOR, PATCH) \
(PG_VERSIONNUM(PG_MAJOR_VERSION, PG_MINOR_VERSION, PG_PATCH_VERSION) >= \
PG_VERSIONNUM(MAJOR, MINOR, PATCH))
#include "pgcompat.h"
/* Flag indicating a pg_buffer; used for assertions within callbacks */
#ifndef NDEBUG
#define PyBUF_PYGAME 0x4000
#endif
#define PyBUF_HAS_FLAG(f, F) (((f) & (F)) == (F))
/* Array information exchange struct C type; inherits from Py_buffer
*
* Pygame uses its own Py_buffer derived C struct as an internal representation
* of an imported array buffer. The extended Py_buffer allows for a
* per-instance release callback,
*/
typedef void (*pybuffer_releaseproc)(Py_buffer *);
typedef struct pg_bufferinfo_s {
Py_buffer view;
PyObject *consumer; /* Input: Borrowed reference */
pybuffer_releaseproc release_buffer;
} pg_buffer;
#include "pgimport.h"
/*
* BASE module
*/
#ifndef PYGAMEAPI_BASE_INTERNAL
#define pgExc_SDLError ((PyObject *)PYGAMEAPI_GET_SLOT(base, 0))
#define pg_RegisterQuit \
(*(void (*)(void (*)(void)))PYGAMEAPI_GET_SLOT(base, 1))
/**
* \brief Convert number like object *obj* to C int and in *val*.
*
* \param obj The Python object to convert.
* \param val A pointer to the C integer to store the result.
* \returns 1 if the conversion was successful, 0 otherwise.
*
* \note This function will clear any Python errors.
* \note This function will convert floats to integers.
*/
#define pg_IntFromObj \
(*(int (*)(PyObject *, int *))PYGAMEAPI_GET_SLOT(base, 2))
/**
* \brief Convert number like object at position *i* in sequence *obj*
* to C int and place in argument *val*.
*
* \param obj The Python object to convert.
* \param i The index of the object to convert.
* \param val A pointer to the C integer to store the result.
* \returns 1 if the conversion was successful, 0 otherwise.
*
* \note This function will clear any Python errors.
* \note This function will convert floats to integers.
*/
#define pg_IntFromObjIndex \
(*(int (*)(PyObject *, int, int *))PYGAMEAPI_GET_SLOT(base, 3))
/**
* \brief Convert the two number like objects in length 2 sequence *obj* to C
* int and place in arguments *val1* and *val2*.
*
* \param obj The Python two element sequence object to convert.
* \param val A pointer to the C integer to store the result.
* \param val2 A pointer to the C integer to store the result.
* \returns 1 if the conversion was successful, 0 otherwise.
*
* \note This function will clear any Python errors.
* \note This function will convert floats to integers.
*/
#define pg_TwoIntsFromObj \
(*(int (*)(PyObject *, int *, int *))PYGAMEAPI_GET_SLOT(base, 4))
/**
* \brief Convert number like object *obj* to C float and in *val*.
*
* \param obj The Python object to convert.
* \param val A pointer to the C float to store the result.
* \returns 1 if the conversion was successful, 0 otherwise.
*
* \note This function will clear any Python errors.
*/
#define pg_FloatFromObj \
(*(int (*)(PyObject *, float *))PYGAMEAPI_GET_SLOT(base, 5))
/**
* \brief Convert number like object at position *i* in sequence *obj* to C
* float and place in argument *val*.
*
* \param obj The Python object to convert.
* \param i The index of the object to convert.
* \param val A pointer to the C float to store the result.
* \returns 1 if the conversion was successful, 0 otherwise.
*
* \note This function will clear any Python errors.
*/
#define pg_FloatFromObjIndex \
(*(int (*)(PyObject *, int, float *))PYGAMEAPI_GET_SLOT(base, 6))
/**
* \brief Convert the two number like objects in length 2 sequence *obj* to C
* float and place in arguments *val1* and *val2*.
*
* \param obj The Python two element sequence object to convert.
* \param val A pointer to the C float to store the result.
* \param val2 A pointer to the C float to store the result.
* \returns 1 if the conversion was successful, 0 otherwise.
*
* \note This function will clear any Python errors.
*/
#define pg_TwoFloatsFromObj \
(*(int (*)(PyObject *, float *, float *))PYGAMEAPI_GET_SLOT(base, 7))
/**
* \brief Convert number like object *obj* to C Uint32 and in *val*.
*
* \param obj The Python object to convert.
* \param val A pointer to the C int to store the result.
* \returns 1 if the conversion was successful, 0 otherwise.
*/
#define pg_UintFromObj \
(*(int (*)(PyObject *, Uint32 *))PYGAMEAPI_GET_SLOT(base, 8))
/**
* \brief Convert number like object at position *i* in sequence *obj* to C
* Uint32 and place in argument *val*.
*
* \param obj The Python object to convert.
* \param i The index of the object to convert.
* \param val A pointer to the C int to store the result.
* \returns 1 if the conversion was successful, 0 otherwise.
*/
#define pg_UintFromObjIndex \
(*(int (*)(PyObject *, int, Uint32 *))PYGAMEAPI_GET_SLOT(base, 9))
/**
* \brief Initialize all of the pygame modules.
* \returns 1 on success, 0 on failure with PyErr set.
*/
#define pg_mod_autoinit (*(int (*)(const char *))PYGAMEAPI_GET_SLOT(base, 10))
/**
* \brief Quit all of the pygame modules.
*/
#define pg_mod_autoquit (*(void (*)(const char *))PYGAMEAPI_GET_SLOT(base, 11))
/**
* \brief Convert the color represented by object *obj* into a red, green,
* blue, alpha length 4 C array *RGBA*.
*
* The object must be a length 3 or 4 sequence of numbers having values between
* 0 and 255 inclusive. For a length 3 sequence an alpha value of 255 is
* assumed.
*
* \param obj The Python object to convert.
* \param RGBA A pointer to the C array to store the result.
* \returns 1 if the conversion was successful, 0 otherwise.
*/
#define pg_RGBAFromObj \
(*(int (*)(PyObject *, Uint8 *))PYGAMEAPI_GET_SLOT(base, 12))
/**
* \brief Given a Py_buffer, return a python dictionary representing the array
* interface.
*
* \param view_p A pointer to the Py_buffer to convert to a dictionary.
*
* \returns A Python dictionary representing the array interface of the object.
*/
#define pgBuffer_AsArrayInterface \
(*(PyObject * (*)(Py_buffer *)) PYGAMEAPI_GET_SLOT(base, 13))
/**
* \brief Given a Py_buffer, return a python capsule representing the array
* interface.
*
* \param view_p A pointer to the Py_buffer to convert to a capsule.
*
* \returns A Python capsule representing the array interface of the object.
*/
#define pgBuffer_AsArrayStruct \
(*(PyObject * (*)(Py_buffer *)) PYGAMEAPI_GET_SLOT(base, 14))
/**
* \brief Get a buffer object from a given Python object.
*
* \param obj The Python object to get the buffer from.
* \param pg_view_p A pointer to a pg_buffer struct to store the buffer in.
* \param flags The desired buffer access mode.
*
* \returns 0 on success, -1 on failure.
*
* \note This function attempts to get a buffer object from a given Python
* object. If the object supports the buffer protocol, it will be used to
* create the buffer. If not, it will try to get an array interface or
* dictionary representation of the object and use that to create the buffer.
* If none of these methods work, it will raise a ValueError.
*
*/
#define pgObject_GetBuffer \
(*(int (*)(PyObject *, pg_buffer *, int))PYGAMEAPI_GET_SLOT(base, 15))
/**
* \brief Release a pg_buffer object.
*
* \param pg_view_p The pg_buffer object to release.
*
* \note This function releases a pg_buffer object.
* \note some calls to this function expect this function to not clear
* previously set errors.
*/
#define pgBuffer_Release (*(void (*)(pg_buffer *))PYGAMEAPI_GET_SLOT(base, 16))
/**
* \brief Write the array interface dictionary buffer description *dict* into a
* Pygame buffer description struct *pg_view_p*.
*
* \param pg_view_p The Pygame buffer description struct to write into.
* \param dict The array interface dictionary to read from.
* \param flags The PyBUF flags describing the view type requested.
*
* \returns 0 on success, or -1 on failure.
*/
#define pgDict_AsBuffer \
(*(int (*)(pg_buffer *, PyObject *, int))PYGAMEAPI_GET_SLOT(base, 17))
#define pgExc_BufferError ((PyObject *)PYGAMEAPI_GET_SLOT(base, 18))
/**
* \brief Get the default SDL window created by a pygame.display.set_mode()
* call, or *NULL*.
*
* \return The default window, or *NULL* if no window has been created.
*/
#define pg_GetDefaultWindow \
(*(SDL_Window * (*)(void)) PYGAMEAPI_GET_SLOT(base, 19))
/**
* \brief Set the default SDL window created by a pygame.display.set_mode()
* call. The previous window, if any, is destroyed. Argument *win* may be
* *NULL*. This function is called by pygame.display.set_mode().
*
* \param win The new default window. May be NULL.
*/
#define pg_SetDefaultWindow \
(*(void (*)(SDL_Window *))PYGAMEAPI_GET_SLOT(base, 20))
/**
* \brief Return a borrowed reference to the Pygame default window display
* surface, or *NULL* if no default window is open.
*
* \return The default renderer, or *NULL* if no renderer has been created.
*/
#define pg_GetDefaultWindowSurface \
(*(pgSurfaceObject * (*)(void)) PYGAMEAPI_GET_SLOT(base, 21))
/**
* \brief Set the Pygame default window display surface. The previous
* surface, if any, is destroyed. Argument *screen* may be *NULL*. This
* function is called by pygame.display.set_mode().
*
* \param screen The new default window display surface. May be NULL.
*/
#define pg_SetDefaultWindowSurface \
(*(void (*)(pgSurfaceObject *))PYGAMEAPI_GET_SLOT(base, 22))
/**
* \returns NULL if the environment variable PYGAME_BLEND_ALPHA_SDL2 is not
* set, otherwise returns a pointer to the environment variable.
*/
#define pg_EnvShouldBlendAlphaSDL2 \
(*(char *(*)(void))PYGAMEAPI_GET_SLOT(base, 23))
/**
* \brief Convert number like object *obj* to C double and in *val*.
*
* \param obj The Python object to convert.
* \param val A pointer to the C double to store the result.
* \returns 1 if the conversion was successful, 0 otherwise.
*
* \note This function will clear any Python errors.
*/
#define pg_DoubleFromObj \
(*(int (*)(PyObject *, double *))PYGAMEAPI_GET_SLOT(base, 24))
/**
* \brief Convert number like object at position *i* in sequence *obj* to C
* double and place in argument *val*.
*
* \param obj The Python object to convert.
* \param i The index of the object to convert.
* \param val A pointer to the C double to store the result.
* \returns 1 if the conversion was successful, 0 otherwise.
*
* \note This function will clear any Python errors.
*/
#define pg_DoubleFromObjIndex \
(*(int (*)(PyObject *, int, double *))PYGAMEAPI_GET_SLOT(base, 25))
/**
* \brief Convert the two number like objects in length 2 sequence *obj* to C
* double and place in arguments *val1* and *val2*.
*
* \param obj The Python two element sequence object to convert.
* \param val A pointer to the C double to store the result.
* \param val2 A pointer to the C double to store the result.
* \returns 1 if the conversion was successful, 0 otherwise.
*/
#define pg_TwoDoublesFromObj \
(*(int (*)(PyObject *, double *, double *))PYGAMEAPI_GET_SLOT(base, 26))
#define import_pygame_base() IMPORT_PYGAME_MODULE(base)
#endif /* ~PYGAMEAPI_BASE_INTERNAL */
typedef struct {
/**
* \brief The SDL rect wrapped by this object.
*/
PyObject_HEAD SDL_Rect r;
/**
* \brief A list of weak references to this rect.
*/
PyObject *weakreflist;
} pgRectObject;
/**
* \brief Convert a pgRectObject to an SDL_Rect.
*
* \param obj A pgRectObject instance.
* \returns the SDL_Rect field of *obj*, a pgRect_Type instance.
*
* \note SDL_Rect pgRect_AsRect(PyObject *obj)
*/
#define pgRect_AsRect(x) (((pgRectObject *)x)->r)
#ifndef PYGAMEAPI_RECT_INTERNAL
/**
* \brief The Pygame rectangle object type pygame.Rect.
*/
#define pgRect_Type (*(PyTypeObject *)PYGAMEAPI_GET_SLOT(rect, 0))
/**
* \brief Check if *obj* is a `pygame.Rect` instance.
*
* \returns true if *obj* is a `pygame.Rect` instance
*/
#define pgRect_Check(obj) ((obj)->ob_type == &pgRect_Type)
/**
* \brief Create a new `pygame.Rect` instance.
*
* \param r A pointer to an SDL_Rect struct.
* \returns a new `pygame.Rect` object for the SDL_Rect *r*.
* Returns *NULL* on error.
*
* \note PyObject* pgRect_New(SDL_Rect *r)
*/
#define pgRect_New (*(PyObject * (*)(SDL_Rect *)) PYGAMEAPI_GET_SLOT(rect, 1))
/**
* \brief Create a new `pygame.Rect` instance from x, y, w, h.
*
* \param x The x coordinate of the rectangle.
* \param y The y coordinate of the rectangle.
* \param w The width of the rectangle.
* \param h The height of the rectangle.
* \returns a new `pygame.Rect` object. Returns *NULL* on error.
*
* \note PyObject* pgRect_New4(int x, int y, int w, int h)
*/
#define pgRect_New4 \
(*(PyObject * (*)(int, int, int, int)) PYGAMEAPI_GET_SLOT(rect, 2))
/**
* \brief Convert a Python object to a `pygame.Rect` instance.
*
* \param obj A Python object.
* A rectangle can be a length 4 sequence integers (x, y, w, h), or a length 2
* sequence of position (x, y) and size (w, h), or a length 1 tuple containing
* a rectangle representation, or have a method *rect* that returns a
* rectangle.
*
* \param temp A pointer to an SDL_Rect struct to store the result in.
* \returns a pointer to the SDL_Rect field of the `pygame.Rect` instance
* *obj*. Returns *NULL* on error.
*
* \note This function will clear any Python errors.
* \note SDL_Rect* pgRect_FromObject(PyObject *obj, SDL_Rect *temp)
*/
#define pgRect_FromObject \
(*(SDL_Rect * (*)(PyObject *, SDL_Rect *)) PYGAMEAPI_GET_SLOT(rect, 3))
/**
* \brief Normalize a `pygame.Rect` instance. A rect with a negative size
* (negative width and/or height) will be adjusted to have a positive size.
*
* \param rect A pointer to a `pygame.Rect` instance.
* \returns *rect* normalized with positive values only.
*
* \note void pgRect_Normalize(SDL_Rect *rect)
*/
#define pgRect_Normalize (*(void (*)(SDL_Rect *))PYGAMEAPI_GET_SLOT(rect, 4))
#define import_pygame_rect() IMPORT_PYGAME_MODULE(rect)
#endif /* ~PYGAMEAPI_RECT_INTERNAL */
/*
* JOYSTICK module
*/
typedef struct pgJoystickObject {
PyObject_HEAD int id;
SDL_Joystick *joy;
/* Joysticks form an intrusive linked list.
*
* Note that we don't maintain refcounts for these so they are weakrefs
* from the Python side.
*/
struct pgJoystickObject *next;
struct pgJoystickObject *prev;
} pgJoystickObject;
#define pgJoystick_AsID(x) (((pgJoystickObject *)x)->id)
#define pgJoystick_AsSDL(x) (((pgJoystickObject *)x)->joy)
#ifndef PYGAMEAPI_JOYSTICK_INTERNAL
#define pgJoystick_Type (*(PyTypeObject *)PYGAMEAPI_GET_SLOT(joystick, 0))
#define pgJoystick_Check(x) ((x)->ob_type == &pgJoystick_Type)
#define pgJoystick_New (*(PyObject * (*)(int)) PYGAMEAPI_GET_SLOT(joystick, 1))
#define import_pygame_joystick() IMPORT_PYGAME_MODULE(joystick)
#endif
/*
* DISPLAY module
*/
typedef struct {
Uint32 hw_available : 1;
Uint32 wm_available : 1;
Uint32 blit_hw : 1;
Uint32 blit_hw_CC : 1;
Uint32 blit_hw_A : 1;
Uint32 blit_sw : 1;
Uint32 blit_sw_CC : 1;
Uint32 blit_sw_A : 1;
Uint32 blit_fill : 1;
Uint32 video_mem;
SDL_PixelFormat *vfmt;
SDL_PixelFormat vfmt_data;
int current_w;
int current_h;
} pg_VideoInfo;
/**
* A pygame object that wraps an SDL_VideoInfo struct.
* The object returned by `pygame.display.Info()`
*/
typedef struct {
PyObject_HEAD pg_VideoInfo info;
} pgVidInfoObject;
/**
* \brief Convert a pgVidInfoObject to an SDL_VideoInfo.
*
* \note SDL_VideoInfo pgVidInfo_AsVidInfo(PyObject *obj)
*
* \returns the SDL_VideoInfo field of *obj*, a pgVidInfo_Type instance.
* \param obj A pgVidInfo_Type instance.
*
* \note Does not check that *obj* is not `NULL` or an `pgVidInfoObject`
* object.
*/
#define pgVidInfo_AsVidInfo(x) (((pgVidInfoObject *)x)->info)
#ifndef PYGAMEAPI_DISPLAY_INTERNAL
/**
* \brief The pgVidInfoObject object Python type.
* \note pgVideoInfo_Type is used for the `pygame.display.Info()` object.
*/
#define pgVidInfo_Type (*(PyTypeObject *)PYGAMEAPI_GET_SLOT(display, 0))
/**
* \brief Check if *obj* is a pgVidInfoObject.
*
* \returns true if *x* is a `pgVidInfo_Type` instance
* \note Will return false if *x* is a subclass of `pgVidInfo_Type`.
* \note This macro does not check that *x* is not ``NULL``.
* \note int pgVidInfo_Check(PyObject *x)
*/
#define pgVidInfo_Check(x) ((x)->ob_type == &pgVidInfo_Type)
/**
* \brief Create a new pgVidInfoObject.
*
* \param i A pointer to an SDL_VideoInfo struct.
* \returns a new `pgVidInfoObject` object for the SDL_VideoInfo *i*.
*
* \note PyObject* pgVidInfo_New(SDL_VideoInfo *i)
* \note On failure, raise a Python exception and return `NULL`.
*/
#define pgVidInfo_New \
(*(PyObject * (*)(pg_VideoInfo *)) PYGAMEAPI_GET_SLOT(display, 1))
#define import_pygame_display() IMPORT_PYGAME_MODULE(display)
#endif /* ~PYGAMEAPI_DISPLAY_INTERNAL */
/*
* SURFACE module
*/
struct pgSubSurface_Data;
struct SDL_Surface;
/**
* \brief A pygame object that wraps an SDL_Surface. A `pygame.Surface`
* instance.
*/
typedef struct {
PyObject_HEAD struct SDL_Surface *surf;
/**
* \brief If true, the surface will be freed when the python object is
* destroyed.
*/
int owner;
/**
* \brief The subsurface data for this surface (if a subsurface).
*/
struct pgSubSurface_Data *subsurface;
/**
* \brief A list of weak references to this surface.
*/
PyObject *weakreflist;
/**
* \brief A list of locks for this surface.
*/
PyObject *locklist;
/**
* \brief Usually a buffer object which the surface gets its data from.
*/
PyObject *dependency;
} pgSurfaceObject;
/**
* \brief Convert a `pygame.Surface` instance to an SDL_Surface.
*
* \param x A `pygame.Surface` instance.
* \returns the SDL_Surface field of *x*, a `pygame.Surface` instance.
*
* \note SDL_Surface* pgSurface_AsSurface(PyObject *x)
*/
#define pgSurface_AsSurface(x) (((pgSurfaceObject *)x)->surf)
#ifndef PYGAMEAPI_SURFACE_INTERNAL
/**
* \brief The `pygame.Surface` object Python type.
*/
#define pgSurface_Type (*(PyTypeObject *)PYGAMEAPI_GET_SLOT(surface, 0))
/**
* \brief Check if *x* is a `pygame.Surface` instance.
*
* \param x The object to check.
* \returns true if *x* is a `pygame.Surface` instance
*
* \note Will return false if *x* is a subclass of `pygame.Surface`.
* \note This macro does not check that *x* is not ``NULL``.
* \note int pgSurface_Check(PyObject *x)
*/
#define pgSurface_Check(x) \
(PyObject_IsInstance((x), (PyObject *)&pgSurface_Type))
/**
* \brief Create a new `pygame.Surface` instance.
*
* \param s The SDL surface to wrap in a python object.
* \param owner If true, the surface will be freed when the python object is
* destroyed. \returns A new new pygame surface instance for SDL surface *s*.
* Returns *NULL* on error.
*
* \note pgSurfaceObject* pgSurface_New2(SDL_Surface *s, int owner)
*/
#define pgSurface_New2 \
(*(pgSurfaceObject * (*)(SDL_Surface *, int)) \
PYGAMEAPI_GET_SLOT(surface, 1))
/**
* \brief Sets the SDL surface for a `pygame.Surface` instance.
*
* \param self The `pygame.Surface` instance to set the surface for.
* \param s The SDL surface to set.
* \param owner If true, the surface will be freed when the python object is
* destroyed. \returns 0 on success, -1 on failure.
*
* \note int pgSurface_SetSurface(pgSurfaceObject *self, SDL_Surface *s, int
* owner)
*/
#define pgSurface_SetSurface \
(*(int (*)(pgSurfaceObject *, SDL_Surface *, int))PYGAMEAPI_GET_SLOT( \
surface, 3))
/**
* \brief Blit one surface onto another.
*
* \param dstobj The destination surface.
* \param srcobj The source surface.
* \param dstrect The destination rectangle.
* \param srcrect The source rectangle.
* \param the_args The blit flags.
* \return 0 for success, -1 or -2 for error.
*
* \note Is accessible through the C api.
* \note int pgSurface_Blit(PyObject *dstobj, PyObject *srcobj, SDL_Rect
* *dstrect, SDL_Rect *srcrect, int the_args)
*/
#define pgSurface_Blit \
(*(int (*)(pgSurfaceObject *, pgSurfaceObject *, SDL_Rect *, SDL_Rect *, \
int))PYGAMEAPI_GET_SLOT(surface, 2))
#define import_pygame_surface() \
do { \
IMPORT_PYGAME_MODULE(surface); \
if (PyErr_Occurred() != NULL) \
break; \
IMPORT_PYGAME_MODULE(surflock); \
} while (0)
#define pgSurface_New(surface) pgSurface_New2((surface), 1)
#define pgSurface_NewNoOwn(surface) pgSurface_New2((surface), 0)
#endif /* ~PYGAMEAPI_SURFACE_INTERNAL */
/*
* SURFLOCK module
* auto imported/initialized by surface
*/
#ifndef PYGAMEAPI_SURFLOCK_INTERNAL
#define pgLifetimeLock_Type (*(PyTypeObject *)PYGAMEAPI_GET_SLOT(surflock, 0))
#define pgLifetimeLock_Check(x) ((x)->ob_type == &pgLifetimeLock_Type)
#define pgSurface_Prep(x) \
if ((x)->subsurface) \
(*(*(void (*)(pgSurfaceObject *))PYGAMEAPI_GET_SLOT(surflock, 1)))(x)
#define pgSurface_Unprep(x) \
if ((x)->subsurface) \
(*(*(void (*)(pgSurfaceObject *))PYGAMEAPI_GET_SLOT(surflock, 2)))(x)
#define pgSurface_Lock \
(*(int (*)(pgSurfaceObject *))PYGAMEAPI_GET_SLOT(surflock, 3))
#define pgSurface_Unlock \
(*(int (*)(pgSurfaceObject *))PYGAMEAPI_GET_SLOT(surflock, 4))
#define pgSurface_LockBy \
(*(int (*)(pgSurfaceObject *, PyObject *))PYGAMEAPI_GET_SLOT(surflock, 5))
#define pgSurface_UnlockBy \
(*(int (*)(pgSurfaceObject *, PyObject *))PYGAMEAPI_GET_SLOT(surflock, 6))
#define pgSurface_LockLifetime \
(*(PyObject * (*)(PyObject *, PyObject *)) PYGAMEAPI_GET_SLOT(surflock, 7))
#endif
/*
* EVENT module
*/
typedef struct pgEventObject pgEventObject;
#ifndef PYGAMEAPI_EVENT_INTERNAL
#define pgEvent_Type (*(PyTypeObject *)PYGAMEAPI_GET_SLOT(event, 0))
#define pgEvent_Check(x) ((x)->ob_type == &pgEvent_Type)
#define pgEvent_New \
(*(PyObject * (*)(SDL_Event *)) PYGAMEAPI_GET_SLOT(event, 1))
#define pgEvent_New2 \
(*(PyObject * (*)(int, PyObject *)) PYGAMEAPI_GET_SLOT(event, 2))
#define pgEvent_FillUserEvent \
(*(int (*)(pgEventObject *, SDL_Event *))PYGAMEAPI_GET_SLOT(event, 3))
#define pg_EnableKeyRepeat (*(int (*)(int, int))PYGAMEAPI_GET_SLOT(event, 4))
#define pg_GetKeyRepeat (*(void (*)(int *, int *))PYGAMEAPI_GET_SLOT(event, 5))
#define import_pygame_event() IMPORT_PYGAME_MODULE(event)
#endif
/*
* RWOBJECT module
* the rwobject are only needed for C side work, not accessible from python.
*/
#ifndef PYGAMEAPI_RWOBJECT_INTERNAL
#define pgRWops_FromObject \
(*(SDL_RWops * (*)(PyObject *, char **)) PYGAMEAPI_GET_SLOT(rwobject, 0))
#define pgRWops_IsFileObject \
(*(int (*)(SDL_RWops *))PYGAMEAPI_GET_SLOT(rwobject, 1))
#define pg_EncodeFilePath \
(*(PyObject * (*)(PyObject *, PyObject *)) PYGAMEAPI_GET_SLOT(rwobject, 2))
#define pg_EncodeString \
(*(PyObject * (*)(PyObject *, const char *, const char *, PyObject *)) \
PYGAMEAPI_GET_SLOT(rwobject, 3))
#define pgRWops_FromFileObject \
(*(SDL_RWops * (*)(PyObject *)) PYGAMEAPI_GET_SLOT(rwobject, 4))
#define pgRWops_ReleaseObject \
(*(int (*)(SDL_RWops *))PYGAMEAPI_GET_SLOT(rwobject, 5))
#define import_pygame_rwobject() IMPORT_PYGAME_MODULE(rwobject)
#endif
/*
* PixelArray module
*/
#ifndef PYGAMEAPI_PIXELARRAY_INTERNAL
#define PyPixelArray_Type ((PyTypeObject *)PYGAMEAPI_GET_SLOT(pixelarray, 0))
#define PyPixelArray_Check(x) ((x)->ob_type == &PyPixelArray_Type)
#define PyPixelArray_New (*(PyObject * (*)) PYGAMEAPI_GET_SLOT(pixelarray, 1))
#define import_pygame_pixelarray() IMPORT_PYGAME_MODULE(pixelarray)
#endif /* PYGAMEAPI_PIXELARRAY_INTERNAL */
/*
* Color module
*/
typedef struct pgColorObject pgColorObject;
#ifndef PYGAMEAPI_COLOR_INTERNAL
#define pgColor_Type (*(PyObject *)PYGAMEAPI_GET_SLOT(color, 0))
#define pgColor_Check(x) ((x)->ob_type == &pgColor_Type)
#define pgColor_New (*(PyObject * (*)(Uint8 *)) PYGAMEAPI_GET_SLOT(color, 1))
#define pgColor_NewLength \
(*(PyObject * (*)(Uint8 *, Uint8)) PYGAMEAPI_GET_SLOT(color, 3))
#define pg_RGBAFromColorObj \
(*(int (*)(PyObject *, Uint8 *))PYGAMEAPI_GET_SLOT(color, 2))
#define pg_RGBAFromFuzzyColorObj \
(*(int (*)(PyObject *, Uint8 *))PYGAMEAPI_GET_SLOT(color, 4))
#define pgColor_AsArray(x) (((pgColorObject *)x)->data)
#define pgColor_NumComponents(x) (((pgColorObject *)x)->len)
#define import_pygame_color() IMPORT_PYGAME_MODULE(color)
#endif /* PYGAMEAPI_COLOR_INTERNAL */
/*
* Math module
*/
#ifndef PYGAMEAPI_MATH_INTERNAL
#define pgVector2_Check(x) \
((x)->ob_type == (PyTypeObject *)PYGAMEAPI_GET_SLOT(math, 0))
#define pgVector3_Check(x) \
((x)->ob_type == (PyTypeObject *)PYGAMEAPI_GET_SLOT(math, 1))
/*
#define pgVector2_New \
(*(PyObject*(*)) \
PYGAMEAPI_GET_SLOT(PyGAME_C_API, 1))
*/
#define import_pygame_math() IMPORT_PYGAME_MODULE(math)
#endif /* PYGAMEAPI_MATH_INTERNAL */
#define IMPORT_PYGAME_MODULE _IMPORT_PYGAME_MODULE
/*
* base pygame API slots
* disable slots with NO_PYGAME_C_API
*/
#ifdef PYGAME_H
PYGAMEAPI_DEFINE_SLOTS(base);
PYGAMEAPI_DEFINE_SLOTS(rect);
PYGAMEAPI_DEFINE_SLOTS(cdrom);
PYGAMEAPI_DEFINE_SLOTS(joystick);
PYGAMEAPI_DEFINE_SLOTS(display);
PYGAMEAPI_DEFINE_SLOTS(surface);
PYGAMEAPI_DEFINE_SLOTS(surflock);
PYGAMEAPI_DEFINE_SLOTS(event);
PYGAMEAPI_DEFINE_SLOTS(rwobject);
PYGAMEAPI_DEFINE_SLOTS(pixelarray);
PYGAMEAPI_DEFINE_SLOTS(color);
PYGAMEAPI_DEFINE_SLOTS(math);
#else /* ~PYGAME_H */
PYGAMEAPI_EXTERN_SLOTS(base);
PYGAMEAPI_EXTERN_SLOTS(rect);
PYGAMEAPI_EXTERN_SLOTS(cdrom);
PYGAMEAPI_EXTERN_SLOTS(joystick);
PYGAMEAPI_EXTERN_SLOTS(display);
PYGAMEAPI_EXTERN_SLOTS(surface);
PYGAMEAPI_EXTERN_SLOTS(surflock);
PYGAMEAPI_EXTERN_SLOTS(event);
PYGAMEAPI_EXTERN_SLOTS(rwobject);
PYGAMEAPI_EXTERN_SLOTS(pixelarray);
PYGAMEAPI_EXTERN_SLOTS(color);
PYGAMEAPI_EXTERN_SLOTS(math);
#endif /* ~PYGAME_H */
#endif /* PYGAME_H */
/* Use the end of this file for other cross module inline utility
* functions There seems to be no good reason to stick to macro only
* functions in Python 3.
*/
static PG_INLINE PyObject *
pg_tuple_couple_from_values_int(int val1, int val2)
{
/* This function turns two input integers into a python tuple object.
* Currently, 5th November 2022, this is faster than using Py_BuildValue
* to do the same thing.
*/
PyObject *tup = PyTuple_New(2);
if (!tup) {
return NULL;
}
PyObject *tmp = PyLong_FromLong(val1);
if (!tmp) {
Py_DECREF(tup);
return NULL;
}
PyTuple_SET_ITEM(tup, 0, tmp);
tmp = PyLong_FromLong(val2);
if (!tmp) {
Py_DECREF(tup);
return NULL;
}
PyTuple_SET_ITEM(tup, 1, tmp);
return tup;
}
static PG_INLINE PyObject *
pg_tuple_triple_from_values_int(int val1, int val2, int val3)
{
/* This function turns three input integers into a python tuple object.
* Currently, 5th November 2022, this is faster than using Py_BuildValue
* to do the same thing.
*/
PyObject *tup = PyTuple_New(3);
if (!tup) {
return NULL;
}
PyObject *tmp = PyLong_FromLong(val1);
if (!tmp) {
Py_DECREF(tup);
return NULL;
}
PyTuple_SET_ITEM(tup, 0, tmp);
tmp = PyLong_FromLong(val2);
if (!tmp) {
Py_DECREF(tup);
return NULL;
}
PyTuple_SET_ITEM(tup, 1, tmp);
tmp = PyLong_FromLong(val3);
if (!tmp) {
Py_DECREF(tup);
return NULL;
}
PyTuple_SET_ITEM(tup, 2, tmp);
return tup;
}

View file

@ -0,0 +1,171 @@
/*
Bitmask 1.7 - A pixel-perfect collision detection library.
Copyright (C) 2002-2005 Ulf Ekstrom except for the bitcount
function which is copyright (C) Donald W. Gillies, 1992.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef BITMASK_H
#define BITMASK_H
#ifdef __cplusplus
extern "C" {
#endif
#include <limits.h>
/* Define INLINE for different compilers. If your compiler does not
support inlining then there might be a performance hit in
bitmask_overlap_area().
*/
#ifndef INLINE
#ifdef __GNUC__
#define INLINE inline
#else
#ifdef _MSC_VER
#define INLINE __inline
#else
#define INLINE
#endif
#endif
#endif
#define BITMASK_W unsigned long int
#define BITMASK_W_LEN (sizeof(BITMASK_W) * CHAR_BIT)
#define BITMASK_W_MASK (BITMASK_W_LEN - 1)
#define BITMASK_N(n) ((BITMASK_W)1 << (n))
typedef struct bitmask {
int w, h;
BITMASK_W bits[1];
} bitmask_t;
/* Creates a bitmask of width w and height h, where
w and h must both be greater than or equal to 0.
The mask is automatically cleared when created.
*/
bitmask_t *
bitmask_create(int w, int h);
/* Frees all the memory allocated by bitmask_create for m. */
void
bitmask_free(bitmask_t *m);
/* Create a copy of the given bitmask. */
bitmask_t *
bitmask_copy(bitmask_t *m);
/* Clears all bits in the mask */
void
bitmask_clear(bitmask_t *m);
/* Sets all bits in the mask */
void
bitmask_fill(bitmask_t *m);
/* Flips all bits in the mask */
void
bitmask_invert(bitmask_t *m);
/* Counts the bits in the mask */
unsigned int
bitmask_count(bitmask_t *m);
/* Returns nonzero if the bit at (x,y) is set. Coordinates start at
(0,0) */
static INLINE int
bitmask_getbit(const bitmask_t *m, int x, int y)
{
return (m->bits[x / BITMASK_W_LEN * m->h + y] &
BITMASK_N(x & BITMASK_W_MASK)) != 0;
}
/* Sets the bit at (x,y) */
static INLINE void
bitmask_setbit(bitmask_t *m, int x, int y)
{
m->bits[x / BITMASK_W_LEN * m->h + y] |= BITMASK_N(x & BITMASK_W_MASK);
}
/* Clears the bit at (x,y) */
static INLINE void
bitmask_clearbit(bitmask_t *m, int x, int y)
{
m->bits[x / BITMASK_W_LEN * m->h + y] &= ~BITMASK_N(x & BITMASK_W_MASK);
}
/* Returns nonzero if the masks overlap with the given offset.
The overlap tests uses the following offsets (which may be negative):
+----+----------..
|A | yoffset
| +-+----------..
+--|B
|xoffset
| |
: :
*/
int
bitmask_overlap(const bitmask_t *a, const bitmask_t *b, int xoffset,
int yoffset);
/* Like bitmask_overlap(), but will also give a point of intersection.
x and y are given in the coordinates of mask a, and are untouched
if there is no overlap. */
int
bitmask_overlap_pos(const bitmask_t *a, const bitmask_t *b, int xoffset,
int yoffset, int *x, int *y);
/* Returns the number of overlapping 'pixels' */
int
bitmask_overlap_area(const bitmask_t *a, const bitmask_t *b, int xoffset,
int yoffset);
/* Fills a mask with the overlap of two other masks. A bitwise AND. */
void
bitmask_overlap_mask(const bitmask_t *a, const bitmask_t *b, bitmask_t *c,
int xoffset, int yoffset);
/* Draws mask b onto mask a (bitwise OR). Can be used to compose large
(game background?) mask from several submasks, which may speed up
the testing. */
void
bitmask_draw(bitmask_t *a, const bitmask_t *b, int xoffset, int yoffset);
void
bitmask_erase(bitmask_t *a, const bitmask_t *b, int xoffset, int yoffset);
/* Return a new scaled bitmask, with dimensions w*h. The quality of the
scaling may not be perfect for all circumstances, but it should
be reasonable. If either w or h is 0 a clear 1x1 mask is returned. */
bitmask_t *
bitmask_scale(const bitmask_t *m, int w, int h);
/* Convolve b into a, drawing the output into o, shifted by offset. If offset
* is 0, then the (x,y) bit will be set if and only if
* bitmask_overlap(a, b, x - b->w - 1, y - b->h - 1) returns true.
*
* Modifies bits o[xoffset ... xoffset + a->w + b->w - 1)
* [yoffset ... yoffset + a->h + b->h - 1). */
void
bitmask_convolve(const bitmask_t *a, const bitmask_t *b, bitmask_t *o,
int xoffset, int yoffset);
#ifdef __cplusplus
} /* End of extern "C" { */
#endif
#endif

View file

@ -0,0 +1,102 @@
#if !defined(PGCOMPAT_H)
#define PGCOMPAT_H
#include <Python.h>
/* In CPython, Py_Exit finalises the python interpreter before calling C exit()
* This does not exist on PyPy, so use exit() directly here */
#ifdef PYPY_VERSION
#define PG_EXIT(n) exit(n)
#else
#define PG_EXIT(n) Py_Exit(n)
#endif
/* define common types where SDL is not included */
#ifndef SDL_VERSION_ATLEAST
#ifdef _MSC_VER
typedef unsigned __int8 uint8_t;
typedef unsigned __int32 uint32_t;
#else
#include <stdint.h>
#endif
typedef uint32_t Uint32;
typedef uint8_t Uint8;
#endif /* no SDL */
#if defined(SDL_VERSION_ATLEAST)
#ifndef SDL_WINDOW_VULKAN
#define SDL_WINDOW_VULKAN 0
#endif
#ifndef SDL_WINDOW_ALWAYS_ON_TOP
#define SDL_WINDOW_ALWAYS_ON_TOP 0
#endif
#ifndef SDL_WINDOW_SKIP_TASKBAR
#define SDL_WINDOW_SKIP_TASKBAR 0
#endif
#ifndef SDL_WINDOW_UTILITY
#define SDL_WINDOW_UTILITY 0
#endif
#ifndef SDL_WINDOW_TOOLTIP
#define SDL_WINDOW_TOOLTIP 0
#endif
#ifndef SDL_WINDOW_POPUP_MENU
#define SDL_WINDOW_POPUP_MENU 0
#endif
#ifndef SDL_WINDOW_INPUT_GRABBED
#define SDL_WINDOW_INPUT_GRABBED 0
#endif
#ifndef SDL_WINDOW_INPUT_FOCUS
#define SDL_WINDOW_INPUT_FOCUS 0
#endif
#ifndef SDL_WINDOW_MOUSE_FOCUS
#define SDL_WINDOW_MOUSE_FOCUS 0
#endif
#ifndef SDL_WINDOW_FOREIGN
#define SDL_WINDOW_FOREIGN 0
#endif
#ifndef SDL_WINDOW_ALLOW_HIGHDPI
#define SDL_WINDOW_ALLOW_HIGHDPI 0
#endif
#ifndef SDL_WINDOW_MOUSE_CAPTURE
#define SDL_WINDOW_MOUSE_CAPTURE 0
#endif
#ifndef SDL_WINDOW_ALWAYS_ON_TOP
#define SDL_WINDOW_ALWAYS_ON_TOP 0
#endif
#ifndef SDL_WINDOW_SKIP_TASKBAR
#define SDL_WINDOW_SKIP_TASKBAR 0
#endif
#ifndef SDL_WINDOW_UTILITY
#define SDL_WINDOW_UTILITY 0
#endif
#ifndef SDL_WINDOW_TOOLTIP
#define SDL_WINDOW_TOOLTIP 0
#endif
#ifndef SDL_WINDOW_POPUP_MENU
#define SDL_WINDOW_POPUP_MENU 0
#endif
#ifndef SDL_MOUSEWHEEL_FLIPPED
#define NO_SDL_MOUSEWHEEL_FLIPPED
#endif
#endif /* defined(SDL_VERSION_ATLEAST) */
#endif /* ~defined(PGCOMPAT_H) */

View file

@ -0,0 +1,67 @@
#ifndef PGIMPORT_H
#define PGIMPORT_H
/* Prefix when importing module */
#define IMPPREFIX "pygame."
#include "pgcompat.h"
#define PYGAMEAPI_LOCAL_ENTRY "_PYGAME_C_API"
#define PG_CAPSULE_NAME(m) (IMPPREFIX m "." PYGAMEAPI_LOCAL_ENTRY)
/*
* fill API slots defined by PYGAMEAPI_DEFINE_SLOTS/PYGAMEAPI_EXTERN_SLOTS
*/
#define _IMPORT_PYGAME_MODULE(module) \
{ \
PyObject *_mod_##module = PyImport_ImportModule(IMPPREFIX #module); \
\
if (_mod_##module != NULL) { \
PyObject *_c_api = \
PyObject_GetAttrString(_mod_##module, PYGAMEAPI_LOCAL_ENTRY); \
\
Py_DECREF(_mod_##module); \
if (_c_api != NULL && PyCapsule_CheckExact(_c_api)) { \
void **localptr = (void **)PyCapsule_GetPointer( \
_c_api, PG_CAPSULE_NAME(#module)); \
_PGSLOTS_##module = localptr; \
} \
Py_XDECREF(_c_api); \
} \
}
#define PYGAMEAPI_IS_IMPORTED(module) (_PGSLOTS_##module != NULL)
/*
* source file must include one of these in order to use _IMPORT_PYGAME_MODULE.
* this is set by import_pygame_*() functions.
* disable with NO_PYGAME_C_API
*/
#define PYGAMEAPI_DEFINE_SLOTS(module) void **_PGSLOTS_##module = NULL
#define PYGAMEAPI_EXTERN_SLOTS(module) extern void **_PGSLOTS_##module
#define PYGAMEAPI_GET_SLOT(module, index) _PGSLOTS_##module[(index)]
/*
* disabled API with NO_PYGAME_C_API; do nothing instead
*/
#ifdef NO_PYGAME_C_API
#undef PYGAMEAPI_DEFINE_SLOTS
#undef PYGAMEAPI_EXTERN_SLOTS
#define PYGAMEAPI_DEFINE_SLOTS(module)
#define PYGAMEAPI_EXTERN_SLOTS(module)
/* intentionally leave this defined to cause a compiler error *
#define PYGAMEAPI_GET_SLOT(api_root, index)
#undef PYGAMEAPI_GET_SLOT*/
#undef _IMPORT_PYGAME_MODULE
#define _IMPORT_PYGAME_MODULE(module)
#endif /* NO_PYGAME_C_API */
#define encapsulate_api(ptr, module) \
PyCapsule_New(ptr, PG_CAPSULE_NAME(module), NULL)
#endif /* ~PGIMPORT_H */

View file

@ -0,0 +1,83 @@
/* platform/compiler adjustments */
#ifndef PG_PLATFORM_H
#define PG_PLATFORM_H
#if defined(HAVE_SNPRINTF) /* defined in python.h (pyerrors.h) and SDL.h \
(SDL_config.h) */
#undef HAVE_SNPRINTF /* remove GCC redefine warning */
#endif /* HAVE_SNPRINTF */
#ifndef PG_INLINE
#if defined(__clang__)
#define PG_INLINE __inline__ __attribute__((__unused__))
#elif defined(__GNUC__)
#define PG_INLINE __inline__
#elif defined(_MSC_VER)
#define PG_INLINE __inline
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define PG_INLINE inline
#else
#define PG_INLINE
#endif
#endif /* ~PG_INLINE */
// Worth trying this on MSVC/win32 builds to see if provides any speed up
#ifndef PG_FORCEINLINE
#if defined(__clang__)
#define PG_FORCEINLINE __inline__ __attribute__((__unused__))
#elif defined(__GNUC__)
#define PG_FORCEINLINE __inline__
#elif defined(_MSC_VER)
#define PG_FORCEINLINE __forceinline
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define PG_FORCEINLINE inline
#else
#define PG_FORCEINLINE
#endif
#endif /* ~PG_FORCEINLINE */
/* This is unconditionally defined in Python.h */
#if defined(_POSIX_C_SOURCE)
#undef _POSIX_C_SOURCE
#endif
#if defined(HAVE_SNPRINTF)
#undef HAVE_SNPRINTF
#endif
/* SDL needs WIN32 */
#if !defined(WIN32) && \
(defined(MS_WIN32) || defined(_WIN32) || defined(__WIN32) || \
defined(__WIN32__) || defined(_WINDOWS))
#define WIN32
#endif
#ifndef PG_TARGET_SSE4_2
#if defined(__clang__) || \
(defined(__GNUC__) && \
((__GNUC__ == 4 && __GNUC_MINOR__ >= 9) || __GNUC__ >= 5))
// The old gcc 4.8 on centos used by manylinux1 does not seem to get sse4.2
// intrinsics
#define PG_FUNCTION_TARGET_SSE4_2 __attribute__((target("sse4.2")))
// No else; we define the fallback later
#endif
#endif /* ~PG_TARGET_SSE4_2 */
#ifdef PG_FUNCTION_TARGET_SSE4_2
#if !defined(__SSE4_2__) && !defined(PG_COMPILE_SSE4_2)
#if defined(__x86_64__) || defined(__i386__)
#define PG_COMPILE_SSE4_2 1
#endif
#endif
#endif /* ~PG_TARGET_SSE4_2 */
/* Fallback definition of target attribute */
#ifndef PG_FUNCTION_TARGET_SSE4_2
#define PG_FUNCTION_TARGET_SSE4_2
#endif
#ifndef PG_COMPILE_SSE4_2
#define PG_COMPILE_SSE4_2 0
#endif
#endif /* ~PG_PLATFORM_H */

View file

@ -0,0 +1,34 @@
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
/* To allow the Pygame C api to be globally shared by all code within an
* extension module built from multiple C files, only include the pygame.h
* header within the top level C file, the one which calls the
* 'import_pygame_*' macros. All other C source files of the module should
* include _pygame.h instead.
*/
#ifndef PYGAME_H
#define PYGAME_H
#include "_pygame.h"
#endif

View file

@ -0,0 +1,56 @@
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
Copyright (C) 2007 Rene Dudfield, Richard Goedeken
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
/* Bufferproxy module C api. */
#if !defined(PG_BUFPROXY_HEADER)
#define PG_BUFPROXY_HEADER
#include <Python.h>
typedef PyObject *(*_pgbufproxy_new_t)(PyObject *, getbufferproc);
typedef PyObject *(*_pgbufproxy_get_obj_t)(PyObject *);
typedef int (*_pgbufproxy_trip_t)(PyObject *);
#ifndef PYGAMEAPI_BUFPROXY_INTERNAL
#include "pgimport.h"
PYGAMEAPI_DEFINE_SLOTS(bufferproxy);
#define pgBufproxy_Type (*(PyTypeObject *)PYGAMEAPI_GET_SLOT(bufferproxy, 0))
#define pgBufproxy_Check(x) ((x)->ob_type == &pgBufproxy_Type)
#define pgBufproxy_New (*(_pgbufproxy_new_t)PYGAMEAPI_GET_SLOT(bufferproxy, 1))
#define pgBufproxy_GetParent \
(*(_pgbufproxy_get_obj_t)PYGAMEAPI_GET_SLOT(bufferproxy, 2))
#define pgBufproxy_Trip \
(*(_pgbufproxy_trip_t)PYGAMEAPI_GET_SLOT(bufferproxy, 3))
#define import_pygame_bufferproxy() _IMPORT_PYGAME_MODULE(bufferproxy)
#endif /* ~PYGAMEAPI_BUFPROXY_INTERNAL */
#endif /* ~defined(PG_BUFPROXY_HEADER) */

View file

@ -0,0 +1,50 @@
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
#include <Python.h>
#include "pgplatform.h"
struct TTF_Font;
typedef struct {
PyObject_HEAD TTF_Font *font;
PyObject *weakreflist;
unsigned int ttf_init_generation;
} PyFontObject;
#define PyFont_AsFont(x) (((PyFontObject *)x)->font)
#ifndef PYGAMEAPI_FONT_INTERNAL
#include "pgimport.h"
PYGAMEAPI_DEFINE_SLOTS(font);
#define PyFont_Type (*(PyTypeObject *)PYGAMEAPI_GET_SLOT(font, 0))
#define PyFont_Check(x) ((x)->ob_type == &PyFont_Type)
#define PyFont_New (*(PyObject * (*)(TTF_Font *)) PYGAMEAPI_GET_SLOT(font, 1))
/*slot 2 taken by FONT_INIT_CHECK*/
#define import_pygame_font() _IMPORT_PYGAME_MODULE(font)
#endif

View file

@ -0,0 +1,42 @@
/*
pygame - Python Game Library
Copyright (C) 2009 Vicent Marti
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef PYGAME_FREETYPE_H_
#define PYGAME_FREETYPE_H_
#include "pgplatform.h"
#include "pgimport.h"
#include "pgcompat.h"
#ifndef PYGAME_FREETYPE_INTERNAL
PYGAMEAPI_DEFINE_SLOTS(_freetype);
#define pgFont_Type (*(PyTypeObject *)PYGAMEAPI_GET_SLOT(_freetype, 0))
#define pgFont_Check(x) ((x)->ob_type == &pgFont_Type)
#define pgFont_New \
(*(PyObject * (*)(const char *, long)) PYGAMEAPI_GET_SLOT(_freetype, 1))
#define import_pygame_freetype() _IMPORT_PYGAME_MODULE(_freetype)
#endif /* PYGAME_FREETYPE_INTERNAL */
#endif /* PYGAME_FREETYPE_H_ */

View file

@ -0,0 +1,45 @@
/*
pygame - Python Game Library
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef PGMASK_H
#define PGMASK_H
#include <Python.h>
#include "bitmask.h"
typedef struct {
PyObject_HEAD bitmask_t *mask;
void *bufdata;
} pgMaskObject;
#define pgMask_AsBitmap(x) (((pgMaskObject *)x)->mask)
#ifndef PYGAMEAPI_MASK_INTERNAL
#include "pgimport.h"
PYGAMEAPI_DEFINE_SLOTS(mask);
#define pgMask_Type (*(PyTypeObject *)PYGAMEAPI_GET_SLOT(mask, 0))
#define pgMask_Check(x) ((x)->ob_type == &pgMask_Type)
#define import_pygame_mask() _IMPORT_PYGAME_MODULE(mask)
#endif /* ~PYGAMEAPI_MASK_INTERNAL */
#endif /* ~PGMASK_H */

View file

@ -0,0 +1,71 @@
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
#ifndef PGMIXER_H
#define PGMIXER_H
#include <Python.h>
#include <structmember.h>
#include "pgcompat.h"
struct Mix_Chunk;
typedef struct {
PyObject_HEAD Mix_Chunk *chunk;
Uint8 *mem;
PyObject *weakreflist;
} pgSoundObject;
typedef struct {
PyObject_HEAD int chan;
} pgChannelObject;
#define pgSound_AsChunk(x) (((pgSoundObject *)x)->chunk)
#define pgChannel_AsInt(x) (((pgChannelObject *)x)->chan)
#include "pgimport.h"
#ifndef PYGAMEAPI_MIXER_INTERNAL
PYGAMEAPI_DEFINE_SLOTS(mixer);
#define pgSound_Type (*(PyTypeObject *)PYGAMEAPI_GET_SLOT(mixer, 0))
#define pgSound_Check(x) ((x)->ob_type == &pgSound_Type)
#define pgSound_New \
(*(PyObject * (*)(Mix_Chunk *)) PYGAMEAPI_GET_SLOT(mixer, 1))
#define pgSound_Play \
(*(PyObject * (*)(PyObject *, PyObject *)) PYGAMEAPI_GET_SLOT(mixer, 2))
#define pgChannel_Type (*(PyTypeObject *)PYGAMEAPI_GET_SLOT(mixer, 3))
#define pgChannel_Check(x) ((x)->ob_type == &pgChannel_Type)
#define pgChannel_New (*(PyObject * (*)(int)) PYGAMEAPI_GET_SLOT(mixer, 4))
#define import_pygame_mixer() _IMPORT_PYGAME_MODULE(mixer)
#endif /* PYGAMEAPI_MIXER_INTERNAL */
#endif /* ~PGMIXER_H */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#ifndef PGMASK_INTERNAL_H
#define PGMASK_INTERNAL_H
#include "include/pygame_mask.h"
#define PYGAMEAPI_MASK_NUMSLOTS 1
#endif /* ~PGMASK_INTERNAL_H */

View file

@ -0,0 +1,14 @@
#ifndef MIXER_INTERNAL_H
#define MIXER_INTERNAL_H
#include <SDL_mixer.h>
/* test mixer initializations */
#define MIXER_INIT_CHECK() \
if (!SDL_WasInit(SDL_INIT_AUDIO)) \
return RAISE(pgExc_SDLError, "mixer not initialized")
#define PYGAMEAPI_MIXER_NUMSLOTS 5
#include "include/pygame_mixer.h"
#endif /* ~MIXER_INTERNAL_H */

View file

@ -0,0 +1,123 @@
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
#ifndef PALETTE_H
#define PALETTE_H
#include <SDL.h>
/* SDL 2 does not assign a default palette color scheme to a new 8 bit
* surface. Instead, the palette is set all white. This defines the SDL 1.2
* default palette.
*/
static const SDL_Color default_palette_colors[] = {
{0, 0, 0, 255}, {0, 0, 85, 255}, {0, 0, 170, 255},
{0, 0, 255, 255}, {0, 36, 0, 255}, {0, 36, 85, 255},
{0, 36, 170, 255}, {0, 36, 255, 255}, {0, 73, 0, 255},
{0, 73, 85, 255}, {0, 73, 170, 255}, {0, 73, 255, 255},
{0, 109, 0, 255}, {0, 109, 85, 255}, {0, 109, 170, 255},
{0, 109, 255, 255}, {0, 146, 0, 255}, {0, 146, 85, 255},
{0, 146, 170, 255}, {0, 146, 255, 255}, {0, 182, 0, 255},
{0, 182, 85, 255}, {0, 182, 170, 255}, {0, 182, 255, 255},
{0, 219, 0, 255}, {0, 219, 85, 255}, {0, 219, 170, 255},
{0, 219, 255, 255}, {0, 255, 0, 255}, {0, 255, 85, 255},
{0, 255, 170, 255}, {0, 255, 255, 255}, {85, 0, 0, 255},
{85, 0, 85, 255}, {85, 0, 170, 255}, {85, 0, 255, 255},
{85, 36, 0, 255}, {85, 36, 85, 255}, {85, 36, 170, 255},
{85, 36, 255, 255}, {85, 73, 0, 255}, {85, 73, 85, 255},
{85, 73, 170, 255}, {85, 73, 255, 255}, {85, 109, 0, 255},
{85, 109, 85, 255}, {85, 109, 170, 255}, {85, 109, 255, 255},
{85, 146, 0, 255}, {85, 146, 85, 255}, {85, 146, 170, 255},
{85, 146, 255, 255}, {85, 182, 0, 255}, {85, 182, 85, 255},
{85, 182, 170, 255}, {85, 182, 255, 255}, {85, 219, 0, 255},
{85, 219, 85, 255}, {85, 219, 170, 255}, {85, 219, 255, 255},
{85, 255, 0, 255}, {85, 255, 85, 255}, {85, 255, 170, 255},
{85, 255, 255, 255}, {170, 0, 0, 255}, {170, 0, 85, 255},
{170, 0, 170, 255}, {170, 0, 255, 255}, {170, 36, 0, 255},
{170, 36, 85, 255}, {170, 36, 170, 255}, {170, 36, 255, 255},
{170, 73, 0, 255}, {170, 73, 85, 255}, {170, 73, 170, 255},
{170, 73, 255, 255}, {170, 109, 0, 255}, {170, 109, 85, 255},
{170, 109, 170, 255}, {170, 109, 255, 255}, {170, 146, 0, 255},
{170, 146, 85, 255}, {170, 146, 170, 255}, {170, 146, 255, 255},
{170, 182, 0, 255}, {170, 182, 85, 255}, {170, 182, 170, 255},
{170, 182, 255, 255}, {170, 219, 0, 255}, {170, 219, 85, 255},
{170, 219, 170, 255}, {170, 219, 255, 255}, {170, 255, 0, 255},
{170, 255, 85, 255}, {170, 255, 170, 255}, {170, 255, 255, 255},
{255, 0, 0, 255}, {255, 0, 85, 255}, {255, 0, 170, 255},
{255, 0, 255, 255}, {255, 36, 0, 255}, {255, 36, 85, 255},
{255, 36, 170, 255}, {255, 36, 255, 255}, {255, 73, 0, 255},
{255, 73, 85, 255}, {255, 73, 170, 255}, {255, 73, 255, 255},
{255, 109, 0, 255}, {255, 109, 85, 255}, {255, 109, 170, 255},
{255, 109, 255, 255}, {255, 146, 0, 255}, {255, 146, 85, 255},
{255, 146, 170, 255}, {255, 146, 255, 255}, {255, 182, 0, 255},
{255, 182, 85, 255}, {255, 182, 170, 255}, {255, 182, 255, 255},
{255, 219, 0, 255}, {255, 219, 85, 255}, {255, 219, 170, 255},
{255, 219, 255, 255}, {255, 255, 0, 255}, {255, 255, 85, 255},
{255, 255, 170, 255}, {255, 255, 255, 255}, {0, 0, 0, 255},
{0, 0, 85, 255}, {0, 0, 170, 255}, {0, 0, 255, 255},
{0, 36, 0, 255}, {0, 36, 85, 255}, {0, 36, 170, 255},
{0, 36, 255, 255}, {0, 73, 0, 255}, {0, 73, 85, 255},
{0, 73, 170, 255}, {0, 73, 255, 255}, {0, 109, 0, 255},
{0, 109, 85, 255}, {0, 109, 170, 255}, {0, 109, 255, 255},
{0, 146, 0, 255}, {0, 146, 85, 255}, {0, 146, 170, 255},
{0, 146, 255, 255}, {0, 182, 0, 255}, {0, 182, 85, 255},
{0, 182, 170, 255}, {0, 182, 255, 255}, {0, 219, 0, 255},
{0, 219, 85, 255}, {0, 219, 170, 255}, {0, 219, 255, 255},
{0, 255, 0, 255}, {0, 255, 85, 255}, {0, 255, 170, 255},
{0, 255, 255, 255}, {85, 0, 0, 255}, {85, 0, 85, 255},
{85, 0, 170, 255}, {85, 0, 255, 255}, {85, 36, 0, 255},
{85, 36, 85, 255}, {85, 36, 170, 255}, {85, 36, 255, 255},
{85, 73, 0, 255}, {85, 73, 85, 255}, {85, 73, 170, 255},
{85, 73, 255, 255}, {85, 109, 0, 255}, {85, 109, 85, 255},
{85, 109, 170, 255}, {85, 109, 255, 255}, {85, 146, 0, 255},
{85, 146, 85, 255}, {85, 146, 170, 255}, {85, 146, 255, 255},
{85, 182, 0, 255}, {85, 182, 85, 255}, {85, 182, 170, 255},
{85, 182, 255, 255}, {85, 219, 0, 255}, {85, 219, 85, 255},
{85, 219, 170, 255}, {85, 219, 255, 255}, {85, 255, 0, 255},
{85, 255, 85, 255}, {85, 255, 170, 255}, {85, 255, 255, 255},
{170, 0, 0, 255}, {170, 0, 85, 255}, {170, 0, 170, 255},
{170, 0, 255, 255}, {170, 36, 0, 255}, {170, 36, 85, 255},
{170, 36, 170, 255}, {170, 36, 255, 255}, {170, 73, 0, 255},
{170, 73, 85, 255}, {170, 73, 170, 255}, {170, 73, 255, 255},
{170, 109, 0, 255}, {170, 109, 85, 255}, {170, 109, 170, 255},
{170, 109, 255, 255}, {170, 146, 0, 255}, {170, 146, 85, 255},
{170, 146, 170, 255}, {170, 146, 255, 255}, {170, 182, 0, 255},
{170, 182, 85, 255}, {170, 182, 170, 255}, {170, 182, 255, 255},
{170, 219, 0, 255}, {170, 219, 85, 255}, {170, 219, 170, 255},
{170, 219, 255, 255}, {170, 255, 0, 255}, {170, 255, 85, 255},
{170, 255, 170, 255}, {170, 255, 255, 255}, {255, 0, 0, 255},
{255, 0, 85, 255}, {255, 0, 170, 255}, {255, 0, 255, 255},
{255, 36, 0, 255}, {255, 36, 85, 255}, {255, 36, 170, 255},
{255, 36, 255, 255}, {255, 73, 0, 255}, {255, 73, 85, 255},
{255, 73, 170, 255}, {255, 73, 255, 255}, {255, 109, 0, 255},
{255, 109, 85, 255}, {255, 109, 170, 255}, {255, 109, 255, 255},
{255, 146, 0, 255}, {255, 146, 85, 255}, {255, 146, 170, 255},
{255, 146, 255, 255}, {255, 182, 0, 255}, {255, 182, 85, 255},
{255, 182, 170, 255}, {255, 182, 255, 255}, {255, 219, 0, 255},
{255, 219, 85, 255}, {255, 219, 170, 255}, {255, 219, 255, 255},
{255, 255, 0, 255}, {255, 255, 85, 255}, {255, 255, 170, 255},
{255, 255, 255, 255}};
static const int default_palette_size =
(int)(sizeof(default_palette_colors) / sizeof(SDL_Color));
#endif

View file

@ -0,0 +1,26 @@
/* array structure interface version 3 declarations */
#if !defined(PG_ARRAYINTER_HEADER)
#define PG_ARRAYINTER_HEADER
static const int PAI_CONTIGUOUS = 0x01;
static const int PAI_FORTRAN = 0x02;
static const int PAI_ALIGNED = 0x100;
static const int PAI_NOTSWAPPED = 0x200;
static const int PAI_WRITEABLE = 0x400;
static const int PAI_ARR_HAS_DESCR = 0x800;
typedef struct {
int two; /* contains the integer 2 -- simple sanity check */
int nd; /* number of dimensions */
char typekind; /* kind in array -- character code of typestr */
int itemsize; /* size of each element */
int flags; /* flags indicating how the data should be */
/* interpreted */
Py_intptr_t *shape; /* A length-nd array of shape information */
Py_intptr_t *strides; /* A length-nd array of stride information */
void *data; /* A pointer to the first element of the array */
PyObject *descr; /* NULL or a data-description */
} PyArrayInterface;
#endif

View file

@ -0,0 +1,7 @@
#ifndef PG_BUFPROXY_INTERNAL_H
#define PG_BUFPROXY_INTERNAL_H
#include "include/pygame_bufferproxy.h"
#define PYGAMEAPI_BUFPROXY_NUMSLOTS 4
#endif /* ~PG_BUFPROXY_INTERNAL_H */

View file

@ -0,0 +1,27 @@
/* Python 2.x/3.x compatibility tools (internal)
*/
#ifndef PGCOMPAT_INTERNAL_H
#define PGCOMPAT_INTERNAL_H
#include "include/pgcompat.h"
/* Module init function returns new module instance. */
#define MODINIT_DEFINE(mod_name) PyMODINIT_FUNC PyInit_##mod_name(void)
/* Defaults for unicode file path encoding */
#if defined(MS_WIN32)
#define UNICODE_DEF_FS_ERROR "replace"
#else
#define UNICODE_DEF_FS_ERROR "surrogateescape"
#endif
#define RELATIVE_MODULE(m) ("." m)
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#define Slice_GET_INDICES_EX(slice, length, start, stop, step, slicelength) \
PySlice_GetIndicesEx(slice, length, start, stop, step, slicelength)
#endif /* ~PGCOMPAT_INTERNAL_H */

View file

@ -0,0 +1,20 @@
#if !defined(PGOPENGL_H)
#define PGOPENGL_H
/** This header includes definitions of Opengl functions as pointer types for
** use with the SDL function SDL_GL_GetProcAddress.
**/
#if defined(_WIN32)
#define GL_APIENTRY __stdcall
#else
#define GL_APIENTRY
#endif
typedef void(GL_APIENTRY *GL_glReadPixels_Func)(int, int, int, int,
unsigned int, unsigned int,
void *);
typedef void(GL_APIENTRY *GL_glViewport_Func)(int, int, unsigned int,
unsigned int);
#endif

View file

@ -0,0 +1,23 @@
/* platform/compiler adjustments (internal) */
#ifndef PG_PLATFORM_INTERNAL_H
#define PG_PLATFORM_INTERNAL_H
#include "include/pgplatform.h"
#ifndef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
#ifndef ABS
#define ABS(a) (((a) < 0) ? -(a) : (a))
#endif
/* warnings */
#define PG_STRINGIZE_HELPER(x) #x
#define PG_STRINGIZE(x) PG_STRINGIZE_HELPER(x)
#define PG_WARN(desc) \
message(__FILE__ "(" PG_STRINGIZE(__LINE__) "): WARNING: " #desc)
#endif /* ~PG_PLATFORM_INTERNAL_H */

View file

@ -0,0 +1,32 @@
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
/* This will use PYGAMEAPI_DEFINE_SLOTS instead
* of PYGAMEAPI_EXTERN_SLOTS for base modules.
*/
#ifndef PYGAME_INTERNAL_H
#define PYGAME_INTERNAL_H
#define PYGAME_H
#include "_pygame.h"
#endif /* ~PYGAME_INTERNAL_H */

View file

@ -0,0 +1,147 @@
/*
pygame - Python Game Library
Copyright (C) 2006, 2007 Rene Dudfield, Marcus von Appen
Originally put in the public domain by Sam Lantinga.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef SCRAP_H
#define SCRAP_H
/* This is unconditionally defined in Python.h */
#if defined(_POSIX_C_SOURCE)
#undef _POSIX_C_SOURCE
#endif
#include <Python.h>
/* Handle clipboard text and data in arbitrary formats */
/**
* Predefined supported pygame scrap types.
*/
#define PYGAME_SCRAP_TEXT "text/plain"
#define PYGAME_SCRAP_BMP "image/bmp"
#define PYGAME_SCRAP_PPM "image/ppm"
#define PYGAME_SCRAP_PBM "image/pbm"
/**
* The supported scrap clipboard types.
*
* This is only relevant in a X11 environment, which supports mouse
* selections as well. For Win32 and MacOS environments the default
* clipboard is used, no matter what value is passed.
*/
typedef enum {
SCRAP_CLIPBOARD,
SCRAP_SELECTION /* only supported in X11 environments. */
} ScrapClipType;
/**
* Macro for initialization checks.
*/
#define PYGAME_SCRAP_INIT_CHECK() \
if (!pygame_scrap_initialized()) \
return (PyErr_SetString(pgExc_SDLError, "scrap system not initialized."), \
NULL)
/**
* \brief Checks, whether the pygame scrap module was initialized.
*
* \return 1 if the modules was initialized, 0 otherwise.
*/
extern int
pygame_scrap_initialized(void);
/**
* \brief Initializes the pygame scrap module internals. Call this before any
* other method.
*
* \return 1 on successful initialization, 0 otherwise.
*/
extern int
pygame_scrap_init(void);
/**
* \brief Checks, whether the pygame window lost the clipboard focus or not.
*
* \return 1 if the window lost the focus, 0 otherwise.
*/
extern int
pygame_scrap_lost(void);
/**
* \brief Places content of a specific type into the clipboard.
*
* \note For X11 the following notes are important: The following types
* are reserved for internal usage and thus will throw an error on
* setting them: "TIMESTAMP", "TARGETS", "SDL_SELECTION".
* Setting PYGAME_SCRAP_TEXT ("text/plain") will also automatically
* set the X11 types "STRING" (XA_STRING), "TEXT" and "UTF8_STRING".
*
* For Win32 the following notes are important: Setting
* PYGAME_SCRAP_TEXT ("text/plain") will also automatically set
* the Win32 type "TEXT" (CF_TEXT).
*
* For QNX the following notes are important: Setting
* PYGAME_SCRAP_TEXT ("text/plain") will also automatically set
* the QNX type "TEXT" (Ph_CL_TEXT).
*
* \param type The type of the content.
* \param srclen The length of the content.
* \param src The NULL terminated content.
* \return 1, if the content could be successfully pasted into the clipboard,
* 0 otherwise.
*/
extern int
pygame_scrap_put(char *type, Py_ssize_t srclen, char *src);
/**
* \brief Gets the current content from the clipboard.
*
* \note The received content does not need to be the content previously
* placed in the clipboard using pygame_put_scrap(). See the
* pygame_put_scrap() notes for more details.
*
* \param type The type of the content to receive.
* \param count The size of the returned content.
* \return The content or NULL in case of an error or if no content of the
* specified type was available.
*/
extern char *
pygame_scrap_get(char *type, size_t *count);
/**
* \brief Gets the currently available content types from the clipboard.
*
* \return The different available content types or NULL in case of an
* error or if no content type is available.
*/
extern char **
pygame_scrap_get_types(void);
/**
* \brief Checks whether content for the specified scrap type is currently
* available in the clipboard.
*
* \param type The type to check for.
* \return 1, if there is content and 0 otherwise.
*/
extern int
pygame_scrap_contains(char *type);
#endif /* SCRAP_H */

View file

@ -0,0 +1,84 @@
#define NO_PYGAME_C_API
#include "_surface.h"
#include "_blit_info.h"
#if !defined(PG_ENABLE_ARM_NEON) && defined(__aarch64__)
// arm64 has neon optimisations enabled by default, even when fpu=neon is not
// passed
#define PG_ENABLE_ARM_NEON 1
#endif
int
pg_sse2_at_runtime_but_uncompiled();
int
pg_neon_at_runtime_but_uncompiled();
int
pg_avx2_at_runtime_but_uncompiled();
#if (defined(__SSE2__) || defined(PG_ENABLE_ARM_NEON))
void
alphablit_alpha_sse2_argb_surf_alpha(SDL_BlitInfo *info);
void
alphablit_alpha_sse2_argb_no_surf_alpha(SDL_BlitInfo *info);
void
alphablit_alpha_sse2_argb_no_surf_alpha_opaque_dst(SDL_BlitInfo *info);
void
blit_blend_rgba_mul_sse2(SDL_BlitInfo *info);
void
blit_blend_rgb_mul_sse2(SDL_BlitInfo *info);
void
blit_blend_rgba_add_sse2(SDL_BlitInfo *info);
void
blit_blend_rgb_add_sse2(SDL_BlitInfo *info);
void
blit_blend_rgba_sub_sse2(SDL_BlitInfo *info);
void
blit_blend_rgb_sub_sse2(SDL_BlitInfo *info);
void
blit_blend_rgba_max_sse2(SDL_BlitInfo *info);
void
blit_blend_rgb_max_sse2(SDL_BlitInfo *info);
void
blit_blend_rgba_min_sse2(SDL_BlitInfo *info);
void
blit_blend_rgb_min_sse2(SDL_BlitInfo *info);
void
blit_blend_premultiplied_sse2(SDL_BlitInfo *info);
#endif /* (defined(__SSE2__) || defined(PG_ENABLE_ARM_NEON)) */
/* Deliberately putting these outside of the preprocessor guards as I want to
move to a system of trusting the runtime checks to head to the right
function and having a fallback function there if pygame is not compiled
with the right stuff (this is the strategy used for AVX2 right now.
Potentially I might want to shift both these into a slightly different
file as they are not exactly blits (though v. similar) - or I could rename
the SIMD trilogy of files to replace the word blit with something more
generic like surface_ops*/
void
premul_surf_color_by_alpha_non_simd(SDL_Surface *src, SDL_Surface *dst);
void
premul_surf_color_by_alpha_sse2(SDL_Surface *src, SDL_Surface *dst);
int
pg_has_avx2();
void
blit_blend_rgba_mul_avx2(SDL_BlitInfo *info);
void
blit_blend_rgb_mul_avx2(SDL_BlitInfo *info);
void
blit_blend_rgba_add_avx2(SDL_BlitInfo *info);
void
blit_blend_rgb_add_avx2(SDL_BlitInfo *info);
void
blit_blend_rgba_sub_avx2(SDL_BlitInfo *info);
void
blit_blend_rgb_sub_avx2(SDL_BlitInfo *info);
void
blit_blend_rgba_max_avx2(SDL_BlitInfo *info);
void
blit_blend_rgb_max_avx2(SDL_BlitInfo *info);
void
blit_blend_rgba_min_avx2(SDL_BlitInfo *info);
void
blit_blend_rgb_min_avx2(SDL_BlitInfo *info);

View file

@ -0,0 +1,361 @@
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
Copyright (C) 2007 Marcus von Appen
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
#ifndef SURFACE_H
#define SURFACE_H
/* This is defined in SDL.h */
#if defined(_POSIX_C_SOURCE)
#undef _POSIX_C_SOURCE
#endif
#include <SDL.h>
#include "pygame.h"
/* Blend modes */
#define PYGAME_BLEND_ADD 0x1
#define PYGAME_BLEND_SUB 0x2
#define PYGAME_BLEND_MULT 0x3
#define PYGAME_BLEND_MIN 0x4
#define PYGAME_BLEND_MAX 0x5
#define PYGAME_BLEND_RGB_ADD 0x1
#define PYGAME_BLEND_RGB_SUB 0x2
#define PYGAME_BLEND_RGB_MULT 0x3
#define PYGAME_BLEND_RGB_MIN 0x4
#define PYGAME_BLEND_RGB_MAX 0x5
#define PYGAME_BLEND_RGBA_ADD 0x6
#define PYGAME_BLEND_RGBA_SUB 0x7
#define PYGAME_BLEND_RGBA_MULT 0x8
#define PYGAME_BLEND_RGBA_MIN 0x9
#define PYGAME_BLEND_RGBA_MAX 0x10
#define PYGAME_BLEND_PREMULTIPLIED 0x11
#define PYGAME_BLEND_ALPHA_SDL2 0x12
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define GET_PIXEL_24(b) (b[0] + (b[1] << 8) + (b[2] << 16))
#else
#define GET_PIXEL_24(b) (b[2] + (b[1] << 8) + (b[0] << 16))
#endif
#define GET_PIXEL(pxl, bpp, source) \
switch (bpp) { \
case 2: \
pxl = *((Uint16 *)(source)); \
break; \
case 4: \
pxl = *((Uint32 *)(source)); \
break; \
default: { \
Uint8 *b = (Uint8 *)source; \
pxl = GET_PIXEL_24(b); \
} break; \
}
#define GET_PIXELVALS(_sR, _sG, _sB, _sA, px, fmt, ppa) \
SDL_GetRGBA(px, fmt, &(_sR), &(_sG), &(_sB), &(_sA)); \
if (!ppa) { \
_sA = 255; \
}
#define GET_PIXELVALS_1(sr, sg, sb, sa, _src, _fmt) \
sr = _fmt->palette->colors[*((Uint8 *)(_src))].r; \
sg = _fmt->palette->colors[*((Uint8 *)(_src))].g; \
sb = _fmt->palette->colors[*((Uint8 *)(_src))].b; \
sa = 255;
/* For 1 byte palette pixels */
#define SET_PIXELVAL(px, fmt, _dR, _dG, _dB, _dA) \
*(px) = (Uint8)SDL_MapRGBA(fmt, _dR, _dG, _dB, _dA)
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define SET_OFFSETS_24(or, og, ob, fmt) \
{ \
or = (fmt->Rshift == 0 ? 0 : fmt->Rshift == 8 ? 1 : 2); \
og = (fmt->Gshift == 0 ? 0 : fmt->Gshift == 8 ? 1 : 2); \
ob = (fmt->Bshift == 0 ? 0 : fmt->Bshift == 8 ? 1 : 2); \
}
#define SET_OFFSETS_32(or, og, ob, fmt) \
{ \
or = (fmt->Rshift == 0 ? 0 \
: fmt->Rshift == 8 ? 1 \
: fmt->Rshift == 16 ? 2 \
: 3); \
og = (fmt->Gshift == 0 ? 0 \
: fmt->Gshift == 8 ? 1 \
: fmt->Gshift == 16 ? 2 \
: 3); \
ob = (fmt->Bshift == 0 ? 0 \
: fmt->Bshift == 8 ? 1 \
: fmt->Bshift == 16 ? 2 \
: 3); \
}
#else
#define SET_OFFSETS_24(or, og, ob, fmt) \
{ \
or = (fmt->Rshift == 0 ? 2 : fmt->Rshift == 8 ? 1 : 0); \
og = (fmt->Gshift == 0 ? 2 : fmt->Gshift == 8 ? 1 : 0); \
ob = (fmt->Bshift == 0 ? 2 : fmt->Bshift == 8 ? 1 : 0); \
}
#define SET_OFFSETS_32(or, og, ob, fmt) \
{ \
or = (fmt->Rshift == 0 ? 3 \
: fmt->Rshift == 8 ? 2 \
: fmt->Rshift == 16 ? 1 \
: 0); \
og = (fmt->Gshift == 0 ? 3 \
: fmt->Gshift == 8 ? 2 \
: fmt->Gshift == 16 ? 1 \
: 0); \
ob = (fmt->Bshift == 0 ? 3 \
: fmt->Bshift == 8 ? 2 \
: fmt->Bshift == 16 ? 1 \
: 0); \
}
#endif
#define CREATE_PIXEL(buf, r, g, b, a, bp, ft) \
switch (bp) { \
case 2: \
*((Uint16 *)(buf)) = ((r >> ft->Rloss) << ft->Rshift) | \
((g >> ft->Gloss) << ft->Gshift) | \
((b >> ft->Bloss) << ft->Bshift) | \
((a >> ft->Aloss) << ft->Ashift); \
break; \
case 4: \
*((Uint32 *)(buf)) = ((r >> ft->Rloss) << ft->Rshift) | \
((g >> ft->Gloss) << ft->Gshift) | \
((b >> ft->Bloss) << ft->Bshift) | \
((a >> ft->Aloss) << ft->Ashift); \
break; \
}
/* Pretty good idea from Tom Duff :-). */
#define LOOP_UNROLLED4(code, n, width) \
n = (width + 3) / 4; \
switch (width & 3) { \
case 0: \
do { \
code; \
case 3: \
code; \
case 2: \
code; \
case 1: \
code; \
} while (--n > 0); \
}
/* Used in the srcbpp == dstbpp == 1 blend functions */
#define REPEAT_3(code) \
code; \
code; \
code;
#define REPEAT_4(code) \
code; \
code; \
code; \
code;
#define BLEND_ADD(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \
tmp = dR + sR; \
dR = (tmp <= 255 ? tmp : 255); \
tmp = dG + sG; \
dG = (tmp <= 255 ? tmp : 255); \
tmp = dB + sB; \
dB = (tmp <= 255 ? tmp : 255);
#define BLEND_SUB(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \
tmp = dR - sR; \
dR = (tmp >= 0 ? tmp : 0); \
tmp = dG - sG; \
dG = (tmp >= 0 ? tmp : 0); \
tmp = dB - sB; \
dB = (tmp >= 0 ? tmp : 0);
#define BLEND_MULT(sR, sG, sB, sA, dR, dG, dB, dA) \
dR = (dR && sR) ? ((dR * sR) + 255) >> 8 : 0; \
dG = (dG && sG) ? ((dG * sG) + 255) >> 8 : 0; \
dB = (dB && sB) ? ((dB * sB) + 255) >> 8 : 0;
#define BLEND_MIN(sR, sG, sB, sA, dR, dG, dB, dA) \
if (sR < dR) { \
dR = sR; \
} \
if (sG < dG) { \
dG = sG; \
} \
if (sB < dB) { \
dB = sB; \
}
#define BLEND_MAX(sR, sG, sB, sA, dR, dG, dB, dA) \
if (sR > dR) { \
dR = sR; \
} \
if (sG > dG) { \
dG = sG; \
} \
if (sB > dB) { \
dB = sB; \
}
#define BLEND_RGBA_ADD(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \
tmp = dR + sR; \
dR = (tmp <= 255 ? tmp : 255); \
tmp = dG + sG; \
dG = (tmp <= 255 ? tmp : 255); \
tmp = dB + sB; \
dB = (tmp <= 255 ? tmp : 255); \
tmp = dA + sA; \
dA = (tmp <= 255 ? tmp : 255);
#define BLEND_RGBA_SUB(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \
tmp = dR - sR; \
dR = (tmp >= 0 ? tmp : 0); \
tmp = dG - sG; \
dG = (tmp >= 0 ? tmp : 0); \
tmp = dB - sB; \
dB = (tmp >= 0 ? tmp : 0); \
tmp = dA - sA; \
dA = (tmp >= 0 ? tmp : 0);
#define BLEND_RGBA_MULT(sR, sG, sB, sA, dR, dG, dB, dA) \
dR = (dR && sR) ? ((dR * sR) + 255) >> 8 : 0; \
dG = (dG && sG) ? ((dG * sG) + 255) >> 8 : 0; \
dB = (dB && sB) ? ((dB * sB) + 255) >> 8 : 0; \
dA = (dA && sA) ? ((dA * sA) + 255) >> 8 : 0;
#define BLEND_RGBA_MIN(sR, sG, sB, sA, dR, dG, dB, dA) \
if (sR < dR) { \
dR = sR; \
} \
if (sG < dG) { \
dG = sG; \
} \
if (sB < dB) { \
dB = sB; \
} \
if (sA < dA) { \
dA = sA; \
}
#define BLEND_RGBA_MAX(sR, sG, sB, sA, dR, dG, dB, dA) \
if (sR > dR) { \
dR = sR; \
} \
if (sG > dG) { \
dG = sG; \
} \
if (sB > dB) { \
dB = sB; \
} \
if (sA > dA) { \
dA = sA; \
}
#if 1
/* Choose an alpha blend equation. If the sign is preserved on a right shift
* then use a specialized, faster, equation. Otherwise a more general form,
* where all additions are done before the shift, is needed.
*/
#if (-1 >> 1) < 0
#define ALPHA_BLEND_COMP(sC, dC, sA) ((((sC - dC) * sA + sC) >> 8) + dC)
#else
#define ALPHA_BLEND_COMP(sC, dC, sA) (((dC << 8) + (sC - dC) * sA + sC) >> 8)
#endif
#define ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB, dA) \
do { \
if (dA) { \
dR = ALPHA_BLEND_COMP(sR, dR, sA); \
dG = ALPHA_BLEND_COMP(sG, dG, sA); \
dB = ALPHA_BLEND_COMP(sB, dB, sA); \
dA = sA + dA - ((sA * dA) / 255); \
} \
else { \
dR = sR; \
dG = sG; \
dB = sB; \
dA = sA; \
} \
} while (0)
#define ALPHA_BLEND_PREMULTIPLIED_COMP(sC, dC, sA) \
(sC + dC - ((dC + 1) * sA >> 8))
#define ALPHA_BLEND_PREMULTIPLIED(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \
do { \
dR = ALPHA_BLEND_PREMULTIPLIED_COMP(sR, dR, sA); \
dG = ALPHA_BLEND_PREMULTIPLIED_COMP(sG, dG, sA); \
dB = ALPHA_BLEND_PREMULTIPLIED_COMP(sB, dB, sA); \
dA = ALPHA_BLEND_PREMULTIPLIED_COMP(sA, dA, sA); \
} while (0)
#elif 0
#define ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB, dA) \
do { \
if (sA) { \
if (dA && sA < 255) { \
int dContrib = dA * (255 - sA) / 255; \
dA = sA + dA - ((sA * dA) / 255); \
dR = (dR * dContrib + sR * sA) / dA; \
dG = (dG * dContrib + sG * sA) / dA; \
dB = (dB * dContrib + sB * sA) / dA; \
} \
else { \
dR = sR; \
dG = sG; \
dB = sB; \
dA = sA; \
} \
} \
} while (0)
#endif
int
surface_fill_blend(SDL_Surface *surface, SDL_Rect *rect, Uint32 color,
int blendargs);
void
surface_respect_clip_rect(SDL_Surface *surface, SDL_Rect *rect);
int
pygame_AlphaBlit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst,
SDL_Rect *dstrect, int the_args);
int
pygame_Blit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst,
SDL_Rect *dstrect, int the_args);
int
premul_surf_color_by_alpha(SDL_Surface *src, SDL_Surface *dst);
int
pg_warn_simd_at_runtime_but_uncompiled();
#endif /* SURFACE_H */

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2018 Adafruit Industries
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,159 @@
Metadata-Version: 2.1
Name: Adafruit-Blinka
Version: 8.47.0
Summary: CircuitPython APIs for non-CircuitPython versions of Python such as CPython on Linux and MicroPython.
Home-page: https://github.com/adafruit/Adafruit_Blinka
Author: Adafruit Industries
Author-email: circuitpython@adafruit.com
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: MicroPython
Requires-Python: >=3.7.0
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: Adafruit-PlatformDetect (>=3.70.1)
Requires-Dist: Adafruit-PureIO (>=1.1.7)
Requires-Dist: binho-host-adapter (>=0.1.6)
Requires-Dist: pyftdi (>=0.40.0)
Requires-Dist: adafruit-circuitpython-typing
Requires-Dist: RPi.GPIO
Requires-Dist: rpi-ws281x (>=4.0.0)
Requires-Dist: sysv-ipc (>=1.1.0) ; sys_platform == "linux" and platform_machine != "mips"
Introduction
============
.. image:: https://readthedocs.org/projects/adafruit-micropython-blinka/badge/?version=latest
:target: https://circuitpython.readthedocs.io/projects/blinka/en/latest/
:alt: Documentation Status
.. image:: https://img.shields.io/discord/327254708534116352.svg
:target: https://adafru.it/discord
:alt: Discord
.. 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 emulating the CircuitPython API
for devices or hosts running CPython or MicroPython. Working code exists to emulate these CircuitPython packages:
* **analogio** - analog input/output pins, using pin identities from board+microcontroller packages
* **bitbangio** - software-driven interfaces for I2C, SPI
* **board** - breakout-specific pin identities
* **busio** - hardware-driven interfaces for I2C, SPI, UART
* **digitalio** - digital input/output pins, using pin identities from board+microcontroller packages
* **keypad** - support for scanning keys and key matrices
* **microcontroller** - chip-specific pin identities
* **micropython** - MicroPython-specific module
* **neopixel_write** - low-level interface to NeoPixels
* **pulseio** - contains classes that provide access to basic pulse IO (PWM)
* **pwmio** - contains classes that provide access to basic pulse IO (PWM)
* **rainbowio** - provides the colorwheel() function
* **usb_hid** - act as a hid-device using usb_gadget kernel driver
For details, see the `Blinka API reference
<https://circuitpython.readthedocs.io/projects/blinka/en/latest/index.html>`_.
Dependencies
=============
The emulation described above is intended to provide a
CircuitPython-like API for devices which 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* CPython/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
=============
The pin names may vary by board, so you may need to change the pin names in the code. This
example runs on the Raspberry Pi boards to blink an LED connected to GPIO 18 (Pin 12):
.. code-block:: python
import time
import board
import digitalio
PIN = board.D18
print("hello blinky!")
led = digitalio.DigitalInOut(PIN)
led.direction = digitalio.Direction.OUTPUT
while True:
led.value = True
time.sleep(0.5)
led.value = False
time.sleep(0.5)
Contributing
============
Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_Blinka/blob/master/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.
Building locally
================
Sphinx documentation
-----------------------
Sphinx is used to build the documentation based on rST files and comments in the code. First,
install dependencies (feel free to reuse the virtual environment from above):
.. code-block:: shell
python3 -m venv .env
source .env/bin/activate
pip install Sphinx sphinx-rtd-theme Adafruit-PlatformDetect
Now, once you have the virtual environment activated:
.. code-block:: shell
cd docs
sphinx-build -E -W -b html . _build/html
This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
locally verify it will pass.

View file

@ -0,0 +1,736 @@
Adafruit_Blinka-8.47.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
Adafruit_Blinka-8.47.0.dist-info/LICENSE,sha256=UODDtbRIa-DtQgY5-KH28RXykQH-7mvNlUpLgdsE0PM,1086
Adafruit_Blinka-8.47.0.dist-info/METADATA,sha256=L-obzwoo5EtsUHRiKpaFKt-pa9wEmzrLjEfSs8Mbg2E,5535
Adafruit_Blinka-8.47.0.dist-info/RECORD,,
Adafruit_Blinka-8.47.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
Adafruit_Blinka-8.47.0.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
Adafruit_Blinka-8.47.0.dist-info/top_level.txt,sha256=ol8MVXQjyEEz8Hm-Z57kjjZYbi9TpphczXLTwQMQTBk,167
__pycache__/analogio.cpython-311.pyc,,
__pycache__/bitbangio.cpython-311.pyc,,
__pycache__/board.cpython-311.pyc,,
__pycache__/busio.cpython-311.pyc,,
__pycache__/digitalio.cpython-311.pyc,,
__pycache__/keypad.cpython-311.pyc,,
__pycache__/micropython.cpython-311.pyc,,
__pycache__/neopixel_write.cpython-311.pyc,,
__pycache__/onewireio.cpython-311.pyc,,
__pycache__/pulseio.cpython-311.pyc,,
__pycache__/pwmio.cpython-311.pyc,,
__pycache__/rainbowio.cpython-311.pyc,,
__pycache__/usb_hid.cpython-311.pyc,,
adafruit_blinka/__init__.py,sha256=_KnQR9IT_5pOnboD4shO4eKtJ5JGxYLSsn6abn5u9qE,2385
adafruit_blinka/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/agnostic/__init__.py,sha256=2ZBsZstZ0j9N2jC3h16RlIegYM6pLnB5G3CJoQZh4OE,1164
adafruit_blinka/agnostic/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/agnostic/__pycache__/time.cpython-311.pyc,,
adafruit_blinka/agnostic/time.py,sha256=zbUmuMLoP9LbQY5VzqI53RkJkcMT8tmwqjifyVLzyeM,2011
adafruit_blinka/board/OLIMEX_LIME2.py,sha256=1hwzEcfJghG02KxAow7cVyHxOKBEqzsVT9ATM7mgZRw,2237
adafruit_blinka/board/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/board/__pycache__/OLIMEX_LIME2.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/binho_nova.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/clockworkcpi3.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/coral_dev_board.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/coral_dev_board_mini.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/dragonboard_410c.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/feather_can_u2if.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/feather_epd_u2if.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/feather_huzzah.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/feather_rfm_u2if.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/feather_u2if.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/ftdi_ft2232h.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/ftdi_ft232h.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/generic_agnostic_board.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/generic_linux_pc.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/giantboard.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/greatfet_one.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/hifive_unleashed.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/itsybitsy_u2if.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/kb2040_u2if.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/lichee_rv.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/licheepi_4a.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/macropad_u2if.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/microchip_mcp2221.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/milkv_duo.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/nodemcu.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/pico_u2if.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/pineH64.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/pyboard.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/qt2040_trinkey_u2if.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/qtpy_u2if.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/rp2040_one_u2if.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/soPine.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/tritium-h3.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/udoo_x86ultra.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/vivid_unit.cpython-311.pyc,,
adafruit_blinka/board/__pycache__/x86j41x5.cpython-311.pyc,,
adafruit_blinka/board/bananapi/__init__.py,sha256=vV-I0ULkHsU8jvVuAiivQIG8TbruobbLZfS6qf5S6cU,152
adafruit_blinka/board/bananapi/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/bananapi/__pycache__/bpim2plus.cpython-311.pyc,,
adafruit_blinka/board/bananapi/__pycache__/bpim2zero.cpython-311.pyc,,
adafruit_blinka/board/bananapi/__pycache__/bpim5.cpython-311.pyc,,
adafruit_blinka/board/bananapi/bpim2plus.py,sha256=LgEX0AUGJzc_rAUFxWhhF-iY1772nhZClMkTZgzEEe8,1441
adafruit_blinka/board/bananapi/bpim2zero.py,sha256=hF1uV721yCx-83-X0HYLYeBuae-h2-vvpDKalZoiBEA,1441
adafruit_blinka/board/bananapi/bpim5.py,sha256=dvuj_C6eQgOxvvPlbuDZiDNl-JJJKUeYDEgJRiiDWMQ,1337
adafruit_blinka/board/beagleboard/__init__.py,sha256=J8PAw_ifGdqZ-tKrZ-4AHJsbKLNsM63bZb4vEt9LxJc,154
adafruit_blinka/board/beagleboard/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/beagleboard/__pycache__/beaglebone_ai.cpython-311.pyc,,
adafruit_blinka/board/beagleboard/__pycache__/beaglebone_black.cpython-311.pyc,,
adafruit_blinka/board/beagleboard/__pycache__/beaglebone_blue.cpython-311.pyc,,
adafruit_blinka/board/beagleboard/__pycache__/beaglebone_pocketbeagle.cpython-311.pyc,,
adafruit_blinka/board/beagleboard/__pycache__/beaglev_starlight.cpython-311.pyc,,
adafruit_blinka/board/beagleboard/beaglebone_ai.py,sha256=-4ZWsFAqJXfkiWhUCNRkP7m03dovomsgdbceLdT-76w,4599
adafruit_blinka/board/beagleboard/beaglebone_black.py,sha256=h90N2OCcE9nYqYwGL1t-DYT6krDybG2m-8WwB11JgV4,5598
adafruit_blinka/board/beagleboard/beaglebone_blue.py,sha256=kiY3my53vRZbxf7nAYJ9xQ0gUwkoXURJyGuqH4wRv28,359
adafruit_blinka/board/beagleboard/beaglebone_pocketbeagle.py,sha256=O8rUJd09xVXrMygiOG7AU3pjcwyQDgn-jSmL1ijJjFw,4582
adafruit_blinka/board/beagleboard/beaglev_starlight.py,sha256=VA2u28-hR8ac1dpmjUk8HkPcCqvwQRKLN3GTzeZrfhc,835
adafruit_blinka/board/binho_nova.py,sha256=dg2g7HTYMPnILgYLtvatEaZ1pvTZrnf1h69_KFJhe7M,417
adafruit_blinka/board/clockworkcpi3.py,sha256=nh7DGjZL5qxhj_lMPnV3x8JJLhAdlLZ-uOVbJ6LKy18,1048
adafruit_blinka/board/coral_dev_board.py,sha256=WevyZSohoNC9R0qZGybDuvpJBoBgv5bkLH6tDlef94A,833
adafruit_blinka/board/coral_dev_board_mini.py,sha256=DaPwzx-nZgXbdiiQ0J8qLxE1JlNj06sJ1MS66uGeGEs,1395
adafruit_blinka/board/dragonboard_410c.py,sha256=yp1JjBiDDM9JdhLKi5U23Ez_nlM9M4zWkQ7r5LlvivQ,972
adafruit_blinka/board/feather_can_u2if.py,sha256=cXKUO4ypBpxd7cU8tE7krDZ-xdM7SOyZADqBe7HmYJM,1484
adafruit_blinka/board/feather_epd_u2if.py,sha256=jqfUXoRTFBiAfF7MTv-wgp7EyUdEQuTjAXkj6FlEOGU,1431
adafruit_blinka/board/feather_huzzah.py,sha256=_xRgtV7yPXdFtWevnLr5B0bc-yqcT5ejaS3GwCaZ22o,647
adafruit_blinka/board/feather_rfm_u2if.py,sha256=ShHQawz8J2_Kk-Uuv_kSpHQsmQa5wsTDIQmrVuu9qac,1486
adafruit_blinka/board/feather_u2if.py,sha256=p4vCZfBfDz67bXY7h-jW_ceAzwoel35RtEoLChlPyDI,1220
adafruit_blinka/board/ftdi_ft2232h.py,sha256=whZg1Medz5_hwYoq1qQh8kkxU-FXOHLw7OTWwpHP-IQ,789
adafruit_blinka/board/ftdi_ft232h.py,sha256=QzbLi43Q94b2CwJTnHEdNGmOODlsZAAqGc3_M2T6FPQ,458
adafruit_blinka/board/generic_agnostic_board.py,sha256=fWyqxUUYjm06Ijr0f6XmPthQ8YDDzGFlN545Drj98nA,873
adafruit_blinka/board/generic_linux_pc.py,sha256=HQ-A3YNp54IXlBXVVR34zBJBc2MDCtwRlCqPDhn9VPI,165
adafruit_blinka/board/giantboard.py,sha256=_otsz78DH2LjyxuoWo5LTShK8_d2ufftbC7oOrb_Ebo,784
adafruit_blinka/board/greatfet_one.py,sha256=W_bjRw7biUvUYGeUyFyrHb_8oIq1Dnm1InZxubTM6Eo,1847
adafruit_blinka/board/hardkernel/__init__.py,sha256=-PYWUqlVU6GQEETfbPorR-iTQcxnHsx2pKK7hZKzNe0,153
adafruit_blinka/board/hardkernel/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/hardkernel/__pycache__/odroidc2.cpython-311.pyc,,
adafruit_blinka/board/hardkernel/__pycache__/odroidc4.cpython-311.pyc,,
adafruit_blinka/board/hardkernel/__pycache__/odroidm1.cpython-311.pyc,,
adafruit_blinka/board/hardkernel/__pycache__/odroidm1s.cpython-311.pyc,,
adafruit_blinka/board/hardkernel/__pycache__/odroidn2.cpython-311.pyc,,
adafruit_blinka/board/hardkernel/__pycache__/odroidxu4.cpython-311.pyc,,
adafruit_blinka/board/hardkernel/odroidc2.py,sha256=3x2TopbyW5FqINsmbQsZ_mw7nAMH3sr0cytpY_HBwt8,1639
adafruit_blinka/board/hardkernel/odroidc4.py,sha256=kXq4A0DFZ3HtW4MiwZqA3H81aYtUqiIG8s0BX6WjQx4,1269
adafruit_blinka/board/hardkernel/odroidm1.py,sha256=h5CLswDTwSC2nBNHeG-L7DupLSgWiZyhBfCrlsyffCw,1000
adafruit_blinka/board/hardkernel/odroidm1s.py,sha256=HGla4et0Zr2SyinvSXSKnd5SwjHKMgv2rK7MqNgAoSw,1103
adafruit_blinka/board/hardkernel/odroidn2.py,sha256=a70gXVhL6_aQMzZyb4vNgwA88diPlSzBBy23sjIidRk,2048
adafruit_blinka/board/hardkernel/odroidxu4.py,sha256=4-SFuPWIFOZVK5oAXl5zvekxzNu9gUNYadiiLxm7dnE,903
adafruit_blinka/board/hifive_unleashed.py,sha256=wPnltQDvNoKNICDmzsKbzfWYIgipPPrOy3dte_zm44U,851
adafruit_blinka/board/itsybitsy_u2if.py,sha256=GE_m7S1ZDEW0GmoEDquDjnwzHpLh2jYhcE1GRzJ5puM,1351
adafruit_blinka/board/kb2040_u2if.py,sha256=Dbiw5h0KQrpEYqV4bE9I2SbgQEPk2O-yM2nHgXhGeSQ,1264
adafruit_blinka/board/khadas/__init__.py,sha256=FPNBqsJPsHCkp4WfPK7MaDzTqhfr5NksgM5DswqLzSs,149
adafruit_blinka/board/khadas/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/khadas/__pycache__/khadasvim3.cpython-311.pyc,,
adafruit_blinka/board/khadas/khadasvim3.py,sha256=Cp2uUheqVC-goW5UFWHUlok77A1QrglYizCQ9uhUmEU,2985
adafruit_blinka/board/lemaker/__init__.py,sha256=oJqscrLv3JGVY8-_g203aClXq6l72sKu0s6fwsRJbcY,150
adafruit_blinka/board/lemaker/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/lemaker/__pycache__/bananapro.cpython-311.pyc,,
adafruit_blinka/board/lemaker/bananapro.py,sha256=vKh2D-ehC2vlsOWFvAEYS4jU2DPTUUr32Cqm9AyfFww,3787
adafruit_blinka/board/librecomputer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/board/librecomputer/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/librecomputer/__pycache__/aml_s905x_cc_v1.cpython-311.pyc,,
adafruit_blinka/board/librecomputer/__pycache__/roc_rk3328_cc.cpython-311.pyc,,
adafruit_blinka/board/librecomputer/aml_s905x_cc_v1.py,sha256=ep3mIc57FSDhEvRdLpV9fIntqR8gHutYeBg4xZP9S20,1307
adafruit_blinka/board/librecomputer/roc_rk3328_cc.py,sha256=u_bmIpMEAVCjj1Y5fRXefCZUs-VO1mK_GpodJAmmLpM,1153
adafruit_blinka/board/lichee_rv.py,sha256=gQio9fsip3deYP87H_TS3tf7hI5AKGv8MuP4YmxQ83k,764
adafruit_blinka/board/licheepi_4a.py,sha256=ZWgiMLTJqeCPQVD93t3LKh1NVN4I_4IFv1pPZrit4GE,739
adafruit_blinka/board/linksprite/__init__.py,sha256=vp_0eCnvrRMk88r1vW_OrUkNBMXdYUXraqSuT45X-0c,174
adafruit_blinka/board/linksprite/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/linksprite/__pycache__/pcduino2.cpython-311.pyc,,
adafruit_blinka/board/linksprite/__pycache__/pcduino3.cpython-311.pyc,,
adafruit_blinka/board/linksprite/pcduino2.py,sha256=t7Y7hRZBo1mgcEcn-Mgy9RWhjwj_hqVrdwSsp33MeQ4,1253
adafruit_blinka/board/linksprite/pcduino3.py,sha256=iLoxH07NVg3pqGRcut_2PTOQhHX2JlmabubgTB4YSmI,1107
adafruit_blinka/board/lubancat/__init__.py,sha256=Zf2uJ08dlYPYxzfxQ5mMkXcTxseSMD8x89F5IfYF24U,151
adafruit_blinka/board/lubancat/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/lubancat/__pycache__/lubancat1.cpython-311.pyc,,
adafruit_blinka/board/lubancat/__pycache__/lubancat2.cpython-311.pyc,,
adafruit_blinka/board/lubancat/__pycache__/lubancat4.cpython-311.pyc,,
adafruit_blinka/board/lubancat/__pycache__/lubancat5.cpython-311.pyc,,
adafruit_blinka/board/lubancat/__pycache__/lubancat_imx6ull.cpython-311.pyc,,
adafruit_blinka/board/lubancat/__pycache__/lubancat_stm32mp157.cpython-311.pyc,,
adafruit_blinka/board/lubancat/__pycache__/lubancat_zero.cpython-311.pyc,,
adafruit_blinka/board/lubancat/lubancat1.py,sha256=nbL7u0DAAgPgk9FZRg8Sju6scpMvXhTJQjYVltsA3FM,1482
adafruit_blinka/board/lubancat/lubancat2.py,sha256=FjEhhmuoAje-1etsXsNmnS3CBUhj5S1jXdllfE3o6j8,1563
adafruit_blinka/board/lubancat/lubancat4.py,sha256=HVTsaaVMn2Xv1ejIF1U1FhF6_3kgfpI1AIZDuFrjBiQ,1767
adafruit_blinka/board/lubancat/lubancat5.py,sha256=gtpgxoN2vslf3lDF8jYH3Rbuv220hkrDeywhCotHzPQ,1591
adafruit_blinka/board/lubancat/lubancat_imx6ull.py,sha256=IXK7Ur-QTq-VG9UFlj82VSEbNw2_HRiEQwohdtJdIto,1751
adafruit_blinka/board/lubancat/lubancat_stm32mp157.py,sha256=SaU6nW_WSFPEIEgsiijTZigxSp1S17-Sidh5IcymDUI,1537
adafruit_blinka/board/lubancat/lubancat_zero.py,sha256=TlHHoCYu6be-Cic3BQL40oJX_9tlz0CVwZ6BL2pWaec,1495
adafruit_blinka/board/luckfox/__pycache__/luckfoxpico.cpython-311.pyc,,
adafruit_blinka/board/luckfox/__pycache__/luckfoxpico_max.cpython-311.pyc,,
adafruit_blinka/board/luckfox/__pycache__/luckfoxpico_mini.cpython-311.pyc,,
adafruit_blinka/board/luckfox/__pycache__/luckfoxpico_plus.cpython-311.pyc,,
adafruit_blinka/board/luckfox/luckfoxpico.py,sha256=tDDNbFJaoSPaqE_7sQYNug8esgDhtmVa2YJL7hiRRgg,1340
adafruit_blinka/board/luckfox/luckfoxpico_max.py,sha256=Gy_Ji7zRi8pK0vR9NvN8Wf_Yg7JHXHoGW2AuWTkqIY4,1381
adafruit_blinka/board/luckfox/luckfoxpico_mini.py,sha256=BzcANpBwdMs_PFv9G0P9HxLyME3h6bvZecjqrnKuAMg,1174
adafruit_blinka/board/luckfox/luckfoxpico_plus.py,sha256=_OqT0lhrlU1pxgRlCFjHkCygPl4HU-JkqDxFNTU2zUo,1363
adafruit_blinka/board/macropad_u2if.py,sha256=wTXpVKTDb4ov7n7GQYMPXKlTHejFz5_eWGxnBiP-g34,1454
adafruit_blinka/board/microchip_mcp2221.py,sha256=-uPZQZfle5_4iB2ylcHN3gReSbZqWj5ykwe0yxQvqnA,295
adafruit_blinka/board/milkv_duo.py,sha256=P_xLUzdgwnDIpi8W8B5Yrm0dxNcFPLc84unZObG1mQE,806
adafruit_blinka/board/nanopi/__init__.py,sha256=3B1Z7hYACPToFK-bHMxmzvmGn2M1oQvf_XDfm0PFN0E,149
adafruit_blinka/board/nanopi/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/nanopi/__pycache__/duo2.cpython-311.pyc,,
adafruit_blinka/board/nanopi/__pycache__/neo.cpython-311.pyc,,
adafruit_blinka/board/nanopi/__pycache__/neoair.cpython-311.pyc,,
adafruit_blinka/board/nanopi/duo2.py,sha256=Ed-CkB-hzN-9LIz9PBqOtBYhxeaFyMicfyPKhk9XtNg,573
adafruit_blinka/board/nanopi/neo.py,sha256=6w_2EBFrP55bN1-XCPwtqtUo-yj6fBTMvFgw_M4QxtA,846
adafruit_blinka/board/nanopi/neoair.py,sha256=6w_2EBFrP55bN1-XCPwtqtUo-yj6fBTMvFgw_M4QxtA,846
adafruit_blinka/board/nodemcu.py,sha256=5BpaWQJ59FpSRHdEPGIMPFCTwEstr-f74AoPw5uyxOc,694
adafruit_blinka/board/nvidia/__init__.py,sha256=oMuz9rKClk1dFbCOyEi1Qe1YkhLa4YTk0n-aRQwpagU,149
adafruit_blinka/board/nvidia/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/nvidia/__pycache__/clara_agx_xavier.cpython-311.pyc,,
adafruit_blinka/board/nvidia/__pycache__/jetson_nano.cpython-311.pyc,,
adafruit_blinka/board/nvidia/__pycache__/jetson_nx.cpython-311.pyc,,
adafruit_blinka/board/nvidia/__pycache__/jetson_orin.cpython-311.pyc,,
adafruit_blinka/board/nvidia/__pycache__/jetson_orin_nx.cpython-311.pyc,,
adafruit_blinka/board/nvidia/__pycache__/jetson_tx1.cpython-311.pyc,,
adafruit_blinka/board/nvidia/__pycache__/jetson_tx2.cpython-311.pyc,,
adafruit_blinka/board/nvidia/__pycache__/jetson_tx2_nx.cpython-311.pyc,,
adafruit_blinka/board/nvidia/__pycache__/jetson_xavier.cpython-311.pyc,,
adafruit_blinka/board/nvidia/clara_agx_xavier.py,sha256=YfqchUj2Q2cAy-by2XazeQFEahLI8DllKvCPiiP13w4,652
adafruit_blinka/board/nvidia/jetson_nano.py,sha256=GIMNnBHNaMt8csjSEJBsNyuWkpuOp6M3_kievldktq8,719
adafruit_blinka/board/nvidia/jetson_nx.py,sha256=SfcnRby1N6CVM08NIyXY_WW46r1IxZDOrxR8oa17-bo,640
adafruit_blinka/board/nvidia/jetson_orin.py,sha256=bIhAJj1qz3Bi2MHQPXCAb5OC0mKgTMJ7xEXdOp_yUNI,704
adafruit_blinka/board/nvidia/jetson_orin_nx.py,sha256=HhtDtKkjDdKeJZsnKMsbhFhkUaBLNBS0vE-zRIolxAc,712
adafruit_blinka/board/nvidia/jetson_tx1.py,sha256=eD1dMq4YV_jLro7kFjTXzuK6HkLuqElCiJjrFaKIGMY,642
adafruit_blinka/board/nvidia/jetson_tx2.py,sha256=q3aQgtHXiuJN3nGm8UYkHk26Opkg0H_YYxcRCfcwb74,642
adafruit_blinka/board/nvidia/jetson_tx2_nx.py,sha256=4uuR2TdG1xzRY__yXhlwdj3OFolECSxFwH9UOVD_slU,644
adafruit_blinka/board/nvidia/jetson_xavier.py,sha256=0tJIccuAfbJZor2TDsXorDvm24a63KA8Ie9sAsvbIDA,649
adafruit_blinka/board/onion/__init__.py,sha256=O8pRGz7qUm_r-Dv_8QM6h-s4Q-_floGDdoRisZ5WHUk,148
adafruit_blinka/board/onion/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/onion/__pycache__/omega2.cpython-311.pyc,,
adafruit_blinka/board/onion/omega2.py,sha256=Ecj4J_wXeawee6Nac1ScazyGQdpDkA-3_8nQftcDsR8,713
adafruit_blinka/board/orangepi/__init__.py,sha256=AlwNbq_1J7jHRR9y3MRMB7oc6_QkRGWpjBbFTRRI5P8,160
adafruit_blinka/board/orangepi/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/orangepi/__pycache__/orangepi3.cpython-311.pyc,,
adafruit_blinka/board/orangepi/__pycache__/orangepi4.cpython-311.pyc,,
adafruit_blinka/board/orangepi/__pycache__/orangepi5.cpython-311.pyc,,
adafruit_blinka/board/orangepi/__pycache__/orangepi5plus.cpython-311.pyc,,
adafruit_blinka/board/orangepi/__pycache__/orangepipc.cpython-311.pyc,,
adafruit_blinka/board/orangepi/__pycache__/orangepipc2.cpython-311.pyc,,
adafruit_blinka/board/orangepi/__pycache__/orangepir1.cpython-311.pyc,,
adafruit_blinka/board/orangepi/__pycache__/orangepizero.cpython-311.pyc,,
adafruit_blinka/board/orangepi/__pycache__/orangepizero2.cpython-311.pyc,,
adafruit_blinka/board/orangepi/__pycache__/orangepizeroplus.cpython-311.pyc,,
adafruit_blinka/board/orangepi/__pycache__/orangepizeroplus2h5.cpython-311.pyc,,
adafruit_blinka/board/orangepi/orangepi3.py,sha256=rnJgsm_aZmKI1_CADcw-T_PZfWsGw-5ZIbpPYyq_9cw,630
adafruit_blinka/board/orangepi/orangepi4.py,sha256=znp3mcuiByc7ilworP7eVIkzjH2kp7DmQJfYR4T9OzY,3607
adafruit_blinka/board/orangepi/orangepi5.py,sha256=TKQrIEoSzLY_FzByiXomQEXrkat811QhxnoQN2uE190,1311
adafruit_blinka/board/orangepi/orangepi5plus.py,sha256=jDZnqFH5P8ti1il4S6n7LZ71LpXFE8SYIC597Nev7Pw,1851
adafruit_blinka/board/orangepi/orangepipc.py,sha256=O6JxRxKooaFtYwUK5EfS3VPXH9-mnLC9co39ofYGLD4,793
adafruit_blinka/board/orangepi/orangepipc2.py,sha256=3PDjD3Kx-3eJjSprx3M87Qgc2EpwfpdRUHZT6tbuKh0,777
adafruit_blinka/board/orangepi/orangepir1.py,sha256=d9tTCnymzpsqy6ZFfYJ3eNcEzN8BFrr7y3NKIsfaefw,734
adafruit_blinka/board/orangepi/orangepizero.py,sha256=pBhZ2uW3bEQPMP3zDkLIpJsqriNPhgdaX6HryGeHqXo,802
adafruit_blinka/board/orangepi/orangepizero2.py,sha256=MPVsqzuK6na_UVhZ-MvotUaljb1SXF4At3d4oMqi0iw,659
adafruit_blinka/board/orangepi/orangepizeroplus.py,sha256=x8nCWS-rAHlVOQvrhc7754KKH58L80fku3Sf3DpeEC8,772
adafruit_blinka/board/orangepi/orangepizeroplus2h5.py,sha256=kBSVBCHR0-0Hhw2a0bhXaFlkwwVR6ooLU37bsRDbZQw,710
adafruit_blinka/board/pico_u2if.py,sha256=My1sX_3siyopJnhizeSbD1PUsH_OlaoidBm1xtrLFXc,981
adafruit_blinka/board/pine64/__init__.py,sha256=2g5wpsZUfAhsHZVRn07LH-AX4-wk2SlcGgo2fYbLrqU,112
adafruit_blinka/board/pine64/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/pine64/__pycache__/pine64.cpython-311.pyc,,
adafruit_blinka/board/pine64/__pycache__/quartz64_a.cpython-311.pyc,,
adafruit_blinka/board/pine64/pine64.py,sha256=RbWGqFLBHqvAVfwFSa2O_B6FYOIWhjcj-qKw3dqlnNk,788
adafruit_blinka/board/pine64/quartz64_a.py,sha256=EEqvhM7n9_Yvzn69JcpG_tFkyFBFEVqw9dc0Nr7qYSY,717
adafruit_blinka/board/pineH64.py,sha256=Ro4_scT0-sun2JPcm5-2X4nfSk-esfAAH_HnjuZxcDM,675
adafruit_blinka/board/pyboard.py,sha256=oBKkuJcpv73ftg6ySGnA-AO158uBqIQfGTPJi-2Gvps,896
adafruit_blinka/board/qt2040_trinkey_u2if.py,sha256=Np8uZ8vUKqaYlRJSprKGBlG84nhemSK8bFI9f6XAL24,445
adafruit_blinka/board/qtpy_u2if.py,sha256=xoi0sCIDzA7BhmrWxfustt0hMxdveDAsA0hfTpFSet4,1299
adafruit_blinka/board/radxa/__init__.py,sha256=K2BxqGGcHui_nRk34EtRjbWfUFJoIzrruS7IOXkdhIY,156
adafruit_blinka/board/radxa/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/radxa/__pycache__/radxacm3.cpython-311.pyc,,
adafruit_blinka/board/radxa/__pycache__/radxazero.cpython-311.pyc,,
adafruit_blinka/board/radxa/__pycache__/radxazero3.cpython-311.pyc,,
adafruit_blinka/board/radxa/__pycache__/rock5.cpython-311.pyc,,
adafruit_blinka/board/radxa/__pycache__/rock5c.cpython-311.pyc,,
adafruit_blinka/board/radxa/__pycache__/rockpi3a.cpython-311.pyc,,
adafruit_blinka/board/radxa/__pycache__/rockpi3c.cpython-311.pyc,,
adafruit_blinka/board/radxa/__pycache__/rockpi4.cpython-311.pyc,,
adafruit_blinka/board/radxa/__pycache__/rockpie.cpython-311.pyc,,
adafruit_blinka/board/radxa/__pycache__/rockpis.cpython-311.pyc,,
adafruit_blinka/board/radxa/radxacm3.py,sha256=-er4WibbewrPZ-0Y-wOiT3DVIist9scyPDLhLT2PBqk,2124
adafruit_blinka/board/radxa/radxazero.py,sha256=m3ON3u7L7dNCb6xtxdBboesVKxSw07bDeUKn3WEdgLI,857
adafruit_blinka/board/radxa/radxazero3.py,sha256=j5_sOtmd5tr6p2mtrqiF1xyZQ3X-5_3Lc1_uYI9Jhpo,1138
adafruit_blinka/board/radxa/rock5.py,sha256=yNdMefkPHoI9c7-HOWQKTMPeBXXgmjXA7qOjRk3ANME,2465
adafruit_blinka/board/radxa/rock5c.py,sha256=MOPzYT-vunAyoZ17wwI60BWwBPwdzcsRrxCSpdtMs64,2925
adafruit_blinka/board/radxa/rockpi3a.py,sha256=CffA4XLyK_UH2b-H74nGMrTIm-JIpbzuqY34FZX24XU,1513
adafruit_blinka/board/radxa/rockpi3c.py,sha256=r8GL9AJrGuK4Dxx1koZJWu8RTLNUu8YFMWHvoEoqj94,1129
adafruit_blinka/board/radxa/rockpi4.py,sha256=6vTty9Q5LRhICn0rmLGT1O5ZrNymqXlNQRF2y6NvDEo,1096
adafruit_blinka/board/radxa/rockpie.py,sha256=BeNilV6XQxa9urhlaFeZCUuQ4oYwlDnAetk-AZxMpSw,1500
adafruit_blinka/board/radxa/rockpis.py,sha256=96ne9jWxzJmmV8P4-T-edBH_R9SN31yWpOWfssHAy_c,999
adafruit_blinka/board/raspberrypi/__init__.py,sha256=apZ0b0uyIcb8QFCn5Wl8IGYRAxLnE-DxZelJh_QY_nA,155
adafruit_blinka/board/raspberrypi/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/raspberrypi/__pycache__/pico.cpython-311.pyc,,
adafruit_blinka/board/raspberrypi/__pycache__/raspi_1b_rev1.cpython-311.pyc,,
adafruit_blinka/board/raspberrypi/__pycache__/raspi_1b_rev2.cpython-311.pyc,,
adafruit_blinka/board/raspberrypi/__pycache__/raspi_40pin.cpython-311.pyc,,
adafruit_blinka/board/raspberrypi/__pycache__/raspi_4b.cpython-311.pyc,,
adafruit_blinka/board/raspberrypi/__pycache__/raspi_cm.cpython-311.pyc,,
adafruit_blinka/board/raspberrypi/pico.py,sha256=Sy8iobMIuSJjBRPsqQQD4VEKBPMgOrQ85O61x5RWIUg,765
adafruit_blinka/board/raspberrypi/raspi_1b_rev1.py,sha256=_qrfxJVUWsHiGsKvlxiFTBxNsxgHeTUWsxQOlDpcpAI,667
adafruit_blinka/board/raspberrypi/raspi_1b_rev2.py,sha256=VJcaSo9V71MsuEpPJ7GKj7K0QdcTjHqZgfn_DiaDrrk,667
adafruit_blinka/board/raspberrypi/raspi_40pin.py,sha256=APNyA3mRi8aMt99lvatBlMGPoyxpAzxPwJpHnukbkDw,876
adafruit_blinka/board/raspberrypi/raspi_4b.py,sha256=ohRDflMXMybpZN8Z5GLI4c9wt37-HTElGJnlgK1XP4I,889
adafruit_blinka/board/raspberrypi/raspi_cm.py,sha256=1dqWpNri5uQt1E8QMBpFmwHWW6bdr9aTC4U-n8416mY,1172
adafruit_blinka/board/repkapi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/board/repkapi/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/repkapi/__pycache__/repka_pi_3.cpython-311.pyc,,
adafruit_blinka/board/repkapi/__pycache__/repka_pi_4.cpython-311.pyc,,
adafruit_blinka/board/repkapi/repka_pi_3.py,sha256=EQwpiva5bqjcLKkv0W1EkdbtG9AsKRBOcxRLgaIzleY,1515
adafruit_blinka/board/repkapi/repka_pi_4.py,sha256=StIajnEykxEmJSv61oJn4X7Zy-dE7HBBFZPhw8Ym-oY,1222
adafruit_blinka/board/rp2040_one_u2if.py,sha256=yBSnnRTKRav_tJcVcPo_k0B9TVnKQ1mOzDle16wTAT0,1379
adafruit_blinka/board/siemens/__init__.py,sha256=9wQJn9L_oGWjYMQnb1ypt3Qn-GN3O_gBeMP6adyqb8E,133
adafruit_blinka/board/siemens/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/siemens/__pycache__/siemens_iot2050.cpython-311.pyc,,
adafruit_blinka/board/siemens/siemens_iot2050.py,sha256=HGMUpDTXOsvhreJb6uOA4f5iECOr0Dc3zzGSfVysb9k,991
adafruit_blinka/board/soPine.py,sha256=1Ilo95Fw2hJYdbk_7jSxrjLS57rFeLRTjV3s1WYN0hk,788
adafruit_blinka/board/starfive/__init__.py,sha256=lzjWkQbeJrk-cmzhi0mnO8qeiZSd9l6WPlh6nQzgcig,134
adafruit_blinka/board/starfive/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/starfive/__pycache__/visionfive2.cpython-311.pyc,,
adafruit_blinka/board/starfive/visionfive2.py,sha256=BDR2p35IFDtZWoI3FHAKfOyUIrq1ecfw9DWse-MkRdc,671
adafruit_blinka/board/stm32/__init__.py,sha256=c-0d6DvHBpcSKZxCR7mMeXZMwT-d99cGv9QWuuTt3-g,148
adafruit_blinka/board/stm32/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/stm32/__pycache__/osd32mp1_brk.cpython-311.pyc,,
adafruit_blinka/board/stm32/__pycache__/osd32mp1_red.cpython-311.pyc,,
adafruit_blinka/board/stm32/__pycache__/stm32mp157c_dk2.cpython-311.pyc,,
adafruit_blinka/board/stm32/osd32mp1_brk.py,sha256=u_RZPOGGBIffEfZhn8827a8vu091JZEjqxVM_v7RAKM,5364
adafruit_blinka/board/stm32/osd32mp1_red.py,sha256=kgSgwkmOl9qpKAnoOkQn5b41kIFkS4viFR0gwLtvn7k,941
adafruit_blinka/board/stm32/stm32mp157c_dk2.py,sha256=dkuHgQfc8wFsypxAr1n1ekSOibqjnVF8uCF8KxYSJw4,760
adafruit_blinka/board/tritium-h3.py,sha256=XFQ4m35tkepZFEn0gS27kvL3aBomTimSfgdKaqbsMoM,756
adafruit_blinka/board/udoo_x86ultra.py,sha256=birnNFZFnu9dRTQZKoG--LbhKtGw4o5JduDcFLiXZu4,1826
adafruit_blinka/board/vivid_unit.py,sha256=gWJhgb2Hq16J09DWxQ_aYFKfTdSUP9RIARgglAfhWWM,1152
adafruit_blinka/board/walnutpi/__init__.py,sha256=HpQkQRA-2Cl7389IERUIgE5DCASYSUxuAKzOxcnDLLo,151
adafruit_blinka/board/walnutpi/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/board/walnutpi/__pycache__/walnutpi1b.cpython-311.pyc,,
adafruit_blinka/board/walnutpi/walnutpi1b.py,sha256=vyajN6CUA54nbc5IQrdY5nb6-Y8H7juYMEXtQsN9-40,861
adafruit_blinka/board/x86j41x5.py,sha256=BiQC0DcXJ-hfHhHdSTseFykxs5nJ-tbO_hi0GwQ1De4,840
adafruit_blinka/microcontroller/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/__pycache__/alias.cpython-311.pyc,,
adafruit_blinka/microcontroller/alias.py,sha256=AWGTzgWfU4wPWlWTM3An-ma5ybMmOttRy19qFJ-hbyo,1107
adafruit_blinka/microcontroller/allwinner/D1/__init__.py,sha256=pQbuLoEazWS2sWJNDkJE55F4HVqEbRRN8bdvkw9jWMg,149
adafruit_blinka/microcontroller/allwinner/D1/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/allwinner/D1/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/allwinner/D1/pin.py,sha256=0_1ubBtZgQn-wth_59ZkZ5GEP6JSSQsCY8_3itTRNS0,1880
adafruit_blinka/microcontroller/allwinner/__init__.py,sha256=Y1J80-zqqh-_D-mGwASK31hBqAWepGpg9Ter4zV07pE,153
adafruit_blinka/microcontroller/allwinner/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/allwinner/a20/__init__.py,sha256=ZoouDSdlo-I6MVa7c5cYV9zEONpAt2boVdAnyAMdDxI,157
adafruit_blinka/microcontroller/allwinner/a20/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/allwinner/a20/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/allwinner/a20/pin.py,sha256=wpEyTv81B9HLbRUxpamUBueLFnxd7cbvltm1ldJl3Lc,2901
adafruit_blinka/microcontroller/allwinner/a33/__init__.py,sha256=iMRDKlgRD4dkujNy4bC0oapqAwLAiqXvGRbBsIXfrpk,157
adafruit_blinka/microcontroller/allwinner/a33/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/allwinner/a33/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/allwinner/a33/pin.py,sha256=-WNR-GiUItT1PUgS9I0HtEZm2tON1oVylaCl5eyWOwE,1118
adafruit_blinka/microcontroller/allwinner/a64/__init__.py,sha256=24lqgbULhG68JmHe9kMwC3-srJrNqa_pcyCa4NK7btA,157
adafruit_blinka/microcontroller/allwinner/a64/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/allwinner/a64/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/allwinner/a64/pin.py,sha256=uhKew4XZHhnt0KgwuUeS_DJ-AN11rZfEBHcj5XJSwDg,1785
adafruit_blinka/microcontroller/allwinner/h3/__init__.py,sha256=WPukV4agF7vSpLgZLWGIN4AKQXotgOJF_-xKlxzJAQc,156
adafruit_blinka/microcontroller/allwinner/h3/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/allwinner/h3/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/allwinner/h3/pin.py,sha256=cHS4fdVnAV2n9GCm92_orgY3TYQzRGUAmwy0BFAhdog,1254
adafruit_blinka/microcontroller/allwinner/h5/__init__.py,sha256=ln-NIylI35Ju9rXDBvIYeNNSx7XQ9vdz03StRMOW8vo,156
adafruit_blinka/microcontroller/allwinner/h5/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/allwinner/h5/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/allwinner/h5/pin.py,sha256=6KFLZMlHgxQBRInFmEJjNVJerx-QrY-N6yl7Sh2Alak,1488
adafruit_blinka/microcontroller/allwinner/h6/__init__.py,sha256=11_b_whLOkzEsfMy4U1bSlDX9pYyuf429nmb_bvqA7E,156
adafruit_blinka/microcontroller/allwinner/h6/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/allwinner/h6/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/allwinner/h6/pin.py,sha256=o9Cof9gXpaZ0shTWyUHJbh0IgzqSMOl1ekBDU5TTtwk,1107
adafruit_blinka/microcontroller/allwinner/h616/__init__.py,sha256=UtdnyzqeOG4Fb8oHbP6EADCKEhRwVoWaVXo2INhu54M,158
adafruit_blinka/microcontroller/allwinner/h616/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/allwinner/h616/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/allwinner/h616/pin.py,sha256=qeAMyReKqLEpESdyBE8pX905JbwPzOoYrxzpgQRY0OA,2968
adafruit_blinka/microcontroller/am335x/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/am335x/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/am335x/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/am335x/__pycache__/sysfs_pwmout.cpython-311.pyc,,
adafruit_blinka/microcontroller/am335x/pin.py,sha256=qzcru8U0A-lVrtAfu-LYm06sgzUNf87iD6WU6AtPGWY,11328
adafruit_blinka/microcontroller/am335x/sysfs_pwmout.py,sha256=Y5Un0pFxL-KzInvNDFlwN0rxv3KKWLXfex8DfuBJ0I8,10443
adafruit_blinka/microcontroller/am65xx/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/am65xx/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/am65xx/__pycache__/analogio.cpython-311.pyc,,
adafruit_blinka/microcontroller/am65xx/__pycache__/i2c.cpython-311.pyc,,
adafruit_blinka/microcontroller/am65xx/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/am65xx/__pycache__/pwmout.cpython-311.pyc,,
adafruit_blinka/microcontroller/am65xx/__pycache__/spi.cpython-311.pyc,,
adafruit_blinka/microcontroller/am65xx/analogio.py,sha256=pvxhKRVhEE74xhYMaWU3m6pXs1eFV6youQ2zcR4kIXs,1470
adafruit_blinka/microcontroller/am65xx/i2c.py,sha256=CoDIHGZbCNkUp54pKnkhY-YwFtLxzZDZmZojWhIIB_I,3006
adafruit_blinka/microcontroller/am65xx/pin.py,sha256=mvI5Uz991yeiSm-qZ3iKf0DPWpVs8M5YDbsQn-5y3vo,5198
adafruit_blinka/microcontroller/am65xx/pwmout.py,sha256=TOaY1Az7Ii2vk5Sb_IKNwOIEzuYWh0TlyIZtmOEXCnk,5250
adafruit_blinka/microcontroller/am65xx/spi.py,sha256=m4oVAMVHC6633xc7adGjeQt_OFZqq6bijNEQwATbf3Q,4372
adafruit_blinka/microcontroller/amlogic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/amlogic/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/a311d/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/amlogic/a311d/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/a311d/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/a311d/pin.py,sha256=o6OcZf53ZIV-cMoKUDNejvxg-xy5ju5AjVRU3qHNOKg,6706
adafruit_blinka/microcontroller/amlogic/a311d/pulseio/PulseIn.py,sha256=ZA-onxIMJGFHKD2XxwVjt3hrrojzbkfdlvHGPOFZii0,6171
adafruit_blinka/microcontroller/amlogic/a311d/pulseio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/amlogic/a311d/pulseio/__pycache__/PulseIn.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/a311d/pulseio/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/a311d/pulseio/libgpiod_pulsein,sha256=kRojwle4tzo0LpBoGW4pccqI7Y8oFk9ZtF627mwQg_w,20372
adafruit_blinka/microcontroller/amlogic/a311d/pulseio/libgpiod_pulsein.license,sha256=lu6UbVXdYmAXgHbHvkjDb5WYAPKoZcdb1InK-GoVgtE,113
adafruit_blinka/microcontroller/amlogic/a311d/pulseio/libgpiod_pulsein64,sha256=qPBI_Jg4NVgiqkf7WDXtdOZn6yXjQhaYyGumDRNCu5s,25832
adafruit_blinka/microcontroller/amlogic/a311d/pulseio/libgpiod_pulsein64.license,sha256=lu6UbVXdYmAXgHbHvkjDb5WYAPKoZcdb1InK-GoVgtE,113
adafruit_blinka/microcontroller/amlogic/meson_g12_common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/amlogic/meson_g12_common/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/meson_g12_common/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/meson_g12_common/pin.py,sha256=qWp7S_r8Zx5Ia2Oz4ezB6skyI7b41swJsTwRkSg5Rqc,7156
adafruit_blinka/microcontroller/amlogic/meson_g12_common/pulseio/PulseIn.py,sha256=36Lu8PywzYAExSTILiJH1tzyBXBonFnkAtHMbzA0vxc,6211
adafruit_blinka/microcontroller/amlogic/meson_g12_common/pulseio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/amlogic/meson_g12_common/pulseio/__pycache__/PulseIn.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/meson_g12_common/pulseio/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/meson_g12_common/pulseio/libgpiod_pulsein,sha256=MaJiUVA-oXNR93fsGBpMs-zpYSSSB8h8sXr1WoeS4ps,25216
adafruit_blinka/microcontroller/amlogic/meson_g12_common/pulseio/libgpiod_pulsein.license,sha256=UpaQW3I-925TXZF5zQ8olRBfev3bNy90FO17W0SpTXc,102
adafruit_blinka/microcontroller/amlogic/s905/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/amlogic/s905/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/s905/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/s905/pin.py,sha256=oh7i-SvUO4BLG4KWdSSFnGu1_WOEH3-I5fJYZYg28iI,2036
adafruit_blinka/microcontroller/amlogic/s905x/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/amlogic/s905x/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/s905x/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/s905x/pin.py,sha256=Sh9dzfaq-It8I4B-jhc_IrzDCQ6oIOZkGu__O2qROGs,1620
adafruit_blinka/microcontroller/amlogic/s905x3/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/amlogic/s905x3/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/s905x3/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/s905x3/pin.py,sha256=Tuq5fAGl1fv4v1n2ZNL7dwCXiRmrnpzcL1RlaEHDALk,276
adafruit_blinka/microcontroller/amlogic/s905y2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/amlogic/s905y2/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/s905y2/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/s905y2/pin.py,sha256=x2LOt3nzJ24xl775POGb1z5FGtdS5WXDa04EhtOwSe0,1778
adafruit_blinka/microcontroller/amlogic/s922x/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/amlogic/s922x/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/s922x/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/amlogic/s922x/pin.py,sha256=S2tBpl0hJr6iCSIIVJARFhdXvdc_LQpkyiIwpeBin-U,275
adafruit_blinka/microcontroller/atheros/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/atheros/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/atheros/ar9331/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/atheros/ar9331/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/atheros/ar9331/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/atheros/ar9331/pin.py,sha256=wg-CWxypeoukHuOJYKdo7hw1BM3ggUMU7JpNP6g_70s,1224
adafruit_blinka/microcontroller/bcm2711/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/bcm2711/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/bcm2711/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/bcm2711/pin.py,sha256=vVoooAtrl3x88CZzz4xBduIEoTAjIt0aaTbSQpBuAk4,1855
adafruit_blinka/microcontroller/bcm283x/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/bcm283x/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/bcm283x/__pycache__/neopixel.cpython-311.pyc,,
adafruit_blinka/microcontroller/bcm283x/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/bcm283x/neopixel.py,sha256=95796h44qgR28fnl5aMqlDEDIa9FFlfa2F2t7C9cDCg,4838
adafruit_blinka/microcontroller/bcm283x/pin.py,sha256=msKbs1vXmC1HMaQSoh7SLUJje3YIzD5-Pj3jS6uTJg8,3438
adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py,sha256=GuBB53Q8sZBKfz3FSOgPy-4qf31ZWtF6qlcFiGN6bAM,6317
adafruit_blinka/microcontroller/bcm283x/pulseio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/bcm283x/pulseio/__pycache__/PulseIn.cpython-311.pyc,,
adafruit_blinka/microcontroller/bcm283x/pulseio/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein,sha256=uqiXM-_mZV8oOV16noHJgdA78PS3RWVxeCWV_fuwanw,20448
adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein.license,sha256=lu6UbVXdYmAXgHbHvkjDb5WYAPKoZcdb1InK-GoVgtE,113
adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein64,sha256=rX5l-18nJWRpzJEe1aLS5Iz0qFmi_yacl9f2UJIsAjg,25832
adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein64.license,sha256=lu6UbVXdYmAXgHbHvkjDb5WYAPKoZcdb1InK-GoVgtE,113
adafruit_blinka/microcontroller/bcm283x/pwmio/PWMOut.py,sha256=ho5lr5Yg_KchuqluKgddEzcOxB7yTdXTMe3wQAEtZiA,4494
adafruit_blinka/microcontroller/bcm283x/pwmio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/bcm283x/pwmio/__pycache__/PWMOut.cpython-311.pyc,,
adafruit_blinka/microcontroller/bcm283x/pwmio/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/cv1800b/__init__.py,sha256=6BGssOqFeSmWCaV4bH2aXukuLQbCcUo1c2tocByZsOw,158
adafruit_blinka/microcontroller/cv1800b/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/cv1800b/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/cv1800b/pin.py,sha256=lQfOQgxXwFT_7ZaK2XvCefekKZdCCJByHKtLzBSORL4,983
adafruit_blinka/microcontroller/dra74x/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/dra74x/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/dra74x/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/dra74x/pin.py,sha256=LEW8oOGxikXkEkf_jy3kzYvA7oUNpv9JfiyEvz8U1CU,5715
adafruit_blinka/microcontroller/esp8266/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/esp8266/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/esp8266/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/esp8266/pin.py,sha256=UtmCV_m_UCGMo6aVgG_g8CWuWSrMukpVvmIzoeOj2io,668
adafruit_blinka/microcontroller/ftdi_mpsse/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/ftdi_mpsse/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/ftdi_mpsse/ft2232h/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/ftdi_mpsse/ft2232h/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/ftdi_mpsse/ft2232h/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/ftdi_mpsse/ft2232h/pin.py,sha256=oSwlmnbkl0KjvcoyoQ7hLPM0hH7Chtc8oYKWn_Lr2KA,1467
adafruit_blinka/microcontroller/ftdi_mpsse/ft232h/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/ftdi_mpsse/ft232h/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/ftdi_mpsse/ft232h/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/ftdi_mpsse/ft232h/pin.py,sha256=nwMFrcy5uzRDcGdchNw2656MjAZegDLZGYdlnto_CTM,536
adafruit_blinka/microcontroller/ftdi_mpsse/mpsse/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/ftdi_mpsse/mpsse/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/ftdi_mpsse/mpsse/__pycache__/i2c.cpython-311.pyc,,
adafruit_blinka/microcontroller/ftdi_mpsse/mpsse/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/ftdi_mpsse/mpsse/__pycache__/spi.cpython-311.pyc,,
adafruit_blinka/microcontroller/ftdi_mpsse/mpsse/__pycache__/url.cpython-311.pyc,,
adafruit_blinka/microcontroller/ftdi_mpsse/mpsse/i2c.py,sha256=REqSCoewYO3vB7_eVpppZR9Cgh71MpeBprMZdB6LLv8,2666
adafruit_blinka/microcontroller/ftdi_mpsse/mpsse/pin.py,sha256=_qPnCOZFDBD0SgaICC0y0ixptHz-erOJwUdapsqQakU,2587
adafruit_blinka/microcontroller/ftdi_mpsse/mpsse/spi.py,sha256=i_6-7KsEp3lqkqrynrIjwHcR0PITxS_9KAieXx9c6RQ,3447
adafruit_blinka/microcontroller/ftdi_mpsse/mpsse/url.py,sha256=02zOWpWKifu19KV-liGVTzPcKp6uENqv548-1Qeh2Zo,891
adafruit_blinka/microcontroller/generic_agnostic_board/PWMOut.py,sha256=3dwH0B-qGk_YgSGsPAPkeOAY-bi0y8QM8J3HUKs5ApE,3831
adafruit_blinka/microcontroller/generic_agnostic_board/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/generic_agnostic_board/__pycache__/PWMOut.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_agnostic_board/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_agnostic_board/__pycache__/analogio.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_agnostic_board/__pycache__/generic_agnostic_board.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_agnostic_board/__pycache__/i2c.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_agnostic_board/__pycache__/neopixel.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_agnostic_board/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_agnostic_board/__pycache__/spi.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_agnostic_board/analogio.py,sha256=766PnV5dPiXtAG8sxAWyhn9_yW8MBOXTT07jgzuFcx8,1357
adafruit_blinka/microcontroller/generic_agnostic_board/generic_agnostic_board.py,sha256=Xrg-ww3XNK6KUIzb_j0_BUY32SxDLcY__Jg67Z6sxeQ,556
adafruit_blinka/microcontroller/generic_agnostic_board/i2c.py,sha256=S1T3Tzb49y30R0T2J6XSpgKk-S-pXjq1cBf_1Vj__Rg,815
adafruit_blinka/microcontroller/generic_agnostic_board/neopixel.py,sha256=GCJwhUwhY_QeQTF8kb1zr2vltxgunI6Ak1LtMAz_k0Y,501
adafruit_blinka/microcontroller/generic_agnostic_board/pin.py,sha256=T5u-DKdOqOMRMDENkbo3pg-Unl7lMlEpMd4XZObUbN8,5567
adafruit_blinka/microcontroller/generic_agnostic_board/spi.py,sha256=eeMsr2DCmNcBT-tFRuJoxWM7olD83hFHgunngOzURLo,1520
adafruit_blinka/microcontroller/generic_linux/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/generic_linux/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_linux/__pycache__/i2c.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_linux/__pycache__/libgpiod_chip.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_linux/__pycache__/libgpiod_pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_linux/__pycache__/periphery_pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_linux/__pycache__/spi.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_linux/__pycache__/sysfs_analogin.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_linux/__pycache__/sysfs_analogout.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_linux/__pycache__/sysfs_pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_linux/__pycache__/sysfs_pwmout.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_linux/i2c.py,sha256=ExnBKW6QR6llKlKLd6-6dgn_6ahD2J1JtbmcRY0LtnY,3181
adafruit_blinka/microcontroller/generic_linux/libgpiod/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/generic_linux/libgpiod/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_linux/libgpiod/__pycache__/libgpiod_chip_1_x.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_linux/libgpiod/__pycache__/libgpiod_chip_2_x.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_linux/libgpiod/__pycache__/libgpiod_pin_1_x.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_linux/libgpiod/__pycache__/libgpiod_pin_2_x.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_linux/libgpiod/libgpiod_chip_1_x.py,sha256=XgKtEA__6CFefqUGxnKCxk2OjOA4I7TY5GyrsEZDAJU,868
adafruit_blinka/microcontroller/generic_linux/libgpiod/libgpiod_chip_2_x.py,sha256=G55Me7ufzNlwNH1ODFNtj9dTB7PvD7UDfG-cU18BpZc,732
adafruit_blinka/microcontroller/generic_linux/libgpiod/libgpiod_pin_1_x.py,sha256=ggcDXPoNV0oY7mepLpbHUcFN4Mo7BfilajqNiTnmFvw,4912
adafruit_blinka/microcontroller/generic_linux/libgpiod/libgpiod_pin_2_x.py,sha256=yyiyjh30chSqoItkNsdu092TLAkZ32RKdz7b4petPMo,3224
adafruit_blinka/microcontroller/generic_linux/libgpiod_chip.py,sha256=Ha54h6thhpA8H9oDoR5AnVxgG9GF-URDpdkVmVK8TyY,767
adafruit_blinka/microcontroller/generic_linux/libgpiod_pin.py,sha256=H6gHZ5ByMkaGcrMUojArswKtdglw6ZelA3CBs9oXxAw,762
adafruit_blinka/microcontroller/generic_linux/periphery_pin.py,sha256=chCRjTNBeIK51wNfSrq4rxHxUd8GhR9HijgQjPT0Ym8,2781
adafruit_blinka/microcontroller/generic_linux/spi.py,sha256=PRDh5kkrZUicXwgRUwm5PpTj3_xIP1cuOotfGL90XEk,4462
adafruit_blinka/microcontroller/generic_linux/sysfs_analogin.py,sha256=i3JxF1QBAvSwsO5GD2-nr6u9XvwlxUXrLLsYRfBmixc,2780
adafruit_blinka/microcontroller/generic_linux/sysfs_analogout.py,sha256=KxJUIlyzOhE7eQgvDV-GNMtbT2sECcHbUlk9gtuGMrI,2708
adafruit_blinka/microcontroller/generic_linux/sysfs_pin.py,sha256=gWPS3ky0EiIxvuVhWqmb2D6iaVbojYZJ-rb0SICjgj4,10891
adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py,sha256=PerErKoEHb08Na61mXcxylQnG2uyH1TgSQPuNQ4yeNY,11023
adafruit_blinka/microcontroller/generic_micropython/__init__.py,sha256=pTx54EcyfWW1Og6vxyLeBch2FFs2uTRt2kyE_pd_xXM,1091
adafruit_blinka/microcontroller/generic_micropython/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_micropython/__pycache__/i2c.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_micropython/__pycache__/spi.cpython-311.pyc,,
adafruit_blinka/microcontroller/generic_micropython/i2c.py,sha256=I2Evb0RwlmZmT2D4U2NDyplu4GBvvwQjz6EcFeyuglk,1473
adafruit_blinka/microcontroller/generic_micropython/spi.py,sha256=AMvjLP4BG7f8H60daUcDyIJVcesAn42cYEft-hqWPJE,1869
adafruit_blinka/microcontroller/hfu540/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/hfu540/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/hfu540/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/hfu540/pin.py,sha256=Xu-TgsZ65bPJHZ48uRNMo9HIUPfQoc7oJ9XrAkp9Ysk,891
adafruit_blinka/microcontroller/mcp2221/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/mcp2221/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/mcp2221/__pycache__/analogio.cpython-311.pyc,,
adafruit_blinka/microcontroller/mcp2221/__pycache__/i2c.cpython-311.pyc,,
adafruit_blinka/microcontroller/mcp2221/__pycache__/mcp2221.cpython-311.pyc,,
adafruit_blinka/microcontroller/mcp2221/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/mcp2221/analogio.py,sha256=C7E5HXbjp3-44jXsAygKngFCC-sDNtAbPRMaDyyzp-8,1437
adafruit_blinka/microcontroller/mcp2221/i2c.py,sha256=oFLZTGWy2nHEnUUoq8SZ1N1nwtqnf9eGIaOHIN1QNzI,1544
adafruit_blinka/microcontroller/mcp2221/mcp2221.py,sha256=p8MtF53PxW8nRrwzK7KodDretFEUHqKqWvwrITS86oI,13674
adafruit_blinka/microcontroller/mcp2221/pin.py,sha256=ycyPIR6rwFkfJ1d5dDRwfU1pqmcec3IdAjoPEkW1qXY,2883
adafruit_blinka/microcontroller/mips24kec/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/mips24kec/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/mips24kec/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/mips24kec/pin.py,sha256=0iutvzeuEfl8Izg1Or3QeCah481ABtqo7ZA3TIuABoA,1302
adafruit_blinka/microcontroller/mt8167/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/mt8167/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/mt8167/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/mt8167/pin.py,sha256=QAwKHB0wDcbqsyWtuhp1VyJGWZdGWIgvMXwYgbO9ayA,2028
adafruit_blinka/microcontroller/nova/__init__.py,sha256=FmgXWzhOXRA9Grann9isQUxF2h1BN8MVTlEMC2HY_nQ,1129
adafruit_blinka/microcontroller/nova/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/nova/__pycache__/i2c.cpython-311.pyc,,
adafruit_blinka/microcontroller/nova/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/nova/__pycache__/pwmout.cpython-311.pyc,,
adafruit_blinka/microcontroller/nova/__pycache__/spi.cpython-311.pyc,,
adafruit_blinka/microcontroller/nova/__pycache__/uart.cpython-311.pyc,,
adafruit_blinka/microcontroller/nova/i2c.py,sha256=bGBCZilT7YTm2dART3eEmeNDzi_U5n4RvwvKVNMjAj0,6260
adafruit_blinka/microcontroller/nova/pin.py,sha256=Bg9rLnJKCubz0EwAwy6WD8iSLOv-9cNgJZofxwvI-d4,2065
adafruit_blinka/microcontroller/nova/pwmout.py,sha256=oQjCAxr2RmJpDZNwrJrK30Ze0e0Bn4Ws5SD3z5ct1eg,7201
adafruit_blinka/microcontroller/nova/spi.py,sha256=sMPVlwPGIl-VJDIQEYSJwPp34_O7Lkua7P_B-S2z_x0,8491
adafruit_blinka/microcontroller/nova/uart.py,sha256=lfdgSC3vJL7F8DglvZkDm4knmDU4N9TZTSVmevAlacE,2556
adafruit_blinka/microcontroller/nxp_imx6ull/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/nxp_imx6ull/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/nxp_imx6ull/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/nxp_imx6ull/pin.py,sha256=zvRZLEoCgz6VkIFZWKFFX4V5YAPcPmm8AdvUEovVX7A,2149
adafruit_blinka/microcontroller/nxp_imx8m/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/nxp_imx8m/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/nxp_imx8m/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/nxp_imx8m/pin.py,sha256=PZKoFxqrBf7vwzTBK5Y_Hm75KrflMT3LzMnpeQSoAfY,1214
adafruit_blinka/microcontroller/nxp_lpc4330/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/nxp_lpc4330/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/nxp_lpc4330/__pycache__/analogio.cpython-311.pyc,,
adafruit_blinka/microcontroller/nxp_lpc4330/__pycache__/i2c.cpython-311.pyc,,
adafruit_blinka/microcontroller/nxp_lpc4330/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/nxp_lpc4330/__pycache__/pwmout.cpython-311.pyc,,
adafruit_blinka/microcontroller/nxp_lpc4330/__pycache__/spi.cpython-311.pyc,,
adafruit_blinka/microcontroller/nxp_lpc4330/__pycache__/uart.cpython-311.pyc,,
adafruit_blinka/microcontroller/nxp_lpc4330/analogio.py,sha256=P7e0OM20r6wkMwrdp6V8ZCngA0Q3tOTRyKDDHNLaqrY,1441
adafruit_blinka/microcontroller/nxp_lpc4330/i2c.py,sha256=dvZw_-XBBj613MFrRq0X_Ln5gT18nxdg5KfXhCeHxMU,1614
adafruit_blinka/microcontroller/nxp_lpc4330/pin.py,sha256=wX5IjrSor8JfFe7yvC5ZB7UfD2BMLelathCOQ-gr5Gw,5450
adafruit_blinka/microcontroller/nxp_lpc4330/pwmout.py,sha256=WPeavaU7Lxe3BJaPfhYnbgOtVF6npCvO73aWgLVpWJo,6735
adafruit_blinka/microcontroller/nxp_lpc4330/spi.py,sha256=SvpwPCYCf9PR_YpOBAGBQbhno4rMwPItAMWi3F8JQEw,4678
adafruit_blinka/microcontroller/nxp_lpc4330/uart.py,sha256=h2qK0cUOKdHGQrcplbvekLVyHSfp_101aOLuBk3Z3tM,2000
adafruit_blinka/microcontroller/pentium/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/pentium/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/pentium/j4105/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/pentium/j4105/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/pentium/j4105/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/pentium/j4105/pin.py,sha256=0jTP0QaNbqRxuThr4odWvqm-IpgcddXGEZ6hy9jwW5k,1314
adafruit_blinka/microcontroller/pentium/n3710/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/pentium/n3710/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/pentium/n3710/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/pentium/n3710/pin.py,sha256=UgGvw8jai9lSiv0-jzb-3AYDRQrMY39RK2EpSCPgW_c,2249
adafruit_blinka/microcontroller/rockchip/PWMOut.py,sha256=llueFwmndWl52aXL348_hGjaxTHXgUKHKCvjIpgFmro,12729
adafruit_blinka/microcontroller/rockchip/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/rockchip/__pycache__/PWMOut.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rk3308/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/rockchip/rk3308/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rk3308/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rk3308/pin.py,sha256=EPiNI-cXvt3bfOeWWvVriuRWOkOue_k2n3OcRwJgNNg,4936
adafruit_blinka/microcontroller/rockchip/rk3328/__init__.py,sha256=pb23QZkdWqUNZQrotHSfQwIJ_6yxAXJ8jPFkitXSIy8,159
adafruit_blinka/microcontroller/rockchip/rk3328/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rk3328/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rk3328/pin.py,sha256=U5NacEY7W890aiEr9I432H2cIQL293zmNtUykneJQ1U,3767
adafruit_blinka/microcontroller/rockchip/rk3399/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/rockchip/rk3399/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rk3399/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rk3399/pin.py,sha256=DXajUEbR3hVrOtQYcrW1w2uJwQtV_JHojLw2H8659DE,5378
adafruit_blinka/microcontroller/rockchip/rk3566/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/rockchip/rk3566/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rk3566/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rk3566/pin.py,sha256=GzpDsW-jnY56CY-oCBXVHXvqH771H20Hoa7dHU-DBJM,6151
adafruit_blinka/microcontroller/rockchip/rk3568/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/rockchip/rk3568/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rk3568/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rk3568/pin.py,sha256=dM4J7OIzPenIKFqugYGLeoqf-LsJZ75Azm420_kvb54,5510
adafruit_blinka/microcontroller/rockchip/rk3568b2/__init__.py,sha256=oFMcYY3KXVnLQLCDC9muCvXz0A6cb-IhQvutmtNpfqw,96
adafruit_blinka/microcontroller/rockchip/rk3568b2/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rk3568b2/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rk3568b2/pin.py,sha256=NXUgiaklXAkFJCiEOkqDU7_SaO3p4-VbhiaUTd0ZP7c,3217
adafruit_blinka/microcontroller/rockchip/rk3588/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/rockchip/rk3588/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rk3588/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rk3588/pin.py,sha256=zgAiXvekMP8__V9jp9NmR1b1A4Bep2ZZoDSCyzGAqV0,7772
adafruit_blinka/microcontroller/rockchip/rk3588s/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/rockchip/rk3588s/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rk3588s/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rk3588s/pin.py,sha256=GmVFnJqRK63SQMRwsYEtsXfSiiS6QD2w01vj59uF6vk,6989
adafruit_blinka/microcontroller/rockchip/rv1103/__init__.py,sha256=xQfoJkhdXFJWFrvW3xstRGYI2jdZwwaZasV4fJx1myA,159
adafruit_blinka/microcontroller/rockchip/rv1103/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rv1103/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rv1103/pin.py,sha256=Nes3dLq2NZcxIE7IijDqFyFec4jnacLhv2s3mNUBrts,5091
adafruit_blinka/microcontroller/rockchip/rv1106/__init__.py,sha256=B4mjQg-cbLwmfb900_XQSOacnkAP9xB8jqsMzMv2LqA,159
adafruit_blinka/microcontroller/rockchip/rv1106/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rv1106/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/rockchip/rv1106/pin.py,sha256=Tefp2r52H-I9as0bJ6S36rPj7tWUrngbioxFwA_a1ZE,5849
adafruit_blinka/microcontroller/rp2040/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/rp2040/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/rp2040/__pycache__/i2c.cpython-311.pyc,,
adafruit_blinka/microcontroller/rp2040/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/rp2040/__pycache__/spi.cpython-311.pyc,,
adafruit_blinka/microcontroller/rp2040/__pycache__/uart.cpython-311.pyc,,
adafruit_blinka/microcontroller/rp2040/i2c.py,sha256=Nok-jLZ4COCXqTNRiOE90KFGo7o7b4xbfzVgZz35POA,2032
adafruit_blinka/microcontroller/rp2040/pin.py,sha256=XDAKGmwX8T8aqyuruiPxbEsop8MQrMtuxTM09nEYn58,4819
adafruit_blinka/microcontroller/rp2040/spi.py,sha256=AnpOm2620qrdGWP-R0YRNyN466Mj-3JRrntJoD5Ve8I,2787
adafruit_blinka/microcontroller/rp2040/uart.py,sha256=TmdfOdSXjFzowlDX0e6rUGHHq75lrbUgywD5PzujRUE,1643
adafruit_blinka/microcontroller/rp2040_u2if/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/rp2040_u2if/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/rp2040_u2if/__pycache__/analogio.cpython-311.pyc,,
adafruit_blinka/microcontroller/rp2040_u2if/__pycache__/i2c.cpython-311.pyc,,
adafruit_blinka/microcontroller/rp2040_u2if/__pycache__/neopixel.cpython-311.pyc,,
adafruit_blinka/microcontroller/rp2040_u2if/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/rp2040_u2if/__pycache__/pwmio.cpython-311.pyc,,
adafruit_blinka/microcontroller/rp2040_u2if/__pycache__/rp2040_u2if.cpython-311.pyc,,
adafruit_blinka/microcontroller/rp2040_u2if/__pycache__/spi.cpython-311.pyc,,
adafruit_blinka/microcontroller/rp2040_u2if/analogio.py,sha256=GSZN_kSq_rUYUAX4v7TC7FAhqeg45n_4cdwX7DzukUA,1984
adafruit_blinka/microcontroller/rp2040_u2if/i2c.py,sha256=mNLjEuqh4bZYxuMlOf-kO5IBBF9sFyffiJdfc39yuiQ,5712
adafruit_blinka/microcontroller/rp2040_u2if/neopixel.py,sha256=MV4CYEgKNscCmUA0CqI9tgMa5u7YW6DPOsvh5RZUE34,522
adafruit_blinka/microcontroller/rp2040_u2if/pin.py,sha256=Pba8KW8h7aT7UtKDP1FzOXAyDTZ4zt7_Bj0SneATRGM,2257
adafruit_blinka/microcontroller/rp2040_u2if/pwmio.py,sha256=0shXaflbOPtkgbDytx8q-r_-VkrFbkJB3D8YpdiZR-0,1342
adafruit_blinka/microcontroller/rp2040_u2if/rp2040_u2if.py,sha256=iliM4lVhCWbkyAHinejMe7ys1OJv9vlTeKFEMkblFhQ,16641
adafruit_blinka/microcontroller/rp2040_u2if/spi.py,sha256=fjSL5eDHeEMZXqhNPpM9dE975XdcpuHvGQ87SNahC4M,5008
adafruit_blinka/microcontroller/sama5/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/sama5/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/sama5/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/sama5/pin.py,sha256=Han_erLLWKOYV4v73wdSFQjZVylNX2r3bcXoahvttFI,1074
adafruit_blinka/microcontroller/samsung/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/samsung/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/samsung/exynos5422/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/samsung/exynos5422/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/samsung/exynos5422/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/samsung/exynos5422/pin.py,sha256=bnluZii5quhUL_2onQM0FgVIuNR5Y0uAGHjCRh0U1Rc,2326
adafruit_blinka/microcontroller/snapdragon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/snapdragon/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/snapdragon/apq8016/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/snapdragon/apq8016/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/snapdragon/apq8016/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/snapdragon/apq8016/pin.py,sha256=7tuhDvXKoZIr3UI4h9hanKJvW-jpsfPD1f8cUWdSOgg,3581
adafruit_blinka/microcontroller/starfive/JH7110/__init__.py,sha256=uCUdxtsMvlFBZ0JfcZd7UqeXd5UCHOlA1U85lIfheD8,147
adafruit_blinka/microcontroller/starfive/JH7110/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/starfive/JH7110/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/starfive/JH7110/pin.py,sha256=s7cZlT0X5C_Ei16Op4akijH4bTNQ2pYAEvt4ddBmzIw,2665
adafruit_blinka/microcontroller/starfive/JH7110/pwmio/PWMOut.py,sha256=8S-jnqsaPUkO9VfgZc0P7zxuZHohXA71gse292SQvFk,4438
adafruit_blinka/microcontroller/starfive/JH7110/pwmio/__init__.py,sha256=wYVnbWF6RR-pPgDvS0QK_fJ9Z4EFxK_Qfopg2m8Z454,159
adafruit_blinka/microcontroller/starfive/JH7110/pwmio/__pycache__/PWMOut.cpython-311.pyc,,
adafruit_blinka/microcontroller/starfive/JH7110/pwmio/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/starfive/JH71x0/__init__.py,sha256=uQzBqDw63SlmAu-cj0uDsqjJnBQAB1Wzvfw6k_XE4nY,159
adafruit_blinka/microcontroller/starfive/JH71x0/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/starfive/JH71x0/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/starfive/JH71x0/pin.py,sha256=1kld4eClhKBRfcPap1BA19W5FN8cMNW6YP2cCx_Q8e0,1015
adafruit_blinka/microcontroller/starfive/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/starfive/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/stm32/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/stm32/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/stm32/stm32f405/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/stm32/stm32f405/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/stm32/stm32f405/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/stm32/stm32f405/pin.py,sha256=STQxwOcTWfjNzhvXBMbn_SXsxitOup0yj3aIMRjP4zM,1192
adafruit_blinka/microcontroller/stm32/stm32mp157/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/stm32/stm32mp157/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/stm32/stm32mp157/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/stm32/stm32mp157/pin.py,sha256=NK_yfV4mgo_N0fs0oloyQJuJdU1unZnH8WgyEN-zNb8,3418
adafruit_blinka/microcontroller/tegra/PWMOut.py,sha256=UZ1xkO8loMHFVE5QWP0PtUeJ4RYpOXiFQVDjzr3PbHo,4440
adafruit_blinka/microcontroller/tegra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/tegra/__pycache__/PWMOut.cpython-311.pyc,,
adafruit_blinka/microcontroller/tegra/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/tegra/t186/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/tegra/t186/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/tegra/t186/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/tegra/t186/pin.py,sha256=sJ29lBiCvmS6QL_UzVDTYmIV8BarQe2l-PhVwAWinvs,3414
adafruit_blinka/microcontroller/tegra/t194/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/tegra/t194/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/tegra/t194/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/tegra/t194/pin.py,sha256=TSg_B9H-uEZUDSz4-6dLmcMI0CbyRBLxlEAHgrkw1pA,3387
adafruit_blinka/microcontroller/tegra/t210/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/tegra/t210/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/tegra/t210/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/tegra/t210/pin.py,sha256=z9VTpmQKMMzWJBPM8o_2X24rr-ZkfxMLmn3cbdGfGHc,3564
adafruit_blinka/microcontroller/tegra/t234/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/tegra/t234/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/tegra/t234/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/tegra/t234/pin.py,sha256=6ETpnxJ_ni_1Pz4nBFpg2CjQN-mRzKYS1eyfpW4Q-TE,3321
adafruit_blinka/microcontroller/thead/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
adafruit_blinka/microcontroller/thead/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/thead/th1520/__init__.py,sha256=sefd-Bqm5dSrUbt2zwe0tvrU987N44XWXBVrKErd6Rc,120
adafruit_blinka/microcontroller/thead/th1520/__pycache__/__init__.cpython-311.pyc,,
adafruit_blinka/microcontroller/thead/th1520/__pycache__/pin.cpython-311.pyc,,
adafruit_blinka/microcontroller/thead/th1520/pin.py,sha256=Tx5T_0CLFqiPiGYifL07Ul7VPMCzFf5Htcwc1S_ueVo,3456
analogio.py,sha256=UonLPxGpPco5YXo_q82jfxgQmJneAUnJESz9hOPW5Ok,3370
bitbangio.py,sha256=KNt_Lmg_dOGVu2gKUb63e9YJg-8flYaq2F-AqnSVn0o,4535
board.py,sha256=7ahNYVCouvRN1SuzsCAs4OGJFxTzlTyBb6f3vA_tjww,15404
busio.py,sha256=xNcjHOnU61TmnqBu5xl64GI6AXB_t39MAJVP5pzKoH0,22472
digitalio.py,sha256=e7VfhUVLoxmgnP_j-FmVz9zUGlsiTqtAHHwpwLXG27s,9918
keypad.py,sha256=ragQirpuLOqTI_7XNmaUTCOL9qMeDkFX6SVA4fafFG8,18820
microcontroller/__init__.py,sha256=IJVUrlQiFBoHJ2WoIRDEWC6AZpu3oq-ZvfsGeJPE3q8,7275
microcontroller/__pycache__/__init__.cpython-311.pyc,,
microcontroller/__pycache__/pin.cpython-311.pyc,,
microcontroller/pin.py,sha256=OlFDovK09_TO_2mUaZh0o0dNAPWxXpaF0C0Iboxheno,7738
micropython-stubs/micropython.pyi,sha256=gIE7gt93t1Ur8Iv_FxHVZfGD1BqR5FH8zgDuj2isr0E,645
micropython.py,sha256=6D4KCjMpp48_onWPME_Gf7v83CKiKz2_9vBoF2-gVhI,626
neopixel_write.py,sha256=t5oOv8w-_sO5xBCLr3RYr8b0rS44A1SbTL7A9_G8rTY,1509
onewireio.py,sha256=kCgKFtBjs-2PmpkTOC0ny4M-ap136V5_5Z8c3P3bYCo,1326
pulseio.py,sha256=MZ5fUNP86wNjXDuk-BNbkzy-VsmJ9SUpnxZZ0JfsoRY,918
pwmio.py,sha256=Y3pRlSbmILiVUTY9dgGr8FK8kWE11ve7yKJdaDwmFNM,2961
rainbowio.py,sha256=c38T9U1xuXgh0JeD_xs_RUfzrHhiQKRpcVJCC8BakwE,1181
usb_hid.py,sha256=pNaGDmg-JQABuEN4qIwkfwxeeSLSoohTnQOI1w8cLfA,24778

View file

@ -0,0 +1,5 @@
Wheel-Version: 1.0
Generator: setuptools (71.1.0)
Root-Is-Purelib: true
Tag: py3-none-any

View file

@ -0,0 +1,16 @@
adafruit_blinka
analogio
bitbangio
board
busio
digitalio
keypad
microcontroller
micropython
micropython-stubs
neopixel_write
onewireio
pulseio
pwmio
rainbowio
usb_hid

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2018 Adafruit Industries
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,114 @@
Metadata-Version: 2.1
Name: Adafruit-PlatformDetect
Version: 3.73.0
Summary: Platform detection for use by libraries like Adafruit-Blinka.
Author-email: Adafruit Industries <circuitpython@adafruit.com>
License: MIT
Project-URL: Homepage, https://github.com/adafruit/Adafruit_Python_PlatformDetect
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Hardware
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Description-Content-Type: text/x-rst
License-File: LICENSE
Introduction
============
.. image:: https://readthedocs.org/projects/adafruit-platformdetect/badge/?version=latest
:target: https://circuitpython.readthedocs.io/projects/platformdetect/en/latest/
:alt: Documentation Status
.. image:: https://img.shields.io/discord/327254708534116352.svg
:target: https://adafru.it/discord
:alt: Discord
.. image:: https://github.com/adafruit/Adafruit_Python_PlatformDetect/workflows/Build%20CI/badge.svg
:target: https://github.com/adafruit/Adafruit_Python_PlatformDetect/actions
: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 library provides best-guess platform detection for a range of single-board
computers and (potentially) other platforms. It was written primarily for use
in `Adafruit_Blinka <https://github.com/adafruit/Adafruit_Blinka>`_, but may be
useful in other contexts.
Platform detection is divided into "chip" and "board" detection, with the latter
generally dependent on the former. Platform info is gathered from:
- Python's `sys.platform`
- Various files on Linux systems:
- /proc/cpuinfo (for processor info, Raspberry Pi hardware revisions, etc.)
- /proc/device-tree/compatible (for 96Boards info)
- Beaglebone EEPROM board IDs
- Distribution-specific files such as /etc/armbian-release.
Dependencies
=============
This driver depends on:
* Python 3.7 or higher
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-PlatformDetect/>`_. To install for current user:
.. code-block:: shell
pip3 install Adafruit-PlatformDetect
To install system-wide (this may be required in some cases):
.. code-block:: shell
sudo pip3 install Adafruit-PlatformDetect
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-PlatformDetect
Usage Example
=============
.. code-block:: python
from adafruit_platformdetect import Detector
detector = Detector()
print("Chip id: ", detector.chip.id)
print("Board id: ", detector.board.id)
# Check for specific board models:
print("Pi 3B+? ", detector.board.RASPBERRY_PI_3B_PLUS)
print("BBB? ", detector.board.BEAGLEBONE_BLACK)
print("Orange Pi PC? ", detector.board.ORANGE_PI_PC)
print("generic Linux PC? ", detector.board.GENERIC_LINUX_PC)
Contributing
============
Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_Python_PlatformDetect/blob/master/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.
Documentation
=============
For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.

View file

@ -0,0 +1,20 @@
Adafruit_PlatformDetect-3.73.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
Adafruit_PlatformDetect-3.73.0.dist-info/LICENSE,sha256=UODDtbRIa-DtQgY5-KH28RXykQH-7mvNlUpLgdsE0PM,1086
Adafruit_PlatformDetect-3.73.0.dist-info/METADATA,sha256=Mb_pZ7qdK0E6YpwNrPtnsrx7FOrVL8y4z5MYQcNdP9k,3768
Adafruit_PlatformDetect-3.73.0.dist-info/RECORD,,
Adafruit_PlatformDetect-3.73.0.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
Adafruit_PlatformDetect-3.73.0.dist-info/top_level.txt,sha256=xyO_mesQw7M0Gaxa5eePp8_s0PUwdPu7XFC00EDyXDc,24
adafruit_platformdetect/__init__.py,sha256=138V6uriVaw8zAn7Z0isJ1wq9_UPmqOKT8I5XCJ0jSM,4273
adafruit_platformdetect/__pycache__/__init__.cpython-311.pyc,,
adafruit_platformdetect/__pycache__/board.cpython-311.pyc,,
adafruit_platformdetect/__pycache__/chip.cpython-311.pyc,,
adafruit_platformdetect/__pycache__/revcodes.cpython-311.pyc,,
adafruit_platformdetect/board.py,sha256=RW6PWpiKJGlU2R9WN6yqyLUZsr1CZ6MpvF1VugOIfr4,46647
adafruit_platformdetect/chip.py,sha256=BfJJ18LYFEd9WODeOpjc6XvaRizmU2NNhpiD7AVrNL8,17071
adafruit_platformdetect/constants/__init__.py,sha256=73ItGwyF7Z_AoaSaSMQF9ooLuEyQXOV1Zv9yqAU8G4k,163
adafruit_platformdetect/constants/__pycache__/__init__.cpython-311.pyc,,
adafruit_platformdetect/constants/__pycache__/boards.cpython-311.pyc,,
adafruit_platformdetect/constants/__pycache__/chips.cpython-311.pyc,,
adafruit_platformdetect/constants/boards.py,sha256=khsH1nZYcFH2BsewHEpzjZ3JL9uKqHcL8T63vgv9m7w,15562
adafruit_platformdetect/constants/chips.py,sha256=Te7CSxhVZgP-GyGrYtt383xUYrhJ4-lEOG6L5P_rBSo,1712
adafruit_platformdetect/revcodes.py,sha256=L-wasYt68WmrRpUtPg1C2w53crlGnCJ6_rwwuqoHpLA,8257

View file

@ -0,0 +1,5 @@
Wheel-Version: 1.0
Generator: setuptools (72.1.0)
Root-Is-Purelib: true
Tag: py3-none-any

View file

@ -0,0 +1 @@
adafruit_platformdetect

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2020 Melissa LeBlanc-Williams for Adafruit Industries
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,87 @@
Metadata-Version: 2.1
Name: Adafruit-PureIO
Version: 1.1.11
Summary: Pure python (i.e. no native extensions) access to Linux IO including I2C and SPI. Drop in replacement for smbus and spidev modules.
Author-email: Adafruit Industries <circuitpython@adafruit.com>
License: MIT
Project-URL: Homepage, https://github.com/adafruit/Adafruit_Python_PureIO
Keywords: adafruit,blinka,micropython,pureio,ioctl,spi,i2c,python
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Hardware
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Python: >=3.5.0
Description-Content-Type: text/x-rst
License-File: LICENSE
Provides-Extra: optional
Introduction
============
.. image:: https://readthedocs.org/projects/adafruit-pureio/badge/?version=latest
:target: https://adafruit-pureio.readthedocs.io/en/latest/
:alt: Documentation Status
.. image:: https://img.shields.io/discord/327254708534116352.svg
:target: https://adafru.it/discord
:alt: Discord
.. image:: https://github.com/adafruit/Adafruit_Python_PureIO/workflows/Build%20CI/badge.svg
:target: https://github.com/adafruit/Adafruit_Python_PureIO/actions
:alt: Build Status
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code Style: Black
Pure python (i.e. no native extensions) access to Linux IO including I2C and SPI. Drop in replacement for smbus and spidev modules.
Dependencies
=============
This driver depends on:
* Python 3.5 or higher
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-PureIO/>`_. To install for current user:
.. code-block:: shell
pip3 install Adafruit-PureIO
To install system-wide (this may be required in some cases):
.. code-block:: shell
sudo pip3 install Adafruit-PureIO
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-PureIO
Contributing
============
Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_Python_PureIO/blob/master/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.
Documentation
=============
For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.

View file

@ -0,0 +1,12 @@
Adafruit_PureIO-1.1.11.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
Adafruit_PureIO-1.1.11.dist-info/LICENSE,sha256=ql5UE2yEDtLjM_ZdQ_7LxsDo__Yuuuzk_ygc0qZnIIg,1115
Adafruit_PureIO-1.1.11.dist-info/METADATA,sha256=ZFhWw2KZ9bID_Hw6y3F8wfgROxzB21QRJNeFHvtgR5U,2971
Adafruit_PureIO-1.1.11.dist-info/RECORD,,
Adafruit_PureIO-1.1.11.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
Adafruit_PureIO-1.1.11.dist-info/top_level.txt,sha256=SmMfnx3lOkpNy0PYzumNO0ilFHQbhyQG-l1LwNGJfqQ,16
Adafruit_PureIO/__init__.py,sha256=2YZOh5vH36sr5osQMuBrvBYzL6CMvWq4g85z1Q6LYsQ,113
Adafruit_PureIO/__pycache__/__init__.cpython-311.pyc,,
Adafruit_PureIO/__pycache__/smbus.cpython-311.pyc,,
Adafruit_PureIO/__pycache__/spi.cpython-311.pyc,,
Adafruit_PureIO/smbus.py,sha256=1cWjGk03afhvRaKZqbFlSQT8j8SfmrJg-rlqxdOM3Gg,14872
Adafruit_PureIO/spi.py,sha256=CfZr8GzsWpjnNaRe8Ymwel4QVvADG5oQNI5Rj2BMrW4,11485

View file

@ -0,0 +1,5 @@
Wheel-Version: 1.0
Generator: bdist_wheel (0.40.0)
Root-Is-Purelib: true
Tag: py3-none-any

View file

@ -0,0 +1 @@
Adafruit_PureIO

View file

@ -0,0 +1,3 @@
# SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams for Adafruit Industries
#
# SPDX-License-Identifier: MIT

View file

@ -0,0 +1,386 @@
# SPDX-FileCopyrightText: 2016 Tony DiCola for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`Adafruit_PureIO.smbus`
================================================================================
Pure python (i.e. no native extensions) access to Linux IO I2C interface that mimics the
Python SMBus API.
* Author(s): Tony DiCola, Lady Ada, Melissa LeBlanc-Williams
Implementation Notes
--------------------
**Software and Dependencies:**
* Linux and Python 3.5 or Higher
"""
from ctypes import c_uint8, c_uint16, c_uint32, cast, pointer, POINTER
from ctypes import create_string_buffer, Structure
from fcntl import ioctl
import struct
# pylint: disable=fixme
# I2C C API constants (from linux kernel headers)
I2C_M_TEN = 0x0010 # this is a ten bit chip address
I2C_M_RD = 0x0001 # read data, from slave to master
I2C_M_STOP = 0x8000 # if I2C_FUNC_PROTOCOL_MANGLING
I2C_M_NOSTART = 0x4000 # if I2C_FUNC_NOSTART
I2C_M_REV_DIR_ADDR = 0x2000 # if I2C_FUNC_PROTOCOL_MANGLING
I2C_M_IGNORE_NAK = 0x1000 # if I2C_FUNC_PROTOCOL_MANGLING
I2C_M_NO_RD_ACK = 0x0800 # if I2C_FUNC_PROTOCOL_MANGLING
I2C_M_RECV_LEN = 0x0400 # length will be first received byte
I2C_SLAVE = 0x0703 # Use this slave address
I2C_SLAVE_FORCE = 0x0706 # Use this slave address, even if
# is already in use by a driver!
I2C_TENBIT = 0x0704 # 0 for 7 bit addrs, != 0 for 10 bit
I2C_FUNCS = 0x0705 # Get the adapter functionality mask
I2C_RDWR = 0x0707 # Combined R/W transfer (one STOP only)
I2C_PEC = 0x0708 # != 0 to use PEC with SMBus
I2C_SMBUS = 0x0720 # SMBus transfer
# ctypes versions of I2C structs defined by kernel.
# Tone down pylint for the Python classes that mirror C structs.
# pylint: disable=invalid-name,too-few-public-methods
class i2c_msg(Structure):
"""Linux i2c_msg struct."""
_fields_ = [
("addr", c_uint16),
("flags", c_uint16),
("len", c_uint16),
("buf", POINTER(c_uint8)),
]
class i2c_rdwr_ioctl_data(Structure): # pylint: disable=invalid-name
"""Linux i2c data struct."""
_fields_ = [("msgs", POINTER(i2c_msg)), ("nmsgs", c_uint32)]
# pylint: enable=invalid-name,too-few-public-methods
# pylint: disable=attribute-defined-outside-init
def make_i2c_rdwr_data(messages):
"""Utility function to create and return an i2c_rdwr_ioctl_data structure
populated with a list of specified I2C messages. The messages parameter
should be a list of tuples which represent the individual I2C messages to
send in this transaction. Tuples should contain 4 elements: address value,
flags value, buffer length, ctypes c_uint8 pointer to buffer.
"""
# Create message array and populate with provided data.
msg_data_type = i2c_msg * len(messages)
msg_data = msg_data_type()
for i, message in enumerate(messages):
msg_data[i].addr = message[0] & 0x7F
msg_data[i].flags = message[1]
msg_data[i].len = message[2]
msg_data[i].buf = message[3]
# Now build the data structure.
data = i2c_rdwr_ioctl_data()
data.msgs = msg_data
data.nmsgs = len(messages)
return data
# pylint: enable=attribute-defined-outside-init
# Create an interface that mimics the Python SMBus API.
class SMBus:
"""I2C interface that mimics the Python SMBus API but is implemented with
pure Python calls to ioctl and direct /dev/i2c device access.
"""
def __init__(self, bus=None):
"""Create a new smbus instance. Bus is an optional parameter that
specifies the I2C bus number to use, for example 1 would use device
/dev/i2c-1. If bus is not specified then the open function should be
called to open the bus.
"""
self._device = None
if bus is not None:
self.open(bus)
def __del__(self):
"""Clean up any resources used by the SMBus instance."""
self.close()
def __enter__(self):
"""Context manager enter function."""
# Just return this object so it can be used in a with statement, like
# with SMBus(1) as bus:
# # do stuff!
return self
def __exit__(self, exc_type, exc_val, exc_tb):
"""Context manager exit function, ensures resources are cleaned up."""
self.close()
return False # Don't suppress exceptions.
def open(self, bus):
"""Open the smbus interface on the specified bus."""
# Close the device if it's already open.
if self._device is not None:
self.close()
# Try to open the file for the specified bus. Must turn off buffering
# or else Python 3 fails (see: https://bugs.python.org/issue20074)
# pylint: disable=consider-using-with
self._device = open(f"/dev/i2c-{bus}", "r+b", buffering=0)
# pylint: enable=consider-using-with
# TODO: Catch IOError and throw a better error message that describes
# what's wrong (i.e. I2C may not be enabled or the bus doesn't exist).
def close(self):
"""Close the smbus connection. You cannot make any other function
calls on the bus unless open is called!"""
if self._device is not None:
self._device.close()
self._device = None
def _select_device(self, addr):
"""Set the address of the device to communicate with on the I2C bus."""
ioctl(self._device.fileno(), I2C_SLAVE, addr & 0x7F)
def read_byte(self, addr):
"""Read a single byte from the specified device."""
assert (
self._device is not None
), "Bus must be opened before operations are made against it!"
self._select_device(addr)
return ord(self._device.read(1))
def read_bytes(self, addr, number):
"""Read many bytes from the specified device."""
assert (
self._device is not None
), "Bus must be opened before operations are made against it!"
self._select_device(addr)
return self._device.read(number)
def read_byte_data(self, addr, cmd):
"""Read a single byte from the specified cmd register of the device."""
assert (
self._device is not None
), "Bus must be opened before operations are made against it!"
# Build ctypes values to marshall between ioctl and Python.
reg = c_uint8(cmd)
result = c_uint8()
# Build ioctl request.
request = make_i2c_rdwr_data(
[
(addr, 0, 1, pointer(reg)), # Write cmd register.
(addr, I2C_M_RD, 1, pointer(result)), # Read 1 byte as result.
]
)
# Make ioctl call and return result data.
ioctl(self._device.fileno(), I2C_RDWR, request)
return result.value
def read_word_data(self, addr, cmd):
"""Read a word (2 bytes) from the specified cmd register of the device.
Note that this will interpret data using the endianness of the processor
running Python (typically little endian)!
"""
assert (
self._device is not None
), "Bus must be opened before operations are made against it!"
# Build ctypes values to marshall between ioctl and Python.
reg = c_uint8(cmd)
result = c_uint16()
# Build ioctl request.
request = make_i2c_rdwr_data(
[
(addr, 0, 1, pointer(reg)), # Write cmd register.
(
addr,
I2C_M_RD,
2,
cast(pointer(result), POINTER(c_uint8)),
), # Read word (2 bytes).
]
)
# Make ioctl call and return result data.
ioctl(self._device.fileno(), I2C_RDWR, request)
return result.value
def read_block_data(self, addr, cmd):
"""Perform a block read from the specified cmd register of the device.
The amount of data read is determined by the first byte send back by
the device. Data is returned as a bytearray.
"""
# TODO: Unfortunately this will require calling the low level I2C
# access ioctl to trigger a proper read_block_data. The amount of data
# returned isn't known until the device starts responding so an I2C_RDWR
# ioctl won't work.
raise NotImplementedError()
def read_i2c_block_data(self, addr, cmd, length=32):
"""Perform a read from the specified cmd register of device. Length number
of bytes (default of 32) will be read and returned as a bytearray.
"""
assert (
self._device is not None
), "Bus must be opened before operations are made against it!"
# Build ctypes values to marshall between ioctl and Python.
# convert register into bytearray
if not isinstance(cmd, (bytes, bytearray)):
reg = cmd # backup
cmd = bytearray(1)
cmd[0] = reg
cmdstring = create_string_buffer(len(cmd))
for i, val in enumerate(cmd):
cmdstring[i] = val
result = create_string_buffer(length)
# Build ioctl request.
request = make_i2c_rdwr_data(
[
(
addr,
0,
len(cmd),
cast(cmdstring, POINTER(c_uint8)),
), # Write cmd register.
(addr, I2C_M_RD, length, cast(result, POINTER(c_uint8))), # Read data.
]
)
# Make ioctl call and return result data.
ioctl(self._device.fileno(), I2C_RDWR, request)
return bytearray(
result.raw
) # Use .raw instead of .value which will stop at a null byte!
def write_quick(self, addr):
"""Write a single byte to the specified device."""
# What a strange function, from the python-smbus source this appears to
# just write a single byte that initiates a write to the specified device
# address (but writes no data!). The functionality is duplicated below
# but the actual use case for this is unknown.
assert (
self._device is not None
), "Bus must be opened before operations are made against it!"
# Build ioctl request.
request = make_i2c_rdwr_data(
[
(addr, 0, 0, None),
]
) # Write with no data.
# Make ioctl call and return result data.
ioctl(self._device.fileno(), I2C_RDWR, request)
def write_byte(self, addr, val):
"""Write a single byte to the specified device."""
assert (
self._device is not None
), "Bus must be opened before operations are made against it!"
self._select_device(addr)
data = bytearray(1)
data[0] = val & 0xFF
self._device.write(data)
def write_bytes(self, addr, buf):
"""Write many bytes to the specified device. buf is a bytearray"""
assert (
self._device is not None
), "Bus must be opened before operations are made against it!"
self._select_device(addr)
self._device.write(buf)
def write_byte_data(self, addr, cmd, val):
"""Write a byte of data to the specified cmd register of the device."""
assert (
self._device is not None
), "Bus must be opened before operations are made against it!"
# Construct a string of data to send with the command register and byte value.
data = bytearray(2)
data[0] = cmd & 0xFF
data[1] = val & 0xFF
# Send the data to the device.
self._select_device(addr)
self._device.write(data)
def write_word_data(self, addr, cmd, val):
"""Write a word (2 bytes) of data to the specified cmd register of the
device. Note that this will write the data in the endianness of the
processor running Python (typically little endian)!
"""
assert (
self._device is not None
), "Bus must be opened before operations are made against it!"
# Construct a string of data to send with the command register and word value.
data = struct.pack("=BH", cmd & 0xFF, val & 0xFFFF)
# Send the data to the device.
self._select_device(addr)
self._device.write(data)
def write_block_data(self, addr, cmd, vals):
"""Write a block of data to the specified cmd register of the device.
The amount of data to write should be the first byte inside the vals
string/bytearray and that count of bytes of data to write should follow
it.
"""
# Just use the I2C block data write to write the provided values and
# their length as the first byte.
data = bytearray(len(vals) + 1)
data[0] = len(vals) & 0xFF
data[1:] = vals[0:]
self.write_i2c_block_data(addr, cmd, data)
def write_i2c_block_data(self, addr, cmd, vals):
"""Write a buffer of data to the specified cmd register of the device."""
assert (
self._device is not None
), "Bus must be opened before operations are made against it!"
# Construct a string of data to send, including room for the command register.
data = bytearray(len(vals) + 1)
data[0] = cmd & 0xFF # Command register at the start.
data[1:] = vals[0:] # Copy in the block data (ugly but necessary to ensure
# the entire write happens in one transaction).
# Send the data to the device.
self._select_device(addr)
self._device.write(data)
def process_call(self, addr, cmd, val):
"""Perform a smbus process call by writing a word (2 byte) value to
the specified register of the device, and then reading a word of response
data (which is returned).
"""
assert (
self._device is not None
), "Bus must be opened before operations are made against it!"
# Build ctypes values to marshall between ioctl and Python.
data = create_string_buffer(struct.pack("=BH", cmd, val))
result = c_uint16()
# Build ioctl request.
request = make_i2c_rdwr_data(
[
(addr, 0, 3, cast(pointer(data), POINTER(c_uint8))), # Write data.
(
addr,
I2C_M_RD,
2,
cast(pointer(result), POINTER(c_uint8)),
), # Read word (2 bytes).
]
)
# Make ioctl call and return result data.
ioctl(self._device.fileno(), I2C_RDWR, request)
# Note the python-smbus code appears to have a rather serious bug and
# does not return the result value! This is fixed below by returning it.
return result.value

View file

@ -0,0 +1,404 @@
# SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`Adafruit_PureIO.spi`
================================================================================
Pure python (i.e. no native extensions) access to Linux IO SPI interface that is
similar to the SpiDev API. Based heavily on https://github.com/tomstokes/python-spi/.
* Author(s): Tom Stokes, Melissa LeBlanc-Williams
Implementation Notes
--------------------
**Software and Dependencies:**
* Linux and Python 3.5 or Higher
"""
# imports
from ctypes import create_string_buffer, string_at, addressof
from fcntl import ioctl
import struct
import platform
import os.path
from os import environ
import array
__version__ = "1.1.11"
__repo__ = "https://github.com/adafruit/Adafruit_Python_PureIO.git"
# SPI C API constants (from linux kernel headers)
SPI_CPHA = 0x01
SPI_CPOL = 0x02
SPI_CS_HIGH = 0x04
SPI_LSB_FIRST = 0x08
SPI_THREE_WIRE = 0x10
SPI_LOOP = 0x20
SPI_NO_CS = 0x40
SPI_READY = 0x80
SPI_TX_DUAL = 0x100
SPI_TX_QUAD = 0x200
SPI_RX_DUAL = 0x400
SPI_RX_QUAD = 0x800
SPI_MODE_0 = 0
SPI_MODE_1 = SPI_CPHA
SPI_MODE_2 = SPI_CPOL
SPI_MODE_3 = SPI_CPHA | SPI_CPOL
SPI_DEFAULT_CHUNK_SIZE = 4096
def _ioc_encode(direction, number, structure):
"""
ioctl command encoding helper function
Calculates the appropriate spidev ioctl op argument given the direction,
command number, and argument structure in python's struct.pack format.
Returns a tuple of the calculated op and the struct.pack format
See Linux kernel source file /include/uapi/asm/ioctl.h
"""
ioc_magic = ord("k")
ioc_nrbits = 8
ioc_typebits = 8
if platform.machine() == "mips":
ioc_sizebits = 13
else:
ioc_sizebits = 14
ioc_nrshift = 0
ioc_typeshift = ioc_nrshift + ioc_nrbits
ioc_sizeshift = ioc_typeshift + ioc_typebits
ioc_dirshift = ioc_sizeshift + ioc_sizebits
size = struct.calcsize(structure)
operation = (
(direction << ioc_dirshift)
| (ioc_magic << ioc_typeshift)
| (number << ioc_nrshift)
| (size << ioc_sizeshift)
)
return direction, operation, structure
# pylint: disable=too-many-instance-attributes, too-many-branches
class SPI:
"""
This class is similar to SpiDev, but instead of opening and closing
for each call, it is set up on initialization making it fast.
"""
_IOC_TRANSFER_FORMAT = "QQIIHBBBBH"
if platform.machine() == "mips":
# Direction is 3 bits
_IOC_READ = 2
_IOC_WRITE = 4
else:
# Direction is 2 bits
_IOC_WRITE = 1
_IOC_READ = 2
# _IOC_MESSAGE is a special case, so we ony need the ioctl operation
_IOC_MESSAGE = _ioc_encode(_IOC_WRITE, 0, _IOC_TRANSFER_FORMAT)[1]
_IOC_RD_MODE = _ioc_encode(_IOC_READ, 1, "B")
_IOC_WR_MODE = _ioc_encode(_IOC_WRITE, 1, "B")
_IOC_RD_LSB_FIRST = _ioc_encode(_IOC_READ, 2, "B")
_IOC_WR_LSB_FIRST = _ioc_encode(_IOC_WRITE, 2, "B")
_IOC_RD_BITS_PER_WORD = _ioc_encode(_IOC_READ, 3, "B")
_IOC_WR_BITS_PER_WORD = _ioc_encode(_IOC_WRITE, 3, "B")
_IOC_RD_MAX_SPEED_HZ = _ioc_encode(_IOC_READ, 4, "I")
_IOC_WR_MAX_SPEED_HZ = _ioc_encode(_IOC_WRITE, 4, "I")
_IOC_RD_MODE32 = _ioc_encode(_IOC_READ, 5, "I")
_IOC_WR_MODE32 = _ioc_encode(_IOC_WRITE, 5, "I")
# pylint: disable=too-many-arguments
def __init__(
self,
device,
max_speed_hz=None,
bits_per_word=None,
phase=None,
polarity=None,
cs_high=None,
lsb_first=None,
three_wire=None,
loop=None,
no_cs=None,
ready=None,
):
"""
Create spidev interface object.
"""
if isinstance(device, tuple):
(bus, dev) = device
device = f"/dev/spidev{bus:d}.{dev:d}"
if not os.path.exists(device):
raise IOError(f"{device} does not exist")
self.handle = os.open(device, os.O_RDWR)
self.chunk_size = SPI_DEFAULT_CHUNK_SIZE
if environ.get("SPI_BUFSIZE") is not None:
try:
self.chunk_size = int(os.environ.get("SPI_BUFSIZE"))
except ValueError:
self.chunk_size = SPI_DEFAULT_CHUNK_SIZE
if max_speed_hz is not None:
self.max_speed_hz = max_speed_hz
if bits_per_word is not None:
self.bits_per_word = bits_per_word
if phase is not None:
self.phase = phase
if polarity is not None:
self.polarity = polarity
if cs_high is not None:
self.cs_high = cs_high
if lsb_first is not None:
self.lsb_first = lsb_first
if three_wire is not None:
self.three_wire = three_wire
if loop is not None:
self.loop = loop
if no_cs is not None:
self.no_cs = no_cs
if ready is not None:
self.ready = ready
# pylint: enable=too-many-arguments
def _ioctl(self, ioctl_data, data=None):
"""
ioctl helper function.
Performs an ioctl on self.handle. If the ioctl is an SPI read type
ioctl, returns the result value.
"""
(direction, ioctl_bytes, structure) = ioctl_data
if direction == SPI._IOC_READ:
arg = array.array(structure, [0])
ioctl(self.handle, ioctl_bytes, arg, True)
return arg[0]
arg = struct.pack("=" + structure, data)
ioctl(self.handle, ioctl_bytes, arg)
return None
def _get_mode_field(self, field):
"""Helper function to get specific spidev mode bits"""
return bool(self._ioctl(SPI._IOC_RD_MODE) & field)
def _set_mode_field(self, field, value):
"""Helper function to set a spidev mode bit"""
mode = self._ioctl(SPI._IOC_RD_MODE)
if value:
mode |= field
else:
mode &= ~field
self._ioctl(SPI._IOC_WR_MODE, mode)
@property
def phase(self):
"""SPI clock phase bit"""
return self._get_mode_field(SPI_CPHA)
@phase.setter
def phase(self, phase):
self._set_mode_field(SPI_CPHA, phase)
@property
def polarity(self):
"""SPI polarity bit"""
return self._get_mode_field(SPI_CPOL)
@polarity.setter
def polarity(self, polarity):
self._set_mode_field(SPI_CPOL, polarity)
@property
def cs_high(self):
"""SPI chip select active level"""
return self._get_mode_field(SPI_CS_HIGH)
@cs_high.setter
def cs_high(self, cs_high):
self._set_mode_field(SPI_CS_HIGH, cs_high)
@property
def lsb_first(self):
"""Bit order of SPI word transfers"""
return self._get_mode_field(SPI_LSB_FIRST)
@lsb_first.setter
def lsb_first(self, lsb_first):
self._set_mode_field(SPI_LSB_FIRST, lsb_first)
@property
def three_wire(self):
"""SPI 3-wire mode"""
return self._get_mode_field(SPI_THREE_WIRE)
@three_wire.setter
def three_wire(self, three_wire):
self._set_mode_field(SPI_THREE_WIRE, three_wire)
@property
def loop(self):
"""SPI loopback mode"""
return self._get_mode_field(SPI_LOOP)
@loop.setter
def loop(self, loop):
self._set_mode_field(SPI_LOOP, loop)
@property
def no_cs(self):
"""No chipselect. Single device on bus."""
return self._get_mode_field(SPI_NO_CS)
@no_cs.setter
def no_cs(self, no_cs):
self._set_mode_field(SPI_NO_CS, no_cs)
@property
def ready(self):
"""Slave pulls low to pause"""
return self._get_mode_field(SPI_READY)
@ready.setter
def ready(self, ready):
self._set_mode_field(SPI_READY, ready)
@property
def max_speed_hz(self):
"""Maximum SPI transfer speed in Hz.
Note that the controller cannot necessarily assign the requested
speed.
"""
return self._ioctl(SPI._IOC_RD_MAX_SPEED_HZ)
@max_speed_hz.setter
def max_speed_hz(self, max_speed_hz):
self._ioctl(SPI._IOC_WR_MAX_SPEED_HZ, max_speed_hz)
@property
def bits_per_word(self):
"""Number of bits per word of SPI transfer.
A value of 0 is equivalent to 8 bits per word
"""
return self._ioctl(SPI._IOC_RD_BITS_PER_WORD)
@bits_per_word.setter
def bits_per_word(self, bits_per_word):
self._ioctl(SPI._IOC_WR_BITS_PER_WORD, bits_per_word)
@property
def mode(self):
"""Mode that SPI is currently running in"""
return self._ioctl(SPI._IOC_RD_MODE)
@mode.setter
def mode(self, mode):
self._ioctl(SPI._IOC_WR_MODE, mode)
def writebytes(self, data, max_speed_hz=0, bits_per_word=0, delay=0):
"""Perform half-duplex SPI write."""
data = array.array("B", data).tobytes()
# length = len(data)
chunks = [
data[i : i + self.chunk_size] for i in range(0, len(data), self.chunk_size)
]
for chunk in chunks:
length = len(chunk)
transmit_buffer = create_string_buffer(chunk)
spi_ioc_transfer = struct.pack(
SPI._IOC_TRANSFER_FORMAT,
addressof(transmit_buffer),
0,
length,
max_speed_hz,
delay,
bits_per_word,
0,
0,
0,
0,
)
try:
ioctl(self.handle, SPI._IOC_MESSAGE, spi_ioc_transfer)
except TimeoutError as err:
raise Exception( # pylint: disable=broad-exception-raised
"ioctl timeout. Please try a different SPI frequency or less data."
) from err
def readbytes(self, length, max_speed_hz=0, bits_per_word=0, delay=0):
"""Perform half-duplex SPI read as a binary string"""
receive_buffer = create_string_buffer(length)
spi_ioc_transfer = struct.pack(
SPI._IOC_TRANSFER_FORMAT,
0,
addressof(receive_buffer),
length,
max_speed_hz,
delay,
bits_per_word,
0,
0,
0,
0,
)
ioctl(self.handle, SPI._IOC_MESSAGE, spi_ioc_transfer)
return string_at(receive_buffer, length)
def transfer(self, data, max_speed_hz=0, bits_per_word=0, delay=0):
"""Perform full-duplex SPI transfer"""
data = array.array("B", data).tobytes()
receive_data = []
chunks = [
data[i : i + self.chunk_size] for i in range(0, len(data), self.chunk_size)
]
for chunk in chunks:
length = len(chunk)
receive_buffer = create_string_buffer(length)
transmit_buffer = create_string_buffer(chunk)
spi_ioc_transfer = struct.pack(
SPI._IOC_TRANSFER_FORMAT,
addressof(transmit_buffer),
addressof(receive_buffer),
length,
max_speed_hz,
delay,
bits_per_word,
0,
0,
0,
0,
)
ioctl(self.handle, SPI._IOC_MESSAGE, spi_ioc_transfer)
receive_data += string_at(receive_buffer, length)
return receive_data

View file

@ -0,0 +1,20 @@
Copyright (c) 2006 Hubert Pham
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -0,0 +1,72 @@
Metadata-Version: 2.1
Name: PyAudio
Version: 0.2.14
Summary: Cross-platform audio I/O with PortAudio
Home-page: https://people.csail.mit.edu/hubert/pyaudio/
Author: Hubert Pham
License: MIT
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Sound/Audio
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Provides-Extra: test
Requires-Dist: numpy; extra == "test"
<img align="right" width="200" style="margin-left: 3px" src="https://people.csail.mit.edu/hubert/pyaudio/images/snake-300.png">
# PyAudio
PyAudio provides Python bindings for PortAudio v19, the cross-platform audio I/O library. With PyAudio, you can easily use Python to play and record audio on a variety of platforms, such as GNU/Linux, Microsoft Windows, and Apple macOS.
PyAudio is distributed under the MIT License.
* [Homepage](https://people.csail.mit.edu/hubert/pyaudio/)
* [API Documentation](https://people.csail.mit.edu/hubert/pyaudio/docs/)
* [PyPi](https://pypi.python.org/pypi/PyAudio)
## Installation
See the INSTALLATION file in the source distribution for details. In summary, install PyAudio using `pip` on most platforms.
### Windows
```sh
python -m pip install pyaudio
```
This installs the precompiled PyAudio library with PortAudio v19 19.7.0 included. The library is compiled with support for Windows MME API, DirectSound, WASAPI, and WDM-KS. It does not include support for ASIO. If you require support for APIs not included, you will need to compile PortAudio and PyAudio.
### macOS
Use [Homebrew](https://brew.sh) to install the prerequisite [portaudio](http://portaudio.com) library, then install PyAudio using `pip`:
```sh
brew install portaudio
pip install pyaudio
```
### GNU/Linux
Use the package manager to install PyAudio. For example, on Debian-based systems:
```sh
sudo apt install python3-pyaudio
```
Alternatively, if the latest version of PyAudio is not available, install it using `pip`. Be sure to first install development libraries for `portaudio19` and `python3`.
### Building from source
See the INSTALLATION file.
## Documentation & Usage Examples
* Read the [API Documentation](https://people.csail.mit.edu/hubert/pyaudio/docs/), or generate it from the source using [`sphinx`](https://www.sphinx-doc.org/).
* Usage examples are in the `examples` directory of the source distribution, or see the [project homepage](https://people.csail.mit.edu/hubert/pyaudio/).
## License
PyAudio is distributed under the MIT License. See LICENSE.txt.

View file

@ -0,0 +1,10 @@
PyAudio-0.2.14.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
PyAudio-0.2.14.dist-info/LICENSE.txt,sha256=fntVlrMb-hzPD2Nug0TmemhiZeCRwN02DxG2bcgqvFQ,1055
PyAudio-0.2.14.dist-info/METADATA,sha256=DUBXjHQyuQQ8wZbm03I5nlJAHuN2Ax5b_CIKzVo_aFc,2610
PyAudio-0.2.14.dist-info/RECORD,,
PyAudio-0.2.14.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
PyAudio-0.2.14.dist-info/WHEEL,sha256=aRGEkprvxMbrPi2LMCqFxvgOzuUl8FSsp95vsR9KNqQ,105
PyAudio-0.2.14.dist-info/top_level.txt,sha256=jp8bgmWZh435lFm-DsWc00D0k4xj4iAEmWd1L_TpKk8,8
pyaudio/__init__.py,sha256=7V6ZjNJra5wjKcIoklmSU84UmFMrFm23DT1dtWtxXGU,36914
pyaudio/__pycache__/__init__.cpython-311.pyc,,
pyaudio/_portaudio.cpython-311-aarch64-linux-gnu.so,sha256=5JfXE4yl_22-XY0VsNQZkf1GfjWHVxdAEcf3NnDc2iY,175240

View file

@ -0,0 +1,5 @@
Wheel-Version: 1.0
Generator: setuptools (72.2.0)
Root-Is-Purelib: false
Tag: cp311-cp311-linux_aarch64

View file

@ -0,0 +1 @@
pyaudio

View file

@ -0,0 +1,20 @@
Copyright (c) 2012-2021 Ben Croston
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,260 @@
Metadata-Version: 2.1
Name: RPi.GPIO
Version: 0.7.1
Summary: A module to control Raspberry Pi GPIO channels
Home-page: http://sourceforge.net/projects/raspberry-gpio-python/
Author: Ben Croston
Author-email: ben@croston.org
License: MIT
Keywords: Raspberry Pi GPIO
Classifier: Development Status :: 5 - Production/Stable
Classifier: Operating System :: POSIX :: Linux
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development
Classifier: Topic :: Home Automation
Classifier: Topic :: System :: Hardware
License-File: LICENCE.txt
This package provides a Python module to control the GPIO on a Raspberry Pi.
Note that this module is unsuitable for real-time or timing critical applications. This is because you
can not predict when Python will be busy garbage collecting. It also runs under the Linux kernel which
is not suitable for real time applications - it is multitasking O/S and another process may be given
priority over the CPU, causing jitter in your program. If you are after true real-time performance and
predictability, buy yourself an Arduino http://www.arduino.cc !
Note that the current release does not support SPI, I2C, hardware PWM or serial functionality on the RPi yet.
This is planned for the near future - watch this space! One-wire functionality is also planned.
Although hardware PWM is not available yet, software PWM is available to use on all channels.
For examples and documentation, visit http://sourceforge.net/p/raspberry-gpio-python/wiki/Home/
Change Log
==========
0.7.1
-------
- Better RPi board + peri_addr detection (issue 190 / 191)
- Fix PyEval_InitThreads deprecation warning for Python 3.9 (issue 188)
- Fix build using GCC 10 (issue 187)
- Fix docstrings to not include licence
- Remove Debian/Raspbian stretch packaging support
- Use setuptools instead of distutils
- Added detection of Zero 2 W
- Tested and working with Python 2.7, 3.7, 3.8, 3.9, 3.10
0.7.0
-----
- Updated RPI_INFO to include RPi 4B
- Fixed pull up/down for Pi4 (issue 168)
- Fix spelling mistake in docstrings
- Tested and working on Raspbian Buster + Python 3.8.0b2
- Fix board detection for aarch64 (Issues 161 / 165)
- Fix checking mmap return value in c_gpio.c (issue 166)
0.6.5
-----
- Fix exception on re-export of /sys/class/gpio/gpioNN
0.6.4
-----
- Event cleanup bug (issue 145)
- Raise exception for duplicate PWM objects (issue 54 - Thijs Schreijer <thijs@thijsschreijer.nl>)
- Fix build warnings (Issue 146 - Dominik George)
- test.py runs unchanged for both python 2+3
- Soft PWM stops running fix (Issues 94, 111, 154)
- Soft PWM segfault fix (Luke Allen pull request)
0.6.3
-----
- Fix code so it builds under PyPy (Gasper Zejn)
- os.system breaks event detection - Matt Kimball (issue 127)
0.6.2
-----
- Rewrote Debian packaging mechanism
- RPI_INFO reports Pi 3
- Changed module layout - moved C components to RPi._GPIO
0.6.1
-----
- Update RPI_INFO to detect more board types
- Issue 118 - add_event_detect sometimes gives runtime error with unpriv user
- Issue 120 - setmode() remembers invalid mode
0.6.0a3
-------
- Now uses /dev/gpiomem if available to avoid being run as root
- Fix warnings with pull up/down on pins 3/5
- Correct base address on Pi 2 when devicetree is disabled
- caddr_t error on compile (Issue 109)
- Error on invalid parameters to setup() (issue 93)
- Add timeout parameter to wait_for_edge() (issue 91)
0.5.11
------
- Fix - pins > 26 missing when using BOARD mode
- Add getmode()
- Raise exception when a mix of modes is used
- GPIO.cleanaup() unsets the current pin mode
0.5.10
------
- Issue 95 - support RPi 2 boards
- Introduce RPI_INFO
- Deprecate RPI_REVISION
- Issue 97 - fixed docstring for setup()
0.5.9
-----
- Issue 87 - warn about pull up/down on i2c pins
- Issue 86/75 - wait_for_edge() bugfix
- Issue 84 - recognise RPi properly when using a custom kernel
- Issue 90 - cleanup() on a list/tuple of channels
0.5.8
-----
- Allow lists/tuples of channels in GPIO.setup()
- GPIO.output() now allows lists/tuples of values
- GPIO.wait_for_edge() bug fixes (issue 78)
0.5.7
-----
- Issue 67 - speed up repeated calls to GPIO.wait_for_event()
- Added bouncetime keyword to GPIO.wait_for_event()
- Added extra edge/interrupt unit tests
- GPIO.wait_for_event() can now be mixed with GPIO.add_event_detect()
- Improved cleanups of events
- Issue 69 resolved
0.5.6
-----
- Issue 68 - support for RPi Model B+
- Fix gpio_function()
0.5.5
-----
- Issue 52 - 'unallocate' a channel
- Issue 35 - use switchbounce with GPIO.event_detected()
- Refactored events code
- Rewrote tests to use unittest mechanism and new test board with loopbacks
- Fixed adding events after a GPIO.cleanup()
- Issue 64 - misleading /dev/mem permissions error
- Issue 59 - name collision with PWM constant and class
0.5.4
-----
- Changed release status (from alpha to full release)
- Warn when GPIO.cleanup() used with nothing to clean up (issue 44)
- Avoid collisions in constants (e.g. HIGH / RISING / PUD_DOWN)
- Accept BOARD numbers in gpio_function (issue 34)
- More return values for gpio_function (INPUT, OUTPUT, SPI, I2C, PWM, SERIAL, UNKNOWN)
- Tidy up docstrings
- Fix /dev/mem access error with gpio_function
0.5.3a
------
- Allow pydoc for non-root users (issue 27)
- Fix add_event_detect error when run as daemon (issue 32)
- Simplified exception types
- Changed from distribute to pip
0.5.2a
------
- Added software PWM (experimental)
- Added switch bounce handling to event callbacks
- Added channel number parameter to event callbacks (issue 31)
- Internal refactoring and code tidy up
0.5.1a
------
- Fixed callbacks for multiple GPIOs (issue 28)
0.5.0a
------
- Added new edge detection events (interrupt handling)
- Added add_event_detect()
- Added remove_event_detect()
- Added add_event_callback()
- Added wait_for_edge()
- Removed old experimental event functions
- Removed set_rising_event()
- Removed set_falling_event()
- Removed set_high_event()
- Removed set_low_event()
- Changed event_detected() for new edge detection functionality
- input() now returns 0/LOW == False or 1/HIGH == True (integers) instead of False or True (booleans).
- Fix error on repeated import (issue 3)
- Change SetupException to a RuntimeError so it can be caught on import (issue 25, Chris Hager <chris@linuxuser.at>)
- Improved docstrings of functions
0.4.2a
------
- Fix for installing on Arch Linux (Python 3.3) (issue 20)
- Initial value when setting a channel as an output (issue 19)
0.4.1a
------
- Added VERSION
- Permit input() of channels set as outputs (Eric Ptak <trouch@trouch.com>)
0.4.0a
------
- Added support for Revision 2 boards
- Added RPI_REVISION
- Added cleanup() function and removed automatic reset functionality on program exit
- Added get_function() to read existing GPIO channel functionality (suggestion from Eric Ptak <trouch@trouch.com>)
- Added set_rising_event()
- Added set_falling_event()
- Added set_high_event()
- Added set_low_event()
- Added event_detected()
- Added test/test.py
- Converted debian to armhf
- Fixed C function short_wait() (thanks to Thibault Porteboeuf <thibaultporteboeuf@gmail.com>)
0.3.1a
------
- Fixed critical bug with swapped high/low state on outputs
- Added pull-up / pull-down setup functionality for inputs
0.3.0a
------
- Rewritten as a C extension
- Now uses /dev/mem and SoC registers instead of /sys/class/gpio
- Faster!
- Make call to GPIO.setmode() mandatory
- Added GPIO.HIGH and GPIO.LOW constants
0.2.0
-----
- Changed status from alpha to beta
- Added setmode() to be able to use BCM GPIO 00.nn channel numbers
- Renamed InvalidPinException to InvalidChannelException
0.1.0
------
- Fixed direction bug
- Added MANIFEST.in (to include missing file)
- Changed GPIO channel number to pin number
- Tested and working!
0.0.3a
------
- Added GPIO table
- Refactored
- Fixed a few critical bugs
- Still completely untested!
0.0.2a
------
- Internal refactoring. Still completely untested!
0.0.1a
------
- First version. Completely untested until I can get hold of a Raspberry Pi!

View file

@ -0,0 +1,11 @@
RPi.GPIO-0.7.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
RPi.GPIO-0.7.1.dist-info/LICENCE.txt,sha256=HM8DmgMIjaQr2yGKRGpWQzC4gexx9wIqn7GTDz-2XYo,1061
RPi.GPIO-0.7.1.dist-info/METADATA,sha256=El0-b7E1WnRmiDpKpnT-b2uqgT6DkCTg6084ZanFpAs,8230
RPi.GPIO-0.7.1.dist-info/RECORD,,
RPi.GPIO-0.7.1.dist-info/WHEEL,sha256=aRGEkprvxMbrPi2LMCqFxvgOzuUl8FSsp95vsR9KNqQ,105
RPi.GPIO-0.7.1.dist-info/top_level.txt,sha256=D2ebmx5QNuKCb-J2LbVMXkkhIVNpXvmxlOVIZjPsALw,4
RPi/GPIO/__init__.py,sha256=sdM6clNBKNh1SLlx_Ymapx8w8apBzznBSvq8Nv9WGJQ,1222
RPi/GPIO/__pycache__/__init__.cpython-311.pyc,,
RPi/_GPIO.cpython-311-aarch64-linux-gnu.so,sha256=ali0qFBW_hONSMwxfezEWXvYALsh_1futwOBW4sa-y0,167128
RPi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
RPi/__pycache__/__init__.cpython-311.pyc,,

View file

@ -0,0 +1,5 @@
Wheel-Version: 1.0
Generator: setuptools (72.2.0)
Root-Is-Purelib: false
Tag: cp311-cp311-linux_aarch64

View file

@ -0,0 +1,25 @@
# Copyright (c) 2012-2021 Ben Croston
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to do
# so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""This package provides a Python module to control the GPIO on a Raspberry Pi"""
from RPi._GPIO import *
VERSION = '0.7.1'

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