Compare commits

3 Commits

Author SHA1 Message Date
34e6e50c61 Remove old broken run script 2024-07-14 17:42:39 +02:00
04949c4abd Make cargo check work in the top directory 2024-07-14 17:41:17 +02:00
f31e20c7ce Add a README 2024-07-14 17:40:19 +02:00
7 changed files with 42 additions and 34 deletions

34
README.md Normal file
View File

@ -0,0 +1,34 @@
A DIY split keyboard.
## Directory
### `/lib`
A rust library, and the bulk of the keyboard firmware implementation.
Written using the Embassy framework.
### `/left` and `/right`
Rust binaries, one for each half of the split keyboard.
Most of the actual logic is implemented in `/lib`.
### `/schematic`
Kicad schematics of the keyboard PCBs.
### `/case`
3d-printable files of the keyboard case and related plastics.
### `/editor`
A graphical program for configuring the keyboard layout. Work in progress.
## Developing
Required tools:
- Rust, obviously.
- `probe-rs` for flashing the firmware. Follow instructions at https://probe.rs/
- [`flip-link`](https://github.com/knurling-rs/flip-link/)
- A debug probe of some kind, I recommend a [Pitaya-Link](https://github.com/makerdiary/pitaya-link)
To flash:
- plug in the probe,
- `cd` into either `left` or `right`
- `cargo run`

View File

@ -1,3 +0,0 @@
# tgnt
Keyboard configuration library and editor.

View File

@ -9,7 +9,7 @@ edition = "2021"
path = "../lib" path = "../lib"
package = "tangentbord1-lib" package = "tangentbord1-lib"
[dependencies] [target.thumbv6m-none-eabi.dependencies]
cortex-m-rt = "0.7" cortex-m-rt = "0.7"
embassy-rp = { version = "0.1.0", features = ["time-driver", "critical-section-impl"] } embassy-rp = { version = "0.1.0", features = ["time-driver", "critical-section-impl"] }
embassy-executor = { version = "0.5.0", features = ["nightly", "executor-thread", "integrated-timers", "arch-cortex-m"] } embassy-executor = { version = "0.5.0", features = ["nightly", "executor-thread", "integrated-timers", "arch-cortex-m"] }

View File

@ -1,9 +1,10 @@
//! Firmware for Tangentbord1, left half. //! Firmware for Tangentbord1, left half.
#![no_std] // NOTE: the order of attributes matters here..
#![no_main] #![no_main]
#![cfg(target_os = "none")] // only try to compile this for embedded
#![no_std]
#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)]
#![cfg(target_arch = "arm")]
extern crate alloc; extern crate alloc;
extern crate cortex_m_rt; extern crate cortex_m_rt;

View File

@ -9,7 +9,7 @@ edition = "2021"
path = "../lib" path = "../lib"
package = "tangentbord1-lib" package = "tangentbord1-lib"
[dependencies] [target.thumbv6m-none-eabi.dependencies]
cortex-m-rt = "0.7" cortex-m-rt = "0.7"
embassy-rp = { version = "0.1.0", features = ["time-driver", "critical-section-impl"] } embassy-rp = { version = "0.1.0", features = ["time-driver", "critical-section-impl"] }
embassy-executor = { version = "0.5.0", features = ["nightly", "executor-thread", "integrated-timers", "arch-cortex-m"] } embassy-executor = { version = "0.5.0", features = ["nightly", "executor-thread", "integrated-timers", "arch-cortex-m"] }

View File

@ -1,7 +1,9 @@
//! Firmware for Tangentbord1, right half. //! Firmware for Tangentbord1, right half.
#![no_std] // NOTE: the order of attributes matters here..
#![no_main] #![no_main]
#![cfg(target_os = "none")] // only try to compile this for embedded
#![no_std]
#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)]
extern crate alloc; extern crate alloc;

26
run
View File

@ -1,26 +0,0 @@
#!/usr/bin/env nu
# Build, flash, and run the firmware.
#
# Will also attach to serial logs
def main [
bin: string # Which firmware to run, 'left' or 'right'.
--serial (-s): string # The serial device to get logs from.
--probe (-p): bool # Flash & run using probe-run instead of elf2uf2
] {
if $probe == true {
cargo build --bin $bin
probe-run --chip RP2040 --speed 4000 ("./target/thumbv6m-none-eabi/debug/" + $bin)
} else {
cargo run --bin $bin
}
let log_script = ($env.FILE_PWD | path join "serial-logs")
if $serial == null {
nu $log_script
} else {
nu $log_script --serial $serial
}
}