note description: "[ Hitachi HD44780 controller display size configurations. ]" legal : "See notice at end of class." status : "See notice at end of class."; author : "Paul Bates (paul.a.bates@gmail.com)" date : "$Date$" revision: "$Revision$" expanded class HD44780_DISPLAY_CONFIG inherit ENUM_TYPE [NATURAL_16] create default_create, make convert make ({NATURAL_16}), item: {NATURAL_16} feature -- Access lines: NATURAL_8 -- Number of line in the current configuration do Result := (line_bitmask & item).to_natural_8 end columns: NATURAL_8 -- Number of line in the current configuration do Result := (columns_bitmask & item).bit_shift_right (8).to_natural_8 end feature {NONE} -- Access line_bitmask: NATURAL_16 = 0b0000000000000111 -- Bit mask for extracting the line value. columns_bitmask: NATURAL_16 = 0b0011111100000000 -- Bit mask for extracting the column value. feature -- Members display_16x2: NATURAL_16 = 0b0001000000000010 -- Configuration for a 16 character x 2 rows display display_16x4: NATURAL_16 = 0b0001000000000100 -- Configuration for a 16 character x 4 rows display display_20x2: NATURAL_16 = 0b0001010000000010 -- Configuration for a 20 character x 2 rows display display_20x4: NATURAL_16 = 0b0001010000000100 -- Configuration for a 20 character x 4 rows display display_40x2: NATURAL_16 = 0b0010100000000010 -- Configuration for a 40 character x 2 rows display feature {NONE} -- Members members: ARRAY [NATURAL_16] -- once Result := << display_16x2, display_16x4, display_20x2, display_20x4, display_40x2 >> end end