Lcd companion boards support (VKLCD50RTA & VKLCD70RT)

What is this ?

This is a demo program using Renesas RGA library & USB Camera to demonstrate VK-RZ/A1H's companion boards workability.


Supported companion Boards:

VKLCD50RTA

/media/uploads/tvendov/front_view_hmi_50.png /media/uploads/tvendov/side_view_hmi_50.png

VKLCD70RT

/media/uploads/tvendov/front_view_hmi_70.png/media/uploads/tvendov/side_view_hmi_70.png /media/uploads/tvendov/front_view_lvds.png/media/uploads/tvendov/back_view_lvds.png


How to Configure ?

You can choose which display is installed by altering the lcd_panel.h file

Leave the active one & comment out the others:

#define     LCD_VDC5_CH0_PANEL                  LCD_CH0_PANEL_VKLCD50RTA
//#define     LCD_VDC5_CH0_PANEL                  LCD_CH0_PANEL_VKLCD70RT

You can alter the whole demo with your pictures if you like:


How to compile ?

  • The Demo can be compiled in 3 modes:
    • I. Execution from the internal 10-MB on-chip SRAM.
      • After import in the online compiler just leave only the VKRZA1H_RAM.sct & delete all others linker files in the TOOLCHAIN_ARM_STD folder.
      • Save the result binary in the SD Card (<SD>:\vkrza1\lcd_sample ), altering vkrza1h.ini by this way
    • II. Execution from the on-board serial FALSH in dual (32-MB) mode.
      • After import in the online compiler just leave only the VKRZA1H_DOUBLE.sct & delete all others linker files in the TOOLCHAIN_ARM_STD folder.
      • Drag & drop the result binary in MBED disk, (previously inited in double flash mode)
    • III. Execution from the on-board serial FALSH in single (16-MB) mode.
      • After import in the online compiler just leave only the VKRZA1H_SINGLE.sct & delete all others linker files in the TOOLCHAIN_ARM_STD folder.
      • Drag & drop the result binary in MBED disk, (previously inited in single flash mode )

Quick presentation:


Other demos ?

More demos you can find on our FTP

