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

📄 frmiointerface.frm

📁 AD9954源码
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Begin VB.Form frmIOInterface 
   BorderStyle     =   3  'Fixed Dialog
   ClientHeight    =   3855
   ClientLeft      =   45
   ClientTop       =   45
   ClientWidth     =   2295
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3855
   ScaleWidth      =   2295
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Visible         =   0   'False
   Begin VB.PictureBox pbxFakeTitleBar 
      Align           =   1  'Align Top
      BackColor       =   &H80000002&
      BorderStyle     =   0  'None
      Height          =   255
      Left            =   0
      ScaleHeight     =   255
      ScaleWidth      =   2295
      TabIndex        =   9
      Top             =   0
      Width           =   2295
      Begin VB.Image imgFormCloseButton 
         Height          =   240
         Left            =   2040
         Picture         =   "frmIOInterface.frx":0000
         Tag             =   "0"
         Top             =   0
         Width           =   240
      End
      Begin VB.Image imgShade 
         Height          =   240
         Left            =   1800
         Picture         =   "frmIOInterface.frx":014A
         Tag             =   "0"
         Top             =   0
         Width           =   240
      End
      Begin VB.Label lblFakeTitleBarText 
         BackStyle       =   0  'Transparent
         Caption         =   "DUT I/O"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000009&
         Height          =   255
         Left            =   75
         TabIndex        =   10
         Top             =   30
         Width           =   855
      End
   End
   Begin VB.PictureBox picRollUpDwn 
      AutoRedraw      =   -1  'True
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   255
      Left            =   2160
      ScaleHeight     =   255
      ScaleWidth      =   2295
      TabIndex        =   0
      Tag             =   "Down"
      Top             =   4080
      Visible         =   0   'False
      Width           =   2295
   End
   Begin VB.Frame fraIOPort 
      Caption         =   "I/O Port"
      Height          =   3375
      Left            =   120
      TabIndex        =   1
      Top             =   360
      Width           =   2055
      Begin VB.Frame fraSerialComm 
         Caption         =   "Serial Comm"
         Height          =   1935
         Left            =   120
         TabIndex        =   4
         Top             =   1320
         Width           =   1815
         Begin VB.CheckBox chkLSBFirst 
            Caption         =   "LSB First"
            Height          =   255
            Left            =   120
            TabIndex        =   7
            ToolTipText     =   "Sets the LSB first bit in the control register"
            Top             =   360
            Width           =   1095
         End
         Begin VB.ComboBox lsbSerialIOMode 
            Height          =   315
            ItemData        =   "frmIOInterface.frx":0294
            Left            =   120
            List            =   "frmIOInterface.frx":029E
            Style           =   2  'Dropdown List
            TabIndex        =   6
            ToolTipText     =   "Sets the SDIO Input Only bit value in the control register"
            Top             =   960
            Width           =   1575
         End
         Begin VB.CommandButton cmdLoad 
            Caption         =   "LOAD"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Left            =   120
            Style           =   1  'Graphical
            TabIndex        =   5
            Top             =   1440
            Width           =   1575
         End
         Begin VB.Label lbl2or3Wire 
            Caption         =   "Serial I/O Mode:"
            Height          =   255
            Left            =   120
            TabIndex        =   8
            Top             =   720
            Width           =   1335
         End
      End
      Begin VB.CommandButton cmdIOReset 
         Caption         =   "I/O Reset DUT1"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Index           =   0
         Left            =   120
         TabIndex        =   3
         ToolTipText     =   "Strobes the I/OReset pin"
         Top             =   360
         Width           =   1815
      End
      Begin VB.CommandButton cmdIOReset 
         Caption         =   "I/O Reset DUT2"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Index           =   1
         Left            =   120
         TabIndex        =   2
         ToolTipText     =   "Strobes the I/OReset pin"
         Top             =   840
         Width           =   1815
      End
   End
   Begin VB.Image imgShadeBfr 
      Height          =   240
      Index           =   0
      Left            =   120
      Picture         =   "frmIOInterface.frx":02B2
      Top             =   4080
      Visible         =   0   'False
      Width           =   240
   End
   Begin VB.Image imgShadeBfr 
      Height          =   240
      Index           =   1
      Left            =   480
      Picture         =   "frmIOInterface.frx":03FC
      Top             =   4080
      Width           =   240
   End
   Begin VB.Image imgShadeBfr 
      Height          =   240
      Index           =   2
      Left            =   120
      Picture         =   "frmIOInterface.frx":0546
      Top             =   4320
      Visible         =   0   'False
      Width           =   240
   End
   Begin VB.Image imgShadeBfr 
      Height          =   240
      Index           =   3
      Left            =   480
      Picture         =   "frmIOInterface.frx":0690
      Top             =   4320
      Visible         =   0   'False
      Width           =   240
   End
   Begin VB.Image imgFormCloseBtnBfr 
      Height          =   240
      Index           =   0
      Left            =   1080
      Picture         =   "frmIOInterface.frx":07DA
      Top             =   4080
      Visible         =   0   'False
      Width           =   240
   End
   Begin VB.Image imgFormCloseBtnBfr 
      Height          =   240
      Index           =   1
      Left            =   1320
      Picture         =   "frmIOInterface.frx":0924
      Top             =   4080
      Visible         =   0   'False
      Width           =   240
   End
