/* Read Flash IDs. Vendor ID, Device ID, Device Density.  */
int32_t APS6408_ReadID(OSPI_HandleTypeDef *Ctx, uint8_t *ID, uint32_t LatencyCode)
/* Read Flash IDs. Vendor ID, Device ID, Device Density.  */
int32_t APS6408_ReadID(OSPI_HandleTypeDef *Ctx, uint8_t *ID, uint32_t LatencyCode)
{
  if (APS6408_ReadReg(Ctx, APS6408_MR1_ADDRESS, ID, LatencyCode) != APS6408_OK)
  {
    return APS6408_ERROR;
  }
  *ID &= (APS6408_MR1_VENDOR_ID);
  *(ID + 1) &= (APS6408_MR2_DEVICE_ID | APS6408_MR2_DENSITY);
  return APS6408_OK;
}