• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SPI类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: AHRS

 /// <summary>
 /// Constructs the AHRS class using SPI Communication, overriding the SPI bitrate.
 /// </summary>
 /// <remarks>
 /// The update rate may be between 4 Hz and 60 Hz, representing the number
 /// of updates per second sent by the sensor.
 /// <para/>
 /// This constructor should be used if communicating via SPI.
 /// <para/>
 /// Note that increasing the update rate may increase the CPU utilization.
 /// </remarks>
 /// <param name="spiPortId">The <see cref="SPI.Port">SPI Port</see> to use.</param>
 /// <param name="spiBitrate">The SPI bitrate to use (bits/seconds) (Maximum: 2,000,000)</param>
 /// <param name="updateRateHz">The Update Rate (Hz) [4..60] (Default 50)</param>
 public AHRS(SPI.Port spiPortId, int spiBitrate, byte updateRateHz = NavxDefaultUpdateRateHz)
 {
     CommonInit(updateRateHz);
     if (RobotBase.IsSimulation)
     {
         m_io = new SimulatorIO(updateRateHz, m_ioCompleteSink, m_boardCapabilities);
     }
     else
     {
         m_io = new RegisterIO(new RegisterIO_SPI(new SPI(spiPortId), spiBitrate), updateRateHz, m_ioCompleteSink,
             m_boardCapabilities);
     }
     m_ioThread.Start();
 }
开发者ID:chopshop-166,项目名称:WPILib,代码行数:28,代码来源:AHRS.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SPIF类代码示例发布时间:2022-05-24
下一篇:
C# SPFolder类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap