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
|
/**
* \file
*
* \brief Board specific definition for low power example.
*
* Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef LOW_POWER_BOARD_H_INCLUDED
#define LOW_POWER_BOARD_H_INCLUDED
/**
* Push button definitions for sleep mode and active mode
* @{
*/
#define PIN_PUSHBUTTON_WAKEUP_PIO PIN_PUSHBUTTON_0_PIO
#define PIN_PUSHBUTTON_WAKEUP_MASK PIN_PUSHBUTTON_0_MASK
#define PIN_PUSHBUTTON_WAKEUP_ID PIN_PUSHBUTTON_0_ID
#define PIN_PUSHBUTTON_WAKEUP_ATTR PIN_PUSHBUTTON_0_ATTR
/** @} */
/** Wakeup pin for wait mode: WKUP2 pin (SW0) */
#define WAKEUP_WAIT_INPUT_ID (1u << 2)
/** Wakeup pin for backup mode: WKUP2 pin (SW0) */
#define WAKEUP_BACKUP_INPUT_ID (1u << 2)
/** Hint message for active mode */
#define STRING_ACTIVE \
"Enter into active mode.\n\r" \
"- Press SW0 button to go out.\n\r"
/** Hint message for sleep mode */
#define STRING_SLEEP \
"Enter into sleep mode.\n\r" \
"- Press SW0 button to wake up.\n\r"
/** Hint message for wait mode */
#define STRING_WAIT \
"Enter into wait mode.\n\r" \
"- Switch to 4MHz Fast RC oscillator, PLL stopped.\n\r" \
"- Press SW0 button to wake up.\n\r"
/** Hint message for backup mode */
#define STRING_BACKUP \
"Enter into backup mode.\n\r" \
"- Press SW0 button to wake up.\n\r"
#define CLOCK_LIST_MENU \
"\n\rSelect one of the following clock configurations:\n\r" \
" 1: 125KHz from Fast RC\n\r" \
" 2: 250KHz from Fast RC\n\r" \
" 3: 500KHz from Fast RC\n\r" \
" 4: 1MHz from Fast RC\n\r" \
" 5: 2MHz from Fast RC\n\r" \
" 6: 4MHz from Fast RC\n\r" \
" 7: 8MHz from Fast RC\n\r" \
" 8: 12MHz from Fast RC\n\r" \
" a: 24MHz from PLL clock\n\r" \
" b: 32MHz from PLL clock\n\r" \
" c: 48MHz from PLL clock\n\r" \
" d: 64MHz from PLL clock\n\r" \
" e: 84MHz from PLL clock\n\r" \
" f: 100MHz from PLL clock\n\r" \
" g: 120MHz from PLL clock\n\r" \
#define MIN_CLOCK_FAST_RC_ITEM '1'
#define MAX_CLOCK_FAST_RC_ITEM '8'
#define MIN_CLOCK_PLL_ITEM 'a'
#define MAX_CLOCK_PLL_ITEM 'g'
#define EFC EFC0
extern uint32_t g_fastrc_clock_list[][3];
extern uint32_t g_pll_clock_list[][4];
void init_specific_board(void);
#endif /* LOW_POWER_BOARD_H_INCLUDED */
|