/// <summary> /// Gets access to the Microchip Crownking PIC XML definition database. /// </summary> /// <remarks> /// The local database (if it exists) is used in favor of the Microchip MPLAB X IDE database. /// </remarks> /// <returns> /// The database descriptor or null if no database exists on the current system. /// </returns> public static PICCrownking GetDB() { if (currentDB == null) { currentDB = new PICCrownking(); if (LastError != DBErrorCode.NoError) { currentDB = null; } } return(currentDB); }
/// <summary> /// A PICCrownking extension method that gets a PIC descriptor. /// </summary> /// <param name="db">The PIC database to retrieve definition from.</param> /// <param name="iProcID">Identifier for the processor.</param> /// <returns> /// The PIC descriptor or null. /// </returns> public static IPICDescriptor GetPIC(this PICCrownking db, int iProcID) => db.GetPICAsXML(iProcID)?.ToObject <PIC_v1>().PICDescriptorInterface;
/// <summary> /// A PICCrownking extension method that gets a PIC descriptor. /// </summary> /// <param name="db">The PIC database to retrieve definition from.</param> /// <param name="sPICName">Name of the PIC.</param> /// <returns> /// The PIC descriptor or null. /// </returns> public static IPICDescriptor GetPIC(this PICCrownking db, string sPICName) => db.GetPICAsXML(sPICName)?.ToObject <PIC_v1>().PICDescriptorInterface;