메인 콘텐츠로 건너뛰기
Knowledgebase
Home
Renesas Korea

How do you use IRQs with GUIX to initiate screen changes?

Latest Updated:10/04/2016

Question:

How do yo use IRQs with GUIX to initiate screen changes?

Answer:

You can use IRQs, for example those generated from switches on a kit to generate GUIX events. Here is some code from the attached project that illustrates the process for turning interrupts into events:

#include "application_define.h"

void input_thread_entry(void);

/* Input Thread entry function */
void input_thread_entry(void)
{
    UINT status;

    status = g_sw4_irq.p_api->open(g_sw4_irq.p_ctrl, g_sw4_irq.p_cfg);
    APP_ERROR_TRAP(status)

    status = g_sw5_irq.p_api->open(g_sw5_irq.p_ctrl, g_sw5_irq.p_cfg);
    APP_ERROR_TRAP(status)

    while (1)
    {
        tx_thread_sleep (TX_WAIT_FOREVER);
    }
}

void g_sw4_irq_callback(external_irq_callback_args_t * p_args)
{
    GX_EVENT gxe = {0, 0, 0, 0, 0};

    gxe.gx_event_type = APP_EVENT_SW4_PRESS;
    gx_system_event_send(&gxe);
}

void g_sw5_irq_callback(external_irq_callback_args_t * p_args)
{
    GX_EVENT gxe = {0, 0, 0, 0, 0};

    gxe.gx_event_type = APP_EVENT_SW5_PRESS;
    gx_system_event_send(&gxe);
}

/@api/deki/files/1832/s7_sk_gx_draw_demo_1_0_0g.zip?origin=mt-web

  • 이 기사가 도움이 되셨나요?