Example code for RX65N Envision dev board with GCC RX compiler

There seems to be little example code around for the RX65N Envision kit in general, and even less when using the GCC-RX compiler. I've seen a request or two here for a simple hello world type application. The example app that Renesas supplies for this board using their compiler is complicated and tied in to Emwin, so I've put together a much simpler one for anyone who's interested. It has touch screen and LCD drivers incorporated, all using direct register access, but neatly abstracted away into a simple API. The app reads touch screen coordinates and plots a box on the screen displaying the touch point screen coordinate inside it as text. The main function is effectively this...


lcd_filled_rectangle(0, 0, 480, 272, RED);

while (true)
    touched = touch_get_point(&x, &y);
    if (touched)
        if (x < 450 && y < 240)
            lcd_filled_rectangle(x, y, 30, 32, BLACK);
            itoa(x, text, 10);
            lcd_string(x, y, text, WHITE);
            itoa(y, text, 10);
            lcd_string(x, y + 16, text, WHITE);

Colours parameters to the lcd_* functions are in 24 bit (RGB888) format even though the display uses 16 bit (RGB565) format and are downsized in the functions. I know this is inefficient, but in demo code it's more intuitive to deal with RGB888 format colours.

I've created an e2studio project (version 7.2.0) and the GCC RX version used is All the project files and source are in in the EnvisionDemo1 folder in github here...


If anyone finds this useful I'll do some more examples projects. I also have it working using the cc-rx compiler if anyone is interested in that.