Most honorable JalList Guru's

I have attached my draft library for the k107.  I still have to put in 
the descriptive text but the library does compile but is, as of today, 
untested.

I am sending it now so that TPTB (The Powers That Be) can make 
suggestions as to what has to be changed to conform to your standards.

Please be critical!  I want to learn! I won't mind a kick in the butt if 
I deserve it.

Thanks

Wayne

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

-- -----------------------------------------------------------------------------
-- Title: LCD library for the k107 Serial Backpack
-- Author: Wayne Topa, Copyright (c) 2008..2009, all rights reserved.
-- Adapted-by: 
-- Compiler:  >=2.4k
--
-- This file is part of jallib (http://jallib.googlecode.com)
-- Released under the ZLIB license 
(http://www.opensource.org/licenses/zlib-license.html)
--
-- Sources:
--
-- Description:
--    Serial interface for K107 (and similar) serial LCD backpack for 
-- 2x16 to 4x20 HD44780 compatible alphanumeric LCD displays.
-- .
--    Expects: - 1 pin from Pic to K107
-- .
--    Directions for use of this library in application programs
--    (in this sequence):


-- define in calling program or here ???
const byte K107_CHARS = 20
var byte i
-- var byte cmd[]

procedure k107_init(byte in  geo) is
    var byte cmd[]
    case geo of
        216: block const byte cmd[] = "?G216" end block
        220: block const byte cmd[] = "?G220" end block
        224: block const byte cmd[] = "?G224" end block
        240: block const byte cmd[] = "?G240" end block
        416: block const byte cmd[] = "?G416" end block
        420: block const byte cmd[] = "?G420" end block
    end case
    for 5 using i loop
        serial_sw_write(cmd[i])
    end loop
--  delay required when writing to K107 EEPROM
    delay_100ms(2)
end procedure

-- Tab size can be 1-8
procedure k107_tabsize(byte in tab) is
    serial_sw_write("?")
    serial_sw_write("s")
    serial_sw_write(tab)
    delay_100ms(2)
end procedure

procedure k107_cursor_style(byte in c_style) is
    serial_sw_write("?")
    serial_sw_write("c")
    serial_sw_write(c_style)
    delay_100ms(2)
end procedure
    
-- Back Light settings 00 to FF hex. Use 80 or less normally
procedure k107_backlight(byte in bl) is
    serial_sw_write("?")
    serial_sw_write("s")
    serial_sw_write(bl)
end procedure

-- goto line

procedure k107_goto_line(byte in ln) is
    serial_sw_write("?")
    serial_sw_write("y")
    serial_sw_write(ln)
end procedure

-- goto column

procedure k107_goto_column(byte in cl) is
    serial_sw_write("?")
    serial_sw_write("x")
    serial_sw_write(cl)
end procedure

--  home cursor

procedure k107_home() is
    serial_sw_write("?")
    serial_sw_write("a")
end procedure

-- CLRF, cursor at start of line, line cleared

procedure k107_clrf() is
        serial_sw_write("?")
        serial_sw_write("n")
end procedure

-- tab, advances display one tab postiion

procedure k107_tab() is
    serial_sw_write("?")
    serial_sw_write("t")
end procedure

-- carrage return, cursor to start of current line

procedure k107_CR() is
    serial_sw_write("?")
    serial_sw_write("m")
end procedure

-- clear current line, cursor to start of current line

procedure k107_clr_line_home() is
    serial_sw_write("?")
    serial_sw_write("l")
end procedure


-- clear screen and leave cursor at home position

procedure k107_clear() is
    serial_sw_write("?")
    serial_sw_write("f")
end procedure

-- Non-destructive backspace

procedure k107_cur_back_1_no_del() is
    serial_sw_write("?")
    serial_sw_write("h")
end procedure

-- destructive backspace

procedure k107_cur_back_1_del() is
    serial_sw_write("?")
    serial_sw_write("b")
end procedure

-- forward cursor

procedure k107_cur_forward_1() is
    serial_sw_write("?")
    serial_sw_write("i")
end procedure

-- down cursor

procedure k107_cur_down_1() is
    serial_sw_write("?")
    serial_sw_write("j")
end procedure

-- up cursor

procedure k107_cur_up_1() is
    serial_sw_write("?")
    serial_sw_write("k")
end procedure


Reply via email to