rtic/stable/api/rp2040_pac/timer/index.html
2024-10-24 05:57:30 +00:00

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 &#38; 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-492a78a4a87dcc01.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.82.0 (f6e511eec 2024-10-15)" data-channel="1.82.0" data-search-js="search-a99f1315e7cc5121.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-118b08c4c78b968e.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-921df33f47b8780c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-3b12f09e550e0385.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><h2 class="location"><a href="#">Module timer</a></h2><div class="sidebar-elems"><section><ul class="block"><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#types">Type Aliases</a></li></ul></section><h2><a href="../index.html">In crate rp2040_<wbr>pac</a></h2></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"><h1>Module <a href="../index.html">rp2040_pac</a>::<wbr><a class="mod" href="#">timer</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../../src/rp2040_pac/timer.rs.html#1-315">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></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 &amp; 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 &amp; 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 &amp; 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>