/// <summary> /// Initializes a new instance of the SendRawPmBusRequest class. /// </summary> internal SendRawPmbusBase(bool enablePec, NodeManagerSmbusTransactionType transactionType, byte psuAddress, byte writeLenght, byte readLenght, byte[] pmbusCmd, byte addressFormat) { if (enablePec) { this.flags = 0xC0; } this.flags = (byte)(this.flags & addressFormat); // Flags: [3:1] � SMBUS message transaction type // The NodeManagerSmbusTransactionType enum has already been bit shifted. this.flags = (byte)(this.flags & (byte)transactionType); // Target PSU Address // [7:1] � 7-bit PSU SMBUS address // [0] � reserved should be set to 0 this.targetPsuAddress = (byte)(psuAddress << 1); // Write Length this.writeLenght = writeLenght; // Read Length this.readLenght = readLenght; // PMBUS Command if (pmbusCmd != null) { this.pmBusCommand = pmbusCmd; } else { this.pmBusCommand = new byte[0]; } }
/// <summary> /// Initializes a new instance of the SendRawPmbusStandardRequest class. /// </summary> internal SendRawPmbusStandardRequest(bool enablePec, NodeManagerSmbusTransactionType transactionType, byte psuAddress, byte muxPsuAddress, byte writeLenght, byte readLenght, byte[] pmbusCmd) : base(enablePec, transactionType, psuAddress, writeLenght, readLenght, pmbusCmd, standardFormat) { // MUX PSU address // [0:5] = Mux address // [6:7] = Reserved. Write as 00000b base.muxPsuAddress = (byte)(muxPsuAddress & 0x3F); }
/// <summary> /// Initializes a new instance of the SendRawPmbusStandardRequest class. /// </summary> internal SendRawPmbusExtendedRequest(bool enablePec, NodeManagerSmbusTransactionType transactionType, NodeManagerSensorBus sensorBus, byte psuAddress, byte muxPsuAddress, byte muxChannel, bool configureMux, byte writeLenght, byte readLenght, byte[] pmbusCmd) : base(enablePec, transactionType, psuAddress, writeLenght, readLenght, pmbusCmd, extendedFormat) { // Sensor Bus this.sensorBus = (byte)sensorBus; // 7-bit SMBUS address for SMBUS MUX or 0 for MGPIO controlled. base.muxPsuAddress = (byte)(muxPsuAddress << 1); // MUX channel selection this.muxChannel = muxChannel; if (configureMux) { this.configureMux = 0x01; } }
/// <summary> /// Initializes a new instance of the SendRawPmBusRequest class. /// </summary> internal SendRawPmbusBase(bool enablePec, NodeManagerSmbusTransactionType transactionType, byte psuAddress, byte writeLenght, byte readLenght, byte[] pmbusCmd, byte addressFormat) { if (enablePec) this.flags = 0xC0; this.flags = (byte)(this.flags & addressFormat); // Flags: [3:1] � SMBUS message transaction type // The NodeManagerSmbusTransactionType enum has already been bit shifted. this.flags = (byte)(this.flags & (byte)transactionType); // Target PSU Address // [7:1] � 7-bit PSU SMBUS address // [0] � reserved should be set to 0 this.targetPsuAddress = (byte)(psuAddress << 1); // Write Length this.writeLenght = writeLenght; // Read Length this.readLenght = readLenght; // PMBUS Command if (pmbusCmd != null) this.pmBusCommand = pmbusCmd; else this.pmBusCommand = new byte[0]; }
/// <summary> /// Initializes a new instance of the SendRawPmbusStandardRequest class. /// </summary> internal SendRawPmbusExtendedRequest(bool enablePec, NodeManagerSmbusTransactionType transactionType, NodeManagerSensorBus sensorBus, byte psuAddress, byte muxPsuAddress, byte muxChannel, bool configureMux, byte writeLenght, byte readLenght, byte[] pmbusCmd) : base(enablePec, transactionType, psuAddress, writeLenght, readLenght, pmbusCmd, extendedFormat) { // Sensor Bus this.sensorBus = (byte)sensorBus; // 7-bit SMBUS address for SMBUS MUX or 0 for MGPIO controlled. base.muxPsuAddress = (byte)(muxPsuAddress << 1); // MUX channel selection this.muxChannel = muxChannel; if (configureMux) this.configureMux = 0x01; }