File: anacomp.tcl

package info (click to toggle)
simulavr 1.0.0%2Bgit20160221.e53413b-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 5,748 kB
  • sloc: cpp: 35,491; python: 6,991; ansic: 3,567; makefile: 1,072; sh: 653; asm: 414; tcl: 320
file content (45 lines) | stat: -rw-r--r-- 814 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#
#  Anacomp user extension set for simulavr.tcl
#
#  $Id$
#

switch ${extensionPoint} {
  Initialization {}

  CPU {
    if { ! [info exists dev1] } {
      error "MCU Device Required"
    }
  }

  Gui {
    if { ! [info exists ui] } {
      error "User Interface Required"
    }

    #create some external pins
    ExtAnalogPin pain0 0 $ui "ain0" ".x"
    ExtAnalogPin pain1 0 $ui "ain1" ".x"
    ExtPin epb $Pin_TRISTATE $ui "->BO" ".x"

    #create some nets which connect the pins 
    Net ain0
    ain0 Add pain0
    ain0 Add [AvrDevice_GetPin $dev1 "D6"]

    Net ain1
    ain1 Add pain1
    ain1 Add [AvrDevice_GetPin $dev1 "D7"]

    Net portb
    portb Add epb
    portb Add [AvrDevice_GetPin $dev1 "B0"]
  }

  GdbCommands {
    if { ! [info exists f] } {
      error "File handle required"
    }
  }
}