/* Get factory calibration value for a given peripheral register.  */
bool SYSTEM_GetCalibrationValue(volatile uint32_t *regAddress)
/* Get factory calibration value for a given peripheral register.  */
bool SYSTEM_GetCalibrationValue(volatile uint32_t *regAddress)
{
  SYSTEM_CalAddrVal_TypeDef * p, * end;
  p   = (SYSTEM_CalAddrVal_TypeDef *)(DEVINFO_BASE & 0xFFFFF000);
  end = (SYSTEM_CalAddrVal_TypeDef *)DEVINFO_BASE;
  for ( ; p < end; p++)
  {
    if (p->address == 0xFFFFFFFF)
    {
      return false;
    }
    if (p->address == (uint32_t)regAddress)
    {
      *regAddress = p->calValue;
      return true;
    }
  }
  return false;
}