mirror of
https://github.com/meshtastic/firmware.git
synced 2026-11-07 23:04:49 -05:00
* feat(portduino): Adafruit Arcade Bonnet input driver
Add an InputBroker source for the Adafruit Arcade Bonnet: six buttons
(1A-1F) and a 4-way joystick on an MCP23017 I2C expander.
The expander is polled over I2C every 20 ms rather than serviced from its
interrupt line, because the bonnet ties INT to GPIO17, which is the HUB75
clock on the adafruit-hat mapping. The driver sets INT to open-drain and
enables no interrupt sources so the line never drives against the panel.
Buttons emit once per press and carry a gamepad button code in kbchar
(1E = BTN_SELECT, 1F = BTN_START, so Start pauses games). The joystick
emits directions with the same auto-repeat as LinuxJoystick. The analog
stick bits are ignored; they float with no stick attached.
Config:
Input:
ArcadeBonnet: 0x26
ArcadeBonnetButtons: # optional
select: [1A, 1F]
cancel: 1B
--check validates both keys. The action-name parser moves from
LinuxJoystick.cpp to InputBroker.h so both drivers share it.
Breakout now polls the bonnet joystick's held direction the same way it
polls the USB gamepad, so the paddle glides instead of stepping at the
auto-repeat rate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018vaqwGPoD64pqsnPYbvnUn
* fix(portduino): Arcade Bonnet buttons act in games; address review
1F reported BTN_START, which GamesModule treats as pause, so a bonnet
button bound to select paused Tetris and Breakout instead of dropping or
serving. 1E/1F now report BTN_C/BTN_Z; no bonnet button is Start.
From review:
- Clear the held joystick zones when an I2C read fails, so Breakout's
paddle doesn't keep moving after the bonnet stops answering.
- Set Input.ArcadeBonnet only when the key is present, so a later
config.d file with its own Input section doesn't disable the bonnet.
- Reject addresses outside the MCP23017's 0x20-0x27 in the driver and
in --check, instead of truncating them to a uint8_t.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018vaqwGPoD64pqsnPYbvnUn
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
294 lines
10 KiB
YAML
294 lines
10 KiB
YAML
### Many device configs have been moved to /etc/meshtasticd/available.d
|
|
### To activate, simply copy or link the appropriate file into /etc/meshtasticd/config.d
|
|
|
|
### Define your devices here using Broadcom pin numbering
|
|
### Uncomment the block that corresponds to your hardware
|
|
### Including the "Module:" line!
|
|
---
|
|
Lora:
|
|
# Default to auto-detecting the module type
|
|
# This will be overridden by configs from config.d
|
|
Module: auto
|
|
|
|
# # Uncomment to enable Simulation mode, or use --sim
|
|
# Module: sim
|
|
|
|
# Module: sx1262 # Waveshare SX1302 LISTEN ONLY AT THIS TIME!
|
|
# CS: 7
|
|
# IRQ: 17
|
|
# Reset: 22
|
|
|
|
# Module: RF95 # Elecrow Lora RFM95 IOT https://www.elecrow.com/lora-rfm95-iot-board-for-rpi.html
|
|
# Reset: 22
|
|
# CS: 7
|
|
# IRQ: 25
|
|
|
|
# Module: sx1280 # SX1280
|
|
# CS: 21
|
|
# IRQ: 16
|
|
# Busy: 20
|
|
# Reset: 18
|
|
|
|
### The Radxa Zero 3E/W employs multiple gpio chips.
|
|
### Each gpio pin must be unique, but can be assigned to a specific gpio chip and line.
|
|
### In case solely a no. is given, the default gpio chip and pin == line will be employed.
|
|
###
|
|
# Module: sx1262 # Radxa Zero 3E/W + Ebyte E22-900M30S
|
|
# DIO2_AS_RF_SWITCH: true
|
|
# DIO3_TCXO_VOLTAGE: 1.8
|
|
# CS: # NSS PIN_24 -> chip 4, line 22
|
|
# pin: 24
|
|
# gpiochip: 4
|
|
# line: 22
|
|
# SCK: # SCK PIN_23 -> chip 4, line 18
|
|
# pin: 23
|
|
# gpiochip: 4
|
|
# line: 18
|
|
# Busy: # BUSY PIN_29 -> chip 3!, line 11
|
|
# pin: 29
|
|
# gpiochip: 3
|
|
# line: 11
|
|
# MOSI: # MOSI PIN_19 -> chip 4, line 19
|
|
# pin: 19
|
|
# gpiochip: 4
|
|
# line: 19
|
|
# MISO: # MISO PIN_21 -> chip 4, line 21
|
|
# pin: 21
|
|
# gpiochip: 4
|
|
# line: 21
|
|
# Reset: # NRST PIN_27 -> chip 4, line 10
|
|
# pin: 27
|
|
# gpiochip: 4
|
|
# line: 10
|
|
# IRQ: # DIO1 PIN_28 -> chip 4, line 11
|
|
# pin: 28
|
|
# gpiochip: 4
|
|
# line: 11
|
|
# RXen: # RXEN PIN_22 -> chip 3!, line 17
|
|
# pin: 22
|
|
# gpiochip: 3
|
|
# line: 17
|
|
# TXen: RADIOLIB_NC # TXEN no PIN, no line, fallback to default gpio chip
|
|
|
|
# Module: sx1268 # SX1268-based modules, tested with Ebyte E22 400M33S
|
|
# CS: 21
|
|
# IRQ: 16
|
|
# Busy: 20
|
|
# Reset: 18
|
|
# TXen: 6
|
|
# RXen: 12
|
|
# DIO3_TCXO_VOLTAGE: true
|
|
|
|
# DIO3_TCXO_VOLTAGE: true # the Waveshare Core1262 and others are known to need this setting
|
|
# DIO3_TCXO_DELAY_US: 1000 # TCXO start-up wait, SX126x/LR11xx; default 1000 (RadioLib's own is 5000)
|
|
|
|
# TCXO_OPTIONAL: true # Probe both oscillators (default Vref 1.6V); SX126x/LR20x0/LR11xx only.
|
|
# # SX126x and LR20x0 try TCXO first; LR11x0 tries the crystal first.
|
|
|
|
### DIO the LR2021 raises its interrupt on, DIO5 to DIO11. Defaults to DIO5, which many carriers
|
|
### also drive as an RF switch line -- a pin cannot be both, and the radio will report init
|
|
### success and then receive nothing. Point it at a DIO rfswitch_table does not list.
|
|
### LR2021_IRQ_DIO_NUM is an older spelling of the same setting, read only if IRQ_DIO_NUM is absent.
|
|
# IRQ_DIO_NUM: 9
|
|
# LR2021_IRQ_DIO_NUM: 9
|
|
|
|
# TXen: x # TX and RX enable pins
|
|
# RXen: x
|
|
|
|
# SX126X_MAX_POWER: 8 # Limit the output power to 8 dBm, useful for amped nodes
|
|
|
|
# spiSpeed: 2000000
|
|
|
|
### Set default/fallback gpio chip to use in /dev/. Defaults to 0.
|
|
### Notably the Raspberry Pi 5 puts the GPIO header on gpiochip4
|
|
# gpiochip: 4
|
|
|
|
### Specify the SPI device to use in /dev/. Defaults to spidev0.0
|
|
### Some devices, like the pinedio, may require spidev0.1 as a workaround.
|
|
# spidev: spidev0.0
|
|
|
|
### Deprecated location for User Button:
|
|
|
|
#GPIO:
|
|
# User: 6
|
|
|
|
### Define GPS
|
|
|
|
GPS:
|
|
# SerialPath: /dev/ttyS0 # Use a physical serial GPS device (mutually exclusive with GpsdHost)
|
|
# GpsdHost: localhost # Use gpsd daemon as GPS source instead of a serial device
|
|
# GpsdPort: 2947 # gpsd TCP port (default: 2947)
|
|
# ExtraPins:
|
|
# - 22
|
|
|
|
### Specify I2C device, or leave blank for none
|
|
|
|
I2C:
|
|
# I2CDevice: /dev/i2c-1
|
|
|
|
### Set up SPI displays here. Note that I2C displays are generally auto-detected.
|
|
|
|
Display:
|
|
|
|
### Adafruit PiTFT 2.8 TFT+Touchscreen
|
|
# Panel: ILI9341
|
|
# CS: 8
|
|
# DC: 25
|
|
# Width: 240
|
|
# Height: 320
|
|
# Rotate: true
|
|
|
|
### SHCHV 3.5 RPi TFT+Touchscreen
|
|
# Panel: ILI9486
|
|
# spidev: spidev0.0
|
|
# BusFrequency: 30000000
|
|
# DC: 24
|
|
# Reset: 25
|
|
# Width: 320
|
|
# Height: 480
|
|
# OffsetRotate: 2
|
|
|
|
### TZT 2.0 Inch TFT Display ST7789V 240RGBx320
|
|
# Panel: ST7789
|
|
# spidev: spidev0.0
|
|
# # CS: 8 # can be freely chosen
|
|
# BusFrequency: 80000000
|
|
# DC: 24 # can be freely chosen
|
|
# Width: 320
|
|
# Height: 240
|
|
# Reset: 25 # can be freely chosen
|
|
# Rotate: true
|
|
# OffsetRotate: 1
|
|
# Invert: true
|
|
|
|
### You can also specify the spi device for the display to use
|
|
# spidev: spidev0.0
|
|
|
|
### HUB75 RGB LED matrix panel (Raspberry Pi only, via hzeller/rpi-rgb-led-matrix).
|
|
### Requires the librgbmatrix library to be installed (so `pkg-config rgbmatrix` resolves) and
|
|
### the firmware built with it present. meshtasticd must run as root (or with /dev/gpiomem
|
|
### access) and on-board audio disabled (dtparam=audio=off) so it doesn't fight the PWM timing.
|
|
### The library owns the GPIO pins - they are chosen by HardwareMapping, not set individually.
|
|
# Panel: HUB75
|
|
# HUB75:
|
|
# HardwareMapping: adafruit-hat-pwm # regular | adafruit-hat | adafruit-hat-pwm | regular-pi1 ...
|
|
# Rows: 64 # pixel rows per panel (e.g. 32 or 64)
|
|
# Cols: 64 # pixel columns per panel
|
|
# ChainLength: 1 # panels daisy-chained (width = Cols * ChainLength)
|
|
# Parallel: 1 # parallel chains (height = Rows * Parallel)
|
|
# Brightness: 80 # percent, 1..100
|
|
# PWMBits: 11 # lower = higher refresh, fewer colors
|
|
# GPIOSlowdown: 4 # raise for faster Pis / long cables if the panel ghosts or flickers
|
|
# RGBSequence: RGB # reorder if your panel's colors are swapped (e.g. RBG, BGR)
|
|
# ScanMode: 0 # 0=progressive, 1=interlaced
|
|
# RowAddressType: 0 # 0=default, 1=AB-addressed (some 64x64 panels)
|
|
# Multiplexing: 0 # 0=direct, 1=stripe, 2=checker, ...
|
|
# PanelType: "" # e.g. FM6126A for panels needing a special init
|
|
# PixelMapper: "" # e.g. "U-mapper;Rotate:90"
|
|
# LimitRefreshRateHz: 0 # 0 = no limit
|
|
# DisableHardwarePulsing: false
|
|
|
|
Touchscreen:
|
|
### Note, at least for now, the touchscreen must have a CS pin defined, even if you let Linux manage the CS switching.
|
|
|
|
# Module: STMPE610 # Option 1 for Adafruit PiTFT 2.8
|
|
# CS: 7
|
|
# IRQ: 24
|
|
|
|
# Module: FT5x06 # Option 2 for Adafruit PiTFT 2.8
|
|
# IRQ: 24
|
|
# I2CAddr: 0x38
|
|
|
|
### You can also specify the spi device for the touchscreen to use
|
|
# spidev: spidev0.0
|
|
|
|
Input:
|
|
### Configure device for direct keyboard input
|
|
|
|
# KeyboardDevice: /dev/input/by-id/usb-_Raspberry_Pi_Internal_Keyboard-event-kbd
|
|
|
|
### Configure device for USB gamepad/joystick input (evdev). The D-pad drives
|
|
### Up/Down/Left/Right; buttons are mapped below. Find button codes with `evtest`.
|
|
# JoystickDevice: /dev/input/by-id/usb-0079_USB_Gamepad-event-joystick
|
|
### Map evdev button codes (hex or decimal) to actions. Omit to use built-in
|
|
### defaults (select=0x121, cancel=0x122). Actions: select, cancel, back, up,
|
|
### down, left, right, user. Give an action a list of codes to bind several
|
|
### physical buttons to it -- e.g. the shoulder buttons alongside the D-pad.
|
|
### Games can tell which physical button was pressed even when several share an
|
|
### action: in Snake the shoulders turn relative to the snake's heading while
|
|
### the D-pad steers absolutely, and Start pauses in play while selecting
|
|
### everywhere else.
|
|
### The codes below are an example only -- confirm yours with `evtest`.
|
|
# JoystickButtons:
|
|
# select: [0x121, 0x123, 0x129] # A, Y and Start
|
|
# cancel: [0x122, 0x120] # B and X
|
|
# left: [0x124] # L shoulder, alongside the D-pad
|
|
# right: [0x125] # R shoulder
|
|
|
|
### Adafruit Arcade Bonnet: six buttons (1A-1F) and a 4-way joystick on an MCP23017
|
|
### I2C expander. Needs I2C.I2CDevice. The value is the expander's I2C address (0x26 as
|
|
### shipped). The joystick drives Up/Down/Left/Right; it is polled over I2C, so the
|
|
### bonnet's interrupt line (GPIO17, the HUB75 clock on adafruit-hat) is never used.
|
|
# ArcadeBonnet: 0x26
|
|
### Map bonnet buttons to actions, as with JoystickButtons. Omit to use the defaults:
|
|
### 1A, 1C and 1F select; 1B, 1D and 1E cancel.
|
|
# ArcadeBonnetButtons:
|
|
# select: [1A, 1C, 1F]
|
|
# cancel: [1B, 1D, 1E]
|
|
|
|
### Standard User Button Config
|
|
# UserButton: 6
|
|
|
|
### Trackball/Joystick input
|
|
# TrackballUp: 6
|
|
# TrackballDown: 19
|
|
# TrackballLeft: 5
|
|
# TrackballRight: 26
|
|
# TrackballPress: 13
|
|
|
|
###
|
|
|
|
Logging:
|
|
LogLevel: info # debug, info, warn, error
|
|
# TraceFile: /var/log/meshtasticd.json
|
|
# JSONFile: /packets.json # File location for JSON output of decoded packets
|
|
# JSONFileRotate: 60 # Rotate JSON file every N minutes, or 0 for no rotation
|
|
# JSONFilter: position # filter for packets to save to JSON file
|
|
# AsciiLogs: true # default if not specified is !isatty() on stdout
|
|
|
|
Webserver:
|
|
# Port: 9443 # Port for Webserver & Webservices
|
|
# RootPath: /usr/share/meshtasticd/web # Root Dir of WebServer
|
|
# SSLKey: /etc/meshtasticd/ssl/private_key.pem # Path to SSL Key, generated if not present
|
|
# SSLCert: /etc/meshtasticd/ssl/certificate.pem # Path to SSL Certificate, generated if not present
|
|
|
|
Bluetooth:
|
|
# Enabled: true # Advertise a BLE peripheral via BlueZ, like other Meshtastic devices (Linux only)
|
|
# AdapterId: hci0 # BlueZ adapter to use
|
|
|
|
HostMetrics:
|
|
# ReportInterval: 30 # Interval in minutes between HostMetrics report packets, or 0 for disabled
|
|
# Channel: 0 # channel to send Host Metrics over. Defaults to the primary channel.
|
|
# UserStringCommand: cat /sys/firmware/devicetree/base/serial-number # Command to execute, to send the results as the userString
|
|
|
|
Security:
|
|
# Public keys authorized to send admin messages to this node, as base64, the same text the apps and
|
|
# the CLI show for a node's public key. Up to 16, and up to 3 of them are reflected into the node's
|
|
# own security config so clients and managed mode see them. Files in config.d add to this list, and
|
|
# this file is the authority: a key removed from here loses access, and remote admin cannot drop it.
|
|
# AdminKeys:
|
|
# - rvzaPCZmlh1nWnqNKUFHj0dLBJJIRJhRrkZmaFLHCVY=
|
|
|
|
Config:
|
|
# DisplayMode: TWOCOLOR # uncomment to force BaseUI
|
|
# DisplayMode: COLOR # uncomment to force MUI
|
|
|
|
General:
|
|
MaxNodes: 200
|
|
MaxMessageQueue: 100
|
|
ConfigDirectory: /etc/meshtasticd/config.d/
|
|
AvailableDirectory: /etc/meshtasticd/available.d/
|
|
# MACAddress: AA:BB:CC:DD:EE:FF
|
|
# MACAddressSource: eth0
|
|
# APIPort: 4403
|