Sw2 key press counter and display to tft

Dependencies:   mbed PinDetect

Committer:
reedas
Date:
Tue Nov 26 09:14:00 2019 +0000
Revision:
2:f7100947de37
Parent:
1:402b32a1025f
Switch SW2 key press counter

Who changed what in which revision?

UserRevisionLine numberNew contents of line
reedas 1:402b32a1025f 1 /***************************************************************************//**
reedas 1:402b32a1025f 2 * \file DisplayInterface.h
reedas 1:402b32a1025f 3 * \version 1.0
reedas 1:402b32a1025f 4 *
reedas 1:402b32a1025f 5 * \brief
reedas 1:402b32a1025f 6 * Objective:
reedas 1:402b32a1025f 7 * This is display software i8080 interface source file
reedas 1:402b32a1025f 8 *
reedas 1:402b32a1025f 9 ********************************************************************************
reedas 1:402b32a1025f 10 * \copyright
reedas 1:402b32a1025f 11 * Copyright 2018-2019 Cypress Semiconductor Corporation
reedas 1:402b32a1025f 12 * SPDX-License-Identifier: Apache-2.0
reedas 1:402b32a1025f 13 *
reedas 1:402b32a1025f 14 * Licensed under the Apache License, Version 2.0 (the "License");
reedas 1:402b32a1025f 15 * you may not use this file except in compliance with the License.
reedas 1:402b32a1025f 16 * You may obtain a copy of the License at
reedas 1:402b32a1025f 17 *
reedas 1:402b32a1025f 18 * http://www.apache.org/licenses/LICENSE-2.0
reedas 1:402b32a1025f 19 *
reedas 1:402b32a1025f 20 * Unless required by applicable law or agreed to in writing, software
reedas 1:402b32a1025f 21 * distributed under the License is distributed on an "AS IS" BASIS,
reedas 1:402b32a1025f 22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
reedas 1:402b32a1025f 23 * See the License for the specific language governing permissions and
reedas 1:402b32a1025f 24 * limitations under the License.
reedas 1:402b32a1025f 25 *******************************************************************************/
reedas 1:402b32a1025f 26
reedas 1:402b32a1025f 27
reedas 1:402b32a1025f 28 #include "cy8ckit_028_tft.h"
reedas 1:402b32a1025f 29 #include <mbed_wait_api.h>
reedas 1:402b32a1025f 30 #include "mbed.h"
reedas 1:402b32a1025f 31 #include "PortInOut.h"
reedas 1:402b32a1025f 32
reedas 1:402b32a1025f 33
reedas 1:402b32a1025f 34 DigitalInOut LCD_REG0(P9_0);
reedas 1:402b32a1025f 35 DigitalInOut LCD_REG1(P9_1);
reedas 1:402b32a1025f 36 DigitalInOut LCD_REG2(P9_2);
reedas 1:402b32a1025f 37 DigitalInOut LCD_REG3(P9_4);
reedas 1:402b32a1025f 38 DigitalInOut LCD_REG4(P9_5);
reedas 1:402b32a1025f 39 DigitalInOut LCD_REG5(P0_2);
reedas 1:402b32a1025f 40 DigitalInOut LCD_REG6(P13_0);
reedas 1:402b32a1025f 41 DigitalInOut LCD_REG7(P13_1);
reedas 1:402b32a1025f 42 PortInOut P0(Port0, 0x04);
reedas 1:402b32a1025f 43 PortInOut P9(Port9, 0x37);
reedas 1:402b32a1025f 44 PortInOut P13(Port13, 0x03);
reedas 1:402b32a1025f 45
reedas 1:402b32a1025f 46 DigitalOut LCD_NWR(P12_0);
reedas 1:402b32a1025f 47 DigitalOut LCD_DC(P12_1);
reedas 1:402b32a1025f 48 DigitalOut LCD_RESET(P12_2);
reedas 1:402b32a1025f 49 DigitalOut LCD_NRD(P12_3);
reedas 1:402b32a1025f 50
reedas 1:402b32a1025f 51 /*******************************************************************************
reedas 1:402b32a1025f 52 * Function Name: DataWrite
reedas 1:402b32a1025f 53 ****************************************************************************/
reedas 1:402b32a1025f 54 /**
reedas 1:402b32a1025f 55 *
reedas 1:402b32a1025f 56 * \brief
reedas 1:402b32a1025f 57 * Writes one byte of data to the software i8080 interface.
reedas 1:402b32a1025f 58 *
reedas 1:402b32a1025f 59 * \details
reedas 1:402b32a1025f 60 * This function:
reedas 1:402b32a1025f 61 * - Writes data to the data bus
reedas 1:402b32a1025f 62 * - Sends low pulse to the LCD_NWR line to write data
reedas 1:402b32a1025f 63 *
reedas 1:402b32a1025f 64 * Changed from individual bit banging to port masked writes to
reedas 1:402b32a1025f 65 * P9[5,4,2,1,0], P13[1,0], P0[2] to optimise slightly
reedas 1:402b32a1025f 66 *
reedas 1:402b32a1025f 67 * \todo
reedas 1:402b32a1025f 68 * All this should be replaced with a udb register to save all the shifting
reedas 1:402b32a1025f 69 * and individual bit writing.
reedas 1:402b32a1025f 70 *
reedas 1:402b32a1025f 71 *******************************************************************************/
reedas 1:402b32a1025f 72 void DataWrite(U8 data)
reedas 1:402b32a1025f 73 {
reedas 1:402b32a1025f 74 // LCD_REG0 = (data & 0x01);
reedas 1:402b32a1025f 75 // LCD_REG1 = ((data>>1) & 0x01);
reedas 1:402b32a1025f 76 // LCD_REG2 = ((data>>2) & 0x01);
reedas 1:402b32a1025f 77 // LCD_REG3 = ((data>>3) & 0x01);
reedas 1:402b32a1025f 78 // LCD_REG4 = ((data>>4) & 0x01);
reedas 1:402b32a1025f 79
reedas 1:402b32a1025f 80 /* read the appropriate port and only change the bits we need to then write the
reedas 1:402b32a1025f 81 * affected bits back to the port retaining any unaffected bit values
reedas 1:402b32a1025f 82 */
reedas 1:402b32a1025f 83 int pbyte = P9.read();
reedas 1:402b32a1025f 84 int bit012 = (data & 0x07);
reedas 1:402b32a1025f 85 int bit34 = (data & 0x18) << 1;
reedas 1:402b32a1025f 86 pbyte = (pbyte & 0xc8) | bit34 | bit012;
reedas 1:402b32a1025f 87 P9.write(pbyte);
reedas 1:402b32a1025f 88 // LCD_REG5 = ((data>>5) & 0x01);
reedas 1:402b32a1025f 89 pbyte = P0.read();
reedas 1:402b32a1025f 90 int bit5 = (data & 0x20) >> 3 ;
reedas 1:402b32a1025f 91 pbyte = (pbyte & 0xfb) | bit5 ;
reedas 1:402b32a1025f 92 P0.write(pbyte);
reedas 1:402b32a1025f 93
reedas 1:402b32a1025f 94 // LCD_REG6 = ((data>>6) & 0x01);
reedas 1:402b32a1025f 95 // LCD_REG7 = ((data>>7) & 0x01);
reedas 1:402b32a1025f 96 pbyte = P13.read();
reedas 1:402b32a1025f 97 int bit67 = (data & 0xc0) >> 6 ;
reedas 1:402b32a1025f 98 pbyte = (pbyte & 0xfc) | bit67 ;
reedas 1:402b32a1025f 99 P13.write(pbyte);
reedas 1:402b32a1025f 100 LCD_NWR = 0u;
reedas 1:402b32a1025f 101 LCD_NWR = 1u;
reedas 1:402b32a1025f 102
reedas 1:402b32a1025f 103 }
reedas 1:402b32a1025f 104
reedas 1:402b32a1025f 105
reedas 1:402b32a1025f 106 /*******************************************************************************
reedas 1:402b32a1025f 107 * Function Name: DataRead
reedas 1:402b32a1025f 108 ****************************************************************************//**
reedas 1:402b32a1025f 109 *
reedas 1:402b32a1025f 110 * \brief
reedas 1:402b32a1025f 111 * Reads one byte of data from the software i8080 interface.
reedas 1:402b32a1025f 112 *
reedas 1:402b32a1025f 113 * \details
reedas 1:402b32a1025f 114 * This function:
reedas 1:402b32a1025f 115 * - Changes data bus GPIO pins drive mode to digital Hi-Z with enabled input
reedas 1:402b32a1025f 116 * buffer
reedas 1:402b32a1025f 117 * - Sends low pulse to LCD_NRD line to read data
reedas 1:402b32a1025f 118 * - Reads data from the data bus
reedas 1:402b32a1025f 119 * - Sends low pulse to the LCD_NWR line to write data
reedas 1:402b32a1025f 120 * - Changes data bus GPIO pins drive mode back to to Strong Drive mode
reedas 1:402b32a1025f 121 *
reedas 1:402b32a1025f 122 * \todo
reedas 1:402b32a1025f 123 * All this should be replaced with a udb register to save all the shifting
reedas 1:402b32a1025f 124 * and individual bit reading.
reedas 1:402b32a1025f 125 *
reedas 1:402b32a1025f 126 *******************************************************************************/
reedas 1:402b32a1025f 127 U8 DataRead(void)
reedas 1:402b32a1025f 128 {
reedas 1:402b32a1025f 129 U8 data = 0u;
reedas 1:402b32a1025f 130
reedas 1:402b32a1025f 131 /* enable input */
reedas 1:402b32a1025f 132 LCD_REG0.input();
reedas 1:402b32a1025f 133 LCD_REG1.input();
reedas 1:402b32a1025f 134 LCD_REG2.input();
reedas 1:402b32a1025f 135 LCD_REG3.input();
reedas 1:402b32a1025f 136 LCD_REG4.input();
reedas 1:402b32a1025f 137 LCD_REG5.input();
reedas 1:402b32a1025f 138 LCD_REG6.input();
reedas 1:402b32a1025f 139 LCD_REG7.input();
reedas 1:402b32a1025f 140
reedas 1:402b32a1025f 141 LCD_NRD = 0u; // Pulse read line low then read the data port
reedas 1:402b32a1025f 142
reedas 1:402b32a1025f 143 data = (U8)LCD_REG0.read();
reedas 1:402b32a1025f 144 data |= (U8)LCD_REG1.read()<<1;
reedas 1:402b32a1025f 145 data |= (U8)LCD_REG2.read()<<2;
reedas 1:402b32a1025f 146 data |= (U8)LCD_REG3.read()<<3;
reedas 1:402b32a1025f 147 data |= (U8)LCD_REG4.read()<<4;
reedas 1:402b32a1025f 148 data |= (U8)LCD_REG5.read()<<5;
reedas 1:402b32a1025f 149 data |= (U8)LCD_REG6.read()<<6;
reedas 1:402b32a1025f 150 data |= (U8)LCD_REG7.read()<<7;
reedas 1:402b32a1025f 151
reedas 1:402b32a1025f 152 LCD_NRD = 1u; // Raise the read line and then go back to output port
reedas 1:402b32a1025f 153
reedas 1:402b32a1025f 154 LCD_REG0.output();
reedas 1:402b32a1025f 155 LCD_REG1.output();
reedas 1:402b32a1025f 156 LCD_REG2.output();
reedas 1:402b32a1025f 157 LCD_REG3.output();
reedas 1:402b32a1025f 158 LCD_REG4.output();
reedas 1:402b32a1025f 159 LCD_REG5.output();
reedas 1:402b32a1025f 160 LCD_REG6.output();
reedas 1:402b32a1025f 161 LCD_REG7.output();
reedas 1:402b32a1025f 162
reedas 1:402b32a1025f 163 return data;
reedas 1:402b32a1025f 164 }
reedas 1:402b32a1025f 165
reedas 1:402b32a1025f 166
reedas 1:402b32a1025f 167 /*******************************************************************************
reedas 1:402b32a1025f 168 * Function Name: DisplayIntf_Init
reedas 1:402b32a1025f 169 ****************************************************************************//**
reedas 1:402b32a1025f 170 *
reedas 1:402b32a1025f 171 * \brief
reedas 1:402b32a1025f 172 * Initializes software i8080 interface.
reedas 1:402b32a1025f 173 *
reedas 1:402b32a1025f 174 * \details
reedas 1:402b32a1025f 175 * This function:
reedas 1:402b32a1025f 176 * - Initializes interface GPIO pins
reedas 1:402b32a1025f 177 *
reedas 1:402b32a1025f 178 *******************************************************************************/
reedas 1:402b32a1025f 179 void DisplayIntf_Init(void)
reedas 1:402b32a1025f 180 {
reedas 1:402b32a1025f 181 /* All pins are initialized by the Device Configurator. */
reedas 1:402b32a1025f 182 LCD_RESET = 1u;
reedas 1:402b32a1025f 183 LCD_NRD = 1u;
reedas 1:402b32a1025f 184 LCD_NWR = 1u;
reedas 1:402b32a1025f 185 LCD_DC = 0u;
reedas 1:402b32a1025f 186 LCD_REG0.output();
reedas 1:402b32a1025f 187 LCD_REG1.output();
reedas 1:402b32a1025f 188 LCD_REG2.output();
reedas 1:402b32a1025f 189 LCD_REG3.output();
reedas 1:402b32a1025f 190 LCD_REG4.output();
reedas 1:402b32a1025f 191 LCD_REG5.output();
reedas 1:402b32a1025f 192 LCD_REG6.output();
reedas 1:402b32a1025f 193 LCD_REG7.output();
reedas 1:402b32a1025f 194 wait_ms(20);
reedas 1:402b32a1025f 195 LCD_RESET = 0u;
reedas 1:402b32a1025f 196 wait_ms(100);
reedas 1:402b32a1025f 197
reedas 1:402b32a1025f 198 LCD_RESET = 1u;
reedas 1:402b32a1025f 199 wait_ms(100);
reedas 1:402b32a1025f 200
reedas 1:402b32a1025f 201 DisplayIntf_Write8_A0(0x28);
reedas 1:402b32a1025f 202 DisplayIntf_Write8_A0(0x11); /* Exit Sleep mode */
reedas 1:402b32a1025f 203 wait_ms(100);
reedas 1:402b32a1025f 204 DisplayIntf_Write8_A0(0x36);
reedas 1:402b32a1025f 205 DisplayIntf_Write8_A1(0xA0); /* MADCTL: memory data access control */
reedas 1:402b32a1025f 206 DisplayIntf_Write8_A0(0x3A);
reedas 1:402b32a1025f 207 DisplayIntf_Write8_A1(0x65); /* COLMOD: Interface Pixel format */
reedas 1:402b32a1025f 208 DisplayIntf_Write8_A0(0xB2);
reedas 1:402b32a1025f 209 DisplayIntf_Write8_A1(0x0C);
reedas 1:402b32a1025f 210 DisplayIntf_Write8_A1(0x0C);
reedas 1:402b32a1025f 211 DisplayIntf_Write8_A1(0x00);
reedas 1:402b32a1025f 212 DisplayIntf_Write8_A1(0x33);
reedas 1:402b32a1025f 213 DisplayIntf_Write8_A1(0x33); /* PORCTRK: Porch setting */
reedas 1:402b32a1025f 214 DisplayIntf_Write8_A0(0xB7);
reedas 1:402b32a1025f 215 DisplayIntf_Write8_A1(0x35); /* GCTRL: Gate Control */
reedas 1:402b32a1025f 216 DisplayIntf_Write8_A0(0xBB);
reedas 1:402b32a1025f 217 DisplayIntf_Write8_A1(0x2B); /* VCOMS: VCOM setting */
reedas 1:402b32a1025f 218 DisplayIntf_Write8_A0(0xC0);
reedas 1:402b32a1025f 219 DisplayIntf_Write8_A1(0x2C); /* LCMCTRL: LCM Control */
reedas 1:402b32a1025f 220 DisplayIntf_Write8_A0(0xC2);
reedas 1:402b32a1025f 221 DisplayIntf_Write8_A1(0x01);
reedas 1:402b32a1025f 222 DisplayIntf_Write8_A1(0xFF); /* VDVVRHEN: VDV and VRH Command Enable */
reedas 1:402b32a1025f 223 DisplayIntf_Write8_A0(0xC3);
reedas 1:402b32a1025f 224 DisplayIntf_Write8_A1(0x11); /* VRHS: VRH Set */
reedas 1:402b32a1025f 225 DisplayIntf_Write8_A0(0xC4);
reedas 1:402b32a1025f 226 DisplayIntf_Write8_A1(0x20); /* VDVS: VDV Set */
reedas 1:402b32a1025f 227 DisplayIntf_Write8_A0(0xC6);
reedas 1:402b32a1025f 228 DisplayIntf_Write8_A1(0x0F); /* FRCTRL2: Frame Rate control in normal mode */
reedas 1:402b32a1025f 229 DisplayIntf_Write8_A0(0xD0);
reedas 1:402b32a1025f 230 DisplayIntf_Write8_A1(0xA4);
reedas 1:402b32a1025f 231 DisplayIntf_Write8_A1(0xA1); /* PWCTRL1: Power Control 1 */
reedas 1:402b32a1025f 232 DisplayIntf_Write8_A0(0xE0);
reedas 1:402b32a1025f 233 DisplayIntf_Write8_A1(0xD0);
reedas 1:402b32a1025f 234 DisplayIntf_Write8_A1(0x00);
reedas 1:402b32a1025f 235 DisplayIntf_Write8_A1(0x05);
reedas 1:402b32a1025f 236 DisplayIntf_Write8_A1(0x0E);
reedas 1:402b32a1025f 237 DisplayIntf_Write8_A1(0x15);
reedas 1:402b32a1025f 238 DisplayIntf_Write8_A1(0x0D);
reedas 1:402b32a1025f 239 DisplayIntf_Write8_A1(0x37);
reedas 1:402b32a1025f 240 DisplayIntf_Write8_A1(0x43);
reedas 1:402b32a1025f 241 DisplayIntf_Write8_A1(0x47);
reedas 1:402b32a1025f 242 DisplayIntf_Write8_A1(0x09);
reedas 1:402b32a1025f 243 DisplayIntf_Write8_A1(0x15);
reedas 1:402b32a1025f 244 DisplayIntf_Write8_A1(0x12);
reedas 1:402b32a1025f 245 DisplayIntf_Write8_A1(0x16);
reedas 1:402b32a1025f 246 DisplayIntf_Write8_A1(0x19); /* PVGAMCTRL: Positive Voltage Gamma control */
reedas 1:402b32a1025f 247 DisplayIntf_Write8_A0(0xE1);
reedas 1:402b32a1025f 248 DisplayIntf_Write8_A1(0xD0);
reedas 1:402b32a1025f 249 DisplayIntf_Write8_A1(0x00);
reedas 1:402b32a1025f 250 DisplayIntf_Write8_A1(0x05);
reedas 1:402b32a1025f 251 DisplayIntf_Write8_A1(0x0D);
reedas 1:402b32a1025f 252 DisplayIntf_Write8_A1(0x0C);
reedas 1:402b32a1025f 253 DisplayIntf_Write8_A1(0x06);
reedas 1:402b32a1025f 254 DisplayIntf_Write8_A1(0x2D);
reedas 1:402b32a1025f 255 DisplayIntf_Write8_A1(0x44);
reedas 1:402b32a1025f 256 DisplayIntf_Write8_A1(0x40);
reedas 1:402b32a1025f 257 DisplayIntf_Write8_A1(0x0E);
reedas 1:402b32a1025f 258 DisplayIntf_Write8_A1(0x1C);
reedas 1:402b32a1025f 259 DisplayIntf_Write8_A1(0x18);
reedas 1:402b32a1025f 260 DisplayIntf_Write8_A1(0x16);
reedas 1:402b32a1025f 261 DisplayIntf_Write8_A1(0x19); /* NVGAMCTRL: Negative Voltage Gamma control */
reedas 1:402b32a1025f 262 DisplayIntf_Write8_A0(0x2B);
reedas 1:402b32a1025f 263 DisplayIntf_Write8_A1(0x00);
reedas 1:402b32a1025f 264 DisplayIntf_Write8_A1(0x00);
reedas 1:402b32a1025f 265 DisplayIntf_Write8_A1(0x00);
reedas 1:402b32a1025f 266 DisplayIntf_Write8_A1(0xEF); /* Y address set */
reedas 1:402b32a1025f 267 DisplayIntf_Write8_A0(0x2A);
reedas 1:402b32a1025f 268 DisplayIntf_Write8_A1(0x00);
reedas 1:402b32a1025f 269 DisplayIntf_Write8_A1(0x00);
reedas 1:402b32a1025f 270 DisplayIntf_Write8_A1(0x01);
reedas 1:402b32a1025f 271 DisplayIntf_Write8_A1(0x3F); /* X address set */
reedas 1:402b32a1025f 272 wait_ms(10);
reedas 1:402b32a1025f 273 DisplayIntf_Write8_A0(0x29);
reedas 1:402b32a1025f 274
reedas 1:402b32a1025f 275
reedas 1:402b32a1025f 276 }
reedas 1:402b32a1025f 277
reedas 1:402b32a1025f 278
reedas 1:402b32a1025f 279 /*******************************************************************************
reedas 1:402b32a1025f 280 * Function Name: DisplayIntf_Write8_A0
reedas 1:402b32a1025f 281 ****************************************************************************//**
reedas 1:402b32a1025f 282 *
reedas 1:402b32a1025f 283 * \brief
reedas 1:402b32a1025f 284 * Writes one byte of data to the software i8080 interface with the LCD_DC pin
reedas 1:402b32a1025f 285 * set to 0
reedas 1:402b32a1025f 286 *
reedas 1:402b32a1025f 287 * \details
reedas 1:402b32a1025f 288 * This function:
reedas 1:402b32a1025f 289 * - Sets LCD_DC pin to 0
reedas 1:402b32a1025f 290 * - Writes one data byte
reedas 1:402b32a1025f 291 *
reedas 1:402b32a1025f 292 *******************************************************************************/
reedas 1:402b32a1025f 293 void DisplayIntf_Write8_A0(U8 data)
reedas 1:402b32a1025f 294 {
reedas 1:402b32a1025f 295 LCD_DC = 0u;
reedas 1:402b32a1025f 296 DataWrite(data);
reedas 1:402b32a1025f 297 }
reedas 1:402b32a1025f 298
reedas 1:402b32a1025f 299
reedas 1:402b32a1025f 300 /*******************************************************************************
reedas 1:402b32a1025f 301 * Function Name: DisplayIntf_Write8_A1
reedas 1:402b32a1025f 302 ****************************************************************************//**
reedas 1:402b32a1025f 303 *
reedas 1:402b32a1025f 304 * \brief
reedas 1:402b32a1025f 305 * Writes one byte of data to the software i8080 interface with the LCD_DC pin
reedas 1:402b32a1025f 306 * set to 1
reedas 1:402b32a1025f 307 *
reedas 1:402b32a1025f 308 * \details
reedas 1:402b32a1025f 309 * This function:
reedas 1:402b32a1025f 310 * - Sets LCD_DC pin to 1
reedas 1:402b32a1025f 311 * - Writes one data byte
reedas 1:402b32a1025f 312 *
reedas 1:402b32a1025f 313 *******************************************************************************/
reedas 1:402b32a1025f 314 void DisplayIntf_Write8_A1(U8 data)
reedas 1:402b32a1025f 315 {
reedas 1:402b32a1025f 316 LCD_DC = 1u;
reedas 1:402b32a1025f 317 DataWrite(data);
reedas 1:402b32a1025f 318 }
reedas 1:402b32a1025f 319
reedas 1:402b32a1025f 320
reedas 1:402b32a1025f 321 /*******************************************************************************
reedas 1:402b32a1025f 322 * Function Name: DisplayIntf_WriteM8_A1
reedas 1:402b32a1025f 323 ****************************************************************************//**
reedas 1:402b32a1025f 324 *
reedas 1:402b32a1025f 325 * \brief
reedas 1:402b32a1025f 326 * Writes multiple bytes of data to the software i8080 interface with the LCD_DC
reedas 1:402b32a1025f 327 * pin set to 1
reedas 1:402b32a1025f 328 *
reedas 1:402b32a1025f 329 * \details
reedas 1:402b32a1025f 330 * This function:
reedas 1:402b32a1025f 331 * - Sets LCD_DC pin to 1
reedas 1:402b32a1025f 332 * - Writes data bytes
reedas 1:402b32a1025f 333 *
reedas 1:402b32a1025f 334 *******************************************************************************/
reedas 1:402b32a1025f 335 void DisplayIntf_WriteM8_A1(U8 data[], int num)
reedas 1:402b32a1025f 336 {
reedas 1:402b32a1025f 337 int i = 0;
reedas 1:402b32a1025f 338
reedas 1:402b32a1025f 339 LCD_DC = 1u;
reedas 1:402b32a1025f 340
reedas 1:402b32a1025f 341 for(i = 0; i < num; i++)
reedas 1:402b32a1025f 342 {
reedas 1:402b32a1025f 343 DataWrite(data[i]);
reedas 1:402b32a1025f 344 }
reedas 1:402b32a1025f 345 }
reedas 1:402b32a1025f 346
reedas 1:402b32a1025f 347
reedas 1:402b32a1025f 348 /*******************************************************************************
reedas 1:402b32a1025f 349 * Function Name: DisplayIntf_Read8_A1
reedas 1:402b32a1025f 350 ****************************************************************************//**
reedas 1:402b32a1025f 351 *
reedas 1:402b32a1025f 352 * \brief
reedas 1:402b32a1025f 353 * Reads one byte of data from the software i8080 interface with the LCD_DC pin
reedas 1:402b32a1025f 354 * set to 1
reedas 1:402b32a1025f 355 *
reedas 1:402b32a1025f 356 * \details
reedas 1:402b32a1025f 357 * This function:
reedas 1:402b32a1025f 358 * - Sets LCD_DC pin to 1
reedas 1:402b32a1025f 359 * - Reads one data byte
reedas 1:402b32a1025f 360 *
reedas 1:402b32a1025f 361 *******************************************************************************/
reedas 1:402b32a1025f 362 U8 DisplayIntf_Read8_A1(void)
reedas 1:402b32a1025f 363 {
reedas 1:402b32a1025f 364 LCD_DC = 1u;
reedas 1:402b32a1025f 365 return DataRead();
reedas 1:402b32a1025f 366 }
reedas 1:402b32a1025f 367
reedas 1:402b32a1025f 368
reedas 1:402b32a1025f 369 /*******************************************************************************
reedas 1:402b32a1025f 370 * Function Name: DisplayIntf_ReadM8_A1
reedas 1:402b32a1025f 371 ****************************************************************************//**
reedas 1:402b32a1025f 372 *
reedas 1:402b32a1025f 373 * \brief
reedas 1:402b32a1025f 374 * Reads multiple bytes of data from the software i8080 interface with the LCD_DC
reedas 1:402b32a1025f 375 * pin set to 1
reedas 1:402b32a1025f 376 *
reedas 1:402b32a1025f 377 * \details
reedas 1:402b32a1025f 378 * This function:
reedas 1:402b32a1025f 379 * - Sets LCD_DC pin to 1
reedas 1:402b32a1025f 380 * - Reads data bytes
reedas 1:402b32a1025f 381 *
reedas 1:402b32a1025f 382 *******************************************************************************/
reedas 1:402b32a1025f 383 void DisplayIntf_ReadM8_A1(U8 data[], int num)
reedas 1:402b32a1025f 384 {
reedas 1:402b32a1025f 385 int i = 0;
reedas 1:402b32a1025f 386
reedas 1:402b32a1025f 387 LCD_DC = 1u;
reedas 1:402b32a1025f 388
reedas 1:402b32a1025f 389 for(i = 0; i < num; i++)
reedas 1:402b32a1025f 390 {
reedas 1:402b32a1025f 391 data[i] = DataRead();
reedas 1:402b32a1025f 392 }
reedas 1:402b32a1025f 393 }
reedas 1:402b32a1025f 394
reedas 1:402b32a1025f 395
reedas 1:402b32a1025f 396 /* [] END OF FILE */
reedas 1:402b32a1025f 397
reedas 1:402b32a1025f 398