Command Line Interface

Command Line Interface

-Gordon Sulc
-Shahan Najam

This setup allows you to allocate the pins of an mbed for a specified interface without having to recompile the code. It uses a PS/2 Keyboard as an input device and an LCD as an output device. It can take commands and interpret them according to predefined rules in order to assign/reassign different pins for different interfaces.

Components Used

PS/2 breakout board
LCD display

Hardware Setup

The LCD board was connected through the 'AnalogIn' pins and the PS/2 board was connected through pins 11 and 12 as shown in diagram below.

/media/uploads/Shahan/circuit_schematic.jpg

Purpose

This command line interface lets users specify the functionality of
pins on the fly by typing commands.



Import programCLI

a command line interface that can dynamically assign pins

Currently Supported

DigitalIn: Read
DigitalOut: read, write
PwmOut: read, write
I2C: read, write
Serial: putc, getc, baud

Functionality

Typed command strings are decoded and executed with the following syntax

DigitalOut

create: DOUT C Pxx
read: DOUT R Pxx
write: DOUT W Pxx [0 or 1]

DigitalIn

create: DIN C Pxx
read: DIN R Pxx

PwmOut

create: PWMO C Pxx
read: PWMO R Pxx
write: PWM O Pxx [float]

I2C

create: I2C C Pxx
(Pxx can be either one of the supported pins in the supported pair,
but you must now use the same pin)
read: I2C R Pxx [address] [number of chars to read]
write: I2C W Pxx [address] [number of chars to write] [char 1] [char 2] .... etc

Serial

Currently the Serial Interface is not working
create: SERIAL C Pxx
(Pxx can be either one of the supported pins in the supported pair,
but you must now use the same pin)
getc: SERIAL G Pxx
putc: SERIAL P Pxx [char to write]
baud: SERIAL B Pxx [baud rate]


2 comments on Command Line Interface:

20 Oct 2011

NVM

20 Oct 2011

Please log in to post comments.