Subversion Repositories group.electronics

Rev

Rev 158 | Rev 161 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
158 pfowler 1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
using System.Timers;
7
 
8
using MCP2221;
9
 
10
namespace nitdcscore
11
{
12
    class Program
13
    {
14
 
15
 
16
        static void Main(string[] args) {
17
 
18
 
19
            mcp2221 mcp = new mcp2221();
20
            mcp.Enabled = true;
159 pfowler 21
 
158 pfowler 22
            /*
23
            MchpUsbI2c usbi2c = new MchpUsbI2c();
24
            usbi2c.Settings.GetConnectionStatus();
25
            int count = usbi2c.Management.GetDevCount();
26
            for (int i = 0; i < count; i++) {
27
                usbi2c.Management.SelectDev(i);
28
                usbi2c.Settings.GetConnectionStatus();
29
                string usbDescriptor = usbi2c.Settings.GetUsbStringDescriptor();
30
                Console.WriteLine(usbDescriptor + ":" + i.ToString());
31
            }
32
 
33
            usbi2c.Management.SelectDev(0);
34
            usbi2c.Settings.GetConnectionStatus();
35
            usbi2c.Functions.WriteGpioPinValue(3, 1);
36
 
37
            usbi2c.Management.SelectDev(1);
38
            usbi2c.Settings.GetConnectionStatus();
39
            usbi2c.Functions.WriteGpioPinValue(3, 1);
40
 
41
            usbi2c.Management.SelectDev(0);
42
            usbi2c.Settings.GetConnectionStatus();
43
            int val0 = usbi2c.Functions.ReadGpioPinValue(3);
44
 
45
            usbi2c.Management.SelectDev(1);
46
            usbi2c.Settings.GetConnectionStatus();
47
            int val1 = usbi2c.Functions.ReadGpioPinValue(3);
48
 
49
            Console.WriteLine(val0.ToString() + ":" + val1.ToString());
50
            */
51
 
52
        }
53
 
54
    }
55
}