EVE 1.0
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
reset.h
Go to the documentation of this file.
1
#ifndef RESET_H_INCLUDED
2
#define RESET_H_INCLUDED
3
/**********************************************************************/
4
/*
5
* Copyright (c) 2013-2015, Jetro AS
6
* All rights reserved.
7
*
8
* Redistribution and use in source and binary forms, with or without modification,
9
* are permitted provided that the following conditions are met:
10
*
11
* 1. Redistributions of source code must retain the above copyright notice,
12
* this list of conditions and the following disclaimer.
13
* 2. Redistributions in binary form must reproduce the above copyright notice,
14
* this list of conditions and the following disclaimer in the documentation
15
* and/or other materials provided with the distribution.
16
* 3. The name of the author may not be used to endorse or promote products
17
* derived from this software without specific prior written permission.
18
*
19
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONRIBUTORS ``AS IS'' AND ANY EXPRESS
20
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
22
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
24
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
27
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
28
* OF SUCH DAMAGE.
29
*
30
* This file is part of the EVE platform.
31
*/
32
33
/**
34
* \file
35
* @brief Reset cause primitive.
36
*
37
* @author DT, Jetro as
38
*/
/******************************************************************/
39
40
/**
41
* This module provides functionality to set and get system reset cause
42
*/
43
44
/**
45
* \defgroup reset Reset cause primitive
46
* \ingroup abstract
47
* \{
48
*/
49
50
51
/***********************************************************************
52
* Global defines
53
***********************************************************************/
54
55
/**
56
* Reset cause
57
*/
58
enum
reset_cause_t
59
{
60
RESET_CAUSE_UNKNOWN
,
/**< Unknown reset cause, power-on reset */
61
RESET_CAUSE_WATCHDOG
,
/**< Watchdog reset */
62
RESET_CAUSE_SOFT
,
/**< Software reset */
63
RESET_CAUSE_OFF_GPIO
,
/**< Reset from system off by GPIO sense detect */
64
RESET_CAUSE_OFF_LPCOMP
,
/**< Reset from system off by LPCOMP */
65
RESET_CAUSE_OFF_DEBUG
,
/**< Reset from system off by debug interface */
66
RESET_CAUSE_OFF_NFC
,
/**< Reset from system off by NFC field sense */
67
RESET_CAUSE__FIRST_USER
,
/**< First user-defined software reset cause */
68
/* ... */
69
RESET_CAUSE__LAST_USER
= 0xFF,
/**< Last user-defined software reset cause */
70
};
71
72
73
/**********************************************************************/
74
/**
75
* @brief Name: get_reset_cause\n
76
* Returns reset cause for the last system reset.
77
*
78
* @return Reset cause
79
***********************************************************************/
80
enum
reset_cause_t
get_reset_cause
(
void
);
81
82
/**********************************************************************/
83
/**
84
* @brief Name: set_reset_cause\n
85
* Sets (resets) reset cause.
86
*
87
* @param reset_cause Reset cause. Allowed values: RESET_CAUSE_UNKNOWN, [RESET_CAUSE__FIRST_USER..RESET_CAUSE__LAST_USER]
88
***********************************************************************/
89
void
set_reset_cause
(
enum
reset_cause_t
reset_cause);
90
91
/** \} reset */
92
93
#endif
/* RESET_H_INCLUDED */
RESET_CAUSE__FIRST_USER
Definition:
reset.h:67
set_reset_cause
void set_reset_cause(enum reset_cause_t reset_cause)
Name: set_reset_cause Sets (resets) reset cause.
reset_cause_t
reset_cause_t
Definition:
reset.h:58
RESET_CAUSE_OFF_LPCOMP
Definition:
reset.h:64
RESET_CAUSE_OFF_DEBUG
Definition:
reset.h:65
RESET_CAUSE__LAST_USER
Definition:
reset.h:69
RESET_CAUSE_OFF_GPIO
Definition:
reset.h:63
RESET_CAUSE_UNKNOWN
Definition:
reset.h:60
RESET_CAUSE_SOFT
Definition:
reset.h:62
RESET_CAUSE_WATCHDOG
Definition:
reset.h:61
get_reset_cause
enum reset_cause_t get_reset_cause(void)
Name: get_reset_cause Returns reset cause for the last system reset.
RESET_CAUSE_OFF_NFC
Definition:
reset.h:66
Core
Include
dev
reset.h
Generated on Thu Mar 30 2017 10:16:55 for EVE 1.0 by
1.8.11