summaryrefslogtreecommitdiffstats
path: root/group__deepsleep.html
blob: e95bd01cd1e1b10bba2d0b1d5588954aa9dacdd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
<!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: Sleep Control</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="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Sleep Control</div>  </div>
</div><!--header-->
<div class="contents">

<p>This section covers functions related to the various sleep modes available to the watch, including Sleep, Deep Sleep, and BACKUP mode.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gacad726423f5f38697c87474ab25244ca"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__deepsleep.html#gacad726423f5f38697c87474ab25244ca">watch_register_extwake_callback</a> (uint8_t pin, ext_irq_cb_t callback, bool level)</td></tr>
<tr class="memdesc:gacad726423f5f38697c87474ab25244ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a callback on one of the RTC's external wake pins, which can wake the device from Sleep, Deep Sleep and BACKUP modes (but see warning re: BACKUP mode).  <a href="group__deepsleep.html#gacad726423f5f38697c87474ab25244ca">More...</a><br /></td></tr>
<tr class="separator:gacad726423f5f38697c87474ab25244ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaae4dfbad44338b179a7b2d8a286bacbe"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__deepsleep.html#gaae4dfbad44338b179a7b2d8a286bacbe">watch_disable_extwake_interrupt</a> (uint8_t pin)</td></tr>
<tr class="memdesc:gaae4dfbad44338b179a7b2d8a286bacbe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unregisters the RTC interrupt on one of the EXTWAKE pins. This will prevent a value change on one of these pins from waking the device.  <a href="group__deepsleep.html#gaae4dfbad44338b179a7b2d8a286bacbe">More...</a><br /></td></tr>
<tr class="separator:gaae4dfbad44338b179a7b2d8a286bacbe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga385b36922ec76c5fe697772f97a05846"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__deepsleep.html#ga385b36922ec76c5fe697772f97a05846">watch_store_backup_data</a> (uint32_t data, uint8_t reg)</td></tr>
<tr class="memdesc:ga385b36922ec76c5fe697772f97a05846"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stores data in one of the RTC's backup registers, which retain their data in BACKUP mode.  <a href="group__deepsleep.html#ga385b36922ec76c5fe697772f97a05846">More...</a><br /></td></tr>
<tr class="separator:ga385b36922ec76c5fe697772f97a05846"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2de1f1012475654c4741f60808581196"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__deepsleep.html#ga2de1f1012475654c4741f60808581196">watch_get_backup_data</a> (uint8_t reg)</td></tr>
<tr class="memdesc:ga2de1f1012475654c4741f60808581196"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets 32 bits of data from the RTC's BACKUP register.  <a href="group__deepsleep.html#ga2de1f1012475654c4741f60808581196">More...</a><br /></td></tr>
<tr class="separator:ga2de1f1012475654c4741f60808581196"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9f7a625290748f0df6ba2ceb27e0d81b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__deepsleep.html#ga9f7a625290748f0df6ba2ceb27e0d81b">watch_enter_sleep_mode</a> (void)</td></tr>
<tr class="memdesc:ga9f7a625290748f0df6ba2ceb27e0d81b"><td class="mdescLeft">&#160;</td><td class="mdescRight">enters Sleep Mode by disabling all pins and peripherals except the RTC and the LCD.  <a href="group__deepsleep.html#ga9f7a625290748f0df6ba2ceb27e0d81b">More...</a><br /></td></tr>
<tr class="separator:ga9f7a625290748f0df6ba2ceb27e0d81b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaea469761889ff203385f3bfd88bb2451"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__deepsleep.html#gaea469761889ff203385f3bfd88bb2451">watch_enter_deep_sleep_mode</a> (void)</td></tr>
<tr class="memdesc:gaea469761889ff203385f3bfd88bb2451"><td class="mdescLeft">&#160;</td><td class="mdescRight">enters Deep Sleep Mode by disabling all pins and peripherals except the RTC.  <a href="group__deepsleep.html#gaea469761889ff203385f3bfd88bb2451">More...</a><br /></td></tr>
<tr class="separator:gaea469761889ff203385f3bfd88bb2451"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga50dda38a8a83d7d957e3bb2bf13aa3ef"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__deepsleep.html#ga50dda38a8a83d7d957e3bb2bf13aa3ef">watch_enter_backup_mode</a> (void)</td></tr>
<tr class="memdesc:ga50dda38a8a83d7d957e3bb2bf13aa3ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enters the SAM L22's lowest-power mode, BACKUP.  <a href="group__deepsleep.html#ga50dda38a8a83d7d957e3bb2bf13aa3ef">More...</a><br /></td></tr>
<tr class="separator:ga50dda38a8a83d7d957e3bb2bf13aa3ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadad1beebe4b8c560187177cb4513240b"><td class="memItemLeft" align="right" valign="top"><a id="gadad1beebe4b8c560187177cb4513240b"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>__attribute__</b> ((deprecated(&quot;Use <a class="el" href="group__deepsleep.html#ga9f7a625290748f0df6ba2ceb27e0d81b">watch_enter_sleep_mode</a> or <a class="el" href="group__deepsleep.html#gaea469761889ff203385f3bfd88bb2451">watch_enter_deep_sleep_mode</a> instead&quot;))) void watch_enter_shallow_sleep(bool display_on)</td></tr>
<tr class="separator:gadad1beebe4b8c560187177cb4513240b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga77094010477e7af9456b3b871ec30807"><td class="memItemLeft" align="right" valign="top"><a id="ga77094010477e7af9456b3b871ec30807"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>__attribute__</b> ((deprecated(&quot;Use <a class="el" href="group__deepsleep.html#ga50dda38a8a83d7d957e3bb2bf13aa3ef">watch_enter_backup_mode</a> instead&quot;))) void watch_enter_deep_sleep(void)</td></tr>
<tr class="separator:ga77094010477e7af9456b3b871ec30807"><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 various sleep modes available to the watch, including Sleep, Deep Sleep, and BACKUP mode. </p>
<p>These terms changed meaning a bit over the course of development; if you are coming to this documentation after having worked with an earlier version of the library, these definitions should clarify the terminology. Terms in all caps are modes of the SAM L22; terms in Title Case are specific implementations in this library.</p><ul>
<li>ACTIVE mode is the mode the SAM L22 is in when both the main clock and the CPU are running. It is the most power-hungry mode. If you ever call delay_ms to wait a beat, the watch will remain in ACTIVE mode while taking that delay. In addition, whenever your <code>app_loop</code> function returns false, the device will remain in ACTIVE mode and call your <code>app_loop</code> function again.</li>
<li>STANDBY mode turns off the main clock and halts the CPU. Since the PWM driver is run from the main clock, it also stops the buzzer and any dimming of the LEDs. In this mode, the watch can wake from any interrupt source. Whenever your <code>app_loop</code> function returns true, the watch enters STANDBY mode until the next tick or other interrupt. This mode uses much less power than ACTIVE mode.</li>
<li>Sleep Mode is a special case of STANDBY mode. In this mode, the watch turns off almost all peripherals (including the external interrupt controller), and disables all pins except for the external wake pins. In this mode the watch can only wake from the RTC alarm interrupt or an external wake pin (A2, A4 or the alarm button), but the display remains on and your app's state is retained. You can enter this mode by calling <code>watch_enter_sleep_mode</code>. It consumes an order of magnitude less power than STANDBY mode.</li>
<li>Deep Sleep Mode is identical to sleep mode, but it also turns off the LCD to save a bit more power. You can enter this mode by calling <code>watch_enter_deep_sleep_mode</code>.</li>
<li>BACKUP mode is the lowest possible power mode on the SAM L22. It turns off all pins and peripherals except for the RTC. It also turns off the RAM, obliterating your application's state. The only way to wake from this mode is by setting an external wake interrupt on pin A2 or pin A4, and when you do wake it will be much like a wake from reset. You can enter this mode by calling <code>watch_enter_backup_mode</code>. </li>
</ul>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaae4dfbad44338b179a7b2d8a286bacbe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaae4dfbad44338b179a7b2d8a286bacbe">&#9670;&nbsp;</a></span>watch_disable_extwake_interrupt()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void watch_disable_extwake_interrupt </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>pin</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Unregisters the RTC interrupt on one of the EXTWAKE pins. This will prevent a value change on one of these pins from waking the device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pin</td><td>Either pin BTN_ALARM, A2, or A4. If the pin is BTN_ALARM, this function DOES NOT disable the internal pull down on that pin. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga50dda38a8a83d7d957e3bb2bf13aa3ef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga50dda38a8a83d7d957e3bb2bf13aa3ef">&#9670;&nbsp;</a></span>watch_enter_backup_mode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void watch_enter_backup_mode </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enters the SAM L22's lowest-power mode, BACKUP. </p>
<p>This function does some housekeeping before entering BACKUP mode. It first disables all pins and peripherals except for the RTC, and disables the tick interrupt (since that would wake us up from BACKUP mode). Once again, if you wish to wake from the A2 or the A4 interrupt, you must first configure this by calling watch_register_extwake_callback. </p><dl class="section note"><dt>Note</dt><dd>If you have a callback set for an external wake interrupt, it will be called if triggered while in ACTIVE, STANDBY, Sleep and Deep Sleep modes, but it <em>will not be called</em> when waking from BACKUP mode. Waking from backup is effectively like waking from reset, except that your <a class="el" href="group__app.html#gab6a9f08ba879ce8d28fb19ca2882890a">app_wake_from_backup</a> function will be called. </dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>On current revisions of the SAM L22 silicon, the ALARM_BTN pin (PA02 RTC/IN2) cannot wake the device from deep sleep mode. There is an errata note (Reference: 15010) that says that due to a silicon bug, RTC/IN2 is not functional in BACKUP. As a result, you should not call this function unless you have a device on the nine-pin connector with an external interrupt on pin A2 or A4 (i.e. an accelerometer with an interrupt pin). </dd></dl>

