/* Reads the 128-bit unique chip ID via an IAP call.  */
err_t iapReadUID(uint32_t uid[])
/* Reads the 128-bit unique chip ID via an IAP call.  */
err_t iapReadUID(uint32_t uid[])
{
  unsigned int command[5] = {58};
  unsigned int response[5] = { 0 };
  __disable_irq();
  iap_entry(command, response);
  __enable_irq();
  memcpy(uid, &response[1], 16);
  return ERROR_NONE;
}