URL
https://opencores.org/ocsvn/wishbone_uart_controller/wishbone_uart_controller/trunk
Subversion Repositories wishbone_uart_controller
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 1 to Rev 2
- ↔ Reverse comparison
Rev 1 → Rev 2
/wishbone_uart_controller/branches/software/IOcomunicator.cs
0,0 → 1,62
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Text; |
using System.IO.Ports; |
namespace WindowsFormsApplication1 |
{ |
class IOcomunicator |
{ |
protected static SerialPort port1; |
|
|
|
public IOcomunicator(string portid, int speed) |
{ |
port1 = new SerialPort(portid, speed, Parity.None, 8, StopBits.One); |
port1.Open(); |
port1.ReadTimeout = 100000000; |
port1.DataReceived += new |
SerialDataReceivedEventHandler(port_DataReceived); |
} |
private void port_DataReceived(object sender, |
SerialDataReceivedEventArgs e) { // Show all the incoming data in the port's buffer |
Console.WriteLine(port1.ReadExisting()); |
} |
|
protected void WriteToPort(byte[] buffer,int lenght) |
{ |
port1.Write(buffer, 0, lenght); |
} |
|
public void read(byte adress) |
{ |
Byte[] buffer = new Byte[1]; |
buffer[0] = adress; |
WriteToPort(buffer,1); |
} |
|
public Byte[] topc(int aantalReads) |
{ |
Byte[] buffer = new Byte[aantalReads]; |
buffer[0] = 0; |
WriteToPort(buffer, 1); |
for (int i = 0; i < aantalReads; i++) |
buffer[i] = Convert.ToByte(port1.ReadByte()); |
return buffer; |
} |
public void write(byte adress, byte data) |
{ |
Byte[] buffer = new Byte[2]; |
buffer[1] = data; |
buffer[0] = Convert.ToByte(adress | 128); |
WriteToPort(buffer,2); |
} |
|
|
public void close() |
{ |
port1.Close(); |
} |
} |
} |
/wishbone_uart_controller/branches/software/Form1.resx
0,0 → 1,120
<?xml version="1.0" encoding="utf-8"?> |
<root> |
<!-- |
Microsoft ResX Schema |
|
Version 2.0 |
|
The primary goals of this format is to allow a simple XML format |
that is mostly human readable. The generation and parsing of the |
various data types are done through the TypeConverter classes |
associated with the data types. |
|
Example: |
|
... ado.net/XML headers & schema ... |
<resheader name="resmimetype">text/microsoft-resx</resheader> |
<resheader name="version">2.0</resheader> |
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
<value>[base64 mime encoded serialized .NET Framework object]</value> |
</data> |
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
<comment>This is a comment</comment> |
</data> |
|
There are any number of "resheader" rows that contain simple |
name/value pairs. |
|
Each data row contains a name, and value. The row also contains a |
type or mimetype. Type corresponds to a .NET class that support |
text/value conversion through the TypeConverter architecture. |
Classes that don't support this are serialized and stored with the |
mimetype set. |
|
The mimetype is used for serialized objects, and tells the |
ResXResourceReader how to depersist the object. This is currently not |
extensible. For a given mimetype the value must be set accordingly: |
|
Note - application/x-microsoft.net.object.binary.base64 is the format |
that the ResXResourceWriter will generate, however the reader can |
read any of the formats listed below. |
|
mimetype: application/x-microsoft.net.object.binary.base64 |
value : The object must be serialized with |
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
: and then encoded with base64 encoding. |
|
mimetype: application/x-microsoft.net.object.soap.base64 |
value : The object must be serialized with |
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
: and then encoded with base64 encoding. |
|
mimetype: application/x-microsoft.net.object.bytearray.base64 |
value : The object must be serialized into a byte array |
: using a System.ComponentModel.TypeConverter |
: and then encoded with base64 encoding. |
--> |
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
<xsd:element name="root" msdata:IsDataSet="true"> |
<xsd:complexType> |
<xsd:choice maxOccurs="unbounded"> |
<xsd:element name="metadata"> |
<xsd:complexType> |
<xsd:sequence> |
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
</xsd:sequence> |
<xsd:attribute name="name" use="required" type="xsd:string" /> |
<xsd:attribute name="type" type="xsd:string" /> |
<xsd:attribute name="mimetype" type="xsd:string" /> |
<xsd:attribute ref="xml:space" /> |
</xsd:complexType> |
</xsd:element> |
<xsd:element name="assembly"> |
<xsd:complexType> |
<xsd:attribute name="alias" type="xsd:string" /> |
<xsd:attribute name="name" type="xsd:string" /> |
</xsd:complexType> |
</xsd:element> |
<xsd:element name="data"> |
<xsd:complexType> |
<xsd:sequence> |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
</xsd:sequence> |
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
<xsd:attribute ref="xml:space" /> |
</xsd:complexType> |
</xsd:element> |
<xsd:element name="resheader"> |
<xsd:complexType> |
<xsd:sequence> |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
</xsd:sequence> |
<xsd:attribute name="name" type="xsd:string" use="required" /> |
</xsd:complexType> |
</xsd:element> |
</xsd:choice> |
</xsd:complexType> |
</xsd:element> |
</xsd:schema> |
<resheader name="resmimetype"> |
<value>text/microsoft-resx</value> |
</resheader> |
<resheader name="version"> |
<value>2.0</value> |
</resheader> |
<resheader name="reader"> |
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
</resheader> |
<resheader name="writer"> |
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
</resheader> |
</root> |
/wishbone_uart_controller/branches/software/Form2.resx
0,0 → 1,120
<?xml version="1.0" encoding="utf-8"?> |
<root> |
<!-- |
Microsoft ResX Schema |
|
Version 2.0 |
|
The primary goals of this format is to allow a simple XML format |
that is mostly human readable. The generation and parsing of the |
various data types are done through the TypeConverter classes |
associated with the data types. |
|
Example: |
|
... ado.net/XML headers & schema ... |
<resheader name="resmimetype">text/microsoft-resx</resheader> |
<resheader name="version">2.0</resheader> |
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
<value>[base64 mime encoded serialized .NET Framework object]</value> |
</data> |
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
<comment>This is a comment</comment> |
</data> |
|
There are any number of "resheader" rows that contain simple |
name/value pairs. |
|
Each data row contains a name, and value. The row also contains a |
type or mimetype. Type corresponds to a .NET class that support |
text/value conversion through the TypeConverter architecture. |
Classes that don't support this are serialized and stored with the |
mimetype set. |
|
The mimetype is used for serialized objects, and tells the |
ResXResourceReader how to depersist the object. This is currently not |
extensible. For a given mimetype the value must be set accordingly: |
|
Note - application/x-microsoft.net.object.binary.base64 is the format |
that the ResXResourceWriter will generate, however the reader can |
read any of the formats listed below. |
|
mimetype: application/x-microsoft.net.object.binary.base64 |
value : The object must be serialized with |
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
: and then encoded with base64 encoding. |
|
mimetype: application/x-microsoft.net.object.soap.base64 |
value : The object must be serialized with |
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
: and then encoded with base64 encoding. |
|
mimetype: application/x-microsoft.net.object.bytearray.base64 |
value : The object must be serialized into a byte array |
: using a System.ComponentModel.TypeConverter |
: and then encoded with base64 encoding. |
--> |
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
<xsd:element name="root" msdata:IsDataSet="true"> |
<xsd:complexType> |
<xsd:choice maxOccurs="unbounded"> |
<xsd:element name="metadata"> |
<xsd:complexType> |
<xsd:sequence> |
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
</xsd:sequence> |
<xsd:attribute name="name" use="required" type="xsd:string" /> |
<xsd:attribute name="type" type="xsd:string" /> |
<xsd:attribute name="mimetype" type="xsd:string" /> |
<xsd:attribute ref="xml:space" /> |
</xsd:complexType> |
</xsd:element> |
<xsd:element name="assembly"> |
<xsd:complexType> |
<xsd:attribute name="alias" type="xsd:string" /> |
<xsd:attribute name="name" type="xsd:string" /> |
</xsd:complexType> |
</xsd:element> |
<xsd:element name="data"> |
<xsd:complexType> |
<xsd:sequence> |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
</xsd:sequence> |
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
<xsd:attribute ref="xml:space" /> |
</xsd:complexType> |
</xsd:element> |
<xsd:element name="resheader"> |
<xsd:complexType> |
<xsd:sequence> |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
</xsd:sequence> |
<xsd:attribute name="name" type="xsd:string" use="required" /> |
</xsd:complexType> |
</xsd:element> |
</xsd:choice> |
</xsd:complexType> |
</xsd:element> |
</xsd:schema> |
<resheader name="resmimetype"> |
<value>text/microsoft-resx</value> |
</resheader> |
<resheader name="version"> |
<value>2.0</value> |
</resheader> |
<resheader name="reader"> |
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
</resheader> |
<resheader name="writer"> |
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
</resheader> |
</root> |
/wishbone_uart_controller/branches/software/WindowsFormsApplication1.csproj
0,0 → 1,97
<?xml version="1.0" encoding="utf-8"?> |
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
<PropertyGroup> |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> |
<ProductVersion>8.0.30703</ProductVersion> |
<SchemaVersion>2.0</SchemaVersion> |
<ProjectGuid>{F197B286-252B-4E14-BDB3-8433BC6ABB7C}</ProjectGuid> |
<OutputType>WinExe</OutputType> |
<AppDesignerFolder>Properties</AppDesignerFolder> |
<RootNamespace>WindowsFormsApplication1</RootNamespace> |
<AssemblyName>WindowsFormsApplication1</AssemblyName> |
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> |
<TargetFrameworkProfile>Client</TargetFrameworkProfile> |
<FileAlignment>512</FileAlignment> |
</PropertyGroup> |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> |
<PlatformTarget>x86</PlatformTarget> |
<DebugSymbols>true</DebugSymbols> |
<DebugType>full</DebugType> |
<Optimize>false</Optimize> |
<OutputPath>bin\Debug\</OutputPath> |
<DefineConstants>DEBUG;TRACE</DefineConstants> |
<ErrorReport>prompt</ErrorReport> |
<WarningLevel>4</WarningLevel> |
</PropertyGroup> |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> |
<PlatformTarget>x86</PlatformTarget> |
<DebugType>pdbonly</DebugType> |
<Optimize>true</Optimize> |
<OutputPath>bin\Release\</OutputPath> |
<DefineConstants>TRACE</DefineConstants> |
<ErrorReport>prompt</ErrorReport> |
<WarningLevel>4</WarningLevel> |
</PropertyGroup> |
<ItemGroup> |
<Reference Include="System" /> |
<Reference Include="System.Core" /> |
<Reference Include="System.Xml.Linq" /> |
<Reference Include="System.Data.DataSetExtensions" /> |
<Reference Include="Microsoft.CSharp" /> |
<Reference Include="System.Data" /> |
<Reference Include="System.Deployment" /> |
<Reference Include="System.Drawing" /> |
<Reference Include="System.Windows.Forms" /> |
<Reference Include="System.Xml" /> |
</ItemGroup> |
<ItemGroup> |
<Compile Include="Form2.cs"> |
<SubType>Form</SubType> |
</Compile> |
<Compile Include="Form2.Designer.cs"> |
<DependentUpon>Form2.cs</DependentUpon> |
</Compile> |
<Compile Include="IOcomunicator.cs" /> |
<Compile Include="Form1.cs"> |
<SubType>Form</SubType> |
</Compile> |
<Compile Include="Form1.Designer.cs"> |
<DependentUpon>Form1.cs</DependentUpon> |
</Compile> |
<Compile Include="Program.cs" /> |
<Compile Include="Properties\AssemblyInfo.cs" /> |
<EmbeddedResource Include="Form1.resx"> |
<DependentUpon>Form1.cs</DependentUpon> |
</EmbeddedResource> |
<EmbeddedResource Include="Form2.resx"> |
<DependentUpon>Form2.cs</DependentUpon> |
</EmbeddedResource> |
<EmbeddedResource Include="Properties\Resources.resx"> |
<Generator>ResXFileCodeGenerator</Generator> |
<LastGenOutput>Resources.Designer.cs</LastGenOutput> |
<SubType>Designer</SubType> |
</EmbeddedResource> |
<Compile Include="Properties\Resources.Designer.cs"> |
<AutoGen>True</AutoGen> |
<DependentUpon>Resources.resx</DependentUpon> |
</Compile> |
<None Include="Properties\Settings.settings"> |
<Generator>SettingsSingleFileGenerator</Generator> |
<LastGenOutput>Settings.Designer.cs</LastGenOutput> |
</None> |
<Compile Include="Properties\Settings.Designer.cs"> |
<AutoGen>True</AutoGen> |
<DependentUpon>Settings.settings</DependentUpon> |
<DesignTimeSharedInput>True</DesignTimeSharedInput> |
</Compile> |
</ItemGroup> |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
Other similar extension points exist, see Microsoft.Common.targets. |
<Target Name="BeforeBuild"> |
</Target> |
<Target Name="AfterBuild"> |
</Target> |
--> |
</Project> |
/wishbone_uart_controller/branches/software/Form1.Designer.cs
0,0 → 1,164
namespace WindowsFormsApplication1 |
{ |
|
partial class Form1 |
{ |
/// <summary> |
/// Required designer variable. |
/// </summary> |
private System.ComponentModel.IContainer components = null; |
|
/// <summary> |
/// Clean up any resources being used. |
/// </summary> |
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> |
protected override void Dispose(bool disposing) |
{ |
if (disposing && (components != null)) |
{ |
components.Dispose(); |
} |
base.Dispose(disposing); |
} |
|
#region Windows Form Designer generated code |
|
/// <summary> |
/// Required method for Designer support - do not modify |
/// the contents of this method with the code editor. |
/// </summary> |
private void InitializeComponent() |
{ |
this.read = new System.Windows.Forms.Button(); |
this.write = new System.Windows.Forms.Button(); |
this.toPC = new System.Windows.Forms.Button(); |
this.readadresstext = new System.Windows.Forms.TextBox(); |
this.writeadresstext = new System.Windows.Forms.TextBox(); |
this.returnData = new System.Windows.Forms.TextBox(); |
this.label1 = new System.Windows.Forms.Label(); |
this.label4 = new System.Windows.Forms.Label(); |
this.writedata = new System.Windows.Forms.TextBox(); |
this.SuspendLayout(); |
// |
// read |
// |
this.read.Location = new System.Drawing.Point(16, 48); |
this.read.Name = "read"; |
this.read.Size = new System.Drawing.Size(75, 23); |
this.read.TabIndex = 0; |
this.read.Tag = "read"; |
this.read.Text = "read"; |
this.read.UseVisualStyleBackColor = true; |
this.read.Click += new System.EventHandler(this.read_Click); |
// |
// write |
// |
this.write.Location = new System.Drawing.Point(16, 94); |
this.write.Name = "write"; |
this.write.Size = new System.Drawing.Size(75, 23); |
this.write.TabIndex = 1; |
this.write.Tag = "write"; |
this.write.Text = "write"; |
this.write.UseVisualStyleBackColor = true; |
this.write.Click += new System.EventHandler(this.write_Click); |
// |
// toPC |
// |
this.toPC.Location = new System.Drawing.Point(16, 140); |
this.toPC.Name = "toPC"; |
this.toPC.Size = new System.Drawing.Size(75, 23); |
this.toPC.TabIndex = 4; |
this.toPC.Tag = "to_pc"; |
this.toPC.Text = "to pc"; |
this.toPC.UseVisualStyleBackColor = true; |
this.toPC.Click += new System.EventHandler(this.toPC_Click); |
// |
// readadresstext |
// |
this.readadresstext.Location = new System.Drawing.Point(118, 48); |
this.readadresstext.Name = "readadresstext"; |
this.readadresstext.Size = new System.Drawing.Size(100, 20); |
this.readadresstext.TabIndex = 5; |
this.readadresstext.Tag = "readadresstext"; |
this.readadresstext.TextChanged += new System.EventHandler(this.readadresstext_TextChanged); |
// |
// writeadresstext |
// |
this.writeadresstext.Location = new System.Drawing.Point(118, 96); |
this.writeadresstext.Name = "writeadresstext"; |
this.writeadresstext.Size = new System.Drawing.Size(100, 20); |
this.writeadresstext.TabIndex = 8; |
this.writeadresstext.Tag = "writeadresstext"; |
this.writeadresstext.TextChanged += new System.EventHandler(this.writeadresstext_TextChanged); |
// |
// returnData |
// |
this.returnData.Location = new System.Drawing.Point(258, 159); |
this.returnData.Name = "returnData"; |
this.returnData.ReadOnly = true; |
this.returnData.Size = new System.Drawing.Size(100, 20); |
this.returnData.TabIndex = 13; |
this.returnData.Tag = "returndata"; |
// |
// label1 |
// |
this.label1.AutoSize = true; |
this.label1.Location = new System.Drawing.Point(258, 140); |
this.label1.Name = "label1"; |
this.label1.Size = new System.Drawing.Size(70, 13); |
this.label1.TabIndex = 14; |
this.label1.Text = "returned data"; |
// |
// label4 |
// |
this.label4.AutoSize = true; |
this.label4.Location = new System.Drawing.Point(115, 21); |
this.label4.Name = "label4"; |
this.label4.Size = new System.Drawing.Size(47, 13); |
this.label4.TabIndex = 17; |
this.label4.Text = "register1"; |
// |
// writedata |
// |
this.writedata.Location = new System.Drawing.Point(261, 94); |
this.writedata.Name = "writedata"; |
this.writedata.Size = new System.Drawing.Size(100, 20); |
this.writedata.TabIndex = 11; |
this.writedata.Tag = "writedata"; |
this.writedata.TextChanged += new System.EventHandler(this.writedata_TextChanged); |
// |
// Form1 |
// |
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
this.ClientSize = new System.Drawing.Size(401, 202); |
this.Controls.Add(this.label4); |
this.Controls.Add(this.label1); |
this.Controls.Add(this.returnData); |
this.Controls.Add(this.writedata); |
this.Controls.Add(this.writeadresstext); |
this.Controls.Add(this.readadresstext); |
this.Controls.Add(this.toPC); |
this.Controls.Add(this.write); |
this.Controls.Add(this.read); |
this.Name = "Form1"; |
this.Text = "Form1"; |
this.ResumeLayout(false); |
this.PerformLayout(); |
|
} |
|
#endregion |
|
private System.Windows.Forms.Button read; |
private System.Windows.Forms.Button write; |
private System.Windows.Forms.Button toPC; |
private System.Windows.Forms.TextBox readadresstext; |
private System.Windows.Forms.TextBox writeadresstext; |
private System.Windows.Forms.TextBox returnData; |
private System.Windows.Forms.Label label1; |
private System.Windows.Forms.Label label4; |
private System.Windows.Forms.TextBox writedata; |
} |
} |
|
/wishbone_uart_controller/branches/software/Form1.cs
0,0 → 1,75
using System; |
using System.Collections.Generic; |
using System.ComponentModel; |
using System.Data; |
using System.Drawing; |
using System.Linq; |
using System.Text; |
using System.Windows.Forms; |
|
namespace WindowsFormsApplication1 |
{ |
public partial class Form1 : Form |
{ |
byte writeadress, data, readadress; |
IOcomunicator com; |
public Form1() |
{ |
InitializeComponent(); |
Form2 subForm = new Form2(); |
subForm.Owner = this; |
subForm.ShowDialog(); |
if (subForm.ShowDialog() == DialogResult.OK) |
{ |
com = new IOcomunicator(subForm.portid, subForm.speed); |
} |
} |
private void Form1_FormClosing(object sender, EventArgs e) |
{ |
com.close(); |
} |
|
private void read_Click(object sender, EventArgs e) |
{ |
com.read(readadress); |
} |
|
private void write_Click(object sender, EventArgs e) |
{ |
com.write(writeadress, data); |
} |
|
|
private void toPC_Click(object sender, EventArgs e) |
{ |
byte[] temp = new byte[4]; |
temp=com.topc(4); |
for (int i = 0; i<4;i++ ) |
Console.Write(temp[i]); |
|
} |
|
private void writedata_TextChanged(object sender, EventArgs e) |
{ |
this.data = Convert.ToByte(writedata.Text); |
} |
|
private void writeadresstext_TextChanged(object sender, EventArgs e) |
{ |
this.writeadress = Convert.ToByte(writeadresstext.Text); |
} |
|
private void readadresstext_TextChanged(object sender, EventArgs e) |
{ |
this.readadress= Convert.ToByte(readadresstext.Text); |
} |
|
|
|
|
|
|
|
|
} |
} |
/wishbone_uart_controller/branches/software/Form2.Designer.cs
0,0 → 1,128
namespace WindowsFormsApplication1 |
{ |
partial class Form2 |
{ |
/// <summary> |
/// Required designer variable. |
/// </summary> |
private System.ComponentModel.IContainer components = null; |
|
/// <summary> |
/// Clean up any resources being used. |
/// </summary> |
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> |
protected override void Dispose(bool disposing) |
{ |
if (disposing && (components != null)) |
{ |
components.Dispose(); |
} |
base.Dispose(disposing); |
} |
|
#region Windows Form Designer generated code |
|
/// <summary> |
/// Required method for Designer support - do not modify |
/// the contents of this method with the code editor. |
/// </summary> |
private void InitializeComponent() |
{ |
this.ok = new System.Windows.Forms.Button(); |
this.comportname = new System.Windows.Forms.TextBox(); |
this.label1 = new System.Windows.Forms.Label(); |
this.label2 = new System.Windows.Forms.Label(); |
this.speedsel = new System.Windows.Forms.ComboBox(); |
this.cancel = new System.Windows.Forms.Button(); |
this.SuspendLayout(); |
// |
// ok |
// |
this.ok.Location = new System.Drawing.Point(188, 227); |
this.ok.Name = "ok"; |
this.ok.Size = new System.Drawing.Size(75, 23); |
this.ok.TabIndex = 0; |
this.ok.Tag = "ok"; |
this.ok.Text = "ok"; |
this.ok.UseVisualStyleBackColor = true; |
this.ok.Click += new System.EventHandler(this.ok_Click); |
// |
// comportname |
// |
this.comportname.Location = new System.Drawing.Point(52, 28); |
this.comportname.Name = "comportname"; |
this.comportname.Size = new System.Drawing.Size(100, 20); |
this.comportname.TabIndex = 1; |
// |
// label1 |
// |
this.label1.AutoSize = true; |
this.label1.Location = new System.Drawing.Point(49, 12); |
this.label1.Name = "label1"; |
this.label1.Size = new System.Drawing.Size(77, 13); |
this.label1.TabIndex = 3; |
this.label1.Text = "com port name"; |
// |
// label2 |
// |
this.label2.AutoSize = true; |
this.label2.Location = new System.Drawing.Point(52, 55); |
this.label2.Name = "label2"; |
this.label2.Size = new System.Drawing.Size(80, 13); |
this.label2.TabIndex = 4; |
this.label2.Text = "com port speed"; |
// |
// speedsel |
// |
this.speedsel.FormattingEnabled = true; |
this.speedsel.Items.AddRange(new object[] { |
"9600", |
"19200", |
"57600", |
"115200", |
"230400"}); |
this.speedsel.Location = new System.Drawing.Point(52, 97); |
this.speedsel.Name = "speedsel"; |
this.speedsel.Size = new System.Drawing.Size(121, 21); |
this.speedsel.TabIndex = 5; |
// |
// cancel |
// |
this.cancel.Location = new System.Drawing.Point(291, 227); |
this.cancel.Name = "cancel"; |
this.cancel.Size = new System.Drawing.Size(75, 23); |
this.cancel.TabIndex = 6; |
this.cancel.Tag = "ok"; |
this.cancel.Text = "cancel"; |
this.cancel.UseVisualStyleBackColor = true; |
this.cancel.Click += new System.EventHandler(this.cancel_Click); |
// |
// Form2 |
// |
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
this.ClientSize = new System.Drawing.Size(378, 262); |
this.Controls.Add(this.cancel); |
this.Controls.Add(this.speedsel); |
this.Controls.Add(this.label2); |
this.Controls.Add(this.label1); |
this.Controls.Add(this.comportname); |
this.Controls.Add(this.ok); |
this.Name = "Form2"; |
this.Text = "Form2"; |
this.Load += new System.EventHandler(this.Form2_Load); |
this.ResumeLayout(false); |
this.PerformLayout(); |
|
} |
|
#endregion |
|
private System.Windows.Forms.Button ok; |
private System.Windows.Forms.TextBox comportname; |
private System.Windows.Forms.Label label1; |
private System.Windows.Forms.Label label2; |
private System.Windows.Forms.ComboBox speedsel; |
private System.Windows.Forms.Button cancel; |
} |
} |
/wishbone_uart_controller/branches/software/Form2.cs
0,0 → 1,42
using System; |
using System.Collections.Generic; |
using System.ComponentModel; |
using System.Data; |
using System.Drawing; |
using System.Linq; |
using System.Text; |
using System.Windows.Forms; |
|
namespace WindowsFormsApplication1 |
{ |
|
public partial class Form2 : Form |
{ |
public int speed; |
public string portid; |
public Form2() |
{ |
InitializeComponent(); |
} |
|
private void Form2_Load(object sender, EventArgs e) |
{ |
// int speed=int.Parse(speedsel.SelectedItem.Text); |
// Cominfo cominfo = new Cominfo(speed); |
} |
|
private void ok_Click(object sender, EventArgs e) |
{ |
speed = int.Parse(speedsel.SelectedItem.ToString()); |
portid = comportname.Text; |
this.DialogResult = DialogResult.OK; |
} |
|
private void cancel_Click(object sender, EventArgs e) |
{ |
this.DialogResult = DialogResult.Cancel; |
} |
|
|
} |
} |
/wishbone_uart_controller/branches/software/Program.cs
0,0 → 1,21
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Windows.Forms; |
|
namespace WindowsFormsApplication1 |
{ |
static class Program |
{ |
/// <summary> |
/// The main entry point for the application. |
/// </summary> |
[STAThread] |
static void Main() |
{ |
Application.EnableVisualStyles(); |
Application.SetCompatibleTextRenderingDefault(false); |
Application.Run(new Form1()); |
} |
} |
} |