Пример #1
0
        /// <summary>
        /// Creates a new instance of Lis302Dl class
        /// </summary>
        /// <param name="csPin">CS pin for SPI interface</param>
        /// <param name="spiModule">SPI module</param>
        /// <param name="Clock_Rate_KHZ">SPI clock rate (defaults to 1 MHz in other constructors)</param>
        /// <param name="config">LIS302DL configuration</param>
        public Lis302Dl(Cpu.Pin csPin, SPI.SPI_module spiModule, uint Clock_Rate_KHZ, Lis302Dl.Configuration config)
        {
            SPI.Configuration spiConfig = new SPI.Configuration(csPin, false, 0, 0, true, true, Clock_Rate_KHZ, spiModule);
            _spi = new SPI(spiConfig);

            this.config = config;
            Init();
        }
Пример #2
0
        /// <summary>
        /// Creates a new instance of Lis302Dl class
        /// </summary>
        /// <param name="csPin">CS pin for SPI interface</param>        
        /// <param name="config">LIS302DL configuration</param>
        public Lis302Dl(Cpu.Pin csPin, Lis302Dl.Configuration config)
        {
            // The 302DL is a mode 3 device
            SPI.Configuration spiConfig = new SPI.Configuration(csPin, false, 0, 0, true, true, 10000, SPI.SPI_module.SPI1);
            _spi = new SPI(spiConfig);

            this.config = config;
            Init();
        }