本文整理汇总了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);
}
示例2: SystemParametersInfo
public static extern int SystemParametersInfo(
SPI Action,
uint Param,
ref int result,
int updateIni
);
示例3: TestADXRS450
public TestADXRS450(SPI.Port port)
{
m_gyro = new ADXRS450_Gyro(port);
m_port = (int)port;
started = true;
}
示例4: SystemParametersInfo
public static extern bool SystemParametersInfo(SPI uiAction, uint uiParam, ref ANIMATIONINFO pvParam, SPIF fWinIni);
示例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();
}
示例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);
}
示例7: _SystemParametersInfo_NONCLIENTMETRICS
private static extern bool _SystemParametersInfo_NONCLIENTMETRICS(SPI uiAction, int uiParam, [In, Out] ref NONCLIENTMETRICS pvParam, SPIF fWinIni);
示例8: SystemParametersInfo
public static extern bool SystemParametersInfo(SPI uiAction, uint uiParam, ref MINIMIZEDMETRICS pvParam, uint fWinIni);
示例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);
}
示例10: RegisterIO_SPI
public RegisterIO_SPI(SPI spi_port, int bitrate)
{
port = spi_port;
this.bitrate = bitrate;
}
示例11: TestADXL362
public TestADXL362(SPI.Port port)
{
m_accel = new ADXL362(port, AccelerometerRange.k2G);
m_port = (int) port;
started = true;
}
示例12: SystemParametersInfo
private static extern bool SystemParametersInfo(SPI uiAction, uint uiParam, IntPtr pvParam, SPIF fWinIni);
示例13: SystemParametersInfo
public static void SystemParametersInfo(SPI uiAction, int uiParam, string pvParam, SPIF fWinIni)
{
if (!_SystemParametersInfo_String(uiAction, uiParam, pvParam, fWinIni))
{
HRESULT.ThrowLastError();
}
}
示例14: _SystemParametersInfo_HIGHCONTRAST
private static extern bool _SystemParametersInfo_HIGHCONTRAST(SPI uiAction, int uiParam, [In, Out] ref HIGHCONTRAST pvParam, SPIF fWinIni);
示例15: _SystemParametersInfo_String
private static extern bool _SystemParametersInfo_String(SPI uiAction, int uiParam, [MarshalAs(UnmanagedType.LPWStr)] string pvParam, SPIF fWinIni);