IPC API  3.40.00.06
IpcPower.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2013, 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  */
37 #ifndef ti_pm_IpcPower__include
38 #define ti_pm_IpcPower__include
39 
40 #if defined (__cplusplus)
41 extern "C" {
42 #endif
43 
44 
45 /* =============================================================================
46  * Structures & Definitions
47  * =============================================================================
48  */
49 
54 #define IpcPower_S_SUCCESS (0)
55 
60 #define IpcPower_E_FAIL (-1)
61 
66 #define IpcPower_E_MEMORY (-2)
67 
71 typedef enum IpcPower_Event {
75 
79 typedef Void (*IpcPower_CallbackFuncPtr)(Int event, Ptr data);
80 
86 typedef struct IpcPower_WugenEvtMask {
87  UInt32 mevt0;
88  UInt32 mevt1;
90 
91 /* =============================================================================
92  * IpcPower Functions:
93  * =============================================================================
94  */
95 
101 Void IpcPower_init();
102 
108 Void IpcPower_exit();
109 
113 Void IpcPower_suspend();
114 
120 Void IpcPower_wakeLock();
121 
127 Void IpcPower_wakeUnlock();
128 
135 
142 
148 Bool IpcPower_canHibernate();
149 
162  Ptr data);
163 
175 
184 
198 
199 #if defined (__cplusplus)
200 }
201 #endif /* defined (__cplusplus) */
202 
203 #endif /* ti_ipc_IpcPower__include */
UInt32 mevt0
Definition: IpcPower.h:87
struct IpcPower_WugenEvtMask IpcPower_WugenEvtMask
Type representing OMAP's WUGEN_MEVT[0|1] registers.
Void IpcPower_wakeUnlock()
Enable the core to go to deep sleep mode.
Definition: IpcPower.h:72
Void IpcPower_suspend()
Initiate the suspend procedure.
Void IpcPower_wakeLock()
Disable the deep sleep mode in the core.
Definition: IpcPower.h:73
UInt IpcPower_hibernateUnlock()
Enable the core to go to suspend / hibernate.
IpcPower_Event
Event types for power management callbacks.
Definition: IpcPower.h:71
UInt32 mevt1
Definition: IpcPower.h:88
Bool IpcPower_canHibernate()
Return TRUE if hibernation is allowed.
Type representing OMAP's WUGEN_MEVT[0|1] registers.
Definition: IpcPower.h:86
Int IpcPower_registerCallback(Int event, IpcPower_CallbackFuncPtr fxn, Ptr data)
Register callback function for a Power event.
Int IpcPower_unregisterCallback(Int event, IpcPower_CallbackFuncPtr fxn)
Unregister callback function for a Power event.
Void IpcPower_setWugenEvtMask(IpcPower_WugenEvtMask *mask)
Set WUGEN mask used for suspend.
IpcPower_Event event
Definition: _IpcPower.h:122
Void IpcPower_getWugenEvtMask(IpcPower_WugenEvtMask *mask)
Retrieve current WUGEN mask used for suspend.
Ptr data
Definition: _IpcPower.h:124
UInt IpcPower_hibernateLock()
Disable the core to go to suspend / hibernate.
Void IpcPower_init()
Initialize the IpcPower module.
Void(* IpcPower_CallbackFuncPtr)(Int event, Ptr data)
Power Event Callback function type definition.
Definition: IpcPower.h:79
Void IpcPower_exit()
Finalize the IpcPower module.
Copyright 2015, Texas Instruments Incorporated