End
Attribute VB_Name = "frmIOInterface"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'private variable to store property values
Private mvarNeedsLoading As Boolean
'Should be set true before updating control values
Private IsUpdating As Boolean
Private DutsPoweredDown As Integer

Public Sub PowerDownForm(ByVal DUTNum As Integer, ByVal bPowDwn As Boolean)
    Dim cntr As Integer
    Dim Cntrl As Control
    
    'Make sure that dutnum is either 1 or 2
    If DUTNum <> 1 Then
        DUTNum = 2
    End If
    
    chkLSBFirst.Enabled = Not bPowDwn
    lbl2or3Wire.Enabled = Not bPowDwn
    lsbSerialIOMode.Enabled = Not bPowDwn
    cmdLoad.Enabled = Not bPowDwn
    fraSerialComm.Enabled = Not bPowDwn
End Sub

'Refreshes the values in all of the controls to match the values in the
'register map window
'Used to refresh the form after a setup file has been loaded.
Public Sub RefreshControls()
    'Refresh the controls with the current value of the bit
    'Set the isupdating flag to true
    IsUpdating = True
        
    'Control Register 00h
    'chkSyncDACnMUX.Value = frmRegisterMap.GetBitVal(0, 7)
'    chkLSBFirst.value = frmRegisterMap.GetBitVal(0, 0)
    chkLSBFirst.value = EvalBd.sGetRegMapBitVal(1, CFR1, 8)
    lsbSerialIOMode.ListIndex = EvalBd.sGetRegMapBitVal(1, CFR1, 9)
    
    'Update the state of the serialparallel mode
'    optIOInterface(EvalBoard.SPMode).value = True
    
    'Set the isupdating flag to false
    IsUpdating = False
End Sub

Private Sub chkLSBFirst_Click()
    'Set the bit value in the register map
    'If the form isn't being updated then set the bit in the registermap
    If Not IsUpdating Then
        mvarNeedsLoading = True
    End If
End Sub



Private Sub chkLSBFirst_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
'This code is just for future reference and is not used
'    If Button = vbLeftButton Then
'        With optIOInterface(Index)
'        If X >= 0 And X <= .Width And Y >= 0 And Y <= .Height Then
'            'This code only runs when the checkbox is clicked
'            EvalBoard.SPMode = Index
'            frmDebug.RefreshStatus
'        End If
'        End With
'    End If
End Sub

Private Sub cmdIOReset_Click(Index As Integer)
    'Strobe the IO_Reset pin
    If Index = 0 Then
        EvalBd.IOSync_DUT1 = abvLow
    Else
        EvalBd.IOSync_DUT2 = abvLow
    End If
    EvalBd.WriteEvbBuffVal evb59Buff2
    
    If Index = 0 Then
        EvalBd.IOSync_DUT1 = abvHigh
    Else
        EvalBd.IOSync_DUT2 = abvHigh
    End If
    EvalBd.WriteEvbBuffVal evb59Buff2

    If Index = 0 Then
        EvalBd.IOSync_DUT1 = abvLow
    Else
        EvalBd.IOSync_DUT2 = abvLow
    End If
    EvalBd.WriteEvbBuffVal evb59Buff2
End Sub


Private Sub cmdLoad_Click()
    Dim CurRegVal_DUT1 As String
    Dim CurRegVal_DUT2 As String
    
'    'Update the status bar
''    mdiMain.UpdateStatusBar
'
'    'Set the needs loading flag to false for both forms
    mvarNeedsLoading = False
    
    'Get the current register values
    CurRegVal_DUT1 = EvalBd.sGetRegMapVal(1, CFR1)
    CurRegVal_DUT2 = EvalBd.sGetRegMapVal(2, CFR1)
    
    'Load the current updated register values
    EvalBd.SerialLoad 1, CFR1, Left(CurRegVal_DUT1, 22) & CStr(lsbSerialIOMode.ListIndex) & CStr(chkLSBFirst.value) & Right(CurRegVal_DUT1, 8)
    EvalBd.SerialLoad 2, CFR1, Left(CurRegVal_DUT2, 22) & CStr(lsbSerialIOMode.ListIndex) & CStr(chkLSBFirst.value) & Right(CurRegVal_DUT2, 8)
    
    'Load the new register map with the same values so that it doesn't
    'cause the load button to flash on the control window
    EvalBd.sSetNewRegMapBitVal 1, CFR1, 8, chkLSBFirst.value
    EvalBd.sSetNewRegMapBitVal 2, CFR1, 8, chkLSBFirst.value
    EvalBd.sSetNewRegMapBitVal 1, CFR1, 9, lsbSerialIOMode.ListIndex
    EvalBd.sSetNewRegMapBitVal 2, CFR1, 9, lsbSerialIOMode.ListIndex
    
End Sub

Private Sub Form_Load()
    'Make this form modeless
    Call MakeFormModeless(Me, mdiMain.hWnd)
    
'    'Initialize the window blind button
'    picRollUpDwn_MouseMove vbLeftButton, 0, -1, -1
'
'    'Initialize the controls on the form to
'    'represent the values in the register map
'    Me.RefreshControls
'
'    'Set the needs loading flag to false
'    NeedsLoading = False
    

⌨️ 快捷键说明

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