Skip to content

Instantly share code, notes, and snippets.

View abrugsch's full-sized avatar

Alistair abrugsch

  • UK
View GitHub Profile
@abrugsch
abrugsch / batocerapins.txt
Created February 14, 2025 14:11
myCade-hat batocera findings
myCade-hat batocera findings
up,dn,lt,rt - D-Pad directions
B1-6 Face buttons. usually assigned as North, South, East West, L Trigger, R Trigger
F1-3 Front panel buttons. usually Start, Select, [other]
in the MAP columns, the label is what batocera reports when configuring the controller.
MAP4 uses map=4 gpio=6,12,20,16,24,15,5,11,8,25,9,10,15
the * in the GPIO column indicates that I didn't check which exact face button corresponds
@abrugsch
abrugsch / config.txt
Created February 7, 2025 13:31
Batocera config.txt for RPI4
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# Load the 64-bit kernel
arm_64bit=1
# Run as fast as firmware / board allows
arm_boost=1
@abrugsch
abrugsch / batocera.conf
Created February 7, 2025 13:30
Batocera conf file with GPIO controls for Picade HAT pinout
# ------------ A - System Options ----------- #
## Security
## Enable this to enforce security, requiring a password to access the network share.
system.security.enabled=0
## Services
# exampe: system.services=service1 service2
system.services=pigpio
replaces about 75% of moq calls with NSubstitute equivalents (taken from the moq issue thread discussing open source funding)
Replace "using Moq;" with "using NSubstitute;" (non-regex)
Replace "new Mock<(.*?)>()" with "Substitute.For<$1>()" (Regex)
Replace "Mock<(.*?)>" with "$1" (Regex)
Replace ".Setup(x => x." with "." (non-regex)
Replace ").ReturnsAsync(" with ".Returns(" (non-regex)
Replace "It.IsAny<" with "Arg.Any<" (non-regex)
Replace "It.IsAny<" with "Arg.Any<" (non-regex)
Replace "(\w+.)Verify(x => x.(\w+)((.*?)), Times.Once())" with "await $1Received(1).$2($3)" (Regex)
@abrugsch
abrugsch / RPiPinout.py
Last active May 24, 2018 20:54
raspberry pi pinout dictionary
#from reddit user /u/Grorco and thread https://www.reddit.com/r/raspberry_pi/comments/8lrgsk/raspberry_pi_pinout_dictionary/
def pinoutdict():
"""This returns a dictionary for Raspberry Pi 3 Model B, B+, RPI2 40Pin GPIO pinout.
Keys are ints of the GPIO.BOARD value, values are a list of pin properties."""
pinout = {1:['3.3v'],
2:['5v'],
3:['GPIO','02','SDA1','I2C'],
4:['5v'],
5:['GPIO','03','SCL1','I2C'],
6:['GND'],