Skip to content

Commit

Permalink
Library updates and scad case files
Browse files Browse the repository at this point in the history
  • Loading branch information
zarath committed Dec 20, 2023
1 parent 9b420e3 commit 0f55ecb
Show file tree
Hide file tree
Showing 9 changed files with 427 additions and 305 deletions.
13 changes: 13 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
runner = "probe-rs run --chip RP2040 --protocol swd"
# runner = "elf2uf2-rs -d"

[target.thumbv6m-none-eabi]
runner = "probe-rs run --chip RP2040 --protocol swd" # "elf2uf2-rs -d"
# rustflags = [
# "-C", "link-arg=--nmagic",
# "-C", "link-arg=-Tlink.x",
# "-C", "link-arg=-Tlink-rp.x",
# "-C", "link-arg=-Tdefmt.x",
# "-C", "linker=flip-link",
# "-C", "inline-threshold=5",
# "-C", "no-vectorize-loops",
# ]

[build]
target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+

Expand All @@ -10,3 +22,4 @@ DEFMT_LOG = "debug"

[unstable]
build-std = ["core"]

43 changes: 17 additions & 26 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "subtone"
version = "0.2.0"
version = "0.3.0"
license = "MIT"
resolver = "2"

Expand All @@ -13,40 +13,36 @@ defmt = "0.3"
defmt-rtt = "0.4"
panic-probe = { version = "0.3", features = ["print-defmt"] }

embassy-embedded-hal = { version = "0.1.0", features = ["defmt"] }
embassy-embedded-hal = { version ="0.1.0", features = ["defmt"] }

embassy-executor = { version = "0.2.0", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
embassy-futures = { version = "0.1.0" }
embassy-sync = { version = "0.2.0", features = ["defmt"] }
embassy-time = { version = "0.1.2", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime"] }
embassy-rp = { version = "0.1.0", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver", "critical-section-impl"] }
embassy-executor = { version = "0.4.0", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
embassy-futures = { version = "0.1.1", features = ["defmt"] }
embassy-sync = { version = "0.5.0", features = ["defmt"] }
embassy-time = { version = "0.2.0", features = ["defmt", "defmt-timestamp-uptime"] }
embassy-rp = { version = "0.1.0", features = ["defmt", "unstable-pac", "time-driver", "critical-section-impl"] }

ssd1306 = "0.8.0"
fixed = "1.23.1"
pio-proc = "0.2"
pio = "0.2.1"
static_cell = "1.2.0"
static_cell = "1.3.0"
embedded-graphics = "0.8.1"
display-interface = "0.4.1"

rp2040-boot2 = "0.3.0"

[build-dependencies]
embedded-graphics = "0.8.1"
tinybmp = "0.5.0"
pdm = {version = "0.1.0", git = "https://github.com/zarath/embedded-libs" }

[patch.crates-io]
embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy", rev = "5d5cd2371504915a531e669dce3558485a51a2e1" }
embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "5d5cd2371504915a531e669dce3558485a51a2e1" }
embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "5d5cd2371504915a531e669dce3558485a51a2e1" }
embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "5d5cd2371504915a531e669dce3558485a51a2e1" }
embassy-rp = { git = "https://github.com/embassy-rs/embassy", rev = "5d5cd2371504915a531e669dce3558485a51a2e1" }
embassy-futures = { git = "https://github.com/embassy-rs/embassy", rev = "5d5cd2371504915a531e669dce3558485a51a2e1" }
# embassy-embedded-hal = { version="*", path="../embassy/embassy-embedded-hal/" }
# embassy-sync = { path="../embassy/embassy-sync/" }
# embassy-executor = { path="../embassy/embassy-executor/" }
# embassy-time = { path="../embassy/embassy-time/" }
# embassy-rp = { path="../embassy/embassy-rp/" }
# embassy-futures = { path="../embassy/embassy-futures/" }

embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy", rev = "ca2e3759ad31f511c239d30132a28714b0e402db" }
embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "ca2e3759ad31f511c239d30132a28714b0e402db" }
embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "ca2e3759ad31f511c239d30132a28714b0e402db" }
embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "ca2e3759ad31f511c239d30132a28714b0e402db" }
embassy-rp = { git = "https://github.com/embassy-rs/embassy", rev = "ca2e3759ad31f511c239d30132a28714b0e402db" }
embassy-futures = { git = "https://github.com/embassy-rs/embassy", rev = "ca2e3759ad31f511c239d30132a28714b0e402db" }

# cargo build/run
[profile.dev]
Expand Down Expand Up @@ -100,8 +96,3 @@ debug-assertions = false
incremental = false
lto = 'fat'
opt-level = 's'

[features]
default = []
call-tone = []
rotate = []
220 changes: 220 additions & 0 deletions OpenSCAD/case.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
$fn = 30;
bolt_delta_x = 44.45;
bolt_delta_y = 27.94;
bolt_diameter = 7.0;
vented = false;