</div>
</div>
<a id="gaea469761889ff203385f3bfd88bb2451"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaea469761889ff203385f3bfd88bb2451">&#9670;&nbsp;</a></span>watch_enter_deep_sleep_mode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void watch_enter_deep_sleep_mode </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>enters Deep Sleep Mode by disabling all pins and peripherals except the RTC. </p>
<p>Short of BACKUP mode, this is the lowest power mode you can enter while retaining your application state (and the ability to wake with the alarm button). Just note that the display will be completely off, so you should document to the user of your application that they will need to press the alarm button to wake the device, or use a sensor board with support for an external wake pin.</p>
<p>All notes from watch_enter_sleep_mode apply here, except for power consumption. You can estimate the power consumption of this mode to be on the order of 12 microwatts (about 4µA at 3 V). </p>

</div>
</div>
<a id="ga9f7a625290748f0df6ba2ceb27e0d81b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9f7a625290748f0df6ba2ceb27e0d81b">&#9670;&nbsp;</a></span>watch_enter_sleep_mode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void watch_enter_sleep_mode </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>enters Sleep Mode by disabling all pins and peripherals except the RTC and the LCD. </p>
<p>This sleep mode is not the lowest power mode available, but it has the benefit of allowing you to display a message to the user while asleep. You can also set an alarm interrupt to wake at a configfurable interval (every minute, hour or day) to update the display. You can wake from this mode by pressing the ALARM button, if you registered an extwake callback on the ALARM button. Also note that when your app wakes from this sleep mode, your app_setup method will be called again, since this function will have disabled things you set up there.</p>
<p>Note that to wake from either the ALARM button, the A2 interrupt or the A4 interrupt, you must first configure this by calling watch_register_extwake_callback.</p>
<p>You can estimate the power consumption of this mode to be on the order of 30 microwatts (about 10 µA at 3 V). </p>

