Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

ddi_bc.h File Reference


Detailed Description

Header file for the Battery Charger device driver.

Date:
06/2005
This file contains externally visible declarations for the Battery Charger device driver.

See also:
ddi_bc.c and related files.
Todo:
[PUBS] Add definitions for TBDs in this file.

Definition in file ddi_bc.h.

#include <linux/types.h>

Go to the source code of this file.

Classes

struct  _ddi_bc_Cfg
 Defines the battery charger configuration. More...

Defines

#define DDI_BC_ALKALINE_NIMH_CHARGING_VOLTAGE   1750
#define DDI_BC_EVENT_GROUP   (11<<10)
#define DDI_BC_LIION_CHARGING_VOLTAGE   4200
#define DDI_BC_MAX_RESTART_CYCLES   100

Typedefs

typedef enum _ddi_bc_BrokenReason ddi_bc_BrokenReason_t
typedef struct _ddi_bc_Cfg ddi_bc_Cfg_t
 Defines the battery charger configuration.
typedef enum _ddi_bc_State ddi_bc_State_t
 Defines battery charger states.
typedef enum _ddi_bc_Status ddi_bc_Status_t
 Status returned by Battery Charger functions.

Enumerations

enum  _ddi_bc_BrokenReason {
  DDI_BC_BROKEN_UNINITIALIZED = 0, DDI_BC_BROKEN_CHARGING_TIMEOUT = 1, DDI_BC_BROKEN_FORCED_BY_APPLICATION = 2, DDI_BC_BROKEN_EXTERNAL_BATTERY_VOLTAGE_DETECTED = 3,
  DDI_BC_BROKEN_NO_BATTERY_DETECTED = 4
}
enum  _ddi_bc_State {
  DDI_BC_STATE_UNINITIALIZED = 0, DDI_BC_STATE_BROKEN = 1, DDI_BC_STATE_DISABLED = 2, DDI_BC_STATE_WAITING_TO_CHARGE = 3,
  DDI_BC_STATE_CONDITIONING = 4, DDI_BC_STATE_CHARGING = 5, DDI_BC_STATE_TOPPING_OFF = 6, DDI_BC_STATE_DCDC_MODE_WAITING_TO_CHARGE = 7
}
 Defines battery charger states. More...
enum  _ddi_bc_Status {
  DDI_BC_STATUS_SUCCESS = 0, DDI_BC_STATUS_HARDWARE_DISABLED, DDI_BC_STATUS_BAD_BATTERY_MODE, DDI_BC_STATUS_CLOCK_GATE_CLOSED,
  DDI_BC_STATUS_NOT_INITIALIZED, DDI_BC_STATUS_ALREADY_INITIALIZED, DDI_BC_STATUS_BROKEN, DDI_BC_STATUS_NOT_BROKEN,
  DDI_BC_STATUS_NOT_DISABLED, DDI_BC_STATUS_BAD_ARGUMENT, DDI_BC_STATUS_CFG_BAD_BATTERY_TEMP_CHANNEL, DDI_BC_STATUS_CFG_BAD_CHARGING_VOLTAGE
}
 Status returned by Battery Charger functions. More...
enum  ddi_bc_Event_t {
  ddi_bc_MinEventCode = DDI_BC_EVENT_GROUP, ddi_bc_WaitingToChargeCode, ddi_bc_State_ConditioningCode, ddi_bc_State_Topping_OffCode,
  ddi_bc_State_BrokenCode, ddi_bc_SettingChargeCode, ddi_bc_RaisingDieTempAlarmCode, ddi_bc_DroppingDieTempAlarmCode,
  ddi_bc_MaxEventCode, ddi_bc_DcdcModeWaitingToChargeCode
}
 TBD. More...

Functions

ddi_bc_Status_t ddi_bc_ForceChargingToStart (void)
 Restart the charge cycle.
ddi_bc_BrokenReason_t ddi_bc_GetBrokenReason (void)
 Report the reason for being in the broken state.
uint16_t ddi_bc_GetCurrentLimit (void)
 Report the current limit.
uint32_t ddi_bc_GetCurrentRampSlope (void)
 Report the current ramp slope.
ddi_bc_State_t ddi_bc_GetState (void)
 Get the Battery Charger's current state.
uint32_t ddi_bc_GetStateMachinePeriod (void)
 Report the state machine period.
uint32_t ddi_bc_GetStateTime (void)
 Report the time spent in the present state (milliseconds).
ddi_bc_Status_t ddi_bc_Init (ddi_bc_Cfg_t *pCfg)
 Initialize the Battery Charger.
void ddi_bc_QueryCfg (ddi_bc_Cfg_t *pCfg)
 Report the Battery Charger configuration.
ddi_bc_Status_t ddi_bc_SetBroken (void)
 Declare the battery to be broken.
uint16_t ddi_bc_SetCurrentLimit (uint16_t u16Limit)
 Set the current limit.
uint16_t ddi_bc_SetCurrentThreshold (uint16_t u16Current)
 Set the current threshold.
ddi_bc_Status_t ddi_bc_SetDisable (void)
 Disable the Battery Charger.
ddi_bc_Status_t ddi_bc_SetEnable (void)
 Enable the Battery Charger.
ddi_bc_Status_t ddi_bc_SetFixed (void)
 Declare the battery to be fixed.
ddi_bc_Status_t ddi_bc_SetNewPeriodAndSlope (uint32_t u32StateMachinePeriod, uint16_t u16CurrentRampSlope)
 Set the battery charger state machine period.
void ddi_bc_ShutDown (void)
 Shut down the Battery Charger.
ddi_bc_Status_t ddi_bc_StateMachine (void)
 Advances the state machine.


Generated by  Doxygen 1.6.0   Back to index