• 大小: 4.45MB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2023-10-29
  • 语言: 其他
  • 标签: USB  SPI  STM32  VC  C++  

资源简介

USB转SPI上位机源码 USB转SPI上位机源码 USB转SPI上位机源码 USB转SPI上位机源码

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices; // 用 DllImport 需用此 命名空间

namespace test
{
    
    public partial class Form1 : Form
    {
        //关于dll中函数的说明请查阅USB2UARTSPIIICDLL.h文件
        [DllImport(“USB2UARTSPIIICDLL.dll“ CallingConvention = CallingConvention.Cdecl)]
        public static extern bool OpenUsb(int UsbIndex);

        [DllImport(“USB2UARTSPIIICDLL.dll“ CallingConvention = CallingConvention.Cdecl)]
        public static extern bool CloseUSB(int UsbIndex);

        [DllImport(“USB2UARTSPIIICDLL.dll“ CallingConvention = CallingConvention.Cdecl)]
        public static extern bool ConfigUARTParam (uint baudRateuint parityuint stopBitsint UsbIndex);

        [DllImport(“USB2UARTSPIIICDLL.dll“ CallingConvention = CallingConvention.Cdecl)]
        public static extern bool ConfigSPIParam(uint rateuint fistBituint subModeint UsbIndex);

        [DllImport(“USB2UARTSPIIICDLL.dll“ CallingConvention = CallingConvention.Cdecl)]
        public static extern bool ConfigSPIParamSlave(uint CSEnuint fistBituint subModeint UsbIndex);

        [DllImport(“USB2UARTSPIIICDLL.dll“ CallingConvention = CallingConvention.Cdecl)]
        public static extern bool ConfigIICParam(uint rateint UsbIndex);

        [DllImport(“USB2UARTSPIIICDLL.dll“ CallingConvention = CallingConvention.Cdecl)]
        public static extern bool ConfigIICParamSlave(byte addrint UsbIndex);

        [DllImport(“USB2UARTSPIIICDLL.dll“ CallingConvention = CallingConvention.Cdecl)]
        public static extern bool UARTSendData(byte[] sendBuf uint lenint UsbIndex);

        [DllImport(“USB2UARTSPIIICDLL.dll“ CallingConvention = CallingConvention.Cdecl)]
        public static extern int UARTRcvData(byte[] rcvBuf uint lenint UsbIndex);

        [DllImport(“USB2UARTSPIIICDLL.dll“ CallingConvention = CallingConvention.Cdecl)]
        public static extern bool SPISendData(uint startCS uint endCSbyte[] sendBuf uint lenint UsbIndex);

        [DllImport(“USB2UARTSPIIICDLL.dll“ CallingConvention = CallingConvention.Cdecl)]
        public static extern bool SPIRcvData(uint startCS uint endCSbyte[] rcvBuf uint lenint UsbIndex);

        [DllImport(“USB2UARTSPIIICDLL.dll“ CallingConvention = CallingConvention.Cdecl)]
        public static extern bool SPISendDataSlave(byte[] sendBuf uint lenint UsbIndex);

        [DllImport(“USB2UARTSPIIICDLL.dll“ CallingConvention = CallingConvention.Cdecl)]
        public static extern int SPIRcvDataSlave(byte[] rcvBuf uint lenint UsbIndex);

        [DllImport(“USB2UARTSPIIICDLL.dll“ CallingConvention = CallingConvention.Cdecl)]
        public static extern bool IICSendData(bool strartBitbyte[] sendBuf uint len bool stopBitint UsbIndex);

        [DllIm

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       8394  2013-05-15 15:36  USB2UARTPSIIICV1.3.6.3\USB驱动\stlinkwinusb_x64.cat

     文件        663  2013-05-15 15:36  USB2UARTPSIIICV1.3.6.3\USB驱动\stlinkwinusb_x86.cat

     文件       1638  2017-12-25 19:05  USB2UARTPSIIICV1.3.6.3\USB驱动\stlink_winusb.inf

     文件        114  2013-05-15 16:33  USB2UARTPSIIICV1.3.6.3\USB驱动\stlink_winusb_install.bat

     文件        187  2018-07-02 23:27  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\App.config

     文件     210432  2016-04-08 21:57  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\bin\Debug\lmusbdll.dll

     文件       9728  2018-07-09 00:45  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\bin\Debug\test.exe

     文件      19968  2018-07-09 00:45  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\bin\Debug\test.pdb

     文件      24224  2018-07-16 21:28  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\bin\Debug\test.vshost.exe

     文件        187  2018-07-02 23:27  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\bin\Debug\test.vshost.exe.config

     文件        490  2015-11-13 10:24  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\bin\Debug\test.vshost.exe.manifest

     文件      49152  2018-07-09 00:37  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\bin\Debug\USB2UARTSPIIICDLL.dll

     文件       6123  2018-07-16 21:41  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\Form1.cs

     文件       2018  2018-07-02 23:28  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\Form1.Designer.cs

     文件       5817  2018-07-02 23:28  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\Form1.resx

     文件        853  2018-07-02 23:27  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       7096  2018-07-16 21:28  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件          0  2018-07-02 23:27  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2018-07-02 23:27  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2018-07-02 23:27  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

     文件       2945  2018-07-16 21:42  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\obj\Debug\test.csproj.FileListAbsolute.txt

     文件        977  2018-07-09 00:45  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\obj\Debug\test.csproj.GenerateResource.Cache

     文件        180  2018-07-09 00:45  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\obj\Debug\test.Form1.resources

     文件        180  2018-07-09 00:45  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\obj\Debug\test.Properties.Resources.resources

     文件        516  2018-07-02 23:27  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\Program.cs

     文件       1350  2018-07-02 23:27  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\Properties\AssemblyInfo.cs

     文件       2860  2018-07-02 23:27  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\Properties\Resources.Designer.cs

     文件       5612  2018-07-02 23:27  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\Properties\Resources.resx

     文件       1091  2018-07-02 23:27  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\Properties\Settings.Designer.cs

     文件        249  2018-07-02 23:27  USB2UARTPSIIICV1.3.6.3\例程\C#调用例子\test\test\Properties\Settings.settings

............此处省略140个文件信息

评论

共有 条评论