MT2523 API Reference  LinkIt SDK v4
battery_management.h
1 /* Copyright Statement:
2  *
3  * (C) 2005-2016 MediaTek Inc. All rights reserved.
4  *
5  * This software/firmware and related documentation ("MediaTek Software") are
6  * protected under relevant copyright laws. The information contained herein
7  * is confidential and proprietary to MediaTek Inc. ("MediaTek") and/or its licensors.
8  * Without the prior written permission of MediaTek and/or its licensors,
9  * any reproduction, modification, use or disclosure of MediaTek Software,
10  * and information contained herein, in whole or in part, shall be strictly prohibited.
11  * You may only use, reproduce, modify, or distribute (as applicable) MediaTek Software
12  * if you have agreed to and been bound by the applicable license agreement with
13  * MediaTek ("License Agreement") and been granted explicit permission to do so within
14  * the License Agreement ("Permitted User"). If you are not a Permitted User,
15  * please cease any access or use of MediaTek Software immediately.
16  * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
17  * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES
18  * ARE PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
19  * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
21  * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
22  * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
23  * SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
24  * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
25  * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
26  * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
27  * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
28  * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
29  * CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
30  * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE MEDIATEK SOFTWARE AT ISSUE,
31  * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
32  * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
33  */
34 
35 #ifndef __BATTERY_MANAGEMENT_H__
36 #define __BATTERY_MANAGEMENT_H__
37 
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 
73 #define BATTERY_INVALID_VALUE (-9999)
74 
85 typedef enum {
90 
92 typedef enum {
101 
103 typedef enum {
106 
118 typedef void(* battery_management_callback_t)(battery_management_event_t event, const void *data);
119 
129 
144 int32_t battery_management_get_battery_property(battery_property_t property);
145 
153 
159 
160 
161 #ifdef __cplusplus
162 }
163 #endif
164 
169 #endif /*__BATTERY_MANAGEMENT_H__*/
170 
Battery's average voltage.
Definition: battery_management.h:98
battery_property_t
Battery properties.
Definition: battery_management.h:92
Average charging current.
Definition: battery_management.h:94
battery_management_status_t battery_management_deinit(void)
This function deinitializes the battery management.
An error occurred during the function call.
Definition: battery_management.h:87
Charger existence status.
Definition: battery_management.h:95
Remaining battery capacity in an integer percentage form.
Definition: battery_management.h:93
battery_management_event_t
Battery management events.
Definition: battery_management.h:103
Charger type.
Definition: battery_management.h:96
Remaining battery capacity from 0 to 5 levels.
Definition: battery_management.h:99
Battery update event.
Definition: battery_management.h:104
battery_management_status_t battery_management_init(void)
This function initializes the battery management.
int32_t battery_management_get_battery_property(battery_property_t property)
This function gets the current information about the battery.
Battery temperature.
Definition: battery_management.h:97
The function call was successful.
Definition: battery_management.h:88
battery_management_status_t
This enum defines the return status of the battery management functions.
Definition: battery_management.h:85
battery_management_status_t battery_management_register_callback(battery_management_callback_t callback)
This function registers a callback function to receive the battery management event.
void(* battery_management_callback_t)(battery_management_event_t event, const void *data)
The prototype of the battery management callback function, which needs to be registered to receive th...
Definition: battery_management.h:118
An invalid parameter.
Definition: battery_management.h:86