libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
pwr.c
Go to the documentation of this file.
1
/** @defgroup pwr_file Power/Sleep API
2
* @brief SWM050 Power API.
3
* @ingroup peripheral_apis
4
* LGPL License Terms @ref lgpl_license
5
* @author @htmlonly © @endhtmlonly 2019
6
* Caleb Szalacinski <contact@skiboy.net>
7
*/
8
/*
9
* This file is part of the libopencm3 project.
10
*
11
* Copyright (C) 2019 Caleb Szalacinski <contact@skiboy.net>
12
*
13
* This library is free software: you can redistribute it and/or modify
14
* it under the terms of the GNU Lesser General Public License as published by
15
* the Free Software Foundation, either version 3 of the License, or
16
* (at your option) any later version.
17
*
18
* This library is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU Lesser General Public License for more details.
22
*
23
* You should have received a copy of the GNU Lesser General Public License
24
* along with this library. If not, see <http://www.gnu.org/licenses/>.
25
*/
26
/**@{*/
27
#include <
libopencm3/swm050/sysctl.h
>
28
#include <
libopencm3/swm050/pwr.h
>
29
30
/*---------------------------------------------------------------------------*/
31
/** @brief Go into sleep mode
32
33
Goes to sleep and wakes up on when GPIO pin 9 is pulled low. Please give
34
yourself enough time to connect the debugger before calling this, in order to
35
not get locked out of the MCU.
36
37
*/
38
void
pwr_sleep
(
void
)
39
{
40
SYSCTL_SYS_CFG_2
|=
SYSCTL_SYS_CFG_2_SLEEP
;
41
}
42
/**@}*/
pwr_sleep
void pwr_sleep(void)
Go into sleep mode.
Definition:
pwr.c:38
SYSCTL_SYS_CFG_2_SLEEP
#define SYSCTL_SYS_CFG_2_SLEEP
Definition:
sysctl.h:36
SYSCTL_SYS_CFG_2
#define SYSCTL_SYS_CFG_2
MOS Disconnect (Synwit says that this subregister is unused), Sleep Mode, and Internal Oscillator Dis...
Definition:
sysctl.h:54
pwr.h
sysctl.h
lib
swm050
pwr.c
Generated on Tue Mar 7 2023 16:13:12 for libopencm3 by
1.9.4