Exemple #1
0
        /// <summary>
        ///   Initializes SPI connection and control pins
        /// </summary>
        public void Initialize(SPI spi, OutputPort chipEnablePin, InterruptPort interruptPort)
        {
            // Chip Select : Active Low
            // Clock : Active High, Data clocked in on rising edge
            _spiPort = spi;

            // Initialize IRQ Port
            _irqPin              = interruptPort;
            _irqPin.OnInterrupt += HandleInterrupt;

            // Initialize Chip Enable Port
            _cePin = chipEnablePin;

            // Module reset time
            Thread.Sleep(100);

            _initialized = true;
        }
        /// <summary>
        ///   Initializes SPI connection and control pins
        /// </summary>
        public void Initialize(SPI spi, OutputPort chipEnablePin, InterruptPort interruptPort)
        {
            // Chip Select : Active Low
            // Clock : Active High, Data clocked in on rising edge
            _spiPort = spi;

            // Initialize IRQ Port
            _irqPin = interruptPort;
            _irqPin.OnInterrupt += HandleInterrupt;

            // Initialize Chip Enable Port
            _cePin = chipEnablePin;

            // Module reset time
            Thread.Sleep(100);

            _initialized = true;
        }