Skip to content

Instantly share code, notes, and snippets.

View justacec's full-sized avatar

Justace Clutter justacec

  • Alexandria, VA, USA
View GitHub Profile
@justacec
justacec / Cargo.toml
Created August 27, 2023 12:21
Rust Embedded Mores Code Example
[package]
edition = "2021"
name = "rp2040-pong"
version = "0.1.0"
[dependencies]
cortex-m = "0.7"
cortex-m-rt = "0.7"
#rtic = { git = "https://github.com/rtic-rs/rtic", features = ["thumbv6-backend"]}
#rtic-monotonics = { git = "https://github.com/rtic-rs/rtic", features = ["rp2040"] }
.program morse
.wrap_target
; Ensure start at 0 state
set pins 0
start:
; Pull a 32-bit from the SM0 TX FIFO
pull
; Fill out the scratch buffers
// Initialize and start PIO
let (mut pio, sm0, sm1, _, _) = pac.PIO0.split(&mut pac.RESETS);
let program_sm0 = pio_proc::pio_file!("src/pio0.pio", select_program("morse"));
let installed_sm0 = pio.install(&program_sm0.program).unwrap();
info!("sm0 offset: {}", installed_sm0.offset());
let (mut sm_0, _, _) = pio::PIOBuilder::from_program(installed_sm0)
.set_pins(led_pin_id, 1)
.clock_divisor(50000.0)
.build(sm0);
end_a = "male"; // [none, male, female]
end_b = "male"; // [none, male, female]
length = 101.7;
rung_n = 11;
module __Customizer_Limit__ () {}
rung_width = 3.5;
rung_length = 36.24;
rung_thickness = 1.5;
use metal::*;
use winit::platform::macos::WindowExtMacOS;
use winit::{
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
};
use cocoa::{appkit::NSView, base::id as cocoa_id};
use objc::{rc::autoreleasepool, runtime::YES};
use std::{borrow::Borrow, mem};
use rand::prelude::*;
@justacec
justacec / Configuration.h
Last active February 13, 2021 21:57
Marlin Configuration 2.0 [bugfix-2.0.x branch hash 1d63fe on Jan 2 19:01:09] files for FFCP with a BLTouch (Includes some adjustment of the default tumble parameters)
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
pub mod tmc2209_uart {
use core::marker::PhantomData;
use stm32f4xx_hal::{
serial,
serial::{Tx, Rx}
};
pub struct TMC2209<UART, PINS>
#set WORKAREASIZE 0
#set CPUTAPID 0x0ba00477
#source [find interface/raspberrypi2-native.cfg]
source myraspberrypi2-native.cfg
transport select swd
adapter speed 100
This file has been truncated, but you can view the full file.
@justacec
justacec / Cargo.toml
Last active April 29, 2020 21:21
Use of the BBQueue Crate with the RTFM Framework
[package]
name = "stm32f407_play"
version = "0.1.0"
authors = ["Justace Clutter <justacec@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
panic-abort = "0.3"