Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Zinc at Rust London '14
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Vladimir Pouzanov
August 14, 2014
Technology
130
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Zinc at Rust London '14
Vladimir Pouzanov
August 14, 2014
More Decks by Vladimir Pouzanov
See All by Vladimir Pouzanov
Pixels Everywhere!
farcaller
0
170
Prepare to Dock
farcaller
1
280
REPL Done Right
farcaller
1
330
iOS in Motion
farcaller
1
150
Reversing WTF
farcaller
2
130
iOS TDD
farcaller
1
190
Clang 3.0 Memory Management
farcaller
1
130
Effective Multithreading in iOS
farcaller
1
140
GameKit and Social APIs
farcaller
1
95
Other Decks in Technology
See All in Technology
[AWS Summit Japan 2026]迷っているあなたへ_小さな一歩が、やがて自分を助けてくれる
sh_fk2
2
420
水を運ぶ人としてのリーダーシップ
izumii19
4
1k
クレデンシャル流出 ― 攻撃 3 時間 vs 復旧 10 時間。この非対称性にどう備えるか
kazzpapa3
3
570
iOS アプリの「これって不具合ですか?」を AI に調べてもらう
miichan
0
140
時期が悪い!それでもRaspberry Piを買って遊んで活用するには / 20260627-osc26do-rpi-jikigawarui
akkiesoft
0
830
AI Agentをシステムに組み込む前にゆるく向き合ってみる
hayama17
0
150
PostgreSQL 19 新機能概要 OSC Hokkaido 2026
nori_shinoda
0
250
徹底討論!ECS vs EKS!
daitak
3
1.7k
コミットの「なぜ」を読む
ota1022
0
120
フルAIで個人開発して学んだあれこれ / yuruai vol.1
isaoshimizu
0
130
AIチャットの改善から見えた、良いAI体験とは / What Constitutes a Good AI Experience: Insights from Improving AI Chat
kubode
0
120
Oracle Cloud Infrastructure:2026年6月度サービス・アップデート
oracle4engineer
PRO
0
330
Featured
See All Featured
Building Adaptive Systems
keathley
44
3.1k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
[SF Ruby Conf 2025] Rails X
palkan
2
1.1k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
400
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
450
Believing is Seeing
oripsolob
1
150
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
860
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
480
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
170
Transcript
Zn 30 65.38 Vladimir Pouzanov <
[email protected]
>
rust
embedded
None
None
zinc
why rust?
fun
embedded
it's C and C++ all the way down
useful features
safe
expressive
still not 1.0
metaprogramming
a typical embedded program
think arduino "hello world" in rust
pub unsafe fn main() { init_stack();
init_data(); system_clock::init_clock(&Clock { source: system_clock::Main(12000000), pll: Some(PLL0 { m: 50, n: 3, divisor: 4 }) }); let timer = Timer::new(Timer1, 25, 4); let led1 = Pin::new(Port1, 18, GPIO, Some(Out)); let led2 = Pin::new(Port1, 20, GPIO, Some(Out)); loop { run(&pt::run_args { led1: &led1, led2: &led2, timer: &timer }); } }
pub unsafe fn main() { init_stack();
init_data(); system_clock::init_clock(&Clock { source: system_clock::Main(12000000), pll: Some(PLL0 { m: 50, n: 3, divisor: 4 }) }); let timer = Timer::new(Timer1, 25, 4); let led1 = Pin::new(Port1, 18, GPIO, Some(Out)); let led2 = Pin::new(Port1, 20, GPIO, Some(Out)); loop { run(&pt::run_args { led1: &led1, led2: &led2, timer: &timer }); } }
pub unsafe fn main() { init_stack();
init_data(); system_clock::init_clock(&Clock { source: system_clock::Main(12000000), pll: Some(PLL0 { m: 50, n: 3, divisor: 4 }) }); let timer = Timer::new(Timer1, 25, 4); let led1 = Pin::new(Port1, 18, GPIO, Some(Out)); let led2 = Pin::new(Port1, 20, GPIO, Some(Out)); loop { run(&pt::run_args { led1: &led1, led2: &led2, timer: &timer }); } }
pub unsafe fn main() { init_stack();
init_data(); system_clock::init_clock(&Clock { source: system_clock::Main(12000000), pll: Some(PLL0 { m: 50, n: 3, divisor: 4 }) }); let timer = Timer::new(Timer1, 25, 4); let led1 = Pin::new(Port1, 18, GPIO, Some(Out)); let led2 = Pin::new(Port1, 20, GPIO, Some(Out)); loop { run(&pt::run_args { led1: &led1, led2: &led2, timer: &timer }); } }
pub unsafe fn main() { init_stack();
init_data(); system_clock::init_clock(&Clock { source: system_clock::Main(12000000), pll: Some(PLL0 { m: 50, n: 3, divisor: 4 }) }); let timer = Timer::new(Timer1, 25, 4); let led1 = Pin::new(Port1, 18, GPIO, Some(Out)); let led2 = Pin::new(Port1, 20, GPIO, Some(Out)); loop { run(&pt::run_args { led1: &led1, led2: &led2, timer: &timer }); } }
pub unsafe fn main() { init_stack();
init_data(); system_clock::init_clock(&Clock { source: system_clock::Main(12000000), pll: Some(PLL0 { m: 50, n: 3, divisor: 4 }) }); let timer = Timer::new(Timer1, 25, 4); let led1 = Pin::new(Port1, 18, GPIO, Some(Out)); let led2 = Pin::new(Port1, 20, GPIO, Some(Out)); loop { run(&pt::run_args { led1: &led1, led2: &led2, timer: &timer }); } }
pub unsafe fn main() { init_stack();
init_data(); system_clock::init_clock(&Clock { source: system_clock::Main(12000000), pll: Some(PLL0 { m: 50, n: 3, divisor: 4 }) }); let timer = Timer::new(Timer1, 25, 4); let led1 = Pin::new(Port1, 18, GPIO, Some(Out)); let led2 = Pin::new(Port1, 20, GPIO, Some(Out)); loop { run(&pt::run_args { led1: &led1, led2: &led2, timer: &timer }); } }
pub unsafe fn main() { init_stack();
init_data(); system_clock::init_clock(&Clock { source: system_clock::Main(12000000), pll: Some(PLL0 { m: 50, n: 3, divisor: 4 }) }); let timer = Timer::new(Timer1, 25, 4); let led1 = Pin::new(Port1, 18, GPIO, Some(Out)); let led2 = Pin::new(Port1, 20, GPIO, Some(Out)); loop { run(&pt::run_args { led1: &led1, led2: &led2, timer: &timer }); } }
fn run(args: &pt::run_args) { args.led1.set_high(); args.led2.set_low();
args.timer.wait(1); ! args.led1.set_low(); args.led2.set_high(); args.timer.wait(1); }
fn run(args: &pt::run_args) { args.led1.set_high(); args.led2.set_low();
args.timer.wait(1); ! args.led1.set_low(); args.led2.set_high(); args.timer.wait(1); } WHAT IF I SAY THIS IS THE ONLY CODE YOU NEED?
platform definition and verification in code
lpc17xx@mcu { clock {
source = "main-‐oscillator"; source_frequency = 12_000_000; pll { m = 50; n = 3; divisor = 4; } } ! timer { timer@1 { counter = 25; divisor = 4; } } ! gpio { 1 { led1@18 { direction = "out"; } led2@20 { direction = "out"; } } } } ! os { single_task { loop = "run"; args { timer = &timer; led1 = &led1; led2 = &led2; } } }
lpc17xx@mcu { clock {
source = "main-‐oscillator"; source_frequency = 12_000_000; pll { m = 50; n = 3; divisor = 4; } } ! timer { timer@1 { counter = 25; divisor = 4; } } ! gpio { 1 { led1@18 { direction = "out"; } led2@20 { direction = "out"; } } } } ! os { single_task { loop = "run"; args { timer = &timer; led1 = &led1; led2 = &led2; } } }
lpc17xx@mcu { clock {
source = "main-‐oscillator"; source_frequency = 12_000_000; pll { m = 50; n = 3; divisor = 4; } } ! timer { timer@1 { counter = 25; divisor = 4; } } ! gpio { 1 { led1@18 { direction = "out"; } led2@20 { direction = "out"; } } } } ! os { single_task { loop = "run"; args { timer = &timer; led1 = &led1; led2 = &led2; } } }
lpc17xx@mcu { clock {
source = "main-‐oscillator"; source_frequency = 12_000_000; pll { m = 50; n = 3; divisor = 4; } } ! timer { timer@1 { counter = 25; divisor = 4; } } ! gpio { 1 { led1@18 { direction = "out"; } led2@20 { direction = "out"; } } } } ! os { single_task { loop = "run"; args { timer = &timer; led1 = &led1; led2 = &led2; } } }
lpc17xx@mcu { clock {
source = "main-‐oscillator"; source_frequency = 12_000_000; pll { m = 50; n = 3; divisor = 4; } } ! timer { timer@1 { counter = 25; divisor = 4; } } ! gpio { 1 { led1@18 { direction = "out"; } led2@20 { direction = "out"; } } } } ! os { single_task { loop = "run"; args { timer = &timer; led1 = &led1; led2 = &led2; } } }
lpc17xx@mcu { clock {
source = "main-‐oscillator"; source_frequency = 12_000_000; pll { m = 50; n = 3; divisor = 4; } } ! timer { timer@1 { counter = 25; divisor = 4; } } ! gpio { 1 { led1@18 { direction = "out"; } led2@20 { direction = "out"; } } } } ! os { single_task { loop = "run"; args { timer = &timer; led1 = &led1; led2 = &led2; } } }
compile-time validation
example: configure SPI pin
None
Pin::new(Port1, 11, Function3, Some(Out)); X
spi_ck@11 { function = "sck"; }
spi_ck@11 { function = "sck"; }
hiding complexity from user
single_task { loop = "run";
args { timer = &timer; uart = &uart; dht = &dht; } } } ! pub struct run_args<'a, P, Q> { pub dht: &'a zinc::drivers::dht22::DHT22<'a, P, Q>, pub timer: &'a zinc::hal::lpc17xx::timer::Timer, pub uart: &'a zinc::hal::lpc17xx::uart::UART, }
#[zinc_task] fn run(args: &pt::run_args) {
... }
#[zinc_task] fn run(args: &pt::run_args) {
... }
fn run<P: zinc::hal::timer::Timer,
Q: zinc::hal::pin::GPIO>(args: &pt::run_args<P, Q>) { ... }
thanks! questions? http://vfp.in/zinc-london