Module printing - Printing support for Plumbing

Printing support for Plumbing

Index

Declarations

printing.module:43Process serial.setup

PROC serial.setup (VAL INT board.pin, VAL INT32 baud)

Begins serial operations on the given board pin.

board.pin must be written as TX0, RX0, TX1, RX1, etc. In the case of this process, RX0 and TX0 will both signal the activation of serial port 0, as RX1 and TX1 will activate port 1, etc. the 'R' and 'T' can be used interchangeably.

Parameters:

VAL INT board.pin The board pin to being serial operations on.
VAL INT32 baud The baud rate at which to transmit serial data.

printing.module:56Process serial.read.byte

PROC serial.read.byte (VAL INT board.pin, RESULT BYTE b)

Reads a BYTE from the given pin.

board.pin must be written as TX0, RX0, TX1, RX1, etc.

Parameters:

VAL INT board.pin The pin from which to read.
RESULT BYTE b The resulting byte from the read.

printing.module:69Process serial.write.byte

PROC serial.write.byte (VAL INT board.pin, VAL BYTE b)

Write a BYTE to the given pin.

board.pin must be written as TX0, RX0, TX1, RX1, etc.

Parameters:

VAL INT board.pin The board pin to be written to.
VAL BYTE b The BYTE to be written.

printing.module:82Process serial.write.int

PROC serial.write.int (VAL INT board.pin, VAL INT n)

Write an INT to the serial port in hex.

board.pin must be written as TX0, RX0, TX1, RX1, etc.

Parameters:

VAL INT board.pin The board pin to be written to.
VAL INT n The INT to write.

printing.module:97Process serial.write.int32

PROC serial.write.int32 (VAL INT board.pin, VAL INT32 n)

Write an INT32 to the serial port in hex.

board.pin must be written as TX0, RX0, TX1, RX1, etc.

Parameters:

VAL INT board.pin The board pin to be written to.
VAL INT32 n The long integer (INT32) to write.

printing.module:112Process serial.write.string

PROC serial.write.string (VAL INT board.pin, VAL []BYTE string)

Write a string to the serial port.

board.pin must be written as TX0, RX0, TX1, RX1, etc.

Parameters:

VAL INT board.pin The board pin to be written to.
VAL []BYTE string The array of BYTEs to write.

printing.module:125Process serial.write.newline

PROC serial.write.newline (VAL INT board.pin)

Write a newline.

board.pin must be written as TX0, RX0, TX1, RX1, etc.

Parameters:

VAL INT board.pin The board pin to be written to.

printing.module:135Process printing.zeroArray

PROC printing.zeroArray([]BYTE arr)

Fills the passed array with the character '0'.

Parameters:

[]BYTE arr The array to be filled with '0's.

printing.module:147Process printing.trimTrailing0s

PROC printing.trimTrailing0s (VAL []BYTE arr, INT total)

Helps the user trim the trailing 0s from an array of BYTEs by decrementing total by one for every consecutive '0' at the end of the BYTE array.

Parameters:

VAL []BYTE arr The array of BYTEs to be processed.
INT total On completion of the PROC, this will be the number of elements of the array useful to printing.

printing.module:163Process printing.real32toa.helper

PROC printing.real32toa.helper (VAL INT lhs, []BYTE arr, INT length)

Real 32 to array helper function.

Honestly, this is magic to me. You probably don't need to invoke this.

printing.module:204Process real32toa

PROC real32toa (VAL REAL32 n, []BYTE arr, INT total)

Converts n into a printable array. The BYTE array arr and the INT total should be passed to this process blank, as arr will be populated with printable characters, and total will suggest the number of useful elements to write.

Parameters:

VAL REAL32 n The REAL32 to be printed.
[]BYTE arr The initially empty array to be used for storing BYTEs for printing.
INT total The initially zero INT that will store the total number of elements of arr useful for printing.

printing.module:234Process serial.write.real32

PROC serial.write.real32 (VAL INT board.pin, VAL REAL32 n, VAL INT precision)

Write a REAL32 to the serial port in decimal form.

board.pin must be written as TX0, RX0, TX1, RX1, etc.

Parameters:

VAL INT board.pin The board pin to be written to.
VAL REAL32 n The code REAL32 to write.
VAL INT precision The maximum length of the printed number.