コード例 #1
0
/*
Reset EEPROM and input register to factory default. Refer datasheet TABLE 4-2
Input value = 0, Voltage Reference = 1 (internal), Gain = 0, PowerDown = 0
*/
uint8_t mcp4728::eepromReset()
{
  _values[0] = _values[1] = _values[2] = _values[3] = 0;
  _intVref[0] = _intVref[0] = _intVref[0] = _intVref[0] = 1;
  _gain[0] = _gain[1] = _gain[2] = _gain[3] = 0;
  _powerDown[0] = _powerDown[0] = _powerDown[0] = _powerDown[0] = 0;
  return seqWrite();
}
コード例 #2
0
/*
Write values to each channel using SequencialWrite method.
This will update both input register and EEPROM value
Channel : 0-3, Values : 0-4095
*/
uint8_t mcp4728::eepromWrite(uint16_t value1, uint16_t value2, uint16_t value3, uint16_t value4)
{
  _valuesEp[0] = _values[0] = value1; 
  _valuesEp[1] = _values[1] = value2; 
  _valuesEp[2] = _values[2] = value3; 
  _valuesEp[3] = _values[3] = value4; 
  return seqWrite();
}
コード例 #3
0
void CfgExternalToolModel::initFormats() {
    QList<DocumentFormatId> ids = AppContext::getDocumentFormatRegistry()->getRegisteredFormats();

    DocumentFormatConstraints commonConstraints;
    commonConstraints.addFlagToSupport(DocumentFormatFlag_SupportWriting);
    commonConstraints.addFlagToExclude(DocumentFormatFlag_SingleObjectFormat);
    commonConstraints.addFlagToExclude(DocumentFormatFlag_CannotBeCreated);

    DocumentFormatConstraints seqWrite(commonConstraints);
    seqWrite.supportedObjectTypes += GObjectTypes::SEQUENCE;

    DocumentFormatConstraints seqRead(commonConstraints);
    seqRead.supportedObjectTypes += GObjectTypes::SEQUENCE;

    DocumentFormatConstraints msaWrite(commonConstraints);
    msaWrite.supportedObjectTypes += GObjectTypes::MULTIPLE_SEQUENCE_ALIGNMENT;

    DocumentFormatConstraints msaRead(commonConstraints);
    msaRead.supportedObjectTypes += GObjectTypes::MULTIPLE_SEQUENCE_ALIGNMENT;

    DocumentFormatConstraints annWrite(commonConstraints);
    annWrite.supportedObjectTypes += GObjectTypes::ANNOTATION_TABLE;

    DocumentFormatConstraints annRead(commonConstraints);
    annRead.supportedObjectTypes += GObjectTypes::ANNOTATION_TABLE;

    foreach(const DocumentFormatId& id, ids) {
        DocumentFormat* df = AppContext::getDocumentFormatRegistry()->getFormatById(id);

        if (df->checkConstraints(seqWrite)) {
            seqFormatsW[df->getFormatName()] = df->getFormatId();
        }

        if (df->checkConstraints(seqRead)) {
            seqFormatsR[df->getFormatName()] = df->getFormatId();
        }

        if (df->checkConstraints(msaWrite)) {
            msaFormatsW[df->getFormatName()] = df->getFormatId();
        }

        if (df->checkConstraints(msaRead)) {
            msaFormatsR[df->getFormatName()] = df->getFormatId();
        }

        if (df->checkConstraints(annWrite)) {
            annFormatsW[df->getFormatName()] = df->getFormatId();
        }

        if (df->checkConstraints(annRead)) {
            annFormatsR[df->getFormatName()] = df->getFormatId();
        }
    }
コード例 #4
0
/*
Write all input resistor values to EEPROM using SequencialWrite method.
This will update both input register and EEPROM value
This will also write current Vref, PowerDown, Gain settings to EEPROM
*/
uint8_t mcp4728::eepromWrite()
{
  return seqWrite();
}