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

uint16_t ddi_bc_RampSetLimit ( uint16_t  u16Limit  ) 

Set the current limit.

Function

This function sets the current limit and implements it immediately.

Parameters:
[in] u16Limit The current limit.
Return values:
The expressible version of the limit.

Definition at line 197 of file ddi_bc_ramp.c.

References ddi_bc_hwExpressibleCurrent(), ddi_bc_RampStep(), and _ddi_bc_RampControl::u16Limit.

Referenced by ddi_bc_SetCurrentLimit().

{

      //--------------------------------------------------------------------------
      // Set the limit.
      //--------------------------------------------------------------------------

      g_RampControl.u16Limit = u16Limit;

      //--------------------------------------------------------------------------
      // Step the ramp. Note that we don't care if this function returns an error.
      // We're stepping the ramp to make sure it takes immediate effect, if
      // possible. But, for example, if the Battery Charger is not yet
      // initialized, it doesn't matter.
      //--------------------------------------------------------------------------

      ddi_bc_RampStep(0);

      //--------------------------------------------------------------------------
      // Compute and return the expressible limit.
      //--------------------------------------------------------------------------

      return (ddi_bc_hwExpressibleCurrent(u16Limit));

}


Generated by  Doxygen 1.6.0   Back to index