easy_c 1.0

# LCD32 module declarations:

# The LCD32 module can output two lines of 16 characters each.


# LCD32 (Revision B) Summary:
#
# lcd32 :@= create@RB2_LCD32_B(32s)
#
# call character@(lcd32, cmd, ccccccc)
#    The argument ccccccc is of type Byte.
#    Output character {ccccccc} where {ccccccc} is between 32b and 126b.
#    
# call row_set@(lcd32, cmd, r)
#    The argument r is of type Byte.
#    Set the row to {r}.  {r}=0b is first row and {r}=1b is second row.
#    
# call next_line@(lcd32, cmd)
#    Advance to the next line.
#    
# call clear@(lcd32, cmd)
#    Clear the LCD.
#    
# call carriage_return@(lcd32, cmd)
#    Go to column 0 of current line.
#    
# call column_set@(lcd32, cmd, cccc)
#    The argument cccc is of type Byte.
#    Set the column to {cccc}.  {cccc}=0b is first column and 15b is last.
#    
# End of summary

# LCD32 (Revision B) declarations:

define RB2_LCD32_B
    simple Short

routine create@RB2_LCD32_B
    takes address Short
    returns RB2_LCD32_B
    external RB2__cmd_new

    # Create and return new {RB2_LCD32_B} object
    # connected to LCD32 module at {address}.

routine select@RB2_LCD32_B
    takes lcd32 RB2_LCD32_B
    returns Logical
    external RB2__select

define RB2_LCD32_B_Character
    simple Byte

constant cmd@RB2_LCD32_B_Character RB2_LCD32_B_Character =
  rb2_lcd32_b_character@(0b)

routine character@RB2_LCD32_B
    takes lcd32 RB2_LCD32_B
    takes command RB2_LCD32_B_Character
    takes ccccccc Byte
    returns_nothing
    external RB2__cmd_m


define RB2_LCD32_B_Row_Set
    simple Byte

constant cmd@RB2_LCD32_B_Row_Set RB2_LCD32_B_Row_Set =
  rb2_lcd32_b_row_set@(4b)

routine row_set@RB2_LCD32_B
    takes lcd32 RB2_LCD32_B
    takes command RB2_LCD32_B_Row_Set
    takes r Byte
    returns_nothing
    external RB2__cmd_m


define RB2_LCD32_B_Next_Line
    simple Byte

constant cmd@RB2_LCD32_B_Next_Line RB2_LCD32_B_Next_Line =
  rb2_lcd32_b_next_line@(10b)

routine next_line@RB2_LCD32_B
    takes lcd32 RB2_LCD32_B
    takes command RB2_LCD32_B_Next_Line
    returns_nothing
    external RB2__cmd_c


define RB2_LCD32_B_Clear
    simple Byte

constant cmd@RB2_LCD32_B_Clear RB2_LCD32_B_Clear =
  rb2_lcd32_b_clear@(12b)

routine clear@RB2_LCD32_B
    takes lcd32 RB2_LCD32_B
    takes command RB2_LCD32_B_Clear
    returns_nothing
    external RB2__cmd_c


define RB2_LCD32_B_Carriage_Return
    simple Byte

constant cmd@RB2_LCD32_B_Carriage_Return RB2_LCD32_B_Carriage_Return =
  rb2_lcd32_b_carriage_return@(13b)

routine carriage_return@RB2_LCD32_B
    takes lcd32 RB2_LCD32_B
    takes command RB2_LCD32_B_Carriage_Return
    returns_nothing
    external RB2__cmd_c


define RB2_LCD32_B_Column_Set
    simple Byte

constant cmd@RB2_LCD32_B_Column_Set RB2_LCD32_B_Column_Set =
  rb2_lcd32_b_column_set@(16b)

routine column_set@RB2_LCD32_B
    takes lcd32 RB2_LCD32_B
    takes command RB2_LCD32_B_Column_Set
    takes cccc Byte
    returns_nothing
    external RB2__cmd_m


