summaryrefslogtreecommitdiffstats
path: root/group__buttons.html
diff options
context:
space:
mode:
authorjoeycastillo <joeycastillo@users.noreply.github.com>2021-12-14 17:06:59 +0000
committerjoeycastillo <joeycastillo@users.noreply.github.com>2021-12-14 17:06:59 +0000
commit46c14a44e8e889bbdd317895492b70b179070441 (patch)
treeaa5b27da7d69f720f321f85ec974ef6c7474a41a /group__buttons.html
downloadSensor-Watch-46c14a44e8e889bbdd317895492b70b179070441.tar.gz
Sensor-Watch-46c14a44e8e889bbdd317895492b70b179070441.tar.bz2
Sensor-Watch-46c14a44e8e889bbdd317895492b70b179070441.zip
deploy: e8e9a0e2d86d37fa0354b3475c907eae1bf5a6dd
Diffstat (limited to 'group__buttons.html')
-rw-r--r--group__buttons.html178
1 files changed, 178 insertions, 0 deletions
diff --git a/group__buttons.html b/group__buttons.html
new file mode 100644
index 00000000..0a9633fb
--- /dev/null
+++ b/group__buttons.html
@@ -0,0 +1,178 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.9.1"/>
+<meta name="viewport" content="width=device-width, initial-scale=1"/>
+<title>Sensor Watch: Buttons &amp; External Interrupts</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="search/search.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="search/searchdata.js"></script>
+<script type="text/javascript" src="search/search.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname">Sensor Watch
+ &#160;<span id="projectnumber">0.0.0</span>
+ </div>
+ <div id="projectbrief">A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.9.1 -->
+<script type="text/javascript">
+/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
+var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
+/* @license-end */
+</script>
+<script type="text/javascript" src="menudata.js"></script>
+<script type="text/javascript" src="menu.js"></script>
+<script type="text/javascript">
+/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
+$(function() {
+ initMenu('',true,false,'search.php','Search');
+ $(document).ready(function() { init_search(); });
+});
+/* @license-end */</script>
+<div id="main-nav"></div>
+</div><!-- top -->
+<!-- window showing the filter options -->
+<div id="MSearchSelectWindow"
+ onmouseover="return searchBox.OnSearchSelectShow()"
+ onmouseout="return searchBox.OnSearchSelectHide()"
+ onkeydown="return searchBox.OnSearchSelectKey(event)">
+</div>
+
+<!-- iframe showing the search results (closed by default) -->
+<div id="MSearchResultsWindow">
+<iframe src="javascript:void(0)" frameborder="0"
+ name="MSearchResults" id="MSearchResults">
+</iframe>
+</div>
+
+<div class="header">
+ <div class="summary">
+<a href="#typedef-members">Typedefs</a> &#124;
+<a href="#enum-members">Enumerations</a> &#124;
+<a href="#func-members">Functions</a> &#124;
+<a href="#var-members">Variables</a> </div>
+ <div class="headertitle">
+<div class="title">Buttons &amp; External Interrupts</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>This section covers functions related to the three buttons: Light, Mode and Alarm, as well as external interrupts from devices on the nine-pin connector.
+<a href="#details">More...</a></p>
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
+Typedefs</h2></td></tr>
+<tr class="memitem:gadee2b304ce34a8aec5aedabd75934c1b"><td class="memItemLeft" align="right" valign="top"><a id="gadee2b304ce34a8aec5aedabd75934c1b"></a>
+typedef enum <a class="el" href="group__buttons.html#ga0454ca577b6fcc7a7cb03039cb5150d8">watch_interrupt_trigger</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__buttons.html#gadee2b304ce34a8aec5aedabd75934c1b">watch_interrupt_trigger</a></td></tr>
+<tr class="memdesc:gadee2b304ce34a8aec5aedabd75934c1b"><td class="mdescLeft">&#160;</td><td class="mdescRight">An enum defining the types of interrupt trigger you wish to scan for. <br /></td></tr>
+<tr class="separator:gadee2b304ce34a8aec5aedabd75934c1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
+Enumerations</h2></td></tr>
+<tr class="memitem:ga0454ca577b6fcc7a7cb03039cb5150d8"><td class="memItemLeft" align="right" valign="top"><a id="ga0454ca577b6fcc7a7cb03039cb5150d8"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__buttons.html#ga0454ca577b6fcc7a7cb03039cb5150d8">watch_interrupt_trigger</a> { <b>INTERRUPT_TRIGGER_NONE</b> = 0
+, <b>INTERRUPT_TRIGGER_RISING</b>
+, <b>INTERRUPT_TRIGGER_FALLING</b>
+, <b>INTERRUPT_TRIGGER_BOTH</b>
+ }</td></tr>
+<tr class="memdesc:ga0454ca577b6fcc7a7cb03039cb5150d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">An enum defining the types of interrupt trigger you wish to scan for. <br /></td></tr>
+<tr class="separator:ga0454ca577b6fcc7a7cb03039cb5150d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga9bcddd56ef2065183697b471a5fff6d2"><td class="memItemLeft" align="right" valign="top"><a id="ga9bcddd56ef2065183697b471a5fff6d2"></a>
+void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__buttons.html#ga9bcddd56ef2065183697b471a5fff6d2">watch_enable_external_interrupts</a> (void)</td></tr>
+<tr class="memdesc:ga9bcddd56ef2065183697b471a5fff6d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the external interrupt controller. <br /></td></tr>
+<tr class="separator:ga9bcddd56ef2065183697b471a5fff6d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga14c8fd8d92e4535012fb939ca8f12084"><td class="memItemLeft" align="right" valign="top"><a id="ga14c8fd8d92e4535012fb939ca8f12084"></a>
+void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__buttons.html#ga14c8fd8d92e4535012fb939ca8f12084">watch_disable_external_interrupts</a> (void)</td></tr>
+<tr class="memdesc:ga14c8fd8d92e4535012fb939ca8f12084"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the external interrupt controller. <br /></td></tr>
+<tr class="separator:ga14c8fd8d92e4535012fb939ca8f12084"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gae40d2f73d0412680d83c26b8a0e1d31c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__buttons.html#gae40d2f73d0412680d83c26b8a0e1d31c">watch_register_interrupt_callback</a> (const uint8_t pin, ext_irq_cb_t callback, <a class="el" href="group__buttons.html#ga0454ca577b6fcc7a7cb03039cb5150d8">watch_interrupt_trigger</a> trigger)</td></tr>
+<tr class="memdesc:gae40d2f73d0412680d83c26b8a0e1d31c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configures an external interrupt callback on one of the external interrupt pins. <a href="group__buttons.html#gae40d2f73d0412680d83c26b8a0e1d31c">More...</a><br /></td></tr>
+<tr class="separator:gae40d2f73d0412680d83c26b8a0e1d31c"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gabb98ef2a5bedc045ad2151302719bfea"><td class="memItemLeft" align="right" valign="top"><a id="gabb98ef2a5bedc045ad2151302719bfea"></a>
+&#160;</td><td class="memItemRight" valign="bottom"><b>__attribute__</b> ((deprecated(&quot;Use <a class="el" href="group__buttons.html#gae40d2f73d0412680d83c26b8a0e1d31c">watch_register_interrupt_callback</a> or <a class="el" href="group__deepsleep.html#gacad726423f5f38697c87474ab25244ca">watch_register_extwake_callback</a> instead&quot;))) void watch_register_button_callback(const uint8_t pin</td></tr>
+<tr class="separator:gabb98ef2a5bedc045ad2151302719bfea"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga3d4f747fa7699e83a72ec8d6b8d8f8fc"><td class="memItemLeft" align="right" valign="top"><a id="ga3d4f747fa7699e83a72ec8d6b8d8f8fc"></a>
+&#160;</td><td class="memItemRight" valign="bottom"><b>__attribute__</b> ((deprecated(&quot;Use <a class="el" href="group__buttons.html#ga9bcddd56ef2065183697b471a5fff6d2">watch_enable_external_interrupts</a> instead&quot;))) void watch_enable_buttons(void)</td></tr>
+<tr class="separator:ga3d4f747fa7699e83a72ec8d6b8d8f8fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
+Variables</h2></td></tr>
+<tr class="memitem:ga9d5607684bd75c0f8b06d31fee6bb08c"><td class="memItemLeft" align="right" valign="top"><a id="ga9d5607684bd75c0f8b06d31fee6bb08c"></a>
+ext_irq_cb_t&#160;</td><td class="memItemRight" valign="bottom"><b>callback</b></td></tr>
+<tr class="separator:ga9d5607684bd75c0f8b06d31fee6bb08c"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>This section covers functions related to the three buttons: Light, Mode and Alarm, as well as external interrupts from devices on the nine-pin connector. </p>
+<p>The buttons are the core input UI of the watch, and the way the user will interact with your application. They are active high, pulled down by the microcontroller, and triggered when one of the "pushers" brings a tab from the metal frame into contact with the edge of the board. Note that the buttons can only wake the watch from STANDBY mode, at least as of the current SAM L22 silicon revision. The external interrupt controller runs in STANDBY mode, but it does not run in BACKUP mode; to wake from BACKUP, buttons will not cut it. </p>
+<h2 class="groupheader">Function Documentation</h2>
+<a id="gae40d2f73d0412680d83c26b8a0e1d31c"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#gae40d2f73d0412680d83c26b8a0e1d31c">&#9670;&nbsp;</a></span>watch_register_interrupt_callback()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void watch_register_interrupt_callback </td>
+ <td>(</td>
+ <td class="paramtype">const uint8_t&#160;</td>
+ <td class="paramname"><em>pin</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">ext_irq_cb_t&#160;</td>
+ <td class="paramname"><em>callback</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="group__buttons.html#ga0454ca577b6fcc7a7cb03039cb5150d8">watch_interrupt_trigger</a>&#160;</td>
+ <td class="paramname"><em>trigger</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Configures an external interrupt callback on one of the external interrupt pins. </p>
+<p>You can set one interrupt callback per pin, and you can monitor for a rising condition, a falling condition, or both. If you just want to detect a button press, register your interrupt with INTERRUPT_TRIGGER_RISING; if you want to detect an active-low interrupt signal from a device on the nine-pin connector, use INTERRUPT_TRIGGER_FALLING. If you want to detect both rising and falling conditions (i.e. button down and button up), use INTERRUPT_TRIGGER_BOTH and use watch_get_pin_level to check the pin level in your callback to determine which condition caused the interrupt. </p><dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramname">pin</td><td>One of BTN_LIGHT, BTN_MODE, BTN_ALARM, A0, A1, A3 or A4. If the pin parameter matches one of the three button pins, this function will also enable an internal pull-down resistor. If the pin parameter is A0-A4, you are responsible for setting any required pull configuration using watch_enable_pull_up or watch_enable_pull_down. </td></tr>
+ <tr><td class="paramname">callback</td><td>The function you wish to have called when the button is pressed. </td></tr>
+ <tr><td class="paramname">trigger</td><td>The condition on which you wish to trigger: rising, falling or both. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section note"><dt>Note</dt><dd>Pins A2 and A4 can also generate interrupts via the watch_register_extwake_callback function, which will allow them to trigger even when the watch is in deep sleep mode. </dd></dl>
+<dl class="section warning"><dt>Warning</dt><dd>As of now, A2 is not usable via the watch_register_interrupt_callback function. To enable an external interrupt on pin A2, use the watch_register_extwake_callback function. This issue will be addressed in a future revision of the watch library. </dd></dl>
+
+</div>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
+</small></address>
+</body>
+</html>