Пример #1
0
//****************************************************************************//
// Set VCore level
// SetVCore level is called from the user API 
//****************************************************************************//
void SetVCore (unsigned char level)        // Note: change level by one step only
{
  unsigned char actLevel;
  do {
    actLevel = PMMCTL0_L & PMMCOREV_3;
    if (actLevel < level) 
      SetVCoreUp(++actLevel);               // Set VCore (step by step)
    if (actLevel > level) 
      SetVCoreDown(--actLevel);             // Set VCore (step by step)
  }while (actLevel != level);
}
Пример #2
0
/**************************************************************************************************
 * @fn          SetVCore
 *
 * @brief       SetVCore level is called from the user API. Change level by one step only.
 *
 * @param       level - VcCore level
 *
 * @return      none
 **************************************************************************************************
 */
static void SetVCore (uint8_t level)
{
  uint8_t actLevel;
  do {
    actLevel = PMMCTL0_L & PMMCOREV_3;
    if (actLevel < level)
      SetVCoreUp(++actLevel);               /* Set VCore (step by step) */
    if (actLevel > level)
      SetVCoreDown(--actLevel);             /* Set VCore (step by step) */
  }while (actLevel != level);
}
Пример #3
0
//****************************************************************************//
// Set VCore
//****************************************************************************//
unsigned int SetVCore (unsigned char level) {
   unsigned int actlevel;
   unsigned int status = 0;
  
   level &= PMMCOREV_3;                   // Set Mask for Max. level
   actlevel = (PMMCTL0 & PMMCOREV_3);     // Get actual VCore

   while (((level != actlevel) && (status == 0)) || (level < actlevel)) {  // step by step increase or decrease
      if (level > actlevel)
         status = SetVCoreUp(++actlevel);
      else
         status = SetVCoreDown(--actlevel);
   }
   return status;
}
Пример #4
0
uint16_t SetVCore (uint8_t level) {
	uint16_t actlevel;
	uint16_t status = 0;

	level &= PMMCOREV_3;                       // Set Mask for Max. level
	actlevel = (PMMCTL0 & PMMCOREV_3);         // Get actual VCore

	// step by step increase or decrease
	while ( ( (level != actlevel) && (status == 0) ) || (level < actlevel) ) {
		if (level > actlevel) {
			status = SetVCoreUp (++actlevel);
		} else {
			status = SetVCoreDown (--actlevel);
		}
	}

	return status;
}