- Remove Pin to button mapping from hwconfig, replace with a simple list of Pins to which buttons are attached - Add BUTTON_MAP to config.json which maps indices in the HW button list to button names - Update utils.Buttons to use the button map to connect the correct pins to the matching key codes Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
58 lines
939 B
Python
58 lines
939 B
Python
# SPDX-License-Identifier: MIT
|
|
# Copyright (c) 2025 Matthias Blankertz <matthias@blankertz.org>
|
|
|
|
from machine import Pin
|
|
|
|
# SD Card SPI
|
|
SD_DI = Pin.board.GP3
|
|
SD_DO = Pin.board.GP4
|
|
SD_SCK = Pin.board.GP2
|
|
SD_CS = Pin.board.GP5
|
|
SD_CLOCKRATE = 15000000
|
|
|
|
# MAX98357
|
|
I2S_LRCLK = Pin.board.GP7
|
|
I2S_DCLK = Pin.board.GP6
|
|
I2S_DIN = Pin.board.GP8
|
|
I2S_SD = None
|
|
|
|
# RC522
|
|
RC522_SPIID = 1
|
|
RC522_RST = Pin.board.GP9
|
|
RC522_IRQ = Pin.board.GP14
|
|
RC522_MOSI = Pin.board.GP11
|
|
RC522_MISO = Pin.board.GP12
|
|
RC522_SCK = Pin.board.GP10
|
|
RC522_SS = Pin.board.GP13
|
|
|
|
# WS2812
|
|
LED_DIN = Pin.board.GP16
|
|
|
|
# Buttons
|
|
BUTTONS = [Pin.board.GP17,
|
|
Pin.board.GP18,
|
|
Pin.board.GP19,
|
|
]
|
|
|
|
# Power
|
|
POWER_EN = None
|
|
VBAT_ADC = Pin.board.GP26
|
|
|
|
|
|
def board_init():
|
|
pass
|
|
|
|
|
|
def get_battery_voltage():
|
|
# Not supported on breadboard
|
|
return None
|
|
|
|
|
|
def power_off():
|
|
# Not supported on breadboard
|
|
pass
|
|
|
|
|
|
def get_on_battery():
|
|
return False
|