Esempio n. 1
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.
        /// Pass this argument as 0 if the product ID is unknown at this time.
        /// </param>
        public SmcSettings(UInt16 productId)
        {
            this.productId = productId;
            rc1            = SmcChannelSettings.defaultRCSettings();
            rc2            = SmcChannelSettings.defaultRCSettings();
            analog1        = SmcChannelSettings.defaultAnalogSettings();
            analog2        = SmcChannelSettings.defaultAnalogSettings();
            forwardLimits  = new SmcMotorLimits();
            reverseLimits  = new SmcMotorLimits();

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

            switch (productId)
            {
            case 0xA3: currentLimit = 921; break;

            case 0xA5: currentLimit = 1096; break;

            default:
            case 0xA7: currentLimit = 776; break;

            case 0xA9: currentLimit = 1153; break;
            }
        }
Esempio n. 2
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());
     }
 }