module usb_hole()
{
translate([ 0.0, 0.0, -1.0 ])
minkowski()
{
cube([ 11.0, 6.0, 4.0 ], center = true);
cylinder(h = 2.0, r = 0.5);
}
}

module case ()
{
difference()
{
union()
{
translate([ -0.0, 0.0, 13.0 ])
minkowski()
{
cube([ 52.0, 36.0, 26.0 ], center = true);
cylinder(h = 4.0, r = 2.0);
};
}
translate([ -26.5, -18.5, 2.0 ])
cube([ 53.0, 37.0, 30.0 ]);

translate([ -26.0, 0.0, 30.0 - 11.0 ])
rotate([ 90.0, 0.0, 90.0 ])
usb_hole();

translate([ bolt_delta_x / 2.0, bolt_delta_y / 2.0, -1 ])
cylinder($fn = 6, h = 4.0, d = 6.0);
translate([ -bolt_delta_x / 2.0, bolt_delta_y / 2.0, -1 ])
cylinder($fn = 6, h = 4.0, d = 6.0);
translate([ bolt_delta_x / 2.0, -bolt_delta_y / 2.0, -1 ])
cylinder($fn = 6, h = 4.0, d = 6.0);
translate([ -bolt_delta_x / 2.0, -bolt_delta_y / 2.0, -1 ])
cylinder($fn = 6, h = 4.0, d = 6.0);

translate([ 0.0, 0.0, -1.0 ])
cylinder(h = 4.0, d = 4.0);

if (vented)
{
for (x = [-15:5:15])
for (z = [6:5:21])
{
translate([ x, 30, z ])
rotate([ 90, 0, 0 ])
cylinder(r = 1.25, h = 60.0);
}
for (y = [-7.5:5:7.5])
for (z = [6:5:21])
{
translate([ 20, y, z ])
rotate([ 0, 90, 0 ])
cylinder(r = 1.25, h = 20.0);
}
for (y = [-7.5:5:7.5])
for (z = [6:5:11])
{
translate([ -30, y, z ])
rotate([ 0, 90, 0 ])
cylinder(r = 1.25, h = 20.0);
}
}
}
difference()
{
union()
{
translate([ bolt_delta_x / 2.0, bolt_delta_y / 2.0, 2.0 ])
cylinder(h = 19.5, d = bolt_diameter);
translate([ bolt_delta_x / 2.0, bolt_delta_y / 2.0, 2.0 ])
cylinder(h = 4.0, d1 = bolt_diameter + 4.0, d2 = bolt_diameter);
translate([ bolt_delta_x / 2.0 + 2.0, bolt_delta_y / 2.0, 2.0 + 8.75 ])
cube([ 7.0, 2.0, 19.5 ], center = true);
translate([ bolt_delta_x / 2.0, bolt_delta_y / 2.0 + 2.0, 2.0 + 8.75 ])
cube([ 2.0, 7.0, 19.5 ], center = true);

translate([ -bolt_delta_x / 2.0, bolt_delta_y / 2.0, 2.0 ])
cylinder(h = 19.5, d = bolt_diameter);
translate([ -bolt_delta_x / 2.0, bolt_delta_y / 2.0, 2.0 ])
cylinder(h = 4.0, d1 = bolt_diameter + 4.0, d2 = bolt_diameter);
translate([ -bolt_delta_x / 2.0 - 2.0, bolt_delta_y / 2.0, 2.0 + 8.75 ])
cube([ 7.0, 2.0, 19.5 ], center = true);
translate([ -bolt_delta_x / 2.0, bolt_delta_y / 2.0 + 2.0, 2.0 + 8.75 ])
cube([ 2.0, 7.0, 19.5 ], center = true);

translate([ bolt_delta_x / 2.0, -bolt_delta_y / 2.0, 2.0 ])
cylinder(h = 19.5, d = bolt_diameter);
translate([ bolt_delta_x / 2.0, -bolt_delta_y / 2.0, 2.0 ])
cylinder(h = 4.0, d1 = bolt_diameter + 4.0, d2 = bolt_diameter);
translate([ bolt_delta_x / 2.0 + 2.0, -bolt_delta_y / 2.0, 2.0 + 8.75 ])
cube([ 7.0, 2.0, 19.5 ], center = true);
translate([ bolt_delta_x / 2.0, -bolt_delta_y / 2.0 - 2.0, 2.0 + 8.75 ])
cube([ 2.0, 7.0, 19.5 ], center = true);

translate([ -bolt_delta_x / 2.0, -bolt_delta_y / 2.0, 2.0 ])
cylinder(h = 19.5, d = bolt_diameter);
translate([ -bolt_delta_x / 2.0, -bolt_delta_y / 2.0, 2.0 ])
cylinder(h = 4.0, d1 = bolt_diameter + 4.0, d2 = bolt_diameter);
translate([ -bolt_delta_x / 2.0 - 2.0, -bolt_delta_y / 2.0, 2.0 + 8.75 ])
cube([ 7.0, 2.0, 19.5 ], center = true);
translate([ -bolt_delta_x / 2.0, -bolt_delta_y / 2.0 - 2.0, 2.0 + 8.75 ])
cube([ 2.0, 7.0, 19.5 ], center = true);
};
translate([ bolt_delta_x / 2.0, bolt_delta_y / 2.0, 1.0 ])
cylinder(h = 23.0, d = 2.8);
translate([ -bolt_delta_x / 2.0, bolt_delta_y / 2.0, 1.0 ])
cylinder(h = 23.0, d = 2.8);
translate([ bolt_delta_x / 2.0, -bolt_delta_y / 2.0, 1.0 ])
cylinder(h = 23.0, d = 2.8);
translate([ -bolt_delta_x / 2.0, -bolt_delta_y / 2.0, 1.0 ])
cylinder(h = 23.0, d = 2.8);
}
}

module baseplate()
{
difference()
{
union()
{
translate([ -26.0, -18.0, 0 ])
minkowski()
{
cube([ 52.0, 36.0, 1.0 ]);
cylinder(h = 1.0, r = 2.0);
};
translate([ bolt_delta_x / 2.0, bolt_delta_y / 2.0, 0 ])
cylinder(h = 8.5, d1 = bolt_diameter + 1.0, d2 = bolt_diameter);
translate([ -bolt_delta_x / 2.0, bolt_delta_y / 2.0, 0 ])
cylinder(h = 8.5, d1 = bolt_diameter + 1.0, d2 = bolt_diameter);
translate([ bolt_delta_x / 2.0, -bolt_delta_y / 2.0, 0 ])
cylinder(h = 8.5, d1 = bolt_diameter + 1.0, d2 = bolt_diameter);
translate([ -bolt_delta_x / 2.0, -bolt_delta_y / 2.0, 0 ])
cylinder(h = 8.5, d1 = bolt_diameter + 1.0, d2 = bolt_diameter);
}
translate([ 26.0 - 8.8, 0, -1 ])
cylinder(h = 9.5, d = 8.2);
translate([ 26.0 - 50.0 + 8.2, -6.0, -1.0 ])
cube([ 25.0, 12.0, 4.0 ]);
translate([ bolt_delta_x / 2, bolt_delta_y / 2, -1 ])
cylinder(h = 11.5, d = 2.8);
translate([ -bolt_delta_x / 2, bolt_delta_y / 2, -1 ])
cylinder(h = 11.5, d = 2.8);
translate([ bolt_delta_x / 2, -bolt_delta_y / 2, -1 ])
cylinder(h = 11.5, d = 2.8);
translate([ -bolt_delta_x / 2, -bolt_delta_y / 2, -1 ])
cylinder(h = 11.5, d = 2.8);
translate([ bolt_delta_x / 2, bolt_delta_y / 2, -1 ])
cylinder(h = 3.0, d = 5.0);
translate([ -bolt_delta_x / 2, bolt_delta_y / 2, -1 ])
cylinder(h = 3.0, d = 5.0);
translate([ bolt_delta_x / 2, -bolt_delta_y / 2, -1 ])
cylinder(h = 3.0, d = 5.0);
translate([ -bolt_delta_x / 2, -bolt_delta_y / 2, -1 ])
cylinder(h = 3.0, d = 5.0);
}
}

module pipe(h, do, di)
{
difference()
{
cylinder(h = h, d = do);
translate([ 0.0, 0.0, -1.0 ])
cylinder(h = h + 2.0, d = di);
}
}

module knob()
{
difference()
{
union()
{
difference()
{
minkowski()
{
cylinder(h = 8.0, d1 = 9.0, d2 = 8.0);
sphere(r = 2.0);
};
translate([ 0.0, 0.0, -1.0 ])
cylinder(h = 9.0, d = 6);
translate([ 0.0, 0.0, -2.5 ])
cube([ 20.0, 20.0, 5.0 ], center = true);
}
translate([ -4.0, 1.5, 0.0 ])
cube([ 8.0, 2.0, 8.0 ]);
translate([ 0.0, 0.0, -2.0 ]) pipe(2.0, 13.0, 9.0);
}
translate([ 0.0, 0.0, -1.0 ])
pipe(h = 9.0, do = 9.0, di = 7.3);
translate([ -2.95, 2.1, 0.0 ])
cube([ 5.9, 1.3, 8.0 ]);
translate([ -1.5, 2.5, 0.0 ])
cube([ 3, 1.4, 8.0 ]);
translate([ -0.8, 1.4, 0.0 ])
cube([ 1.6, 2.0, 8.0 ]);

for (a = [0.0:40.0:360.0])
{
translate([ 6.5 * sin(a), 6.5 * cos(a), -1.0 ])
cylinder(h = 12.0, d1 = 2.4, d2 = 2.0);
}
}
}
// baseplate();
// case ();
knob();
// pipe(h=20, do=20, di=16);
Binary file added OpenSCAD/case.stl
Binary file not shown.
Loading

0 comments on commit 0f55ecb

Please sign in to comment.