MotorWare f2806x Driver API Documentation
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 
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 {
100 
101 
104 typedef enum
105 {
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 
Denotes 19 standby clock cycles.
Definition: pwr.h:123
Denotes 51 standby clock cycles.
Definition: pwr.h:155
Denotes 12 standby clock cycles.
Definition: pwr.h:116
Denotes 5 standby clock cycles.
Definition: pwr.h:109
Denotes 15 standby clock cycles.
Definition: pwr.h:119
Denotes 35 standby clock cycles.
Definition: pwr.h:139
Denotes 63 standby clock cycles.
Definition: pwr.h:167
Denotes 38 standby clock cycles.
Definition: pwr.h:142
struct _PWR_Obj_ PWR_Obj
Defines the power (PWR) object.
Denotes 29 standby clock cycles.
Definition: pwr.h:133
Denotes 61 standby clock cycles.
Definition: pwr.h:165
Denotes 22 standby clock cycles.
Definition: pwr.h:126
Denotes 3 standby clock cycles.
Definition: pwr.h:107
Denotes 23 standby clock cycles.
Definition: pwr.h:127
Denotes 18 standby clock cycles.
Definition: pwr.h:122
Denotes 53 standby clock cycles.
Definition: pwr.h:157
volatile uint16_t BORCFG
BOR (Brown Out Reset) Configuration Register.
Definition: pwr.h:177
Denotes 25 standby clock cycles.
Definition: pwr.h:129
Denotes 17 standby clock cycles.
Definition: pwr.h:121
Denotes 8 standby clock cycles.
Definition: pwr.h:112
Denotes 54 standby clock cycles.
Definition: pwr.h:158
void PWR_disableWatchDogInt(PWR_Handle pwrHandle)
Disables the watchdog interrupt.
Definition: pwr.c:69
Denotes 37 standby clock cycles.
Definition: pwr.h:141
Denotes the idle mode.
Definition: pwr.h:96
Denotes 64 standby clock cycles.
Definition: pwr.h:168
Denotes 40 standby clock cycles.
Definition: pwr.h:144
Denotes 13 standby clock cycles.
Definition: pwr.h:117
Denotes 33 standby clock cycles.
Definition: pwr.h:137
Defines the power (PWR) object.
Definition: pwr.h:175
volatile uint16_t rsvd_1[26264]
Definition: pwr.h:178
Denotes 26 standby clock cycles.
Definition: pwr.h:130
Denotes 21 standby clock cycles.
Definition: pwr.h:125
Denotes 34 standby clock cycles.
Definition: pwr.h:138
Denotes 36 standby clock cycles.
Definition: pwr.h:140
Denotes 50 standby clock cycles.
Definition: pwr.h:154
Denotes 7 standby clock cycles.
Definition: pwr.h:111
PWR_Handle PWR_init(void *pMemory, const size_t numBytes)
Initializes the power (PWR) object handle.
Definition: pwr.c:113
Denotes 16 standby clock cycles.
Definition: pwr.h:120
Denotes 11 standby clock cycles.
Definition: pwr.h:115
PWR_LowPowerMode_e
Enumeration to define the power (PWR) low power modes.
Definition: pwr.h:94
Denotes 39 standby clock cycles.
Definition: pwr.h:143
void PWR_setLowPowerMode(PWR_Handle pwrHandle, const PWR_LowPowerMode_e lowPowerMode)
Sets the low power mode.
Definition: pwr.c:128
volatile uint16_t LPMCR0
Definition: pwr.h:179
Denotes 28 standby clock cycles.
Definition: pwr.h:132
void PWR_setNumStandByClocks(PWR_Handle pwrHandle, const PWR_NumStandByClocks_e numClkCycles)
Sets the number of standby clock cycles.
Definition: pwr.c:148
Denotes 43 standby clock cycles.
Definition: pwr.h:147
Denotes 59 standby clock cycles.
Definition: pwr.h:163
Denotes 55 standby clock cycles.
Definition: pwr.h:159
Denotes 58 standby clock cycles.
Definition: pwr.h:162
PWR_NumStandByClocks_e
Enumeration to define the power (PWR) number of standby clock cycles.
Definition: pwr.h:104
Denotes 31 standby clock cycles.
Definition: pwr.h:135
Denotes the halt mode.
Definition: pwr.h:98
Denotes 45 standby clock cycles.
Definition: pwr.h:149
Denotes 56 standby clock cycles.
Definition: pwr.h:160
Denotes 10 standby clock cycles.
Definition: pwr.h:114
Denotes 46 standby clock cycles.
Definition: pwr.h:150
Denotes 4 standby clock cycles.
Definition: pwr.h:108
Denotes 27 standby clock cycles.
Definition: pwr.h:131
Denotes 14 standby clock cycles.
Definition: pwr.h:118
Contains public interface to various functions related to the central processing unit (CPU) object...
Denotes 65 standby clock cycles.
Definition: pwr.h:169
Denotes 32 standby clock cycles.
Definition: pwr.h:136
Denotes 49 standby clock cycles.
Definition: pwr.h:153
Denotes 2 standby clock cycles.
Definition: pwr.h:106
struct _PWR_Obj_ * PWR_Handle
Defines the power (PWR) handle.
Definition: pwr.h:185
Denotes 48 standby clock cycles.
Definition: pwr.h:152
void PWR_enableWatchDogInt(PWR_Handle pwrHandle)
Enables the watchdog interrupt.
Definition: pwr.c:97
void PWR_disableBrownOutReset(PWR_Handle pwrHandle)
Disables the brownout reset functions.
Definition: pwr.c:57
Denotes 47 standby clock cycles.
Definition: pwr.h:151
Denotes 44 standby clock cycles.
Definition: pwr.h:148
Denotes 24 standby clock cycles.
Definition: pwr.h:128
Denotes 62 standby clock cycles.
Definition: pwr.h:166
Denotes 52 standby clock cycles.
Definition: pwr.h:156
Denotes 41 standby clock cycles.
Definition: pwr.h:145
Denotes 57 standby clock cycles.
Definition: pwr.h:161
Denotes 6 standby clock cycles.
Definition: pwr.h:110
Denotes 60 standby clock cycles.
Definition: pwr.h:164
Denotes 20 standby clock cycles.
Definition: pwr.h:124
Denotes the standby mode.
Definition: pwr.h:97
void PWR_enableBrownOutReset(PWR_Handle pwrHandle)
Enables the brownout reset functions.
Definition: pwr.c:85
Denotes 30 standby clock cycles.
Definition: pwr.h:134
Denotes 9 standby clock cycles.
Definition: pwr.h:113
Denotes 42 standby clock cycles.
Definition: pwr.h:146