Robobo
rstc.h
Go to the documentation of this file.
1 
44 #ifndef RSTC_H_INCLUDED
45 #define RSTC_H_INCLUDED
46 
47 #include "../chip.h"
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
55 #define RSTC_GENERAL_RESET (0 << RSTC_SR_RSTTYP_Pos)
56 #define RSTC_BACKUP_RESET (1 << RSTC_SR_RSTTYP_Pos)
57 #define RSTC_WATCHDOG_RESET (2 << RSTC_SR_RSTTYP_Pos)
58 #define RSTC_SOFTWARE_RESET (3 << RSTC_SR_RSTTYP_Pos)
59 #define RSTC_USER_RESET (4 << RSTC_SR_RSTTYP_Pos)
60 
61 #define RSTC_NRST_LOW (LOW << 16)
62 #define RSTC_NRST_HIGH (HIGH << 16)
63 
64 void rstc_set_external_reset(Rstc* p_rstc, const uint32_t ul_length);
65 void rstc_enable_user_reset(Rstc* p_rstc);
66 void rstc_disable_user_reset(Rstc* p_rstc);
69 void rstc_start_software_reset(Rstc* p_rstc);
70 void rstc_reset_extern(Rstc *p_rstc);
71 uint32_t rstc_get_status(Rstc* p_rstc);
72 uint32_t rstc_get_reset_cause(Rstc* p_rstc);
73 
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 #endif /* RSTC_H_INCLUDED */
void rstc_start_software_reset(Rstc *p_rstc)
Perform software reset.
Definition: rstc.c:146
void rstc_disable_user_reset(Rstc *p_rstc)
Disable user reset.
Definition: rstc.c:101
uint32_t rstc_get_status(Rstc *p_rstc)
Get RSTC status.
Definition: rstc.c:168
void rstc_reset_extern(Rstc *p_rstc)
Asserts the NRST pin for external resets.
Definition: rstc.c:156
void rstc_disable_user_reset_interrupt(Rstc *p_rstc)
Disable user reset interrupt.
Definition: rstc.c:131
void rstc_enable_user_reset_interrupt(Rstc *p_rstc)
Enable user reset interrupt.
Definition: rstc.c:116
Rstc hardware registers.
Definition: component_rstc.h:41
void rstc_set_external_reset(Rstc *p_rstc, const uint32_t ul_length)
Set external reset length.
Definition: rstc.c:71
uint32_t rstc_get_reset_cause(Rstc *p_rstc)
Get reset cause.
Definition: rstc.c:180
void rstc_enable_user_reset(Rstc *p_rstc)
Enable user reset.
Definition: rstc.c:86