예제 #1
0
 /// <summary>
 /// Returns the default settings for the given channel.
 /// </summary>
 /// <param name="channel"></param>
 /// <returns></returns>
 public static SmcChannelSettings defaults(SmcChannel channel)
 {
     if (channel.type() == SmcChannelType.Analog)
     {
         return(SmcChannelSettings.defaultAnalogSettings());
     }
     else
     {
         return(SmcChannelSettings.defaultRCSettings());
     }
 }
예제 #2
0
        /// <summary>
        /// Constructs a new SmcSettings object that has the default settings for a particular product.
        /// </summary>
        /// <param name="productId">The product ID of the device.  This determines the initial value of
        /// some product-dependent parameters like highVinShutoffMv.  Pass this argument as 0 if the
        /// product ID is unknown at this time.
        /// </param>
        public SmcSettings(UInt16 productId)
        {
            rc1           = SmcChannelSettings.defaultRCSettings();
            rc2           = SmcChannelSettings.defaultRCSettings();
            analog1       = SmcChannelSettings.defaultAnalogSettings();
            analog2       = SmcChannelSettings.defaultAnalogSettings();
            forwardLimits = new SmcMotorLimits();
            reverseLimits = new SmcMotorLimits();

            if (productId == 0x99 || productId == 0x9D)
            {
                // For the versions with 40V MOSFETs:
                this.highVinShutoffMv = 35000;
            }
            else
            {
                // For the versions with 30V MOSFETs:
                this.highVinShutoffMv = 25000;
            }
        }