using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace CP2103
{
class Program
{
static void Main(string[] args)
{
Int32 numOfDevices = 0;
Int32 retVal = CP210x.GetNumDevices(ref numOfDevices);
IntPtr handle = IntPtr.Zero;
Byte[] prtNum = new Byte[1];
UInt16[] latch = new UInt16[4];
UInt16 mask = 0x01;
if (numOfDevices > 0)
{
retVal = CP210x.Open(0, ref handle);
retVal = CP210x.GetPartNumber(handle, prtNum);
if (prtNum[0] == 3) //cp21"03"
{
//设置GPIO为101
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace CP2103
{
class Program
{
static void Main(string[] args)
{
Int32 numOfDevices = 0;
Int32 retVal = CP210x.GetNumDevices(ref numOfDevices);
IntPtr handle = IntPtr.Zero;
Byte[] prtNum = new Byte[1];
UInt16[] latch = new UInt16[4];
UInt16 mask = 0x01;
if (numOfDevices > 0)
{
retVal = CP210x.Open(0, ref handle);
retVal = CP210x.GetPartNumber(handle, prtNum);
if (prtNum[0] == 3) //cp21"03"
{
//设置GPIO为101