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

ddi_bc_Status_t ddi_bc_SetBroken ( void   ) 

Declare the battery to be broken.

Function

This function forces the Battery Charger into the Broken state.

Return values:
DDI_BC_STATUS_SUCCESS If all goes well
DDI_BC_STATUS_NOT_INITIALIZED If the Battery Charger is not yet initialized.

For internal use only.

See also:
To view the function definition, see ddi_bc_api.c.
Function

This function forces the Battery Charger into the Broken state.

Return values:
DDI_BC_STATUS_SUCCESS If all goes well
DDI_BC_STATUS_NOT_INITIALIZED If the Battery Charger is not yet initialized.

Definition at line 279 of file ddi_bc_api.c.

References DDI_BC_BROKEN_CHARGING_TIMEOUT, ddi_bc_RampReset(), DDI_BC_STATE_BROKEN, DDI_BC_STATE_UNINITIALIZED, DDI_BC_STATUS_NOT_INITIALIZED, DDI_BC_STATUS_SUCCESS, and g_ddi_bc_State.

{

      //--------------------------------------------------------------------------
      // Check if we've been initialized yet.
      //--------------------------------------------------------------------------

      if (g_ddi_bc_State == DDI_BC_STATE_UNINITIALIZED) {
            return (DDI_BC_STATUS_NOT_INITIALIZED);
      }
      //--------------------------------------------------------------------------
      // Reset the current ramp. This will jam the current to zero and power off
      // the charging hardware.
      //--------------------------------------------------------------------------

      ddi_bc_RampReset();

      //--------------------------------------------------------------------------
      // Reset the state timer.
      //--------------------------------------------------------------------------

      g_ddi_bc_u32StateTimer = 0;

      //--------------------------------------------------------------------------
      // Move to the Broken state.
      //--------------------------------------------------------------------------

      ddi_bc_gBrokenReason = DDI_BC_BROKEN_CHARGING_TIMEOUT;

      g_ddi_bc_State = DDI_BC_STATE_BROKEN;

      //--------------------------------------------------------------------------
      // Return success.
      //--------------------------------------------------------------------------

      return (DDI_BC_STATUS_SUCCESS);

}


Generated by  Doxygen 1.6.0   Back to index