</div>
</div>
<a id="ga2de1f1012475654c4741f60808581196"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2de1f1012475654c4741f60808581196">&#9670;&nbsp;</a></span>watch_get_backup_data()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t watch_get_backup_data </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>reg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets 32 bits of data from the RTC's BACKUP register. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">reg</td><td>A register from 0-7. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>An unsigned 32 bit integer with the from the backup register. </dd></dl>

</div>
</div>
<a id="gacad726423f5f38697c87474ab25244ca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacad726423f5f38697c87474ab25244ca">&#9670;&nbsp;</a></span>watch_register_extwake_callback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void watch_register_extwake_callback </td>
          <td>(</td>
          <td class="paramtype">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">bool&#160;</td>
          <td class="paramname"><em>level</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Registers a callback on one of the RTC's external wake pins, which can wake the device from Sleep, Deep Sleep and BACKUP modes (but see warning re: BACKUP mode). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pin</td><td>Either pin BTN_ALARM, A2, or A4. These are the three external wake pins. If the pin is BTN_ALARM, this function also enables an internal pull down on that pin. </td></tr>
    <tr><td class="paramname">callback</td><td>The callback to be called if this pin triggers outside of BACKUP mode. If this is NULL, no callback will be called even in normal modes, but the interrupt will still be enabled so that it can wake the device. </td></tr>
    <tr><td class="paramname">level</td><td>The level you wish to scan for: true for rising, false for falling. Note that you cannot scan for both rising and falling edges like you can with the external interrupt pins; with the external wake interrupt, you can only get one or the other. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>When in ACTIVE, STANDBY and Sleep / Deep sleep modes, this will function much like a standard external interrupt situation: these pins will wake the device, and your callback will be called. However, if the device enters BACKUP mode and one of these pins wakes the device, your callback WILL NOT be called, as the device is basically waking from reset at that point. </dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>As of the current SAM L22 silicon revision (rev B), the BTN_ALARM pin cannot wake the device from BACKUP mode. You can still use this function to register a BTN_ALARM interrupt in normal or deep sleep mode, but to wake from BACKUP, you will need to use pin A2 or A4. </dd></dl>

</div>
</div>
<a id="ga385b36922ec76c5fe697772f97a05846"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga385b36922ec76c5fe697772f97a05846">&#9670;&nbsp;</a></span>watch_store_backup_data()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void watch_store_backup_data </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>reg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Stores data in one of the RTC's backup registers, which retain their data in BACKUP mode. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>An unsigned 32 bit integer with the data you wish to store. </td></tr>
    <tr><td class="paramname">reg</td><td>A register from 0-7. </td></tr>
  </table>
  </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>