1 /**
2  * \file
3  *
4  * \brief SAM System related functionality
5  *
6  * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
7  *
8  * \asf_license_start
9  *
10  * \page License
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions are met:
14  *
15  * 1. Redistributions of source code must retain the above copyright notice,
16  *    this list of conditions and the following disclaimer.
17  *
18  * 2. Redistributions in binary form must reproduce the above copyright notice,
19  *    this list of conditions and the following disclaimer in the documentation
20  *    and/or other materials provided with the distribution.
21  *
22  * 3. The name of Atmel may not be used to endorse or promote products derived
23  *    from this software without specific prior written permission.
24  *
25  * 4. This software may only be redistributed and used in connection with an
26  *    Atmel microcontroller product.
27  *
28  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31  * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38  * POSSIBILITY OF SUCH DAMAGE.
39  *
40  * \asf_license_stop
41  *
42  */
43 /*
44  * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
45  */
46 #ifndef SYSTEM_H_INCLUDED
47 #define SYSTEM_H_INCLUDED
48 
49 #include <compiler.h>
50 #include <clock.h>
51 #include <gclk.h>
52 #include <pinmux.h>
53 #include <power.h>
54 #include <reset.h>
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 /**
61  * \defgroup asfdoc_sam0_system_group SAM System (SYSTEM) Driver
62  *
63  * This driver for Atmel&reg; | SMART ARM&reg;-based microcontrollers provides an interface for the configuration
64  * and management of the device's system relation functionality, necessary for
65  * the basic device operation. This is not limited to a single peripheral, but
66  * extends across multiple hardware peripherals.
67  *
68  * The following peripherals are used by this module:
69  * \if DEVICE_SAML21_SYSTEM_SUPPORT
70  *  - PM (Power Manager)
71  *  - RSTC (Reset Controller)
72  *  - SUPC (Supply Controller)
73  * \endif
74  * \if DEVICE_SAMC21_SYSTEM_SUPPORT
75  *  - PM (Power Manager)
76  *  - RSTC (Reset Controller)
77  *  - SUPC (Supply Controller)
78  * \endif
79  * \if DEVICE_SAMD21_SYSTEM_SUPPORT
80  *  - SYSCTRL (System Control)
81  *  - PM (Power Manager)
82  * \endif
83  *
84  * The following devices can use this module:
85  * \if DEVICE_SAML21_SYSTEM_SUPPORT
86  *  - Atmel | SMART SAM L21
87  * \endif
88  * \if DEVICE_SAMC21_SYSTEM_SUPPORT
89  *  - Atmel | SMART SAM C20/C21
90  * \endif
91  * \if DEVICE_SAMD21_SYSTEM_SUPPORT
92  *  - Atmel | SMART SAM D20/D21
93  *  - Atmel | SMART SAM R21
94  *  - Atmel | SMART SAM D09/D10/D11
95  *  - Atmel | SMART SAM DA1
96  * \endif
97  *
98  * The outline of this documentation is as follows:
99  *  - \ref asfdoc_sam0_system_prerequisites
100  *  - \ref asfdoc_sam0_system_module_overview
101  *  - \ref asfdoc_sam0_system_special_considerations
102  *  - \ref asfdoc_sam0_system_extra_info
103  *  - \ref asfdoc_sam0_system_examples
104  *  - \ref asfdoc_sam0_system_api_overview
105  *
106  *
107  * \section asfdoc_sam0_system_prerequisites Prerequisites
108  *
109  * There are no prerequisites for this module.
110  *
111  *
112  * \section asfdoc_sam0_system_module_overview Module Overview
113  *
114  * The System driver provides a collection of interfaces between the user
115  * application logic, and the core device functionality (such as clocks, reset
116  * cause determination, etc.) that is required for all applications. It contains
117  * a number of sub-modules that control one specific aspect of the device:
118  *
119  * - System Core (this module)
120  * - \ref asfdoc_sam0_system_clock_group "System Clock Control" (sub-module)
121  * - \ref asfdoc_sam0_system_interrupt_group "System Interrupt Control" (sub-module)
122  * - \ref asfdoc_sam0_system_pinmux_group "System Pin Multiplexer Control" (sub-module)
123  *
124  *
125  * \if DEVICE_SAML21_SYSTEM_SUPPORT
126  * \subsection asfdoc_sam0_system_module_overview_vreg_l21 Voltage Regulator
127  * The SAM device controls the voltage regulators for the core (VDDCORE) and
128  * backup (VDDBU) domains. It sets the voltage regulators according to the sleep
129  * modes, the performance level, or the user configuration.
130  *
131  * In active mode, the voltage regulator can be chosen on the fly between a LDO
132  * or a Buck converter. In standby mode, the low power voltage regulator is used
133  * to supply VDDCORE.
134  *
135  * \subsection asfdoc_sam0_system_module_overview_bbps Battery Backup Power Switch
136  * The SAM device supports connection of a battery backup to the VBAT power pin.
137  * It includes functionality that enables automatic power switching between main
138  * power and battery backup power. This will ensure power to the backup domain,
139  * when the main battery or power source is unavailable.
140  * \endif
141  *
142  * \if DEVICE_SAMC21_SYSTEM_SUPPORT
143  * \subsection asfdoc_sam0_system_module_overview_vreg_c21 Voltage Regulator
144  * The SAM device controls the voltage regulators for the core (VDDCORE). It sets
145  * the voltage regulators according to the sleep modes.
146  *
147  * There are a selectable reference voltage and voltage dependent on the temperature
148  * which can be used by analog modules like the ADC.
149  * \endif
150  *
151  * \subsection asfdoc_sam0_system_module_overview_vref Voltage References
152  * The various analog modules within the SAM devices (such as AC, ADC, and
153  * DAC) require a voltage reference to be configured to act as a reference point
154  * for comparisons and conversions.
155  *
156  * The SAM devices contain multiple references, including an internal
157  * temperature sensor and a fixed band-gap voltage source. When enabled, the
158  * associated voltage reference can be selected within the desired peripheral
159  * where applicable.
160  *
161  * \subsection asfdoc_sam0_system_module_overview_reset_cause System Reset Cause
162  * In some applications there may be a need to execute a different program
163  * flow based on how the device was reset. For example, if the cause of reset
164  * was the Watchdog timer (WDT), this might indicate an error in the application,
165  * and a form of error handling or error logging might be needed.
166  *
167  * For this reason, an API is provided to retrieve the cause of the last system
168  * reset, so that appropriate action can be taken.
169  *
170  * \if DEVICE_SAML21_SYSTEM_SUPPORT
171  * There are three groups of reset sources:
172  *   - Power supply reset: Resets caused by an electrical issue. It covers POR and BOD reset.
173  *   - User reset: Resets caused by the application. It covers external reset,
174  *             system reset, and watchdog reset.
175  *   - Backup reset: Resets caused by a backup mode exit condition.
176  *
177  * \subsection asfdoc_sam0_system_module_overview_performance_level Performance Level
178  * Performance level allows the user to adjust the regulator output voltage to reduce
179  * power consumption. The user can on the fly select the most suitable performance
180  * level, depending on the application demands.
181  *
182  * The SAM device can operate at two different performance levels (PL0 and PL2).
183  * When operating at PL0, the voltage applied on the full logic area is reduced
184  * by voltage scaling. This voltage scaling technique allows to reduce the active
185  * power consumption while decreasing the maximum frequency of the device. When
186  * operating at PL2, the voltage regulator supplies the highest voltage, allowing
187  * the device to run at higher clock speeds.
188  *
189  * Performance level transition is possible only when the device is in active
190  * mode. After a reset, the device starts at the lowest performance level
191  * (lowest power consumption and lowest max. frequency). The application can then
192  * switch to another performance level at any time without any stop in the code
193  * execution. As shown in \ref asfdoc_sam0_system_performance_level_transition_figure.
194  *
195  * \note When scaling down the performance level, the bus frequency should first be
196  *  scaled down in order to not exceed the maximum frequency allowed for the
197  *  low performance level.
198  *  When scaling up the performance level (e.g. from PL0 to PL2), check the performance
199  *  level status before increasing the bus frequency. It can be increased only
200  *  when the performance level transition is completed.
201  *
202  * \anchor asfdoc_sam0_system_performance_level_transition_figure
203  * \image html performance_level_transition.svg "Performance Level Transition"
204  *
205  * \subsection asfdoc_sam0_system_module_overview_power_domain Power Domain Gating
206  * Power domain gating allows power saving by reducing the voltage in logic
207  * areas in the device to a low-power supply. The feature is available in
208  * Standby sleep mode and will reduce the voltage in domains where all peripherals
209  * are idle. Internal logic will maintain its content, meaning the corresponding
210  * peripherals will not need to be reconfigured when normal operating voltage
211  * is returned. Most power domains can be in the following three states:
212  *
213  * - Active state: The power domain is powered on.
214  * - Retention state: The main voltage supply for the power domain is switched off,
215  * while maintaining a secondary low-power supply for the sequential cells. The
216  * logic context is restored when waking up.
217  * - Off state: The power domain is entirely powered off. The logic context is lost.
218  *
219  * The SAM L21 device  contains three power domains which can be controlled using
220  * power domain gating, namely PD0, PD1, and PD2. These power domains can be
221  * configured to the following cases:
222  * - Default with no sleepwalking peripherals: A power domain is automatically set
223  * to retention state in standby sleep mode if no activity require it. The application
224  * can force all power domains to remain in active state during standby sleep mode
225  * in order to accelerate wakeup time.
226  * - Default with sleepwalking peripherals: If one or more peripherals are enabled
227  * to perform sleepwalking tasks in standby sleep mode, the corresponding power
228  * domain (PDn) remains in active state as well as all inferior power domains (<PDn).
229  * - Sleepwalking with dynamic power domain gating: During standby sleep mode, a
230  * power domain (PDn) in active can wake up a superior power domain (>PDn) in order
231  * to perform a sleepwalking task. The superior power domain is then automatically
232  * set to active state. At the end of the sleepwalking task, the device can either
233  * be woken up or the superior power domain can return to retention state.
234  *
235  * Power domains can be linked to each other, it allows a power domain (PDn) to be kept
236  * in active state if the inferior power domain (PDn-1) is in active state too.
237  *
238  * \ref asfdoc_sam0_system_power_domain_overview_table illustrates the
239  * four cases to consider in standby mode.
240  *
241  * \anchor asfdoc_sam0_system_power_domain_overview_table
242  * <table>
243  *  <caption>Sleep Mode versus Power Domain State Overview</caption>
244  *  <tr>
245  *      <th>Sleep mode</th>
246  *      <th>PD0</th>
247  *      <th>PD1</th>
248  *      <th>PD2</th>
249  *      <th>PDTOP</th>
250  *      <th>PDBACKUP</th>
251  *  </tr>
252  *  <tr>
253  *      <td>Idle</td>
254  *      <td>active</td>
255  *      <td>active</td>
256  *      <td>active</td>
257  *      <td>active</td>
258  *      <td>active</td>
259  *  </tr>
260  *  <tr>
261  *      <td>Standby - Case 1</td>
262  *      <td>active</td>
263  *      <td>active</td>
264  *      <td>active</td>
265  *      <td>active</td>
266  *      <td>active</td>
267  *  </tr>
268  *  <tr>
269  *      <td>Standby - Case 2</td>
270  *      <td>active</td>
271  *      <td>active</td>
272  *      <td>retention</td>
273  *      <td>active</td>
274  *      <td>active</td>
275  *  </tr>
276  *  <tr>
277  *      <td>Standby - Case 3</td>
278  *      <td>active</td>
279  *      <td>retention</td>
280  *      <td>retention</td>
281  *      <td>active</td>
282  *      <td>active</td>
283  *  </tr>
284  *  <tr>
285  *      <td>Standby - Case 4</td>
286  *      <td>retention</td>
287  *      <td>retention</td>
288  *      <td>retention</td>
289  *      <td>active</td>
290  *      <td>active</td>
291  *  </tr>
292  *  <tr>
293  *      <td>Backup</td>
294  *      <td>off</td>
295  *      <td>off</td>
296  *      <td>off</td>
297  *      <td>off</td>
298  *      <td>active</td>
299  *  </tr>
300  *  <tr>
301  *      <td>Off</td>
302  *      <td>off</td>
303  *      <td>off</td>
304  *      <td>off</td>
305  *      <td>off</td>
306  *      <td>off</td>
307  *  </tr>
308  * </table>
309  *
310  * \subsection asfdoc_sam0_system_module_overview_ram_state RAMs Low Power Mode
311  * By default, in standby sleep mode, RAM is in low power mode (back biased)
312  * if its power domain is in retention state.
313  * \ref asfdoc_sam0_system_power_ram_state_table lists RAMs low power mode.
314  *
315  * \anchor asfdoc_sam0_system_power_ram_state_table
316  * <table>
317  *  <caption>RAM Back-biasing Mode</caption>
318  *  <tr>
319  *      <th>RAM mode</th>
320  *      <th>Description</th>
321  *  </tr>
322  *  <tr>
323  *      <td>Retention Back-biasing mode</td>
324  *      <td>RAM is back-biased if its power domain is in retention mode</td>
325  *  </tr>
326  *  <tr>
327  *      <td>Standby Back-biasing mode</td>
328  *      <td>RAM is back-biased if the device is in standby mode</td>
329  *  </tr>
330  *  <tr>
331  *      <td>Standby OFF mode</td>
332  *      <td>RAM is OFF if the device is in standby mode</td>
333  *  </tr>
334  *  <tr>
335  *      <td>Always OFF mode</td>
336  *      <td>RAM is OFF if the device is in RET mode</td>
337  *  </tr>
338  * </table>
339  *
340  * \endif
341  *
342  * \subsection asfdoc_sam0_system_module_overview_sleep_mode Sleep Modes
343  * The SAM devices have several sleep modes. The sleep mode controls
344  * which clock systems on the device will remain enabled or disabled when the
345  * device enters a low power sleep mode.
346  * \ref asfdoc_sam0_system_module_sleep_mode_table "The table below" lists the
347  * clock settings of the different sleep modes.
348  *
349  * \anchor asfdoc_sam0_system_module_sleep_mode_table
350  * <table>
351  *  <caption>SAM Device Sleep Modes</caption>
352  * \if DEVICE_SAML21_SYSTEM_SUPPORT
353  *  <tr>
354  *      <th>Sleep mode</th>
355  *      <th>System clock</th>
356  *      <th>CPU clock</th>
357  *      <th>AHB/AHB clock</th>
358  *      <th>GCLK clocks</th>
359  *      <th>Oscillators (ONDEMAND  = 0)</th>
360  *      <th>Oscillators (ONDEMAND  = 1)</th>
361  *      <th>Regulator mode</th>
362  *      <th>RAM mode</th>
363  *  </tr>
364  *  <tr>
365  *      <td>Idle</td>
366  *      <td>Run</td>
367  *      <td>Stop</td>
368  *      <td>Run if requested</td>
369  *      <td>Run</td>
370  *      <td>Run</td>
371  *      <td>Run if requested</td>
372  *      <td>Normal</td>
373  *      <td>Normal</td>
374  *  </tr>
375  *  <tr>
376  *      <td>Standby</td>
377  *      <td>Stop</td>
378  *      <td>Stop</td>
379  *      <td>Run if requested</td>
380  *      <td>Run if requested</td>
381  *      <td>Run if requested or RUNSTDBY  = 1</td>
382  *      <td>Run if requested</td>
383  *      <td>Low pwer</td>
384  *      <td>Low pwer</td>
385  *  </tr>
386  *  <tr>
387  *      <td>Backup</td>
388  *      <td>Stop</td>
389  *      <td>Stop</td>
390  *      <td>Stop</td>
391  *      <td>Stop</td>
392  *      <td>Stop</td>
393  *      <td>Stop</td>
394  *      <td>Backup</td>
395  *      <td>Off</td>
396  *  </tr>
397  *  <tr>
398  *      <td>Off</td>
399  *      <td>Off</td>
400  *      <td>Off</td>
401  *      <td>Off</td>
402  *      <td>Off</td>
403  *      <td>Off</td>
404  *      <td>Off</td>
405  *      <td>Off</td>
406  *      <td>Off</td>
407  *  </tr>
408  * \else
409  *  <tr>
410  *      <th>Sleep mode</th>
411  *      <th>CPU clock</th>
412  *      <th>AHB clock</th>
413  *      <th>APB clocks</th>
414  *      <th>Clock sources</th>
415  *      <th>System clock</th>
416  *      <th>32KHz</th>
417  *      <th>Reg mode</th>
418  *      <th>RAM mode</th>
419  *  </tr>
420  *  <tr>
421  *      <td>Idle 0</td>
422  *      <td>Stop</td>
423  *      <td>Run</td>
424  *      <td>Run</td>
425  *      <td>Run</td>
426  *      <td>Run</td>
427  *      <td>Run</td>
428  *      <td>Normal</td>
429  *      <td>Normal</td>
430  *  </tr>
431  *  <tr>
432  *      <td>Idle 1</td>
433  *      <td>Stop</td>
434  *      <td>Stop</td>
435  *      <td>Run</td>
436  *      <td>Run</td>
437  *      <td>Run</td>
438  *      <td>Run</td>
439  *      <td>Normal</td>
440  *      <td>Normal</td>
441  *  </tr>
442  *  <tr>
443  *      <td>Idle 2</td>
444  *      <td>Stop</td>
445  *      <td>Stop</td>
446  *      <td>Stop</td>
447  *      <td>Run</td>
448  *      <td>Run</td>
449  *      <td>Run</td>
450  *      <td>Normal</td>
451  *      <td>Normal</td>
452  *  </tr>
453  *  <tr>
454  *      <td>Standby</td>
455  *      <td>Stop</td>
456  *      <td>Stop</td>
457  *      <td>Stop</td>
458  *      <td>Stop</td>
459  *      <td>Stop</td>
460  *      <td>Stop</td>
461  *      <td>Low Power</td>
462  *      <td>Source/Drain biasing</td>
463  *  </tr>
464  * \endif
465  * </table>
466  *
467  * Before entering device sleep, one of the available sleep modes must be set.
468  * The device will automatically wake up in response to an interrupt being
469  * generated or upon any other sleep mode exit condition.
470  *
471  * Some peripheral clocks will remain enabled during sleep, depending on their
472  * configuration. If desired, the modules can remain clocked during sleep to allow
473  * them continue to operate while other parts of the system are powered down
474  * to save power.
475  *
476  *
477  * \section asfdoc_sam0_system_special_considerations Special Considerations
478  *
479  * Most of the functions in this driver have device specific restrictions and
480  * caveats; refer to your device datasheet.
481  *
482  *
483  * \section asfdoc_sam0_system_extra_info Extra Information
484  *
485  * For extra information, see \ref asfdoc_sam0_system_extra. This includes:
486  *  - \ref asfdoc_sam0_system_extra_acronyms
487  *  - \ref asfdoc_sam0_system_extra_dependencies
488  *  - \ref asfdoc_sam0_system_extra_errata
489  *  - \ref asfdoc_sam0_system_extra_history
490  *
491  *
492  * \section asfdoc_sam0_system_examples Examples
493  *
494  * For SYSTEM module related examples, refer to the sub-modules listed in
495  * the \ref asfdoc_sam0_system_module_overview "Module Overview".
496  *
497  * \if DEVICE_SAML21_SYSTEM_SUPPORT
498  * For a list of examples related to this driver, see
499  * \ref asfdoc_sam0_drivers_power_exqsg.
500  * \endif
501  *
502  *
503  * \section asfdoc_sam0_system_api_overview API Overview
504  * @{
505  */
506 
507 /**
508  * \name System Debugger
509  * @{
510  */
511 
512 /**
513  * \brief Check if debugger is present.
514  *
515  * Check if debugger is connected to the onboard debug system (DAP).
516  *
517  * \return A bool identifying if a debugger is present.
518  *
519  * \retval true  Debugger is connected to the system
520  * \retval false Debugger is not connected to the system
521  *
522  */
system_is_debugger_present(void)523 static inline bool system_is_debugger_present(void)
524 {
525 	return DSU->STATUSB.reg & DSU_STATUSB_DBGPRES;
526 }
527 
528 /**
529  * @}
530  */
531 
532 /**
533  * \name System Identification
534  * @{
535  */
536 
537 /**
538  * \brief Retrieve the device identification signature.
539  *
540  * Retrieves the signature of the current device.
541  *
542  * \return Device ID signature as a 32-bit integer.
543  */
system_get_device_id(void)544 static inline uint32_t system_get_device_id(void)
545 {
546 	return DSU->DID.reg;
547 }
548 
549 /**
550  * @}
551  */
552 
553 /**
554  * \name System Initialization
555  * @{
556  */
557 
558 void system_init(void);
559 
560 /**
561  * @}
562  */
563 
564 
565 /**
566  * @}
567  */
568 
569 /**
570  *
571  * \if DEVICE_SAML21_SYSTEM_SUPPORT
572  * \page asfdoc_sam0_drivers_power_exqsg Examples for SYSTEM Driver
573  *
574  * This is a list of the available Quick Start Guides (QSGs) and example
575  * applications for \ref asfdoc_sam0_system_group. QSGs are simple examples with step-by-step instructions to
576  * configure and use this driver in a selection of
577  * use cases. Note that a QSG can be compiled as a standalone application or be
578  * added to the user application.
579  *
580  *  - \subpage asfdoc_sam0_power_basic_use_case
581  * \endif
582  *
583  * \page asfdoc_sam0_system_extra Extra Information for SYSTEM Driver
584  *
585  * \section asfdoc_sam0_system_extra_acronyms Acronyms
586  * Below is a table listing the acronyms used in this module, along with their
587  * intended meanings.
588  *
589  * <table>
590  *  <tr>
591  *      <th>Acronym</th>
592  *      <th>Definition</th>
593  *  </tr>
594  *  <tr>
595  *      <td>PM</td>
596  *      <td>Power Manager</td>
597  *  </tr>
598  * \if DEVICE_SAML21_SYSTEM_SUPPORT
599  *  <tr>
600  *      <td>SUPC</td>
601  *      <td>Supply Controller</td>
602  *  </tr>
603  *  <tr>
604  *      <td>RSTC</td>
605  *      <td>Reset Controller</td>
606  *  </tr>
607  * \endif
608  * \if DEVICE_SAMC21_SYSTEM_SUPPORT
609  *  <tr>
610  *      <td>SUPC</td>
611  *      <td>Supply Controller</td>
612  *  </tr>
613  *  <tr>
614  *      <td>RSTC</td>
615  *      <td>Reset Controller</td>
616  *  </tr>
617  * \endif
618  * \if DEVICE_SAMD21_SYSTEM_SUPPORT
619  *  <tr>
620  *      <td>SYSCTRL</td>
621  *      <td>System control interface</td>
622  *  </tr>
623  * \endif
624  * </table>
625  *
626  *
627  * \section asfdoc_sam0_system_extra_dependencies Dependencies
628  * This driver has the following dependencies:
629  *
630  *  - None
631  *
632  *
633  * \section asfdoc_sam0_system_extra_errata Errata
634  * There are no errata related to this driver.
635  *
636  *
637  * \section asfdoc_sam0_system_extra_history Module History
638  * An overview of the module history is presented in the table below, with
639  * details on the enhancements and fixes made to the module since its first
640  * release. The current version of this corresponds to the newest version in
641  * the table.
642  *
643  * <table>
644  *  <tr>
645  *      <th>Changelog</th>
646  *  </tr>
647  * \if DEVICE_SAML21_SYSTEM_SUPPORT
648  *  <tr>
649  *      <td>Initial Release</td>
650  *  </tr>
651  * \endif
652  * \if DEVICE_SAMC21_SYSTEM_SUPPORT
653  *  <tr>
654  *      <td>Initial Release</td>
655  *  </tr>
656  * \endif
657  * \if DEVICE_SAMD21_SYSTEM_SUPPORT
658  *  <tr>
659  *      <td>Added new \c system_reset() to reset the complete MCU with some exceptions</td>
660  *  </tr>
661  *  <tr>
662  *      <td>Added new \c system_get_device_id() function to retrieved the device
663  *          ID</td>
664  *  </tr>
665  *  <tr>
666  *      <td>Initial Release</td>
667  *  </tr>
668  * \endif
669  * </table>
670  *
671  * \page asfdoc_sam0_system_document_revision_history Document Revision History
672  *
673  * <table>
674  * <tr>
675  *      <th>Doc. Rev.</th>
676  *      <th>Date</th>
677  *      <th>Comments</th>
678  *  </tr>
679  * \if DEVICE_SAML21_SYSTEM_SUPPORT
680  *  <tr>
681  *      <td>42449A</td>
682  *      <td>07/2015</td>
683  *      <td>Initial document release</td>
684  * </tr>
685  * \endif
686  * \if DEVICE_SAMC21_SYSTEM_SUPPORT
687  *  <tr>
688  *      <td>42484A</td>
689  *      <td>12/2015</td>
690  *      <td>Initial document release.</td>
691  * </tr>
692  * \endif
693  * \if DEVICE_SAMD21_SYSTEM_SUPPORT
694  *  <tr>
695  *      <td>42120E</td>
696  *      <td>12/2015</td>
697  *      <td>Added support for SAM DA1 and SAM D09</td>
698  * </tr>
699  *  <tr>
700  *      <td>42120D</td>
701  *      <td>12/2014</td>
702  *      <td>Added support for SAM R21 and SAM D10/D11</td>
703  * </tr>
704  * <tr>
705  *      <td>42120C</td>
706  *      <td>01/2014</td>
707  *      <td>Added support for SAM D21</td>
708  *  </tr>
709  *  <tr>
710  *      <td>42120B</td>
711  *      <td>06/2013</td>
712  *      <td>Corrected documentation typos</td>
713  *  </tr>
714  *  <tr>
715  *      <td>42120A</td>
716  *      <td>06/2013</td>
717  *      <td>Initial document release</td>
718  *  </tr>
719  * \endif
720  * </table>
721  */
722 
723 #ifdef __cplusplus
724 }
725 #endif
726 
727 #endif /* SYSTEM_H_INCLUDED */
728 
729