Skip to content

Instantly share code, notes, and snippets.

SN32F268 ATmega32U4 WeAct Blackpill - STM32F411 WeAct STM32F405 RP2040 Proton C - STM32F303xC Nice Nano (nRF52840) STM32G0B1xx
Speed 48MHz 16MHz ~96MHz ~168MHz 2@ 133MHz 72MHz 64MHz 64MHz
Voltage 3.3V 5V 3.3V with 5V capable pins 3.3V with 5V capable pins 3.3v 3.3V with some 5V capable pins 3.3v 3.3V with 5V capable pins
Flash size 32kB (~28kB usable) 32kB (28kB
@drashna
drashna / ft6x36.c
Created October 31, 2025 18:55
ft6x36 driver (not working?)
// Copyright 2025 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#include "ft6x36.h"
#include "i2c_master.h"
#include "print.h"
#include "timer.h"
#include "gpio.h"
#include "wait.h"
#ifndef I2C_DRIVER
# define I2C_DRIVER I2CD1
#endif
// ...
if (io_expander_ready()) {
// If we managed to initialize the mcp23018 - we need to reinitialize the matrix / layer state. During an electric discharge the i2c peripherals might be in a weird state. Giving a delay and resetting the MCU allows to recover from this.
mcp23018_reset_loop = 0;
mcp23018_errors = 0;
@drashna
drashna / autocorrect_dict_larger.txt
Last active May 6, 2025 04:26
Autocorrect dictionaries for QMK Firmware
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@drashna
drashna / keymap.c
Created April 1, 2025 23:27
nano scroll lock scrolling
#include QMK_KEYBOARD_H
// Dummy
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {{{KC_NO}}};
void suspend_power_down_user(void) {
// Switch off sensor + LED making trackball unable to wake host
adns5050_power_down();
}
@drashna
drashna / oled_pet.c
Last active December 3, 2024 06:05
basic implementation of luna/etc with defer exec
// Images credit j-inc(/James Incandenza) and pixelbenny.
// Credit to obosob for initial animation approach.
// heavily modified by drashna because he's a glutton for punishment
#define OLED_ANIM_SIZE (32+1)
#define OLED_ANIM_ROWS 4
#define OLED_ANIM_MAX_FRAMES 3
#define OLED_SLEEP_FRAMES 2
{
"configurations": [
{
"name": "Mac",
"includePath": [
"/usr/local/Cellar/arm-gcc-bin@8/8-2019-q3-update_1/arm-none-eabi/include/**",
"/usr/local/Cellar/arm-gcc-bin@8/8-2019-q3-update_1/lib/gcc/arm-none-eabi/8.3.1/include/**",
"/usr/local/Cellar/arm-gcc-bin@8/8-2019-q3-update_1/lib/gcc/arm-none-eabi/8.3.1/include-fixed/**",
"/usr/local/Cellar/avr-gcc@8/8.4.0_2/avr/include/**",
"/usr/local/Cellar/avr-gcc@8/8.4.0_2/lib/avr-gcc/8/gcc/avr/8.4.0/include/**",
@drashna
drashna / config.h
Last active October 30, 2024 15:23
Caps word state sync
#pragma once
#define SPLIT_TRANSACTION_IDS_USER USER_SYNC_A
@drashna
drashna / oled_font.h
Created August 9, 2024 00:34
Oled font with all glyphs
#pragma once
// additional fonts from
// https://github.com/datacute/TinyOLED-Fonts
#include "progmem.h"
// clang-format off
static const unsigned char font[] PROGMEM = {
0x07, 0x08, 0x7F, 0x08, 0x07, 0x00,
#include QMK_KEYBOARD_H
#ifdef OLED_ENABLE
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_2x4(
KC_1, KC_2, KC_3, KC_4,
KC_5, KC_6, KC_7, KC_8
)
};