fb11e647
vrobic
reseau statique a...
|
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
|
/*
* Copyright (C) 2014 Freie Universitรคt Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for more
* details.
*/
/**
* @ingroup cpu_nrf51822
* @{
*
* @file
* @brief Implementation of the kernels power management interface
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Frank Holtz <frank-riot2015@holtznet.de>
*
* @}
*/
#include "cpu.h"
#include "arch/lpm_arch.h"
void lpm_arch_init(void)
{
/* TODO: needs to be implemented */
}
enum lpm_mode lpm_arch_set(enum lpm_mode target)
{
switch (target) {
/* wait for next interrupt */
case LPM_IDLE:
case LPM_SLEEP:
case LPM_POWERDOWN:
__DSB();
__WFI();
break;
case LPM_OFF:
/* Switch of RAM and power off */
NRF_POWER->RAMON = 0;
NRF_POWER->SYSTEMOFF = 1;
break;
/* do nothing here */
case LPM_UNKNOWN:
case LPM_ON:
default:
break;
}
return 0;
}
enum lpm_mode lpm_arch_get(void)
{
/* TODO: needs to be implemented */
return 0;
}
void lpm_arch_awake(void)
{
/* TODO: needs to be implemented */
}
void lpm_arch_begin_awake(void)
{
/* TODO: needs to be implemented */
}
void lpm_arch_end_awake(void)
{
/* TODO: needs to be implemented */
}
|