/// <summary> /// Initializes a new instance of the <see cref="Max9744Amplifier" /> class. /// </summary> /// <param name="max9744Device">The max9744 device.</param> /// <param name="max9744AmplifierReporter">The max9744 amplifier reporter.</param> public Max9744Amplifier(Max9744Device max9744Device, IAmplifierReporter?max9744AmplifierReporter = null) { this.max9744Device = max9744Device; this.max9744AmplifierReporter = max9744AmplifierReporter; this.max9744AmplifierReporter?.SetSource(this); this.volumeRange = new Interval <byte>( (byte)(max9744Device.VolumeRange.Min + 10), (byte)(max9744Device.VolumeRange.Max - 10)); }
/// <summary> /// Creates the specified pin26 feature. /// </summary> /// <param name="amplifierReporter">The amplifier reporter.</param> /// <returns> /// The volume controls. /// </returns> public IAmplifier Create(IAmplifierReporter amplifierReporter) { // return new Amp(); var max9744Device = new Max9744Device( 0x4b, ConnectorPin.P1Pin07, ConnectorPin.P1Pin11, ProcessorPin.Pin02, ProcessorPin.Pin03, null, amplifierReporter); max9744Device.SetMuteState(true); max9744Device.SetShutdownState(false); var amplifier = new Max9744Amplifier(max9744Device, amplifierReporter); return(this.amplifiers.Add(amplifier, max9744Device)); }