blob: 68ef98aa43037557baa2585229ffc872bfffd8ab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
/*
* Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later at the following locations:
*
* http://www.opensource.org/licenses/gpl-license.html
* http://www.gnu.org/copyleft/gpl.html
*/
////////////////////////////////////////////////////////////////////////////////
//! \addtogroup ddi_bc
//! @{
//
// Copyright (c) 2004-2005 SigmaTel, Inc.
//
//! \file ddi_bc_hw.h
//! \brief Internal header file for Battery Charger hardware operations.
//! \date 06/2005
//!
//! This file contains internal declarations for Battery Charger hardware
//! operations.
//!
//! \see ddi_bc.c and related files.
////////////////////////////////////////////////////////////////////////////////
#ifndef _DDI_BC_HW_H
#define _DDI_BC_HW_H
////////////////////////////////////////////////////////////////////////////////
// Definitions
////////////////////////////////////////////////////////////////////////////////
//! The enumeration of battery modes.
typedef enum _ddi_bc_BatteryMode {
DDI_BC_BATTERY_MODE_LI_ION_2_CELLS = 0,
DDI_BC_BATTERY_MODE_LI_ION_1_CELL = 1,
DDI_BC_BATTERY_MODE_2_CELLS = 2,
DDI_BC_BATTERY_MODE_1_CELL = 3
} ddi_bc_BatteryMode_t;
//! The enumeration of bias current sources.
typedef enum _ddi_bc_BiasCurrentSource {
DDI_BC_EXTERNAL_BIAS_CURRENT = 0,
DDI_BC_INTERNAL_BIAS_CURRENT = 1,
} ddi_bc_BiasCurrentSource_t;
////////////////////////////////////////////////////////////////////////////////
// Prototypes
////////////////////////////////////////////////////////////////////////////////
extern int ddi_bc_hwBatteryChargerIsEnabled(void);
extern ddi_bc_BatteryMode_t ddi_bc_hwGetBatteryMode(void);
extern ddi_bc_BiasCurrentSource_t ddi_bc_hwGetBiasCurrentSource(void);
extern ddi_bc_Status_t
ddi_bc_hwSetBiasCurrentSource(ddi_bc_BiasCurrentSource_t);
extern ddi_bc_Status_t ddi_bc_hwSetChargingVoltage(uint16_t);
extern uint16_t ddi_bc_hwGetBatteryVoltage(void);
extern int ddi_bc_hwPowerSupplyIsPresent(void);
extern uint16_t ddi_bc_hwSetMaxCurrent(uint16_t);
extern uint16_t ddi_bc_hwGetMaxCurrent(void);
extern uint16_t ddi_bc_hwSetCurrentThreshold(uint16_t);
extern uint16_t ddi_bc_hwGetCurrentThreshold(void);
extern int ddi_bc_hwChargerPowerIsOn(void);
extern void ddi_bc_hwSetChargerPower(int);
extern int ddi_bc_hwGetChargeStatus(void);
extern void ddi_bc_hwGetDieTemp(int16_t *, int16_t *);
extern ddi_bc_Status_t ddi_bc_hwGetBatteryTemp(uint16_t *);
uint8_t ddi_bc_hwCurrentToSetting(uint16_t);
uint16_t ddi_bc_hwSettingToCurrent(uint8_t);
uint16_t ddi_bc_hwExpressibleCurrent(uint16_t);
////////////////////////////////////////////////////////////////////////////////
//!
//! \brief Checks to see if the DCDC has been manually enabled
//!
//! \fntype Function
//!
//! \retval true if DCDC is ON, false if DCDC is OFF.
//!
////////////////////////////////////////////////////////////////////////////////
bool ddi_bc_hwIsDcdcOn(void);
////////////////////////////////////////////////////////////////////////////////
// End of file
////////////////////////////////////////////////////////////////////////////////
#endif // _DDI_BC_H
//! @}
|