Difference between revisions of "Example serport212"

From wiki.emacinc.com
Jump to: navigation, search
(Usage Example. Getting the Configuration of the SOM212ES Serial Combo Port)
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{todo|Review(12.19.13-13:55->JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}
+
{{todo|SEOKWREV (12.23.13-11:52->JG+);(01.03.14-17:55->KY+);(01.03.14-18:40->MD+);(04.07.14-10:05->BS+)|Jgreene|project=oe 4,oe 5,jg,md,ky,SEOKWREV,bs}}
 +
 
 +
{{#seo:
 +
|title=serport212
 +
|titlemode=append
 +
|keywords=serport212,EMAC SOM212ES
 +
|description=This is a guide to the <code>serport212</code> C example project included in the EMAC OE SDK.
 +
}}
 
This is a guide to the <code>serport212</code> C example project included in the EMAC OE SDK.
 
This is a guide to the <code>serport212</code> C example project included in the EMAC OE SDK.
  
This application is a SOM212ES serial combo port configuration tool. It sets or gets the configuration of the serial combo port on a SOM212ES carrier board.
+
This application is a SOM212ES serial combo port configuration tool. It can set the configuration of the serial combo port on a SOM212ES carrier board to mode '''RS-232''', '''RS-422''' or '''RS-485'''. It can also get the current serial port configuration, reporting it to the console.
  
Also included in the project directory is a BASH version of this tool: <code>serport212.bash</code>.  It performs the same functions and takes the same command parameters as the C executable version.
+
Also included in the project directory is a BASH version of this tool: <code>serport212.sh</code>.  It performs the same functions and takes the same command parameters as the C executable version.
  
 
The <code>serport212</code> project builds one executable: <code>serport212</code>.
 
The <code>serport212</code> project builds one executable: <code>serport212</code>.
Line 10: Line 17:
 
== Opening, Building and Uploading the Project Files ==
 
== Opening, Building and Uploading the Project Files ==
  
<big>1. Open the C/C++ editing perspective.</big>
+
For information on opening the project from within Eclipse, please see [[Importing the EMAC OE SDK Projects with Eclipse]]. Then, follow [[Using the EMAC OE SDK Projects with Eclipse]] for information on how to build, upload and execute the example.
 
 
stub
 
 
 
<big>2. Open the project files.</big>
 
 
 
stub
 
 
 
<big>3. Build the project.</big>
 
 
 
stub
 
 
 
<big>4. Upload the executables to the target system.</big>
 
  
stub
+
Alternatively, the <code>Makefile</code> can be used with the <code>make</code> command from the commandline to build and upload the example.  For more information on this method, please see [[Using EMAC OE SDK Example Projects]].
  
 
==Usage and Behavior==
 
==Usage and Behavior==
Line 36: Line 31:
 
===Using <code>serport212</code>===
 
===Using <code>serport212</code>===
  
  ./serport212 [-sg] [CONFIG]
+
  ./serport212 [-s CONFIG]
 
Where CONFIG is a valid serial port configuration specification: 232, 422 or 485
 
Where CONFIG is a valid serial port configuration specification: 232, 422 or 485
  
 
Options:<br \>
 
Options:<br \>
(--set) -s [CONFIG] Set Serial Port Configuration<br \>
+
{|
(--get) -g Get Serial Port Configuration
+
|<no options>
 +
|Get serial port configuration
 +
|-
 +
|(--set) -s [232, 422 or 485]
 +
|Set serial port configuration
 +
|-
 +
|(--help) -h
 +
|Print help message
 +
|-
 +
|(--version) -v
 +
|Print version
 +
|}
  
 
===Usage Example. Setting the Configuration of the SOM212ES Serial Combo Port===
 
===Usage Example. Setting the Configuration of the SOM212ES Serial Combo Port===
Line 54: Line 60:
  
 
<syntaxhighlight lang="text">
 
<syntaxhighlight lang="text">
som9g45:/tmp# ./serport212 -g    
+
som9g45:/tmp# ./serport212     
232
+
RS-232
 
</syntaxhighlight>
 
</syntaxhighlight>
  
...serport212 reports that the SOM212ES serial combo port is set to RS-232 mode.
+
...serport212 reports that the SOM212ES serial combo port is set to '''RS-232''' mode.
  
 
==Summary==
 
==Summary==
  
 
The serport212 application is a SOM212ES serial combo port configuration tool. It sets or gets the configuration of the serial combo port on a SOM212ES carrier board.
 
The serport212 application is a SOM212ES serial combo port configuration tool. It sets or gets the configuration of the serial combo port on a SOM212ES carrier board.

Latest revision as of 10:07, 7 April 2014

TODO: {{#todo:SEOKWREV (12.23.13-11:52->JG+);(01.03.14-17:55->KY+);(01.03.14-18:40->MD+);(04.07.14-10:05->BS+)|Jgreene|oe 4,oe 5,jg,md,ky,SEOKWREV,bs}}

This is a guide to the serport212 C example project included in the EMAC OE SDK.

This application is a SOM212ES serial combo port configuration tool. It can set the configuration of the serial combo port on a SOM212ES carrier board to mode RS-232, RS-422 or RS-485. It can also get the current serial port configuration, reporting it to the console.

Also included in the project directory is a BASH version of this tool: serport212.sh. It performs the same functions and takes the same command parameters as the C executable version.

The serport212 project builds one executable: serport212.

Opening, Building and Uploading the Project Files

For information on opening the project from within Eclipse, please see Importing the EMAC OE SDK Projects with Eclipse. Then, follow Using the EMAC OE SDK Projects with Eclipse for information on how to build, upload and execute the example.

Alternatively, the Makefile can be used with the make command from the commandline to build and upload the example. For more information on this method, please see Using EMAC OE SDK Example Projects.

Usage and Behavior

serport212 gets or sets the configuration of the serial combo port on a SOM212ES carrier board.

Hardware Requirements

The serport212 C example project must be run on a SOM212ES carrier board.

Using serport212

./serport212 [-s CONFIG]

Where CONFIG is a valid serial port configuration specification: 232, 422 or 485

Options:

<no options> Get serial port configuration
(--set) -s [232, 422 or 485] Set serial port configuration
(--help) -h Print help message
(--version) -v Print version

Usage Example. Setting the Configuration of the SOM212ES Serial Combo Port

som9g45:/tmp# ./serport212 -s 232

...the configuration of the SOM212ES serial combo port is now set to RS-232 mode.

Usage Example. Getting the Configuration of the SOM212ES Serial Combo Port

som9g45:/tmp# ./serport212    
RS-232

...serport212 reports that the SOM212ES serial combo port is set to RS-232 mode.

Summary

The serport212 application is a SOM212ES serial combo port configuration tool. It sets or gets the configuration of the serial combo port on a SOM212ES carrier board.