AHBUARTplugin » History » Version 4
Alexis Jeandet, 21/09/2015 07:07 PM
1 | 1 | Alexis Jeandet | h1. AHBUARTplugin |
---|---|---|---|
2 | |||
3 | p=. !{width: 80%}AHBUARTPluginWLegend.png(AHBUart plugin screenshot example)! |
||
4 | 2 | Alexis Jeandet | |
5 | h2. General Description |
||
6 | |||
7 | The AHBUARTplugin is a root plugin which allows you to connect to any "SOC":https://en.wikipedia.org/wiki/System_on_a_chip using "gaisler's AHBUART":http://www.gaisler.com/products/grlib/grip.pdf IP. The plugin is capable of scanning available serial port on the computer and measuring system clock if a DSU3 IP is also present. Before any transaction it will check if the device is still connected by reading at 0x80000000. |
||
8 | |||
9 | h2. Python's specific features |
||
10 | |||
11 | [[Plugins_Python_API|Common methods]] |
||
12 | |||
13 | Methods list: |
||
14 | |||
15 | * %{color:green}bool% *[[AHBUARTplugin#open|open]]* (%{color:green}QString% PortName, %{color:green}int% baudrate); |
||
16 | * %{color:blue}void% *[[AHBUARTplugin#close|close]]* (); |
||
17 | * %{color:blue}void% *[[AHBUARTplugin#updatePortList|updatePortList]]* (); |
||
18 | * %{color:green}int% *[[AHBUARTplugin#detectSpeed|detectSpeed]]* (); |
||
19 | |||
20 | |||
21 | ---- |
||
22 | |||
23 | ---- |
||
24 | |||
25 | h2(#open). %{color:green}bool% *[[AHBUARTplugin#open|open]]* (%{color:green}QString% PortName, %{color:green}int% baudrate) |
||
26 | |||
27 | Opens given *PortName* with given *baudrate* and returns %{color:blue}true% if success. |
||
28 | On Windows PortName is COMx where x is the port number. |
||
29 | On Linux PortName may be "/dev/ttySx" if you are using an integrated COM port or "/dev/ttyUSBx" if you are using an USB to RS232 converter. In both case x is the port number. |
||
30 | |||
31 | 3 | Alexis Jeandet | *Example:* |
32 | |||
33 | Here we will connect to target through /dev/ttyUSB0 at 3Mbaud and print success if we succeed. |
||
34 | |||
35 | 1 | Alexis Jeandet | <pre><code class="python"> |
36 | 4 | Alexis Jeandet | proxy.loadSysDriver("AHBUARTplugin","AHBUARTplugin0") |
37 | if AHBUARTplugin0.open("/dev/ttyUSB0",3000000): |
||
38 | print "success" |
||
39 | else: |
||
40 | print "failed" |
||
41 | 3 | Alexis Jeandet | </code></pre> |
42 | |||
43 | 2 | Alexis Jeandet | ---- |
44 | |||
45 | h2(#close). %{color:blue}void% *[[AHBUARTplugin#close|close]]* () |
||
46 | |||
47 | Closes current port and tells child plugins that it is disconnected. If already disconnected, does nothing. |
||
48 | |||
49 | ---- |
||
50 | |||
51 | h2(#updatePortList). %{color:blue}void% *[[AHBUARTplugin#updatePortList|updatePortList]]* () |
||
52 | |||
53 | Search for available serial port on the computer. This method isn't much useful in the python terminal since the list of serial ports will be used only for completion on the GUI. |
||
54 | |||
55 | |||
56 | ---- |
||
57 | |||
58 | h2(#detectSpeed). %{color:green}int% *[[AHBUARTplugin#detectSpeed|detectSpeed]]* () |
||
59 | |||
60 | Returns the system clock. This method will only work if a DSU3 IP is present on the soc and the timetag counter is counting. |
||
61 | |||
62 | ---- |