Defines the PROM of the Ms5611Device.
コード例 #1
0
        public Ms5611Device(I2cDevice device, Ms5611Osr rate)
        {
            // Validate
            if (device == null) throw new ArgumentNullException(nameof(device));

            // Initialize members
            Hardware = device;
            Prom = new Ms5611PromData();
            Osr = rate;

            // Read current calibration data (potentially not stable until next reset)
            // We don't reset automatically so that it is possible for any ongoing tasks to complete
            ReadProm();
        }
コード例 #2
0
        public Ms5611Device(I2cDevice device, Ms5611Osr rate)
        {
            // Validate
            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }

            // Initialize members
            Hardware = device;
            Prom     = new Ms5611PromData();
            Osr      = rate;

            // Read current calibration data (potentially not stable until next reset)
            // We don't reset automatically so that it is possible for any ongoing tasks to complete
            ReadProm();
        }
コード例 #3
0
        public Ms5611Device(int busNumber, bool csb, Ms5611Osr rate,
                            I2cBusSpeed speed = I2cBusSpeed.FastMode, I2cSharingMode sharingMode = I2cSharingMode.Exclusive)
        {
            // Get address
            ChipSelectBit = csb;
            Address       = GetI2cAddress(csb);

            // Connect to hardware
            _hardware = I2cExtensions.Connect(busNumber, Address, speed, sharingMode);

            // Initialize members
            Prom = new Ms5611PromData();
            Osr  = rate;

            // Read current calibration data (potentially not stable until next reset)
            // We don't reset automatically so that it is possible for any ongoing tasks to complete
            ReadProm();
        }