C:/usr/src/avr/plotter/hpgl.h File Reference

Go to the source code of this file.

Enumerations

enum  _hpgl_command {
  CMD_ERR = -1, CMD_CONT = 0, CMD_PA = 1, CMD_PD,
  CMD_PU, CMD_ARCABS, CMD_INIT, CMD_SEEK0,
  CMD_LB0, CMD_LB, CMD_SI, CMD_SR,
  CMD_DI
}
enum  _scanner_state {
  STATE_EXP1 = 0, STATE_EXP_P, STATE_EXP_S, STATE_EXP_I,
  STATE_EXP_A, STATE_EXP_L, STATE_EXP_D, STATE_X,
  STATE_Y, STATE_SP, STATE_SC, STATE_IP,
  STATE_LB, STATE_SI, STATE_SR, STATE_DT,
  STATE_DI, STATE_EXP4, STATE_ARC, STATE_SKIP_END
}

Functions

void hpgl_init ()
 Initialize the scanner.
int8_t hpgl_char (char c, STEPPER_COORD *x, STEPPER_COORD *y, uint8_t *lb)


Enumeration Type Documentation

HPGL commands. Returned by hpgl_char() when there is data and handled by do_stuff() in motori.c

See also:
do_stuff()

hpgl_char()

Enumerator:
CMD_ERR  Error.
CMD_CONT  Continue, do nothing (data coming).
CMD_PA  Move to returned coordinates.
CMD_PD  Pen down.
CMD_PU  Pen up.
CMD_ARCABS  Start arc absolute.
CMD_INIT  Initialize.
CMD_SEEK0  Locate home position.
CMD_LB0  Mark label start.
CMD_LB  Label text.
CMD_SI  Absolute character size.
CMD_SR  Relative character size.
CMD_DI  Label direction: numpad[0]=sin(theta), numpad[1]=cos(theta).

Definition at line 7 of file hpgl.h.

Internal scanner state.

See also:
hpgl_char()
Enumerator:
STATE_EXP1  Expect first char of a command.
STATE_EXP_P 
STATE_EXP_S 
STATE_EXP_I 
STATE_EXP_A 
STATE_EXP_L 
STATE_EXP_D 
STATE_X 
STATE_Y 
STATE_SP  Select pen.
STATE_SC  Scale.
STATE_IP  Coordinates.
STATE_LB  Label text.
STATE_SI  absolute character size in cm
STATE_SR  relative character size
STATE_DT  label terminator char
STATE_DI  label direction
STATE_EXP4  Expect 4 numbers (like for AA, IP, SC).
STATE_ARC  Arc.
STATE_SKIP_END  Skip all until semicolon.

Definition at line 25 of file hpgl.h.


Function Documentation

int8_t hpgl_char ( char  c,
STEPPER_COORD x,
STEPPER_COORD y,
uint8_t *  lb 
)

Handle next character from the input. When action is determined, return one of the _hpgl_command values. Pass target coordinates in x and y.

Parameters:
c input char
x output: destination x (returns -1 if no data)
y output: destination y (returns -1 if no data)
lb output: next label character (see CMD_LB)
Returns:
_hpgl_command

Definition at line 21 of file hpgl.c.

void hpgl_init (  ) 

Initialize the scanner.

Definition at line 16 of file hpgl.c.


Generated on Sat Jul 4 05:27:39 2009 for motori by  doxygen 1.5.9