MotorWare f2806x Driver API Documentation

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

pwr.h
Go to the documentation of this file.
1 /* --COPYRIGHT--,BSD
2 * Copyright (c) 2015, Texas Instruments Incorporated
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 * --/COPYRIGHT--*/
32 #ifndef _PWR_H_
33 #define _PWR_H_
34
41
42 // **************************************************************************
43 // the includes
44
45 #include "sw/modules/types/src/types.h"
46
47 #include "sw/drivers/cpu/src/32b/f28x/f2806x/cpu.h"
48
49
54
55
56
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60
61
62 // **************************************************************************
63 // the defines
64
65
68 #define PWR_BASE_ADDR (0x00000985)
69
70
73 #define PWR_BORCFG_BORENZ_BITS (1 << 0)
74
75
78 #define PWR_LPMCR0_LPM_BITS (3 << 0)
79
82 #define PWR_LPMCR0_QUALSTDBY_BITS (63 << 2)
83
86 #define PWR_LPMCR0_WDINTE_BITS (1 << 15)
87
88
89 // **************************************************************************
90 // the typedefs
91
94 typedef enum
95 {
96 PWR_LowPowerMode_Idle=0,
97 PWR_LowPowerMode_Standby,
98 PWR_LowPowerMode_Halt
99 } PWR_LowPowerMode_e;
100
101
104 typedef enum
105 {
106 PWR_NumStandByClocks_2=(0 << 2),
107 PWR_NumStandByClocks_3=(1 << 2),
108 PWR_NumStandByClocks_4=(2 << 2),
109 PWR_NumStandByClocks_5=(3 << 2),
110 PWR_NumStandByClocks_6=(4 << 2),
111 PWR_NumStandByClocks_7=(5 << 2),
112 PWR_NumStandByClocks_8=(6 << 2),
113 PWR_NumStandByClocks_9=(7 << 2),
114 PWR_NumStandByClocks_10=(8 << 2),
115 PWR_NumStandByClocks_11=(9 << 2),
116 PWR_NumStandByClocks_12=(10 << 2),
117 PWR_NumStandByClocks_13=(11 << 2),
118 PWR_NumStandByClocks_14=(12 << 2),
119 PWR_NumStandByClocks_15=(13 << 2),
120 PWR_NumStandByClocks_16=(14 << 2),
121 PWR_NumStandByClocks_17=(15 << 2),
122 PWR_NumStandByClocks_18=(16 << 2),
123 PWR_NumStandByClocks_19=(17 << 2),
124 PWR_NumStandByClocks_20=(18 << 2),
125 PWR_NumStandByClocks_21=(19 << 2),
126 PWR_NumStandByClocks_22=(20 << 2),
127 PWR_NumStandByClocks_23=(21 << 2),
128 PWR_NumStandByClocks_24=(22 << 2),
129 PWR_NumStandByClocks_25=(23 << 2),
130 PWR_NumStandByClocks_26=(24 << 2),
131 PWR_NumStandByClocks_27=(25 << 2),
132 PWR_NumStandByClocks_28=(26 << 2),
133 PWR_NumStandByClocks_29=(27 << 2),
134 PWR_NumStandByClocks_30=(28 << 2),
135 PWR_NumStandByClocks_31=(29 << 2),
136 PWR_NumStandByClocks_32=(30 << 2),
137 PWR_NumStandByClocks_33=(31 << 2),
138 PWR_NumStandByClocks_34=(32 << 2),
139 PWR_NumStandByClocks_35=(33 << 2),
140 PWR_NumStandByClocks_36=(34 << 2),
141 PWR_NumStandByClocks_37=(35 << 2),
142 PWR_NumStandByClocks_38=(36 << 2),
143 PWR_NumStandByClocks_39=(37 << 2),
144 PWR_NumStandByClocks_40=(38 << 2),
145 PWR_NumStandByClocks_41=(39 << 2),
146 PWR_NumStandByClocks_42=(40 << 2),
147 PWR_NumStandByClocks_43=(41 << 2),
148 PWR_NumStandByClocks_44=(42 << 2),
149 PWR_NumStandByClocks_45=(43 << 2),
150 PWR_NumStandByClocks_46=(44 << 2),
151 PWR_NumStandByClocks_47=(45 << 2),
152 PWR_NumStandByClocks_48=(46 << 2),
153 PWR_NumStandByClocks_49=(47 << 2),
154 PWR_NumStandByClocks_50=(48 << 2),
155 PWR_NumStandByClocks_51=(49 << 2),
156 PWR_NumStandByClocks_52=(50 << 2),
157 PWR_NumStandByClocks_53=(51 << 2),
158 PWR_NumStandByClocks_54=(52 << 2),
159 PWR_NumStandByClocks_55=(53 << 2),
160 PWR_NumStandByClocks_56=(54 << 2),
161 PWR_NumStandByClocks_57=(55 << 2),
162 PWR_NumStandByClocks_58=(56 << 2),
163 PWR_NumStandByClocks_59=(57 << 2),
164 PWR_NumStandByClocks_60=(58 << 2),
165 PWR_NumStandByClocks_61=(59 << 2),
166 PWR_NumStandByClocks_62=(60 << 2),
167 PWR_NumStandByClocks_63=(61 << 2),
168 PWR_NumStandByClocks_64=(62 << 2),
169 PWR_NumStandByClocks_65=(63 << 2)
170 } PWR_NumStandByClocks_e;
171
172
175 typedef struct _PWR_Obj_
176 {
177 volatile uint16_t BORCFG;
178 volatile uint16_t rsvd_1[26264]; //<! Reserved
179 volatile uint16_t LPMCR0; //<! Low Power Mode Control Register 0
180 } PWR_Obj;
181
182
185 typedef struct _PWR_Obj_ *PWR_Handle;
186
187
188 // **************************************************************************
189 // the globals
190
191
192 // **************************************************************************
193 // the function prototypes
194
195
198 extern void PWR_disableBrownOutReset(PWR_Handle pwrHandle);
199
200
203 extern void PWR_disableWatchDogInt(PWR_Handle pwrHandle);
204
205
208 extern void PWR_enableBrownOutReset(PWR_Handle pwrHandle);
209
210
213 extern void PWR_enableWatchDogInt(PWR_Handle pwrHandle);
214
215
220 extern PWR_Handle PWR_init(void *pMemory,const size_t numBytes);
221
222
226 extern void PWR_setLowPowerMode(PWR_Handle pwrHandle,const PWR_LowPowerMode_e lowPowerMode);
227
228
232 extern void PWR_setNumStandByClocks(PWR_Handle pwrHandle,const PWR_NumStandByClocks_e numClkCycles);
233
234
235 #ifdef __cplusplus
236 }
237 #endif // extern "C"
238
240 #endif // end of _PWR_H_ definition
241
PWR_NumStandByClocks_19
Denotes 19 standby clock cycles.
Definition: pwr.h:123
PWR_NumStandByClocks_51
Denotes 51 standby clock cycles.
Definition: pwr.h:155
PWR_NumStandByClocks_12
Denotes 12 standby clock cycles.
Definition: pwr.h:116
PWR_NumStandByClocks_5
Denotes 5 standby clock cycles.
Definition: pwr.h:109
PWR_NumStandByClocks_15
Denotes 15 standby clock cycles.
Definition: pwr.h:119
PWR_NumStandByClocks_35
Denotes 35 standby clock cycles.
Definition: pwr.h:139
PWR_NumStandByClocks_63
Denotes 63 standby clock cycles.
Definition: pwr.h:167
PWR_NumStandByClocks_38
Denotes 38 standby clock cycles.
Definition: pwr.h:142
PWR_Obj
struct _PWR_Obj_ PWR_Obj
Defines the power (PWR) object.
PWR_NumStandByClocks_29
Denotes 29 standby clock cycles.
Definition: pwr.h:133
PWR_NumStandByClocks_61
Denotes 61 standby clock cycles.
Definition: pwr.h:165
PWR_NumStandByClocks_22
Denotes 22 standby clock cycles.
Definition: pwr.h:126
PWR_NumStandByClocks_3
Denotes 3 standby clock cycles.
Definition: pwr.h:107
PWR_NumStandByClocks_23
Denotes 23 standby clock cycles.
Definition: pwr.h:127
PWR_NumStandByClocks_18
Denotes 18 standby clock cycles.
Definition: pwr.h:122
PWR_NumStandByClocks_53
Denotes 53 standby clock cycles.
Definition: pwr.h:157
_PWR_Obj_::BORCFG
volatile uint16_t BORCFG
BOR (Brown Out Reset) Configuration Register.
Definition: pwr.h:177
PWR_NumStandByClocks_25
Denotes 25 standby clock cycles.
Definition: pwr.h:129
PWR_NumStandByClocks_17
Denotes 17 standby clock cycles.
Definition: pwr.h:121
PWR_NumStandByClocks_8
Denotes 8 standby clock cycles.
Definition: pwr.h:112
PWR_NumStandByClocks_54
Denotes 54 standby clock cycles.
Definition: pwr.h:158
PWR_disableWatchDogInt
void PWR_disableWatchDogInt(PWR_Handle pwrHandle)
Disables the watchdog interrupt.
Definition: pwr.c:69
PWR_NumStandByClocks_37
Denotes 37 standby clock cycles.
Definition: pwr.h:141
PWR_LowPowerMode_Idle
Denotes the idle mode.
Definition: pwr.h:96
PWR_NumStandByClocks_64
Denotes 64 standby clock cycles.
Definition: pwr.h:168
PWR_NumStandByClocks_40
Denotes 40 standby clock cycles.
Definition: pwr.h:144
PWR_NumStandByClocks_13
Denotes 13 standby clock cycles.
Definition: pwr.h:117
PWR_NumStandByClocks_33
Denotes 33 standby clock cycles.
Definition: pwr.h:137
_PWR_Obj_
Defines the power (PWR) object.
Definition: pwr.h:175
_PWR_Obj_::rsvd_1
volatile uint16_t rsvd_1[26264]
Definition: pwr.h:178
PWR_NumStandByClocks_26
Denotes 26 standby clock cycles.
Definition: pwr.h:130
PWR_NumStandByClocks_21
Denotes 21 standby clock cycles.
Definition: pwr.h:125
PWR_NumStandByClocks_34
Denotes 34 standby clock cycles.
Definition: pwr.h:138
PWR_NumStandByClocks_36
Denotes 36 standby clock cycles.
Definition: pwr.h:140
PWR_NumStandByClocks_50
Denotes 50 standby clock cycles.
Definition: pwr.h:154
PWR_NumStandByClocks_7
Denotes 7 standby clock cycles.
Definition: pwr.h:111
PWR_init
PWR_Handle PWR_init(void *pMemory, const size_t numBytes)
Initializes the power (PWR) object handle.
Definition: pwr.c:113
PWR_NumStandByClocks_16
Denotes 16 standby clock cycles.
Definition: pwr.h:120
PWR_NumStandByClocks_11
Denotes 11 standby clock cycles.
Definition: pwr.h:115
PWR_LowPowerMode_e
PWR_LowPowerMode_e
Enumeration to define the power (PWR) low power modes.
Definition: pwr.h:94
PWR_NumStandByClocks_39
Denotes 39 standby clock cycles.
Definition: pwr.h:143
PWR_setLowPowerMode
void PWR_setLowPowerMode(PWR_Handle pwrHandle, const PWR_LowPowerMode_e lowPowerMode)
Sets the low power mode.
Definition: pwr.c:128
_PWR_Obj_::LPMCR0
volatile uint16_t LPMCR0
Definition: pwr.h:179
PWR_NumStandByClocks_28
Denotes 28 standby clock cycles.
Definition: pwr.h:132
PWR_setNumStandByClocks
void PWR_setNumStandByClocks(PWR_Handle pwrHandle, const PWR_NumStandByClocks_e numClkCycles)
Sets the number of standby clock cycles.
Definition: pwr.c:148
PWR_NumStandByClocks_43
Denotes 43 standby clock cycles.
Definition: pwr.h:147
PWR_NumStandByClocks_59
Denotes 59 standby clock cycles.
Definition: pwr.h:163
PWR_NumStandByClocks_55
Denotes 55 standby clock cycles.
Definition: pwr.h:159
PWR_NumStandByClocks_58
Denotes 58 standby clock cycles.
Definition: pwr.h:162
PWR_NumStandByClocks_e
PWR_NumStandByClocks_e
Enumeration to define the power (PWR) number of standby clock cycles.
Definition: pwr.h:104
PWR_NumStandByClocks_31
Denotes 31 standby clock cycles.
Definition: pwr.h:135
PWR_LowPowerMode_Halt
Denotes the halt mode.
Definition: pwr.h:98
PWR_NumStandByClocks_45
Denotes 45 standby clock cycles.
Definition: pwr.h:149
PWR_NumStandByClocks_56
Denotes 56 standby clock cycles.
Definition: pwr.h:160
PWR_NumStandByClocks_10
Denotes 10 standby clock cycles.
Definition: pwr.h:114
PWR_NumStandByClocks_46
Denotes 46 standby clock cycles.
Definition: pwr.h:150
PWR_NumStandByClocks_4
Denotes 4 standby clock cycles.
Definition: pwr.h:108
PWR_NumStandByClocks_27
Denotes 27 standby clock cycles.
Definition: pwr.h:131
PWR_NumStandByClocks_14
Denotes 14 standby clock cycles.
Definition: pwr.h:118
cpu.h
Contains public interface to various functions related to the central processing unit (CPU) object...
PWR_NumStandByClocks_65
Denotes 65 standby clock cycles.
Definition: pwr.h:169
PWR_NumStandByClocks_32
Denotes 32 standby clock cycles.
Definition: pwr.h:136
PWR_NumStandByClocks_49
Denotes 49 standby clock cycles.
Definition: pwr.h:153
PWR_NumStandByClocks_2
Denotes 2 standby clock cycles.
Definition: pwr.h:106
PWR_Handle
struct _PWR_Obj_ * PWR_Handle
Defines the power (PWR) handle.
Definition: pwr.h:185
PWR_NumStandByClocks_48
Denotes 48 standby clock cycles.
Definition: pwr.h:152
PWR_enableWatchDogInt
void PWR_enableWatchDogInt(PWR_Handle pwrHandle)
Enables the watchdog interrupt.
Definition: pwr.c:97
PWR_disableBrownOutReset
void PWR_disableBrownOutReset(PWR_Handle pwrHandle)
Disables the brownout reset functions.
Definition: pwr.c:57
PWR_NumStandByClocks_47
Denotes 47 standby clock cycles.
Definition: pwr.h:151
PWR_NumStandByClocks_44
Denotes 44 standby clock cycles.
Definition: pwr.h:148
PWR_NumStandByClocks_24
Denotes 24 standby clock cycles.
Definition: pwr.h:128
PWR_NumStandByClocks_62
Denotes 62 standby clock cycles.
Definition: pwr.h:166
PWR_NumStandByClocks_52
Denotes 52 standby clock cycles.
Definition: pwr.h:156
PWR_NumStandByClocks_41
Denotes 41 standby clock cycles.
Definition: pwr.h:145
PWR_NumStandByClocks_57
Denotes 57 standby clock cycles.
Definition: pwr.h:161
PWR_NumStandByClocks_6
Denotes 6 standby clock cycles.
Definition: pwr.h:110
PWR_NumStandByClocks_60
Denotes 60 standby clock cycles.
Definition: pwr.h:164
PWR_NumStandByClocks_20
Denotes 20 standby clock cycles.
Definition: pwr.h:124
PWR_LowPowerMode_Standby
Denotes the standby mode.
Definition: pwr.h:97
PWR_enableBrownOutReset
void PWR_enableBrownOutReset(PWR_Handle pwrHandle)
Enables the brownout reset functions.
Definition: pwr.c:85
PWR_NumStandByClocks_30
Denotes 30 standby clock cycles.
Definition: pwr.h:134
PWR_NumStandByClocks_9
Denotes 9 standby clock cycles.
Definition: pwr.h:113
PWR_NumStandByClocks_42
Denotes 42 standby clock cycles.
Definition: pwr.h:146