コード例 #1
0
        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);
            }
        }
コード例 #2
0
        /// <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);
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        /// <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);
        }