PDL for FM4  Version1.2
Peripheral Driverl Library for FM4
lpm.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright (C) 2013 Spansion LLC. All Rights Reserved.
3 *
4 * This software is owned and published by:
5 * Spansion LLC, 915 DeGuigne Dr. Sunnyvale, CA 94088-3453 ("Spansion").
6 *
7 * BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
8 * BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
9 *
10 * This software contains source code for use with Spansion
11 * components. This software is licensed by Spansion to be adapted only
12 * for use in systems utilizing Spansion components. Spansion shall not be
13 * responsible for misuse or illegal use of this software for devices not
14 * supported herein. Spansion is providing this software "AS IS" and will
15 * not be responsible for issues arising from incorrect user implementation
16 * of the software.
17 *
18 * SPANSION MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
19 * REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
20 * ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
21 * WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
22 * WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
23 * WARRANTY OF NONINFRINGEMENT.
24 * SPANSION SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
25 * NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
26 * LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
27 * LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
28 * INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
29 * INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
30 * SAVINGS OR PROFITS,
31 * EVEN IF SPANSION HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
32 * YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
33 * INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
34 * FROM, THE SOFTWARE.
35 *
36 * This software may be replicated in part or whole for the licensed use,
37 * with the restriction that this Disclaimer and Copyright notice must be
38 * included with each copy of this software, whether used in part or whole,
39 * at all times.
40 */
41 /******************************************************************************/
51 #ifndef __LPM_H__
52 #define __LPM_H__
53 
54 /******************************************************************************/
55 /* Include files */
56 /******************************************************************************/
57 #include "pdl.h"
58 
59 #if (defined(PDL_PERIPHERAL_LPM_ACTIVE))
60 
61 /* C binding of definitions if building with C++ compiler */
62 #ifdef __cplusplus
63 extern "C"
64 {
65 #endif
66 
146 
147 /******************************************************************************/
148 /* Global pre-processor symbols/macros ('#define')
149  ******************************************************************************/
150 
151 // 8-Bit Backup Register address offset
152 #define PDL_u8BREG00 0u
153 #define PDL_u8BREG01 1u
154 #define PDL_u8BREG02 2u
155 #define PDL_u8BREG03 3u
156 #define PDL_u8BREG04 4u
157 #define PDL_u8BREG05 5u
158 #define PDL_u8BREG06 6u
159 #define PDL_u8BREG07 7u
160 #define PDL_u8BREG08 8u
161 #define PDL_u8BREG09 9u
162 #define PDL_u8BREG0A 10u
163 #define PDL_u8BREG0B 11u
164 #define PDL_u8BREG0C 12u
165 #define PDL_u8BREG0D 13u
166 #define PDL_u8BREG0E 14u
167 #define PDL_u8BREG0F 15u
168 #define PDL_u8BREG10 16u
169 #define PDL_u8BREG11 17u
170 #define PDL_u8BREG12 18u
171 #define PDL_u8BREG13 19u
172 #define PDL_u8BREG14 20u
173 #define PDL_u8BREG15 21u
174 #define PDL_u8BREG16 22u
175 #define PDL_u8BREG17 23u
176 #define PDL_u8BREG18 24u
177 #define PDL_u8BREG19 25u
178 #define PDL_u8BREG1A 26u
179 #define PDL_u8BREG1B 27u
180 #define PDL_u8BREG1C 28u
181 #define PDL_u8BREG1D 29u
182 #define PDL_u8BREG1E 30u
183 #define PDL_u8BREG1F 31u
184 
185 // 16-Bit Backup Register address offset
186 #define PDL_u16BREG00 0u
187 #define PDL_u16BREG02 2u
188 #define PDL_u16BREG04 4u
189 #define PDL_u16BREG06 6u
190 #define PDL_u16BREG08 8u
191 #define PDL_u16BREG0A 10u
192 #define PDL_u16BREG0C 12u
193 #define PDL_u16BREG0E 14u
194 #define PDL_u16BREG10 16u
195 #define PDL_u16BREG12 18u
196 #define PDL_u16BREG14 20u
197 #define PDL_u16BREG16 22u
198 #define PDL_u16BREG18 24u
199 #define PDL_u16BREG1A 26u
200 #define PDL_u16BREG1C 28u
201 #define PDL_u16BREG1E 30u
202 
203 // 32-Bit Backup Register address offset
204 #define PDL_u32BREG00 0u
205 #define PDL_u32BREG04 4u
206 #define PDL_u32BREG08 8u
207 #define PDL_u32BREG0C 12u
208 #define PDL_u32BREG10 16u
209 #define PDL_u32BREG14 20u
210 #define PDL_u32BREG18 24u
211 #define PDL_u32BREG1C 28u
212 
213 /******************************************************************************
214  * Global type definitions
215  ******************************************************************************/
216  typedef struct stc_backupreg
217  {
218  uint8_t u8BREG00;
219  uint8_t u8BREG01;
220  uint8_t u8BREG02;
221  uint8_t u8BREG03;
222  uint8_t u8BREG04;
223  uint8_t u8BREG05;
224  uint8_t u8BREG06;
225  uint8_t u8BREG07;
226  uint8_t u8BREG08;
227  uint8_t u8BREG09;
228  uint8_t u8BREG0A;
229  uint8_t u8BREG0B;
230  uint8_t u8BREG0C;
231  uint8_t u8BREG0D;
232  uint8_t u8BREG0E;
233  uint8_t u8BREG0F;
234  uint8_t u8BREG10;
235  uint8_t u8BREG11;
236  uint8_t u8BREG12;
237  uint8_t u8BREG13;
238  uint8_t u8BREG14;
239  uint8_t u8BREG15;
240  uint8_t u8BREG16;
241  uint8_t u8BREG17;
242  uint8_t u8BREG18;
243  uint8_t u8BREG19;
244  uint8_t u8BREG1A;
245  uint8_t u8BREG1B;
246  uint8_t u8BREG1C;
247  uint8_t u8BREG1D;
248  uint8_t u8BREG1E;
249  uint8_t u8BREG1F;
250  } stc_backupreg_t;
251 
252 /******************************************************************************/
253 /* Global variable definitions ('extern') */
254 /******************************************************************************/
255 
256 
257 /******************************************************************************/
258 /* Global function prototypes (definition in C source) */
259 /******************************************************************************/
260 
261  #if (defined(PDL_PERIPHERAL_CLK_ACTIVE)) && (defined(PDL_PERIPHERAL_EXINT_ACTIVE))
262 
263 extern en_result_t Lpm_SetHsCrSleep(boolean_t bDisablePllClock,
264  boolean_t bDisableSubClock) ;
265 
266 extern en_result_t Lpm_SetMainSleep(boolean_t bDisablePllClock,
267  boolean_t bDisableSubClock) ;
268 
269 extern en_result_t Lpm_SetPllSleep(boolean_t bDisableSubClock) ;
270 
271 extern en_result_t Lpm_SetLsCrSleep(boolean_t bDisablePllMainClock,
272  boolean_t bDisableSubClock) ;
273 
274 extern en_result_t Lpm_SetSubSleep(boolean_t bDisablePllMainClock) ;
275 
276 extern en_result_t Lpm_SetHsCrTimer(boolean_t bDisablePllMainClock,
277  boolean_t bDisableSubClock) ;
278 
279 extern en_result_t Lpm_SetMainTimer(boolean_t bDisablePllClock,
280  boolean_t bDisableSubClock) ;
281 
282 extern en_result_t Lpm_SetPllTimer(boolean_t bDisableSubClock) ;
283 
284 extern en_result_t Lpm_SetLsCrTimer(boolean_t bDisablePllMainClock,
285  boolean_t bDisableSubClock) ;
286 
287 extern en_result_t Lpm_SetSubTimer(boolean_t bDisablePllMainClock) ;
288 
289 extern en_result_t Lpm_SetRtcMode(void) ;
290 
291 extern en_result_t Lpm_SetStopMode(void) ;
292 
293 extern en_result_t Lpm_SetDeepRtcMode(void) ;
294 
295 extern en_result_t Lpm_SetDeepStopMode(void) ;
296 
297 #endif // #if (defined(PDL_PERIPHERAL_CLK_ACTIVE)) && (defined(PDL_PERIPHERAL_EXINT_ACTIVE))
298 
300 
302 
303 extern en_result_t Lpm_Read_u8DataBackupRegister(uint8_t u8AddressOffset, uint8_t* u8Data) ;
304 
305 extern en_result_t Lpm_Write_u8DataBackupRegister(uint8_t u8AddressOffset, uint8_t u8Data) ;
306 
307 extern en_result_t Lpm_Read_u16DataBackupRegister(uint8_t u8AddressOffset, uint16_t* u16Data) ;
308 
309 extern en_result_t Lpm_Write_u16DataBackupRegister(uint8_t u8AddressOffset, uint16_t u16Data) ;
310 
311 extern en_result_t Lpm_Read_u32DataBackupRegister(uint8_t u8AddressOffset, uint32_t* u32Data) ;
312 
313 extern en_result_t Lpm_Write_u32DataBackupRegister(uint8_t u8AddressOffset, uint32_t u32Data) ;
314 
316 
317 #ifdef __cplusplus
318 }
319 #endif
320 
321 #endif // #if (defined(PDL_PERIPHERAL_LPM_ACTIVE))
322 
323 #endif /* __LPM_H__ */
324 /******************************************************************************/
325 /* EOF (not truncated) */
326 /******************************************************************************/