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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
プロダクト開発組織の現在地(Ver.2026/07) / product-organization
kaonavi
0
120
AI時代のPlaywright活用(システムテストを自動化する ー 実行エンジンにPla ywrightを選んだ理由)
ynisqa1988
1
700
ガバナンスの「ちょうどいい落とし所」を探れ!開発スピードを妨げない運用判断の勘所 / SRE NEXT 2026
genda
1
260
ヘルスケア領域における AI 活用と その安全性担保のための取り組み (Leveraging AI in Healthcare and Our Efforts to Ensure Its Safety) - Google I/O Extended Tokyo 2026, July 11, 2026
zettaittenani
0
430
企業でAWS Organizationsを動かすための組織設計の考え方
nrinetcom
PRO
1
110
AIと共生する開発者プラットフォーム:バクラクのモノレポ×マイクロサービス基盤
sakajunquality
2
4k
ruby.wasmとPicoRuby.wasmに対応した仮想DOMライブラリを作ってる話 #kaigieffect_kaigi
sue445
PRO
0
160
Devsumi 2026 Summer 人もAIも使える共通基盤を事業の加速装置にする~デザインシステム運用に学ぶ組織レバレッジ~ 渡辺 凌央
legalontechnologies
PRO
1
250
CDKで書くECSのベストプラクティス、 改めて考え直す2026 #cdkconf2026
makies
3
860
非定型なドキュメントを効率よくリファクタする 〜えぇ!?仕様書27本の移行が1日で終わったって!?〜
subroh0508
2
570
AI Native なプロダクト組織の立ち上げ方 : 生産性 100 倍への挑戦
mikesorae
0
250
第67回コンピュータビジョン勉強会CVPR2026読会前編
tsukamotokenji
0
160
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
50
15k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
590
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
350
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Discover your Explorer Soul
emna__ayadi
2
1.2k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
240
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.2k
Scaling GitHub
holman
464
140k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.7k
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