当前位置: 首页>>代码示例>>C#>>正文


C# SPI类代码示例

本文整理汇总了C#中SPI的典型用法代码示例。如果您正苦于以下问题:C# SPI类的具体用法?C# SPI怎么用?C# SPI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SPI类属于命名空间,在下文中一共展示了SPI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NavXMXP_SPI

        public NavXMXP_SPI(SPI.Port port, byte updateRate = 50)
        {
            m_spi = new SPI(port);
            Thread.Sleep(250);
            //Read(DeviceRegister.WHOAMI, 2);
            //Read(DeviceRegister.WHOAMI, 2);
            Thread.Sleep(250);

        }
开发者ID:ThadHouse,项目名称:robotdotnet-wpilib,代码行数:9,代码来源:NavXMXP.cs

示例2: SystemParametersInfo

 public static extern int SystemParametersInfo(
     SPI Action,
     uint Param,
     ref int result,
     int updateIni
     );
开发者ID:slay22,项目名称:TrainstationAdvisor,代码行数:6,代码来源:NativeMethods.cs

示例3: TestADXRS450

 public TestADXRS450(SPI.Port port)
 {
     m_gyro = new ADXRS450_Gyro(port);
     m_port = (int)port;
     started = true;
 }
开发者ID:chopshop-166,项目名称:WPILib,代码行数:6,代码来源:TestADXRS450.cs

示例4: SystemParametersInfo

 public static extern bool SystemParametersInfo(SPI uiAction, uint uiParam, ref ANIMATIONINFO pvParam, SPIF fWinIni);
开发者ID:Biotronic,项目名称:ImmersiveGaming,代码行数:1,代码来源:User32.cs

示例5: LedStripLPD8806

    /// <summary>
    /// c'tor
    /// </summary>
    /// <param name="socket">the Gadgeteer socket that the strip is on</param>
    /// <param name="numLeds">the number of LEDs in the strip</param>
    public LedStripLPD8806(GT.Socket socket, int numLeds)
    {
        var spiConfig = new SPI.Configuration(Cpu.Pin.GPIO_NONE,
                                                            false, // chip select active state
                                                            0, // chip select setup time
                                                            0, // chip select hold time
                                                            false, // clock idle state
                                                            true, // clock edge (true = rising)
                                                            2000,   // 2mhz
                                                            SPI.SPI_module.SPI1
                                                            );

        // the protocol seems to be that we need to write 1 + (1 per 64 LEDs) bytes
        // at the end of each update (I've only tested this on a 32-LED strip)
        int latchBytes = ((numLeds + 63) / 64) * 3;
        mLedByteCount = numLeds * 3;

        mData = new byte[mLedByteCount + latchBytes];
        mNumLeds = numLeds;
        //        mLedStrip = new SPI(socket, spiConfig, SPI.Sharing.Exclusive, null);
        mLedStrip = new SPI(spiConfig);

        // start with all the LEDs off
        for (int i = 0; i < mLedByteCount; i++)
        {
            mData[i] = MASK;
        }

        // give the strip an inital poke of the latch bytes (no idea
        // why this is needed)
        mLedStrip.Write(new byte[latchBytes]);

        // push the initial values (all off) to the strip
        SendUpdate();
    }
开发者ID:joram,项目名称:Gadgeteer,代码行数:40,代码来源:LedStripLPD8806.cs

示例6: SpiController

 /// <summary>
 /// �R���X�g���N�^
 /// </summary>
 /// <param name="pin">SS�s��</param>
 /// <param name="module">SPI���W���[��</param>
 public SpiController(Cpu.Pin pin, SPI.SPI_module module)
 {
     SPI.Configuration config = new SPI.Configuration(pin, false, 1, 1, false, true, 200, module);
     spi = new SPI(config);
 }
开发者ID:shaga,项目名称:NETMF_Sample,代码行数:10,代码来源:SpiController.cs

示例7: _SystemParametersInfo_NONCLIENTMETRICS

 private static extern bool _SystemParametersInfo_NONCLIENTMETRICS(SPI uiAction, int uiParam, [In, Out] ref NONCLIENTMETRICS pvParam, SPIF fWinIni);
开发者ID:AlertProject,项目名称:Text-processing-bundle,代码行数:1,代码来源:NativeMethods.cs

示例8: SystemParametersInfo

 public static extern bool SystemParametersInfo(SPI uiAction, uint uiParam, ref MINIMIZEDMETRICS pvParam, uint fWinIni);
开发者ID:Foda,项目名称:Tide,代码行数:1,代码来源:User32.cs

示例9: MCP4131

        public byte Wiper_Reg; //Wiper Register

        public MCP4131(Cpu.Pin cs_pin, SPI.SPI_module mod)
        {
            MCP4131_Config = new SPI.Configuration(cs_pin, false, 0, 0, false, true, 800, mod);
            MCP4131_SPI = new SPI(MCP4131_Config);
        }
开发者ID:timdee,项目名称:cpre492,代码行数:7,代码来源:Source.cs

示例10: RegisterIO_SPI

 public RegisterIO_SPI(SPI spi_port, int bitrate)
 {
     port = spi_port;
     this.bitrate = bitrate;
 }
开发者ID:chopshop-166,项目名称:WPILib,代码行数:5,代码来源:RegisterIO_SPI.cs

示例11: TestADXL362

 public TestADXL362(SPI.Port port)
 {
     m_accel = new ADXL362(port, AccelerometerRange.k2G);
     m_port = (int) port;
     started = true;
 }
开发者ID:chopshop-166,项目名称:WPILib,代码行数:6,代码来源:TestADXL362.cs

示例12: SystemParametersInfo

 private static extern bool SystemParametersInfo(SPI uiAction, uint uiParam, IntPtr pvParam, SPIF fWinIni);
开发者ID:dremin,项目名称:cairoshell,代码行数:1,代码来源:WindowsTasksService.cs

示例13: SystemParametersInfo

 public static void SystemParametersInfo(SPI uiAction, int uiParam, string pvParam, SPIF fWinIni)
 {
     if (!_SystemParametersInfo_String(uiAction, uiParam, pvParam, fWinIni))
     {
         HRESULT.ThrowLastError();
     }
 }
开发者ID:AlertProject,项目名称:Text-processing-bundle,代码行数:7,代码来源:NativeMethods.cs

示例14: _SystemParametersInfo_HIGHCONTRAST

 private static extern bool _SystemParametersInfo_HIGHCONTRAST(SPI uiAction, int uiParam, [In, Out] ref HIGHCONTRAST pvParam, SPIF fWinIni);
开发者ID:AlertProject,项目名称:Text-processing-bundle,代码行数:1,代码来源:NativeMethods.cs

示例15: _SystemParametersInfo_String

 private static extern bool _SystemParametersInfo_String(SPI uiAction, int uiParam, [MarshalAs(UnmanagedType.LPWStr)] string pvParam, SPIF fWinIni);
开发者ID:AlertProject,项目名称:Text-processing-bundle,代码行数:1,代码来源:NativeMethods.cs


注:本文中的SPI类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。