Subversion Repositories group.electronics

Rev

Rev 159 | Go to most recent revision | Details | 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;
21
 
22
            //Bridge_mcp2221 bridge = new Bridge_mcp2221();
23
 
24
 
25
            /*
26
            NITAAPDevice aap = new NITAAPDevice(bios);
27
            if (aap.init() == 0) {
28
                Console.WriteLine("AAP Found");
29
                aap.Enable();
30
            }
31
 
32
            NITAHFSDevice ahfs = new NITAHFSDevice(bios);
33
            if (ahfs.init() == 0) {
34
                Console.WriteLine("AHCP/FSCP Found");
35
                ahfs.Enable();
36
            }
37
            */
38
 
39
            /*
40
            MchpUsbI2c usbi2c = new MchpUsbI2c();
41
            usbi2c.Settings.GetConnectionStatus();
42
            int count = usbi2c.Management.GetDevCount();
43
            for (int i = 0; i < count; i++) {
44
                usbi2c.Management.SelectDev(i);
45
                usbi2c.Settings.GetConnectionStatus();
46
                string usbDescriptor = usbi2c.Settings.GetUsbStringDescriptor();
47
                Console.WriteLine(usbDescriptor + ":" + i.ToString());
48
            }
49
 
50
            usbi2c.Management.SelectDev(0);
51
            usbi2c.Settings.GetConnectionStatus();
52
            usbi2c.Functions.WriteGpioPinValue(3, 1);
53
 
54
            usbi2c.Management.SelectDev(1);
55
            usbi2c.Settings.GetConnectionStatus();
56
            usbi2c.Functions.WriteGpioPinValue(3, 1);
57
 
58
            usbi2c.Management.SelectDev(0);
59
            usbi2c.Settings.GetConnectionStatus();
60
            int val0 = usbi2c.Functions.ReadGpioPinValue(3);
61
 
62
            usbi2c.Management.SelectDev(1);
63
            usbi2c.Settings.GetConnectionStatus();
64
            int val1 = usbi2c.Functions.ReadGpioPinValue(3);
65
 
66
            Console.WriteLine(val0.ToString() + ":" + val1.ToString());
67
            */
68
 
69
        }
70
 
71
    }
72
}