Ejemplo n.º 1
0
        private bool ConfigureForMPSSE()
        {
            SPIChannelConfig channelConf = new SPIChannelConfig();

            channelConf.ClockRate     = 30 * 1000000;
            channelConf.LatencyTimer  = 1;
            channelConf.configOptions = (UInt32)(SPI_CONFIG_OPTION_MODE.MODE0) | (UInt32)(SPI_CONFIG_OPTION_CS.DBUS3) | (UInt32)(SPI_CONFIG_OPTION_CS_ACTIVE.LOW);
            channelConf.Pins          = 0;

            FTstat = libMPSSESPI.SPI_InitChannel(ft232handle, ref channelConf);
            if (FTstat != FTDI.FT_STATUS.FT_OK)
            {
                libMPSSESPI.Cleanup_libMPSSE();
            }

            options = (UInt32)(SPI_TRANSFER_OPTIONS_SIZE_IN_.BYTES) | (UInt32)(SPI_TRANSFER_OPTIONS_CHIPSELECT_.ENABLE) | (UInt32)(SPI_TRANSFER_OPTIONS_CHIPSELECT_.DISABLE);
            return(true);
        }
Ejemplo n.º 2
0
 public static extern FTDI.FT_STATUS SPI_InitChannel(IntPtr fthandle, ref SPIChannelConfig config);