⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basicport.frm

📁 《Verilog-HDL实践与应用系统设计》一书中的光盘源文件
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      End
      Begin VB.Label Label6 
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         BackColor       =   &H0000FFFF&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "1"
         ForeColor       =   &H80000008&
         Height          =   255
         Index           =   2
         Left            =   5400
         TabIndex        =   12
         Top             =   3480
         Width           =   375
      End
      Begin VB.Label Label6 
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         BackColor       =   &H0000FFFF&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "1"
         ForeColor       =   &H80000008&
         Height          =   255
         Index           =   3
         Left            =   5400
         TabIndex        =   11
         Top             =   3720
         Width           =   375
      End
      Begin VB.Label Label7 
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         BackColor       =   &H0000FFFF&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "1"
         ForeColor       =   &H80000008&
         Height          =   255
         Index           =   0
         Left            =   5400
         TabIndex        =   10
         Top             =   4800
         Width           =   375
      End
      Begin VB.Label Label7 
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         BackColor       =   &H0000FFFF&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "1"
         ForeColor       =   &H80000008&
         Height          =   255
         Index           =   1
         Left            =   5400
         TabIndex        =   9
         Top             =   5040
         Width           =   375
      End
      Begin VB.Label Label7 
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         BackColor       =   &H0000FFFF&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "1"
         ForeColor       =   &H80000008&
         Height          =   255
         Index           =   2
         Left            =   5400
         TabIndex        =   8
         Top             =   5280
         Width           =   375
      End
      Begin VB.Label Label7 
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         BackColor       =   &H0000FFFF&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "1"
         ForeColor       =   &H80000008&
         Height          =   255
         Index           =   3
         Left            =   5400
         TabIndex        =   7
         Top             =   5520
         Width           =   375
      End
      Begin VB.Label Label8 
         BackColor       =   &H00FFFF80&
         Caption         =   "HEX"
         Height          =   255
         Left            =   6120
         TabIndex        =   6
         Top             =   3000
         Width           =   375
      End
      Begin VB.Label Label9 
         BackColor       =   &H00FFFF80&
         Caption         =   "HEX"
         Height          =   255
         Left            =   5880
         TabIndex        =   5
         Top             =   1200
         Width           =   375
      End
      Begin VB.Label Label10 
         BackColor       =   &H00FFFF80&
         Caption         =   "HEX"
         Height          =   255
         Left            =   5880
         TabIndex        =   4
         Top             =   5040
         Width           =   375
      End
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Exit"
      BeginProperty Font 
         Name            =   "MS PMincho"
         Size            =   11.25
         Charset         =   128
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3240
      TabIndex        =   0
      Top             =   6720
      Width           =   1215
   End
End
Attribute VB_Name = "basicport"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Function h_to_d(ByVal hdat As String) As String
    Dim dval As Long
    Dim hexchar As String
    Dim hexval As String
    Dim i As Integer
    Dim power As Long
    Dim tempval As Integer
    hexchar = "123456789ABCDEF"
    hexval = UCase$(hdat)
    dval = 0
    For i = 1 To Len(hexval)
        power = 16 ^ (Len(hexval) - i)
        tempval = InStr(hexchar, Mid$(hexval, i, 1))
        dval = dval + (tempval * power)
    Next i
    h_to_d = Str$(dval)
End Function

Sub Set_bit(para As Integer, code As Integer)
    Dim i As Integer
    Dim datas As Byte
    Dim da As Integer
    Select Case para
        Case Data_port
             For i = 0 To 7
                datas = (2 ^ i) And code
                Label5(i) = rsft(datas, i)
                Next
       Case Con_port
             For i = 0 To 3
                datas = (2 ^ i) And code
                Label6(i) = rsft(datas, i)
                Next

       Case Sts_port
             For i = 0 To 3
                datas = (2 ^ i) And code
                Label7(i) = rsft(datas, i)
                Next

        End Select

End Sub


Private Sub AniPushButton2_Click()

End Sub

Private Sub Command1_Click()
    Unload Me
End Sub



Private Sub Command10_Click()

End Sub



Private Sub Command5_Click()
    Timer1.Enabled = False
        Command5.Enabled = False
    Command4.Enabled = True
End Sub

Private Sub Command4_Click()
    Timer1.Enabled = True
    Command5.Enabled = True
    Command4.Enabled = False
End Sub

Private Sub Command6_Click()
    Dim p As Integer
    Dim code As Integer
        
    code = Val(h_to_d(Text5.Text))
    Set_bit Con_port, code
    Ptrans_out_to_CP (code)

End Sub

Private Sub Command7_Click()
Command8_Click
Command6_Click
Command9_Click

End Sub

Private Sub Command8_Click()
    Dim p As Integer
    Dim da As Integer
    Dim code As Integer
    code = Val(h_to_d(Text4.Text))
    Set_bit Data_port, code
    Ptrans_out_to_DP (code)
End Sub


Private Sub Timer2_Timer()

End Sub


Private Sub Command9_Click()
    Dim datas  As Integer
    Dim i As Integer
    i = 1
    
    datas = Ptrans_read_SSP(i)
    Label1.Caption = Hex(datas)
    Set_bit Sts_port, datas

End Sub


Private Sub Label2_Click()

End Sub


Private Sub Text3_Change()

End Sub


Private Sub Form_Load()
    form_init
End Sub

Private Sub form_init()
    Width = 7770
    Height = 7740
    Left = (Screen.Width - Width) / 2
    Top = (Screen.Height - Height) / 2
    'Picture1.Top = 33
    'Picture1.Left = (Width - Picture1.Width) / 2
End Sub



Private Sub Timer1_Timer()
Command7_Click
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -