Building a Keyboard Interface using S7G2 LCD

s7g2
guix

#1

Package Info
E2 Studio : 5.0
SSP Version : 1.10
Device: S7G2

I. Introduction
The purpose of this project was to create a user interface that allows input into S7G2 Renesas. I decided to make a rudimentary keyboard to insert simple text messages. In the long run, my main objective is to create a login page, in which the user would input a password and gain access to the next pages. In order to accomplish this task, we first need some kind of input. This will be an ongoing project.

II. Guix Studo Keyboard Construction
The hardware and interface drivers can be copied from the “Hello World Project”. This is a good starting point for obtaining the proper drivers.
For the examples below, I will run through the creation button “Q”.

  1. We must first create a window in GUIX Studio. I will call my window “keypad”.
    Go to Insert-> Window-> Window

  • Next we proceed in the creation of the buttons. Click on “Keypad” page and go to Insert ->Button----->Text Button.
  • The properties of the button must now be configured.

Notice the widget name given to the button. The Widget ID is probably the most important to take notice. We must name this exactly as it appears in the Event Handler.cpp page in e2 studio. I have named my Widget ID KEY_Q for easy identification. We can also adjust the color of the button by scrolling through the colors in “Normal Fill” and “Selected Fill”. This must be done for every button.

  • Next we must insert a text prompt. My prompt states “Type in password”.
    Click on the “Keypad” page Go to Insert->Text->Prompt
    The prompt screen must also be configured and named since it will interact with the C code in e2 studio.
    Configure the properties in the “Properties Window”.

III. Guix Event Handler C Code
As seen below, we must declare every key and the output of pressing the key.
Notice “KeypadEventHandler”, this name must match exactly in the Guix Studio. In the “Hello World” program, you will find the “Window Event Handler”. This can be erased, and the handler name of the page given in Guix studio. The code can be configured as follows, with all the characters, numbers and letter used in the keypad. I will be posting updates as I complete this project.