Committer:
tvendov
Date:
Thu Feb 16 10:23:48 2017 +0000
Revision:
0:6435b67ad23c
Initial lcd support (VKLCD50RTA & VKLCD70RT companion boards)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tvendov 0:6435b67ad23c 1 /* mbed Microcontroller Library
tvendov 0:6435b67ad23c 2 * Copyright (c) 2006-2013 ARM Limited
tvendov 0:6435b67ad23c 3 *
tvendov 0:6435b67ad23c 4 * Licensed under the Apache License, Version 2.0 (the "License");
tvendov 0:6435b67ad23c 5 * you may not use this file except in compliance with the License.
tvendov 0:6435b67ad23c 6 * You may obtain a copy of the License at
tvendov 0:6435b67ad23c 7 *
tvendov 0:6435b67ad23c 8 * http://www.apache.org/licenses/LICENSE-2.0
tvendov 0:6435b67ad23c 9 *
tvendov 0:6435b67ad23c 10 * Unless required by applicable law or agreed to in writing, software
tvendov 0:6435b67ad23c 11 * distributed under the License is distributed on an "AS IS" BASIS,
tvendov 0:6435b67ad23c 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
tvendov 0:6435b67ad23c 13 * See the License for the specific language governing permissions and
tvendov 0:6435b67ad23c 14 * limitations under the License.
tvendov 0:6435b67ad23c 15 */
tvendov 0:6435b67ad23c 16 #include "BusInOut.h"
tvendov 0:6435b67ad23c 17 #include "mbed_assert.h"
tvendov 0:6435b67ad23c 18
tvendov 0:6435b67ad23c 19 namespace mbed {
tvendov 0:6435b67ad23c 20
tvendov 0:6435b67ad23c 21 BusInOut::BusInOut(PinName p0, PinName p1, PinName p2, PinName p3, PinName p4, PinName p5, PinName p6, PinName p7, PinName p8, PinName p9, PinName p10, PinName p11, PinName p12, PinName p13, PinName p14, PinName p15) {
tvendov 0:6435b67ad23c 22 PinName pins[16] = {p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15};
tvendov 0:6435b67ad23c 23
tvendov 0:6435b67ad23c 24 // No lock needed in the constructor
tvendov 0:6435b67ad23c 25 _nc_mask = 0;
tvendov 0:6435b67ad23c 26 for (int i=0; i<16; i++) {
tvendov 0:6435b67ad23c 27 _pin[i] = (pins[i] != NC) ? new DigitalInOut(pins[i]) : 0;
tvendov 0:6435b67ad23c 28 if (pins[i] != NC) {
tvendov 0:6435b67ad23c 29 _nc_mask |= (1 << i);
tvendov 0:6435b67ad23c 30 }
tvendov 0:6435b67ad23c 31 }
tvendov 0:6435b67ad23c 32 }
tvendov 0:6435b67ad23c 33
tvendov 0:6435b67ad23c 34 BusInOut::BusInOut(PinName pins[16]) {
tvendov 0:6435b67ad23c 35 // No lock needed in the constructor
tvendov 0:6435b67ad23c 36 _nc_mask = 0;
tvendov 0:6435b67ad23c 37 for (int i=0; i<16; i++) {
tvendov 0:6435b67ad23c 38 _pin[i] = (pins[i] != NC) ? new DigitalInOut(pins[i]) : 0;
tvendov 0:6435b67ad23c 39 if (pins[i] != NC) {
tvendov 0:6435b67ad23c 40 _nc_mask |= (1 << i);
tvendov 0:6435b67ad23c 41 }
tvendov 0:6435b67ad23c 42 }
tvendov 0:6435b67ad23c 43 }
tvendov 0:6435b67ad23c 44
tvendov 0:6435b67ad23c 45 BusInOut::~BusInOut() {
tvendov 0:6435b67ad23c 46 // No lock needed in the destructor
tvendov 0:6435b67ad23c 47 for (int i=0; i<16; i++) {
tvendov 0:6435b67ad23c 48 if (_pin[i] != 0) {
tvendov 0:6435b67ad23c 49 delete _pin[i];
tvendov 0:6435b67ad23c 50 }
tvendov 0:6435b67ad23c 51 }
tvendov 0:6435b67ad23c 52 }
tvendov 0:6435b67ad23c 53
tvendov 0:6435b67ad23c 54 void BusInOut::write(int value) {
tvendov 0:6435b67ad23c 55 lock();
tvendov 0:6435b67ad23c 56 for (int i=0; i<16; i++) {
tvendov 0:6435b67ad23c 57 if (_pin[i] != 0) {
tvendov 0:6435b67ad23c 58 _pin[i]->write((value >> i) & 1);
tvendov 0:6435b67ad23c 59 }
tvendov 0:6435b67ad23c 60 }
tvendov 0:6435b67ad23c 61 unlock();
tvendov 0:6435b67ad23c 62 }
tvendov 0:6435b67ad23c 63
tvendov 0:6435b67ad23c 64 int BusInOut::read() {
tvendov 0:6435b67ad23c 65 lock();
tvendov 0:6435b67ad23c 66 int v = 0;
tvendov 0:6435b67ad23c 67 for (int i=0; i<16; i++) {
tvendov 0:6435b67ad23c 68 if (_pin[i] != 0) {
tvendov 0:6435b67ad23c 69 v |= _pin[i]->read() << i;
tvendov 0:6435b67ad23c 70 }
tvendov 0:6435b67ad23c 71 }
tvendov 0:6435b67ad23c 72 unlock();
tvendov 0:6435b67ad23c 73 return v;
tvendov 0:6435b67ad23c 74 }
tvendov 0:6435b67ad23c 75
tvendov 0:6435b67ad23c 76 void BusInOut::output() {
tvendov 0:6435b67ad23c 77 lock();
tvendov 0:6435b67ad23c 78 for (int i=0; i<16; i++) {
tvendov 0:6435b67ad23c 79 if (_pin[i] != 0) {
tvendov 0:6435b67ad23c 80 _pin[i]->output();
tvendov 0:6435b67ad23c 81 }
tvendov 0:6435b67ad23c 82 }
tvendov 0:6435b67ad23c 83 unlock();
tvendov 0:6435b67ad23c 84 }
tvendov 0:6435b67ad23c 85
tvendov 0:6435b67ad23c 86 void BusInOut::input() {
tvendov 0:6435b67ad23c 87 lock();
tvendov 0:6435b67ad23c 88 for (int i=0; i<16; i++) {
tvendov 0:6435b67ad23c 89 if (_pin[i] != 0) {
tvendov 0:6435b67ad23c 90 _pin[i]->input();
tvendov 0:6435b67ad23c 91 }
tvendov 0:6435b67ad23c 92 }
tvendov 0:6435b67ad23c 93 unlock();
tvendov 0:6435b67ad23c 94 }
tvendov 0:6435b67ad23c 95
tvendov 0:6435b67ad23c 96 void BusInOut::mode(PinMode pull) {
tvendov 0:6435b67ad23c 97 lock();
tvendov 0:6435b67ad23c 98 for (int i=0; i<16; i++) {
tvendov 0:6435b67ad23c 99 if (_pin[i] != 0) {
tvendov 0:6435b67ad23c 100 _pin[i]->mode(pull);
tvendov 0:6435b67ad23c 101 }
tvendov 0:6435b67ad23c 102 }
tvendov 0:6435b67ad23c 103 unlock();
tvendov 0:6435b67ad23c 104 }
tvendov 0:6435b67ad23c 105
tvendov 0:6435b67ad23c 106 BusInOut& BusInOut::operator= (int v) {
tvendov 0:6435b67ad23c 107 // Underlying write is thread safe
tvendov 0:6435b67ad23c 108 write(v);
tvendov 0:6435b67ad23c 109 return *this;
tvendov 0:6435b67ad23c 110 }
tvendov 0:6435b67ad23c 111
tvendov 0:6435b67ad23c 112 BusInOut& BusInOut::operator= (BusInOut& rhs) {
tvendov 0:6435b67ad23c 113 // Underlying read is thread safe
tvendov 0:6435b67ad23c 114 write(rhs.read());
tvendov 0:6435b67ad23c 115 return *this;
tvendov 0:6435b67ad23c 116 }
tvendov 0:6435b67ad23c 117
tvendov 0:6435b67ad23c 118 DigitalInOut& BusInOut::operator[] (int index) {
tvendov 0:6435b67ad23c 119 // No lock needed since _pin is not modified outside the constructor
tvendov 0:6435b67ad23c 120 MBED_ASSERT(index >= 0 && index <= 16);
tvendov 0:6435b67ad23c 121 MBED_ASSERT(_pin[index]);
tvendov 0:6435b67ad23c 122 return *_pin[index];
tvendov 0:6435b67ad23c 123 }
tvendov 0:6435b67ad23c 124
tvendov 0:6435b67ad23c 125 BusInOut::operator int() {
tvendov 0:6435b67ad23c 126 // Underlying read is thread safe
tvendov 0:6435b67ad23c 127 return read();
tvendov 0:6435b67ad23c 128 }
tvendov 0:6435b67ad23c 129
tvendov 0:6435b67ad23c 130 void BusInOut::lock() {
tvendov 0:6435b67ad23c 131 _mutex.lock();
tvendov 0:6435b67ad23c 132 }
tvendov 0:6435b67ad23c 133
tvendov 0:6435b67ad23c 134 void BusInOut::unlock() {
tvendov 0:6435b67ad23c 135 _mutex.unlock();
tvendov 0:6435b67ad23c 136 }
tvendov 0:6435b67ad23c 137
tvendov 0:6435b67ad23c 138 } // namespace mbed
tvendov 0:6435b67ad23c 139