Graphical demo for the LPC4088 Experiment Base Board with one of the Display Expansion Kits. This program displays how to write text in different fonts.

Dependencies:   EALib mbed

Committer:
embeddedartists
Date:
Thu Jun 25 10:30:15 2015 +0000
Revision:
0:5e5e9ec91fc8
First version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
embeddedartists 0:5e5e9ec91fc8 1 /*
embeddedartists 0:5e5e9ec91fc8 2 * Copyright 2013 Embedded Artists AB
embeddedartists 0:5e5e9ec91fc8 3 *
embeddedartists 0:5e5e9ec91fc8 4 * Licensed under the Apache License, Version 2.0 (the "License");
embeddedartists 0:5e5e9ec91fc8 5 * you may not use this file except in compliance with the License.
embeddedartists 0:5e5e9ec91fc8 6 * You may obtain a copy of the License at
embeddedartists 0:5e5e9ec91fc8 7 *
embeddedartists 0:5e5e9ec91fc8 8 * http://www.apache.org/licenses/LICENSE-2.0
embeddedartists 0:5e5e9ec91fc8 9 *
embeddedartists 0:5e5e9ec91fc8 10 * Unless required by applicable law or agreed to in writing, software
embeddedartists 0:5e5e9ec91fc8 11 * distributed under the License is distributed on an "AS IS" BASIS,
embeddedartists 0:5e5e9ec91fc8 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
embeddedartists 0:5e5e9ec91fc8 13 * See the License for the specific language governing permissions and
embeddedartists 0:5e5e9ec91fc8 14 * limitations under the License.
embeddedartists 0:5e5e9ec91fc8 15 */
embeddedartists 0:5e5e9ec91fc8 16
embeddedartists 0:5e5e9ec91fc8 17 #ifndef AR1021I2C_H
embeddedartists 0:5e5e9ec91fc8 18 #define AR1021I2C_H
embeddedartists 0:5e5e9ec91fc8 19
embeddedartists 0:5e5e9ec91fc8 20 #include "TouchPanel.h"
embeddedartists 0:5e5e9ec91fc8 21
embeddedartists 0:5e5e9ec91fc8 22 /**
embeddedartists 0:5e5e9ec91fc8 23 * Microchip Touch Screen Controller (AR1021).
embeddedartists 0:5e5e9ec91fc8 24 *
embeddedartists 0:5e5e9ec91fc8 25 * Please note that this touch panel has an on-board storage for
embeddedartists 0:5e5e9ec91fc8 26 * calibration data. Once a successful calibration has been performed
embeddedartists 0:5e5e9ec91fc8 27 * it is not needed to do additional calibrations since the stored
embeddedartists 0:5e5e9ec91fc8 28 * calibration data will be used.
embeddedartists 0:5e5e9ec91fc8 29 */
embeddedartists 0:5e5e9ec91fc8 30 class AR1021I2C : public TouchPanel {
embeddedartists 0:5e5e9ec91fc8 31 public:
embeddedartists 0:5e5e9ec91fc8 32
embeddedartists 0:5e5e9ec91fc8 33
embeddedartists 0:5e5e9ec91fc8 34 /**
embeddedartists 0:5e5e9ec91fc8 35 * Constructor
embeddedartists 0:5e5e9ec91fc8 36 *
embeddedartists 0:5e5e9ec91fc8 37 * @param mosi I2C SDA pin
embeddedartists 0:5e5e9ec91fc8 38 * @param miso I2C SCL pin
embeddedartists 0:5e5e9ec91fc8 39 * @param siq interrupt pin
embeddedartists 0:5e5e9ec91fc8 40 */
embeddedartists 0:5e5e9ec91fc8 41 AR1021I2C(PinName sda, PinName scl, PinName siq);
embeddedartists 0:5e5e9ec91fc8 42
embeddedartists 0:5e5e9ec91fc8 43 bool info(int* verHigh, int* verLow, int* resBits, int* type);
embeddedartists 0:5e5e9ec91fc8 44
embeddedartists 0:5e5e9ec91fc8 45 virtual bool init(uint16_t width, uint16_t height);
embeddedartists 0:5e5e9ec91fc8 46 virtual bool read(touchCoordinate_t &coord);
embeddedartists 0:5e5e9ec91fc8 47 virtual bool calibrateStart();
embeddedartists 0:5e5e9ec91fc8 48 virtual bool getNextCalibratePoint(uint16_t* x, uint16_t* y);
embeddedartists 0:5e5e9ec91fc8 49 virtual bool waitForCalibratePoint(bool* morePoints, uint32_t timeout);
embeddedartists 0:5e5e9ec91fc8 50
embeddedartists 0:5e5e9ec91fc8 51 private:
embeddedartists 0:5e5e9ec91fc8 52
embeddedartists 0:5e5e9ec91fc8 53
embeddedartists 0:5e5e9ec91fc8 54 I2C _i2c;
embeddedartists 0:5e5e9ec91fc8 55 DigitalIn _siq;
embeddedartists 0:5e5e9ec91fc8 56 InterruptIn _siqIrq;
embeddedartists 0:5e5e9ec91fc8 57 bool _initialized;
embeddedartists 0:5e5e9ec91fc8 58
embeddedartists 0:5e5e9ec91fc8 59
embeddedartists 0:5e5e9ec91fc8 60 int32_t _x;
embeddedartists 0:5e5e9ec91fc8 61 int32_t _y;
embeddedartists 0:5e5e9ec91fc8 62 int32_t _pen;
embeddedartists 0:5e5e9ec91fc8 63
embeddedartists 0:5e5e9ec91fc8 64 uint16_t _width;
embeddedartists 0:5e5e9ec91fc8 65 uint16_t _height;
embeddedartists 0:5e5e9ec91fc8 66 uint8_t _inset;
embeddedartists 0:5e5e9ec91fc8 67
embeddedartists 0:5e5e9ec91fc8 68 int _calibPoint;
embeddedartists 0:5e5e9ec91fc8 69
embeddedartists 0:5e5e9ec91fc8 70
embeddedartists 0:5e5e9ec91fc8 71 int cmd(char cmd, char* data, int len, char* respBuf, int* respLen, bool setCsOff=true);
embeddedartists 0:5e5e9ec91fc8 72 int waitForCalibResponse(uint32_t timeout);
embeddedartists 0:5e5e9ec91fc8 73 void readTouchIrq();
embeddedartists 0:5e5e9ec91fc8 74 };
embeddedartists 0:5e5e9ec91fc8 75
embeddedartists 0:5e5e9ec91fc8 76 #endif
embeddedartists 0:5e5e9ec91fc8 77