/* Keypad Event Handler */
UINT KeypadEventHandler (GX_WINDOW * widget, GX_EVENT * event_ptr)
{
    UINT status;
    GX_PIXELMAP *map;

    switch (event_ptr->gx_event_type)
    {
        case GX_SIGNAL(KEY_A, GX_EVENT_CLICKED):
                {
                    append_key_code("A");
                }
                break;

        case GX_SIGNAL(KEY_B, GX_EVENT_CLICKED):
                {
                    append_key_code("B");
                }
                break;
        case GX_SIGNAL(KEY_C, GX_EVENT_CLICKED):
                {
                    append_key_code("C");
                }
                break;
        case GX_SIGNAL(KEY_E, GX_EVENT_CLICKED):
                {
                    append_key_code("E");
                }
                break;
        case GX_SIGNAL(KEY_F, GX_EVENT_CLICKED):
                {
                    append_key_code("G");
                }
                break;
        case GX_SIGNAL(KEY_G, GX_EVENT_CLICKED):
                {
                    append_key_code("G");
                }
                break;
        case GX_SIGNAL(KEY_H, GX_EVENT_CLICKED):
                {
                    append_key_code("H");
                }
                break;
        case GX_SIGNAL(KEY_I, GX_EVENT_CLICKED):
                {
                    append_key_code("I");
                }
                break;

        case GX_SIGNAL(KEY_J, GX_EVENT_CLICKED):
                {
                    append_key_code("J");
                }
                break;
        case GX_SIGNAL(KEY_K, GX_EVENT_CLICKED):
                {
                    append_key_code("K");
                }
                break;
        case GX_SIGNAL(KEY_L, GX_EVENT_CLICKED):
                {
                    append_key_code("L");
                }
                break;
        case GX_SIGNAL(KEY_M, GX_EVENT_CLICKED):
                {
                    append_key_code("M");
                }
                break;
        case GX_SIGNAL(KEY_N, GX_EVENT_CLICKED):
                {
                    append_key_code("N");
                }
                break;
        case GX_SIGNAL(KEY_O, GX_EVENT_CLICKED):
                {
                    append_key_code("0");
                }
                break;
        case GX_SIGNAL(KEY_P, GX_EVENT_CLICKED):
                {
                    append_key_code("P");
                }
                break;
        case GX_SIGNAL(KEY_Q, GX_EVENT_CLICKED):
                {
                    append_key_code("Q");
                }
                break;
        case GX_SIGNAL(KEY_R, GX_EVENT_CLICKED):
                {
                    append_key_code("R");
                }
                break;
        case GX_SIGNAL(KEY_S, GX_EVENT_CLICKED):
                {
                    append_key_code("S");
                }
                break;
        case GX_SIGNAL(KEY_T, GX_EVENT_CLICKED):
                {
                    append_key_code("T");
                }
                break;
        case GX_SIGNAL(KEY_U, GX_EVENT_CLICKED):
                {
                    append_key_code("U");
                }
                break;
        case GX_SIGNAL(KEY_V, GX_EVENT_CLICKED):
                {
                    append_key_code("V");
                }
                break;
        case GX_SIGNAL(KEY_W, GX_EVENT_CLICKED):
                {
                    append_key_code("W");
                }
                break;
        case GX_SIGNAL(KEY_X, GX_EVENT_CLICKED):
                {
                    append_key_code("X");
                }
                break;
        case GX_SIGNAL(KEY_Y, GX_EVENT_CLICKED):
                {
                    append_key_code("Y");
                }
                break;
        case GX_SIGNAL(KEY_Z, GX_EVENT_CLICKED):
                {
                    append_key_code("Z");
                }
        case GX_SIGNAL(KEY_SPACE, GX_EVENT_CLICKED):
               {
                   append_key_code(" ");
               }
               break;
        case GX_SIGNAL(KEY_Excl, GX_EVENT_CLICKED):
               {
                   append_key_code("!");
               }
               break;
        case GX_SIGNAL(KEY_UnderScore, GX_EVENT_CLICKED):
               {
                   append_key_code("_");
               }
               break;
        case GX_SIGNAL(KEY_00, GX_EVENT_CLICKED):
        {
            append_key_code("0");
        }
        break;
        case GX_SIGNAL(KEY_01, GX_EVENT_CLICKED):
        {
            append_key_code("1");
        }
        break;
        case GX_SIGNAL(KEY_02, GX_EVENT_CLICKED):
        {
            append_key_code("2");
        }
        break;
        case GX_SIGNAL(KEY_03, GX_EVENT_CLICKED):
        {
            append_key_code("3");
        }
        break;
        case GX_SIGNAL(KEY_04, GX_EVENT_CLICKED):
        {
            append_key_code("4");
        }
        break;
        case GX_SIGNAL(KEY_05, GX_EVENT_CLICKED):
        {
            append_key_code("5");
        }
        break;
        case GX_SIGNAL(KEY_06, GX_EVENT_CLICKED):
        {
            append_key_code("6");
        }
        break;
        case GX_SIGNAL(KEY_07, GX_EVENT_CLICKED):
        {
            append_key_code("7");
        }
        break;
        case GX_SIGNAL(KEY_08, GX_EVENT_CLICKED):
        {
            append_key_code("8");
        }
        break;
        case GX_SIGNAL(KEY_09, GX_EVENT_CLICKED):
        {
            append_key_code("9");
        }
        break;

@craig @jcasman Here’s another project that is in process. Thanks for the opportunity.


[SOLVED] S7G2 GUIX Touch Drivers error with SSP1.2.0
SK-S7G2 Tutorials
#2

Beautiful. This is so cool. Thanks for sharing it. Rockin!


#3

@elpaniagua, your tutorial was promoted out on the Renesas America Twitter feed to their 6.6K followers in the US. You may want to beef up your profile information to help potential recruiters find you in the future. At least consider putting your full name. Just trying to help you out. Of course, it’s your choice on what info you want to disclose about your self.