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

ddi_bc_Status_t ddi_bc_SetDisable ( void   ) 

Disable the Battery Charger.

Function

This function forces the Battery Charger into the Disabled 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 Disabled 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 170 of file ddi_bc_api.c.

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

Referenced by ddi_bc_SetNewPeriodAndSlope().

{

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

      if (g_ddi_bc_State == DDI_BC_STATE_UNINITIALIZED) {
            return (DDI_BC_STATUS_NOT_INITIALIZED);
      }
      //--------------------------------------------------------------------------
      // Check if we've been initialized yet.
      //--------------------------------------------------------------------------

      if (g_ddi_bc_State == DDI_BC_STATE_BROKEN) {
            return (DDI_BC_STATUS_BROKEN);
      }
      //--------------------------------------------------------------------------
      // 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 Disabled state.
      //--------------------------------------------------------------------------

      g_ddi_bc_State = DDI_BC_STATE_DISABLED;

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

      return (DDI_BC_STATUS_SUCCESS);

}


Generated by  Doxygen 1.6.0   Back to index