Example #1
0
        public void DisableSPI()
        {
            if (spi == null)
            {
                return;
            }

            spi.Dispose();
            spi = null;
        }
Example #2
0
        public void EnableSPI(bcm2835SPIMode DataMode             = bcm2835SPIMode.BCM2835_SPI_MODE1,
                              bcm2835SPIClockDivider ClockDivider = bcm2835SPIClockDivider.BCM2835_SPI_CLOCK_DIVIDER_256,
                              bcm2835SPIChipSelect ChipSelect     = bcm2835SPIChipSelect.BCM2835_SPI_CS0,
                              bool ChipSelectPolarity             = false)
        {
            if (spi != null)
            {
                spi.Dispose();
            }

            spi = new RaspSPI(DataMode, ClockDivider, ChipSelect, ChipSelectPolarity);
        }
Example #3
0
        public void EnableSPI(SPIMode DataMode             = SPIMode.MODE1,
                              SPIBitOrder BitOrder         = SPIBitOrder.Order_MSBFIRST,
                              SPIClockDivider ClockDivider = SPIClockDivider.Divider_256,
                              ChipSelect ChipSelect        = ChipSelect.CS0,
                              bool ChipSelectPolarity      = false)
        {
            if (spi != null)
            {
                spi.Dispose();
            }

            spi = new RaspSPI(DataMode, BitOrder, ClockDivider, ChipSelect, ChipSelectPolarity);
        }