owner sign in

3.5 The UI functions of the T1 library

Target system!user interface subsystem!functions T1 C library!user interface functions Target system!design of the!user interface double_in() double_in() fgets_keypad() fgets_keypad() printf_lcd() printf_lcd() putchar_lcd() putchar_lcd() getchar_keypad() getchar_keypad() getkey() getkey()

In Section 2.11, the UI functions of the T1 library were introduced. A more detailed view of the operational diagram from Figure 2.10 is given in Figure 3.2.

Figure 3.2: An operational diagram of the UI functions, and their relations to UI elements and feedback control.

The functions fgets_keypad() and getchar_keypad() will be written in Lab Exercise 3. Their detailed operation is illustrated in Figure 3.2, along with the rest of the UI functions. The getchar_keypad() function works like the standard library getchar(): it reads a char from an input stream (a stream is a Unix abstraction in which data elements are made available in sequence), usually from a user-input device like a keyboard. Our getchar_keypad() is a buffered getchar(), which means that it will be able to write to a char-array buffer, which keeps track of the entered characters and can be edited by a user.

The lowest-level C functions supporting double_in() are getkey(), which interprets digital inputs (DIs) as keystrokes and returns the corresponding key code char; and putchar_lcd(), which sends character codes to the LCD so that a user can see the updated number that they are entering. These will be written in Lab Exercise 4.

double_in() double_in() fgets_keypad() fgets_keypad() printf_lcd() printf_lcd() putchar_lcd() putchar_lcd() getchar_keypad() getchar_keypad() getkey() getkey() Target system!user interface subsystem!functions T1 C library!user interface functions Target system!design of the!user interface