-
Notifications
You must be signed in to change notification settings - Fork 0
/
DR_SysTick.h
77 lines (65 loc) · 3.45 KB
/
DR_SysTick.h
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
/*******************************************************************************************************************************//**
*
* @file DR_SysTick.h
* @brief Breve descripción del objetivo del Módulo
* @date 4 de may. de 2016
* @author Ing. Marcelo Trujillo
*
**********************************************************************************************************************************/
/***********************************************************************************************************************************
*** MODULO
**********************************************************************************************************************************/
#ifndef DR_SYSTICK_H_
#define DR_SYSTICK_H_
/***********************************************************************************************************************************
*** INCLUDES GLOBALES
**********************************************************************************************************************************/
#include "DR_tipos.h"
/***********************************************************************************************************************************
*** DEFINES GLOBALES
**********************************************************************************************************************************/
/***********************************************************************************************************************************
*** MACROS GLOBALES
**********************************************************************************************************************************/
//!< 0xE000E010UL: Registro de control del SysTick:
#define SYSTICK ( (systick_t *) 0xE000E010UL )
#define STCTRL SYSTICK->_STCTRL
#define ENABLE SYSTICK->bits._ENABLE
#define TICKINT SYSTICK->bits._TICKINT
#define CLKSOURCE SYSTICK->bits._CLKSOURCE
#define COUNTFLAG SYSTICK->bits._COUNTFLAG
#define STRELOAD SYSTICK->_STRELOAD
#define STCURR SYSTICK->_STCURR
#define STCALIB SYSTICK->_STCALIB
/***********************************************************************************************************************************
*** TIPO DE DATOS GLOBALES
**********************************************************************************************************************************/
//!< ///////////// SYSTICK ///////////////////////////
//!< Tipo de dato específico para manejar el SYSTICK
typedef struct
{
union
{
__RW uint32_t _STCTRL;
struct
{
__RW uint32_t _ENABLE:1;
__RW uint32_t _TICKINT:1;
__RW uint32_t _CLKSOURCE:1;
__RW uint32_t _RESERVED0:13;
__RW uint32_t _COUNTFLAG:1;
__RW uint32_t _RESERVED1:15;
}bits;
};
__RW uint32_t _STRELOAD;
__RW uint32_t _STCURR;
__R uint32_t _STCALIB;
} systick_t;
/***********************************************************************************************************************************
*** VARIABLES GLOBALES
**********************************************************************************************************************************/
/***********************************************************************************************************************************
*** PROTOTIPOS DE FUNCIONES GLOBALES
**********************************************************************************************************************************/
void SysTick_Inicializacion ( void );
#endif /* DR_SYSTICK_H_ */