コード例 #1
0
ファイル: pmm.c プロジェクト: JustBeFine/panstamp
//****************************************************************************//
// 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
ファイル: hal_pmm.c プロジェクト: ShimmerResearch/shimmer3
//****************************************************************************//
// 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
ファイル: HAL_PMM.c プロジェクト: imran27/myfiles
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;
}