protected internal override void CloseChannel(int chipIndex, int channelIndex) { // This assumes that PwmController has ensured that the chip is already open Windows10PwmDriverChip chip = _chipMap[chipIndex]; if (chip.CloseChannel(channelIndex)) { _chipMap.Remove(channelIndex); } }
/// <summary> /// Closes an open channel. /// </summary> /// <param name="pwmChip">The PWM chip.</param> /// <param name="pwmChannel">The PWM channel.</param> protected internal override void CloseChannel(int pwmChip, int pwmChannel) { // This assumes that PwmController has ensured that the chip is already open. Windows10PwmDriverChip chip = _chipMap[pwmChip]; if (chip.CloseChannel(pwmChannel)) { _chipMap.Remove(pwmChannel); } }
protected internal override void OpenChannel(int chipIndex, int channelIndex) { if (!_chipMap.TryGetValue(chipIndex, out Windows10PwmDriverChip chip)) { chip = new Windows10PwmDriverChip(chipIndex, useDefaultChip); _chipMap[chipIndex] = chip; } chip.OpenChannel(channelIndex); }
/// <summary> /// Opens a channel in order for it to be ready to use. /// </summary> /// <param name="pwmChip">The PWM chip.</param> /// <param name="pwmChannel">The PWM channel.</param> protected internal override void OpenChannel(int pwmChip, int pwmChannel) { if (!_chipMap.TryGetValue(pwmChip, out Windows10PwmDriverChip chip)) { chip = new Windows10PwmDriverChip(pwmChip, _useDefaultChip); _chipMap[pwmChip] = chip; } chip.OpenChannel(pwmChannel); }