1 /*
2  * @brief LPC15xx Power ROM API declarations and functions
3  *
4  * @note
5  * Copyright(C) NXP Semiconductors, 2013
6  * All rights reserved.
7  *
8  * @par
9  * Software that is described herein is for illustrative purposes only
10  * which provides customers with programming information regarding the
11  * LPC products.  This software is supplied "AS IS" without any warranties of
12  * any kind, and NXP Semiconductors and its licensor disclaim any and
13  * all warranties, express or implied, including all implied warranties of
14  * merchantability, fitness for a particular purpose and non-infringement of
15  * intellectual property rights.  NXP Semiconductors assumes no responsibility
16  * or liability for the use of the software, conveys no license or rights under any
17  * patent, copyright, mask work right, or any other intellectual property rights in
18  * or to any products. NXP Semiconductors reserves the right to make changes
19  * in the software without notification. NXP Semiconductors also makes no
20  * representation or warranty that such application will be suitable for the
21  * specified use without further testing or modification.
22  *
23  * @par
24  * Permission to use, copy, modify, and distribute this software and its
25  * documentation is hereby granted, under NXP Semiconductors' and its
26  * licensor's relevant copyrights in the software, without fee, provided that it
27  * is used in conjunction with NXP Semiconductors microcontrollers.  This
28  * copyright, permission, and disclaimer notice must appear in all copies of
29  * this code.
30  */
31 
32 #ifndef __ROM_PWR_15XX_H_
33 #define __ROM_PWR_15XX_H_
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 /** @defgroup PWRROM_15XX CHIP: LPC15xx Power ROM API declarations and functions
40  * @ingroup ROMAPI_15XX
41  * @{
42  */
43 
44 /**
45  * @brief LPC15XX Power ROM APIs - set_pll mode options
46  */
47 #define CPU_FREQ_EQU    0
48 #define CPU_FREQ_LTE    1
49 #define CPU_FREQ_GTE    2
50 #define CPU_FREQ_APPROX 3
51 
52 /**
53  * @brief LPC15XX Power ROM APIs - set_pll response0 options
54  */
55 #define PLL_CMD_SUCCESS    0
56 #define PLL_INVALID_FREQ   1
57 #define PLL_INVALID_MODE   2
58 #define PLL_FREQ_NOT_FOUND 3
59 #define PLL_NOT_LOCKED     4
60 
61 /**
62  * @brief LPC15XX Power ROM APIs - set_power mode options
63  */
64 #define PWR_DEFAULT         0
65 #define PWR_CPU_PERFORMANCE 1
66 #define PWR_EFFICIENCY      2
67 #define PWR_LOW_CURRENT     3
68 
69 /**
70  * @brief LPC15XX Power ROM APIs - set_power response0 options
71  */
72 #define PWR_CMD_SUCCESS  0
73 #define PWR_INVALID_FREQ 1
74 #define PWR_INVALID_MODE 2
75 
76 /**
77  * @brief LPC15XX Power ROM APIs - power_mode_configure mode options
78  */
79 #define PMU_SLEEP           0
80 #define PMU_DEEP_SLEEP      1
81 #define PMU_POWERDOWN       2
82 #define PMU_DEEP_POWERDOWN  3
83 
84 /**
85  * @brief LPC15XX Power ROM APIs - power_mode_configure peripheral control bits
86  */
87 #define PMU_PD_WDOSC         (1 << 0)
88 #define PMU_PD_BOD           (1 << 1)
89 #define PMU_PD_ACMP0         (1 << 2)
90 #define PMU_PD_ACMP1         (1 << 3)
91 #define PMU_PD_ACMP2         (1 << 4)
92 #define PMU_PD_ACMP3         (1 << 5)
93 #define PMU_PD_IREF          (1 << 6)
94 #define PMU_PD_TS            (1 << 7)
95 
96 /**
97  * @brief LPC15xx Power ROM API structure
98  * The power profile API provides functions to configure the system clock and optimize the
99  * system setting for lowest power consumption.
100  */
101 typedef struct PWRD_API {
102 	void (*set_pll)(uint32_t cmd[], uint32_t resp[]);	/*!< Set PLL function */
103 	void (*set_power)(uint32_t cmd[], uint32_t resp[]);	/*!< Set power function */
104 	void (*power_mode_configure)(uint32_t power_mode, uint32_t peripheral_ctrl);/*!< Sets the chip is low power modes */
105 	void (*set_aclkgate)(uint32_t aclkgate);
106 	uint32_t (*get_aclkgate)(void);
107 } PWRD_API_T;
108 
109 /**
110  * @}
111  */
112 
113 #ifdef __cplusplus
114 }
115 #endif
116 
117 #endif /* __ROM_PWR_15XX_H_ */
118