mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-12-25 11:29:33 +01:00
47 lines
No EOL
14 KiB
HTML
47 lines
No EOL
14 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Controls time and alarms time is a 64 bit value indicating the time in usec since power-on timeh is the top 32 bits of time & timel is the bottom 32 bits to change time write to timelw before timehw to read time read from timelr before timehr An alarm is set by setting alarm_enable and writing to the corresponding alarm register When an alarm is pending, the corresponding alarm_running signal will be high An alarm can be cancelled before it has finished by clearing the alarm_enable When an alarm fires, the corresponding alarm_irq is set and alarm_running is cleared To clear the interrupt write a 1 to the corresponding alarm_irq"><title>rp2040_pac::timer - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-b0742ba02757f159.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="rp2040_pac" data-themes="" data-resource-suffix="" data-rustdoc-version="1.83.0 (90b35a623 2024-11-26)" data-channel="1.83.0" data-search-js="search-f0d225181b97f9a4.js" data-settings-js="settings-805db61a62df4bd2.js" ><script src="../../static.files/storage-1d39b6787ed640ff.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-f070b9041d14864c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-0111fcff984fae8f.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../rp2040_pac/index.html">rp2040_<wbr>pac</a><span class="version">0.6.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module timer</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate rp2040_<wbr>pac</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">rp2040_pac</a></span><h1>Module <span>timer</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/rp2040_pac/timer.rs.html#1-315">source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Controls time and alarms<br />
|
|
time is a 64 bit value indicating the time in usec since power-on<br />
|
|
timeh is the top 32 bits of time & timel is the bottom 32 bits<br />
|
|
to change time write to timelw before timehw<br />
|
|
to read time read from timelr before timehr<br />
|
|
An alarm is set by setting alarm_enable and writing to the corresponding alarm register<br />
|
|
When an alarm is pending, the corresponding alarm_running signal will be high<br />
|
|
An alarm can be cancelled before it has finished by clearing the alarm_enable<br />
|
|
When an alarm fires, the corresponding alarm_irq is set and alarm_running is cleared<br />
|
|
To clear the interrupt write a 1 to the corresponding alarm_irq</p>
|
|
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="alarm0/index.html" title="mod rp2040_pac::timer::alarm0">alarm0</a></div><div class="desc docblock-short">Arm alarm 0, and configure the time it will fire.<br />
|
|
Once armed, the alarm fires when TIMER_ALARM0 == TIMELR.<br />
|
|
The alarm will disarm itself once it fires, and can<br />
|
|
be disarmed early using the ARMED status register.</div></li><li><div class="item-name"><a class="mod" href="alarm1/index.html" title="mod rp2040_pac::timer::alarm1">alarm1</a></div><div class="desc docblock-short">Arm alarm 1, and configure the time it will fire.<br />
|
|
Once armed, the alarm fires when TIMER_ALARM1 == TIMELR.<br />
|
|
The alarm will disarm itself once it fires, and can<br />
|
|
be disarmed early using the ARMED status register.</div></li><li><div class="item-name"><a class="mod" href="alarm2/index.html" title="mod rp2040_pac::timer::alarm2">alarm2</a></div><div class="desc docblock-short">Arm alarm 2, and configure the time it will fire.<br />
|
|
Once armed, the alarm fires when TIMER_ALARM2 == TIMELR.<br />
|
|
The alarm will disarm itself once it fires, and can<br />
|
|
be disarmed early using the ARMED status register.</div></li><li><div class="item-name"><a class="mod" href="alarm3/index.html" title="mod rp2040_pac::timer::alarm3">alarm3</a></div><div class="desc docblock-short">Arm alarm 3, and configure the time it will fire.<br />
|
|
Once armed, the alarm fires when TIMER_ALARM3 == TIMELR.<br />
|
|
The alarm will disarm itself once it fires, and can<br />
|
|
be disarmed early using the ARMED status register.</div></li><li><div class="item-name"><a class="mod" href="armed/index.html" title="mod rp2040_pac::timer::armed">armed</a></div><div class="desc docblock-short">Indicates the armed/disarmed status of each alarm.<br />
|
|
A write to the corresponding ALARMx register arms the alarm.<br />
|
|
Alarms automatically disarm upon firing, but writing ones here<br />
|
|
will disarm immediately without waiting to fire.</div></li><li><div class="item-name"><a class="mod" href="dbgpause/index.html" title="mod rp2040_pac::timer::dbgpause">dbgpause</a></div><div class="desc docblock-short">Set bits high to enable pause when the corresponding debug ports are active</div></li><li><div class="item-name"><a class="mod" href="inte/index.html" title="mod rp2040_pac::timer::inte">inte</a></div><div class="desc docblock-short">Interrupt Enable</div></li><li><div class="item-name"><a class="mod" href="intf/index.html" title="mod rp2040_pac::timer::intf">intf</a></div><div class="desc docblock-short">Interrupt Force</div></li><li><div class="item-name"><a class="mod" href="intr/index.html" title="mod rp2040_pac::timer::intr">intr</a></div><div class="desc docblock-short">Raw Interrupts</div></li><li><div class="item-name"><a class="mod" href="ints/index.html" title="mod rp2040_pac::timer::ints">ints</a></div><div class="desc docblock-short">Interrupt status after masking & forcing</div></li><li><div class="item-name"><a class="mod" href="pause/index.html" title="mod rp2040_pac::timer::pause">pause</a></div><div class="desc docblock-short">Set high to pause the timer</div></li><li><div class="item-name"><a class="mod" href="timehr/index.html" title="mod rp2040_pac::timer::timehr">timehr</a></div><div class="desc docblock-short">Read from bits 63:32 of time<br />
|
|
always read timelr before timehr</div></li><li><div class="item-name"><a class="mod" href="timehw/index.html" title="mod rp2040_pac::timer::timehw">timehw</a></div><div class="desc docblock-short">Write to bits 63:32 of time<br />
|
|
always write timelw before timehw</div></li><li><div class="item-name"><a class="mod" href="timelr/index.html" title="mod rp2040_pac::timer::timelr">timelr</a></div><div class="desc docblock-short">Read from bits 31:0 of time</div></li><li><div class="item-name"><a class="mod" href="timelw/index.html" title="mod rp2040_pac::timer::timelw">timelw</a></div><div class="desc docblock-short">Write to bits 31:0 of time<br />
|
|
writes do not get copied to time until timehw is written</div></li><li><div class="item-name"><a class="mod" href="timerawh/index.html" title="mod rp2040_pac::timer::timerawh">timerawh</a></div><div class="desc docblock-short">Raw read from bits 63:32 of time (no side effects)</div></li><li><div class="item-name"><a class="mod" href="timerawl/index.html" title="mod rp2040_pac::timer::timerawl">timerawl</a></div><div class="desc docblock-short">Raw read from bits 31:0 of time (no side effects)</div></li></ul><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.RegisterBlock.html" title="struct rp2040_pac::timer::RegisterBlock">Register<wbr>Block</a></div><div class="desc docblock-short">Register block</div></li></ul><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="type" href="type.ALARM0.html" title="type rp2040_pac::timer::ALARM0">ALARM0</a></div><div class="desc docblock-short">ALARM0 (rw) register accessor: Arm alarm 0, and configure the time it will fire.<br />
|
|
Once armed, the alarm fires when TIMER_ALARM0 == TIMELR.<br />
|
|
The alarm will disarm itself once it fires, and can<br />
|
|
be disarmed early using the ARMED status register.</div></li><li><div class="item-name"><a class="type" href="type.ALARM1.html" title="type rp2040_pac::timer::ALARM1">ALARM1</a></div><div class="desc docblock-short">ALARM1 (rw) register accessor: Arm alarm 1, and configure the time it will fire.<br />
|
|
Once armed, the alarm fires when TIMER_ALARM1 == TIMELR.<br />
|
|
The alarm will disarm itself once it fires, and can<br />
|
|
be disarmed early using the ARMED status register.</div></li><li><div class="item-name"><a class="type" href="type.ALARM2.html" title="type rp2040_pac::timer::ALARM2">ALARM2</a></div><div class="desc docblock-short">ALARM2 (rw) register accessor: Arm alarm 2, and configure the time it will fire.<br />
|
|
Once armed, the alarm fires when TIMER_ALARM2 == TIMELR.<br />
|
|
The alarm will disarm itself once it fires, and can<br />
|
|
be disarmed early using the ARMED status register.</div></li><li><div class="item-name"><a class="type" href="type.ALARM3.html" title="type rp2040_pac::timer::ALARM3">ALARM3</a></div><div class="desc docblock-short">ALARM3 (rw) register accessor: Arm alarm 3, and configure the time it will fire.<br />
|
|
Once armed, the alarm fires when TIMER_ALARM3 == TIMELR.<br />
|
|
The alarm will disarm itself once it fires, and can<br />
|
|
be disarmed early using the ARMED status register.</div></li><li><div class="item-name"><a class="type" href="type.ARMED.html" title="type rp2040_pac::timer::ARMED">ARMED</a></div><div class="desc docblock-short">ARMED (rw) register accessor: Indicates the armed/disarmed status of each alarm.<br />
|
|
A write to the corresponding ALARMx register arms the alarm.<br />
|
|
Alarms automatically disarm upon firing, but writing ones here<br />
|
|
will disarm immediately without waiting to fire.</div></li><li><div class="item-name"><a class="type" href="type.DBGPAUSE.html" title="type rp2040_pac::timer::DBGPAUSE">DBGPAUSE</a></div><div class="desc docblock-short">DBGPAUSE (rw) register accessor: Set bits high to enable pause when the corresponding debug ports are active</div></li><li><div class="item-name"><a class="type" href="type.INTE.html" title="type rp2040_pac::timer::INTE">INTE</a></div><div class="desc docblock-short">INTE (rw) register accessor: Interrupt Enable</div></li><li><div class="item-name"><a class="type" href="type.INTF.html" title="type rp2040_pac::timer::INTF">INTF</a></div><div class="desc docblock-short">INTF (rw) register accessor: Interrupt Force</div></li><li><div class="item-name"><a class="type" href="type.INTR.html" title="type rp2040_pac::timer::INTR">INTR</a></div><div class="desc docblock-short">INTR (rw) register accessor: Raw Interrupts</div></li><li><div class="item-name"><a class="type" href="type.INTS.html" title="type rp2040_pac::timer::INTS">INTS</a></div><div class="desc docblock-short">INTS (r) register accessor: Interrupt status after masking & forcing</div></li><li><div class="item-name"><a class="type" href="type.PAUSE.html" title="type rp2040_pac::timer::PAUSE">PAUSE</a></div><div class="desc docblock-short">PAUSE (rw) register accessor: Set high to pause the timer</div></li><li><div class="item-name"><a class="type" href="type.TIMEHR.html" title="type rp2040_pac::timer::TIMEHR">TIMEHR</a></div><div class="desc docblock-short">TIMEHR (r) register accessor: Read from bits 63:32 of time<br />
|
|
always read timelr before timehr</div></li><li><div class="item-name"><a class="type" href="type.TIMEHW.html" title="type rp2040_pac::timer::TIMEHW">TIMEHW</a></div><div class="desc docblock-short">TIMEHW (w) register accessor: Write to bits 63:32 of time<br />
|
|
always write timelw before timehw</div></li><li><div class="item-name"><a class="type" href="type.TIMELR.html" title="type rp2040_pac::timer::TIMELR">TIMELR</a></div><div class="desc docblock-short">TIMELR (r) register accessor: Read from bits 31:0 of time</div></li><li><div class="item-name"><a class="type" href="type.TIMELW.html" title="type rp2040_pac::timer::TIMELW">TIMELW</a></div><div class="desc docblock-short">TIMELW (w) register accessor: Write to bits 31:0 of time<br />
|
|
writes do not get copied to time until timehw is written</div></li><li><div class="item-name"><a class="type" href="type.TIMERAWH.html" title="type rp2040_pac::timer::TIMERAWH">TIMERAWH</a></div><div class="desc docblock-short">TIMERAWH (r) register accessor: Raw read from bits 63:32 of time (no side effects)</div></li><li><div class="item-name"><a class="type" href="type.TIMERAWL.html" title="type rp2040_pac::timer::TIMERAWL">TIMERAWL</a></div><div class="desc docblock-short">TIMERAWL (r) register accessor: Raw read from bits 31:0 of time (no side effects)</div></li></ul></section></div></main></body></html> |