Library for the Princeton PT6312 Vacuum Fluorescent Display (VFD) driver.
This library is documented here.
PT6312.h@2:f010b7022803, 2015-08-27 (annotated)
- Committer:
- wim
- Date:
- Thu Aug 27 21:22:30 2015 +0000
- Revision:
- 2:f010b7022803
- Parent:
- 1:c5e247159aa6
- Child:
- 3:156c23d9652a
Test2
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wim | 0:e59142cded2b | 1 | /* mbed PT6312 Library, for Princeton PT6312 VFD controller |
wim | 0:e59142cded2b | 2 | * Copyright (c) 2015, v01: WH, Initial version |
wim | 0:e59142cded2b | 3 | * |
wim | 0:e59142cded2b | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
wim | 0:e59142cded2b | 5 | * of this software and associated documentation files (the "Software"), to deal |
wim | 0:e59142cded2b | 6 | * in the Software without restriction, including without limitation the rights |
wim | 0:e59142cded2b | 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
wim | 0:e59142cded2b | 8 | * copies of the Software, and to permit persons to whom the Software is |
wim | 0:e59142cded2b | 9 | * furnished to do so, subject to the following conditions: |
wim | 0:e59142cded2b | 10 | * |
wim | 0:e59142cded2b | 11 | * The above copyright notice and this permission notice shall be included in |
wim | 0:e59142cded2b | 12 | * all copies or substantial portions of the Software. |
wim | 0:e59142cded2b | 13 | * |
wim | 0:e59142cded2b | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
wim | 0:e59142cded2b | 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
wim | 0:e59142cded2b | 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
wim | 0:e59142cded2b | 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
wim | 0:e59142cded2b | 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
wim | 0:e59142cded2b | 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
wim | 0:e59142cded2b | 20 | * THE SOFTWARE. |
wim | 0:e59142cded2b | 21 | */ |
wim | 0:e59142cded2b | 22 | |
wim | 0:e59142cded2b | 23 | #ifndef PT6312_H |
wim | 0:e59142cded2b | 24 | #define PT6312_H |
wim | 0:e59142cded2b | 25 | |
wim | 0:e59142cded2b | 26 | /** An interface for driving Princeton PT6312 VFD controller |
wim | 0:e59142cded2b | 27 | * |
wim | 0:e59142cded2b | 28 | * @code |
wim | 0:e59142cded2b | 29 | * #include "mbed.h" |
wim | 0:e59142cded2b | 30 | * |
wim | 0:e59142cded2b | 31 | * DisplayData_t size is 8 bytes (4 digits max 16 segments) ... 22 bytes (11 digits at max 11 segments) |
wim | 0:e59142cded2b | 32 | * DisplayData_t size default is 14 bytes (7 digits max 15 segments) |
wim | 0:e59142cded2b | 33 | * PT6312::DisplayData_t mbed_str = {0xDA,0x00, 0x7C,0x00, 0x3C,0x01, 0xF6,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00}; |
wim | 0:e59142cded2b | 34 | * PT6312::DisplayData_t all_str = {0xFF,0x0F, 0xFF,0x0F, 0xFF,0x0F, 0xFF,0x0F, 0xFF,0x0F, 0xFF,0x0F, 0xFF,0x0F}; |
wim | 0:e59142cded2b | 35 | * |
wim | 0:e59142cded2b | 36 | * // KeyData_t size is 3 bytes |
wim | 0:e59142cded2b | 37 | * PT6312::KeyData_t keydata; |
wim | 0:e59142cded2b | 38 | * |
wim | 0:e59142cded2b | 39 | * // PT6191 declaration, Default setting x Digits, y Segments |
wim | 0:e59142cded2b | 40 | * PT6312 PT6312(p5,p6,p7, p8); |
wim | 0:e59142cded2b | 41 | * |
wim | 0:e59142cded2b | 42 | * int main() { |
wim | 0:e59142cded2b | 43 | * PT6312.cls(); |
wim | 0:e59142cded2b | 44 | * PT6312.writeData(all_str); |
wim | 0:e59142cded2b | 45 | * wait(4); |
wim | 0:e59142cded2b | 46 | * PT6312.writeData(mbed_str); |
wim | 0:e59142cded2b | 47 | * wait(1); |
wim | 0:e59142cded2b | 48 | * PT6312.setBrightness(PT6312_BRT0); |
wim | 0:e59142cded2b | 49 | * wait(1); |
wim | 0:e59142cded2b | 50 | * PT6312.setBrightness(PT6312_BRT3); |
wim | 0:e59142cded2b | 51 | * |
wim | 0:e59142cded2b | 52 | * while (1) { |
wim | 0:e59142cded2b | 53 | * // Check and read keydata |
wim | 1:c5e247159aa6 | 54 | * if (PT6312.getKeys(&keydata)) { |
wim | 0:e59142cded2b | 55 | * pc.printf("Keydata 0..2 = 0x%02x 0x%02x 0x%02x\r\n", keydata[0], keydata[1], keydata[2]); |
wim | 0:e59142cded2b | 56 | * |
wim | 0:e59142cded2b | 57 | * if (keydata[0] == 0x10) { //sw2 |
wim | 0:e59142cded2b | 58 | * PT6312.cls(); |
wim | 0:e59142cded2b | 59 | * PT6312.writeData(all_str); |
wim | 0:e59142cded2b | 60 | * } |
wim | 0:e59142cded2b | 61 | * } |
wim | 0:e59142cded2b | 62 | * } |
wim | 0:e59142cded2b | 63 | * } |
wim | 0:e59142cded2b | 64 | * @endcode |
wim | 0:e59142cded2b | 65 | */ |
wim | 0:e59142cded2b | 66 | |
wim | 0:e59142cded2b | 67 | //Memory size in bytes for Display and Keymatrix |
wim | 0:e59142cded2b | 68 | #define PT6312_DISPLAY_MEM 22 |
wim | 0:e59142cded2b | 69 | #define PT6312_KEY_MEM 3 |
wim | 0:e59142cded2b | 70 | //Significant bits Keymatrix data |
wim | 0:e59142cded2b | 71 | #define PT6312_KEY_BITS 8 |
wim | 0:e59142cded2b | 72 | |
wim | 0:e59142cded2b | 73 | //Reserved bits for commands |
wim | 0:e59142cded2b | 74 | #define PT6312_CMD_MSK 0xE0 |
wim | 0:e59142cded2b | 75 | |
wim | 0:e59142cded2b | 76 | //Mode setting command |
wim | 0:e59142cded2b | 77 | #define PT6312_MODE_SET_CMD 0x00 |
wim | 0:e59142cded2b | 78 | #define PT6312_DIG4_SEG16 0x00 |
wim | 0:e59142cded2b | 79 | #define PT6312_DIG5_SEG16 0x01 |
wim | 0:e59142cded2b | 80 | #define PT6312_DIG6_SEG16 0x02 |
wim | 0:e59142cded2b | 81 | #define PT6312_DIG7_SEG15 0x03 //default |
wim | 0:e59142cded2b | 82 | #define PT6312_DIG8_SEG14 0x04 |
wim | 0:e59142cded2b | 83 | #define PT6312_DIG9_SEG13 0x05 |
wim | 0:e59142cded2b | 84 | #define PT6312_DIG10_SEG12 0x06 |
wim | 0:e59142cded2b | 85 | #define PT6312_DIG11_SEG11 0x07 |
wim | 0:e59142cded2b | 86 | |
wim | 0:e59142cded2b | 87 | |
wim | 0:e59142cded2b | 88 | //Data setting commands |
wim | 0:e59142cded2b | 89 | #define PT6312_DATA_SET_CMD 0x40 |
wim | 0:e59142cded2b | 90 | #define PT6312_DATA_WR 0x00 |
wim | 0:e59142cded2b | 91 | #define PT6312_LED_WR 0x01 |
wim | 0:e59142cded2b | 92 | #define PT6312_KEY_RD 0x02 |
wim | 0:e59142cded2b | 93 | #define PT6312_SW_RD 0x03 |
wim | 0:e59142cded2b | 94 | #define PT6312_ADDR_INC 0x00 |
wim | 0:e59142cded2b | 95 | #define PT6312_ADDR_FIXED 0x04 |
wim | 0:e59142cded2b | 96 | #define PT6312_MODE_NORM 0x00 |
wim | 0:e59142cded2b | 97 | #define PT6312_MODE_TEST 0x08 |
wim | 0:e59142cded2b | 98 | |
wim | 0:e59142cded2b | 99 | //LED settings data |
wim | 0:e59142cded2b | 100 | #define PT6312_LED_MSK 0x0F |
wim | 0:e59142cded2b | 101 | #define PT6312_LED1 0x01 |
wim | 0:e59142cded2b | 102 | #define PT6312_LED2 0x02 |
wim | 0:e59142cded2b | 103 | #define PT6312_LED3 0x04 |
wim | 0:e59142cded2b | 104 | #define PT6312_LED4 0x08 |
wim | 0:e59142cded2b | 105 | |
wim | 0:e59142cded2b | 106 | //Switch settings data |
wim | 0:e59142cded2b | 107 | #define PT6312_SW_MSK 0x0F |
wim | 0:e59142cded2b | 108 | #define PT6312_SW1 0x01 |
wim | 0:e59142cded2b | 109 | #define PT6312_SW2 0x02 |
wim | 0:e59142cded2b | 110 | #define PT6312_SW3 0x04 |
wim | 0:e59142cded2b | 111 | #define PT6312_SW4 0x08 |
wim | 0:e59142cded2b | 112 | |
wim | 0:e59142cded2b | 113 | //Address setting commands |
wim | 0:e59142cded2b | 114 | #define PT6312_ADDR_SET_CMD 0xC0 |
wim | 0:e59142cded2b | 115 | #define PT6312_ADDR_MSK 0x1F |
wim | 0:e59142cded2b | 116 | |
wim | 0:e59142cded2b | 117 | //Display control commands |
wim | 0:e59142cded2b | 118 | #define PT6312_DSP_CTRL_CMD 0x80 |
wim | 0:e59142cded2b | 119 | #define PT6312_BRT_MSK 0x07 |
wim | 0:e59142cded2b | 120 | #define PT6312_BRT0 0x00 //Pulsewidth 1/16 |
wim | 0:e59142cded2b | 121 | #define PT6312_BRT1 0x01 |
wim | 0:e59142cded2b | 122 | #define PT6312_BRT2 0x02 |
wim | 0:e59142cded2b | 123 | #define PT6312_BRT3 0x03 |
wim | 0:e59142cded2b | 124 | #define PT6312_BRT4 0x04 |
wim | 0:e59142cded2b | 125 | #define PT6312_BRT5 0x05 |
wim | 0:e59142cded2b | 126 | #define PT6312_BRT6 0x06 |
wim | 0:e59142cded2b | 127 | #define PT6312_BRT7 0x07 //Pulsewidth 14/16 |
wim | 0:e59142cded2b | 128 | |
wim | 0:e59142cded2b | 129 | #define PT6312_BRT_DEF PT6312_BRT3 |
wim | 0:e59142cded2b | 130 | |
wim | 0:e59142cded2b | 131 | #define PT6312_DSP_OFF 0x00 |
wim | 0:e59142cded2b | 132 | #define PT6312_DSP_ON 0x08 |
wim | 0:e59142cded2b | 133 | |
wim | 0:e59142cded2b | 134 | |
wim | 0:e59142cded2b | 135 | /** A class for driving Princeton PT6312 VFD controller |
wim | 0:e59142cded2b | 136 | * |
wim | 0:e59142cded2b | 137 | * @brief Supports 4 Digits of 16 Segments upto 11 Digits of 11 Segments. Also supports a scanned keyboard of upto 24 keys, 4 switches and 4 LEDs. |
wim | 0:e59142cded2b | 138 | * SPI bus interface device. |
wim | 0:e59142cded2b | 139 | */ |
wim | 0:e59142cded2b | 140 | class PT6312 { |
wim | 0:e59142cded2b | 141 | public: |
wim | 0:e59142cded2b | 142 | |
wim | 0:e59142cded2b | 143 | /** Enums for display mode */ |
wim | 0:e59142cded2b | 144 | enum Mode { |
wim | 0:e59142cded2b | 145 | Dig4_Seg16 = PT6312_DIG4_SEG16, |
wim | 0:e59142cded2b | 146 | Dig5_Seg16 = PT6312_DIG5_SEG16, |
wim | 0:e59142cded2b | 147 | Dig6_Seg16 = PT6312_DIG6_SEG16, |
wim | 0:e59142cded2b | 148 | Dig7_Seg15 = PT6312_DIG7_SEG15, |
wim | 0:e59142cded2b | 149 | Dig8_Seg14 = PT6312_DIG8_SEG14, |
wim | 0:e59142cded2b | 150 | Dig9_Seg13 = PT6312_DIG9_SEG13, |
wim | 0:e59142cded2b | 151 | Dig10_Seg12 = PT6312_DIG10_SEG12, |
wim | 0:e59142cded2b | 152 | Dig11_Seg11 = PT6312_DIG11_SEG11 |
wim | 0:e59142cded2b | 153 | }; |
wim | 0:e59142cded2b | 154 | |
wim | 0:e59142cded2b | 155 | /** Datatypes for display and keymatrix data */ |
wim | 0:e59142cded2b | 156 | typedef char DisplayData_t[PT6312_DISPLAY_MEM]; |
wim | 0:e59142cded2b | 157 | typedef char KeyData_t[PT6312_KEY_MEM]; |
wim | 0:e59142cded2b | 158 | |
wim | 1:c5e247159aa6 | 159 | /** Constructor for class for driving Princeton PT6312 VFD controller |
wim | 0:e59142cded2b | 160 | * |
wim | 0:e59142cded2b | 161 | * @brief Supports 4 Digits of 16 Segments upto 11 Digits of 11 Segments. Also supports a scanned keyboard of upto 24 keys, 4 switches and 4 LEDs. |
wim | 0:e59142cded2b | 162 | * SPI bus interface device. |
wim | 0:e59142cded2b | 163 | * @param PinName mosi, miso, sclk, cs SPI bus pins |
wim | 0:e59142cded2b | 164 | * @param Mode selects either number of Digits and 12 Segments (default 7 Digits, 15 Segments) |
wim | 0:e59142cded2b | 165 | */ |
wim | 0:e59142cded2b | 166 | PT6312(PinName mosi, PinName miso, PinName sclk, PinName cs, Mode mode=Dig7_Seg15); |
wim | 0:e59142cded2b | 167 | |
wim | 0:e59142cded2b | 168 | /** Clear the screen and locate to 0 |
wim | 0:e59142cded2b | 169 | */ |
wim | 0:e59142cded2b | 170 | void cls(); |
wim | 0:e59142cded2b | 171 | |
wim | 0:e59142cded2b | 172 | /** Write databyte to PT6312 |
wim | 0:e59142cded2b | 173 | * @param int address display memory location to write byte |
wim | 0:e59142cded2b | 174 | * @param char data byte written at given address |
wim | 0:e59142cded2b | 175 | * @return none |
wim | 0:e59142cded2b | 176 | */ |
wim | 0:e59142cded2b | 177 | void writeData(int address, char data); |
wim | 0:e59142cded2b | 178 | |
wim | 0:e59142cded2b | 179 | /** Write Display datablock to PT6312 |
wim | 0:e59142cded2b | 180 | * @param DisplayData_t data Array of PT6312_DISPLAY_MEM (=16) bytes for displaydata (starting at address 0) |
wim | 2:f010b7022803 | 181 | * @param length number bytes to write (valide range 0..PT6312_DISPLAY_MEM (=16), starting at address 0) |
wim | 0:e59142cded2b | 182 | * @return none |
wim | 0:e59142cded2b | 183 | */ |
wim | 2:f010b7022803 | 184 | void writeData(DisplayData_t data, int length = PT6312_DISPLAY_MEM); |
wim | 0:e59142cded2b | 185 | |
wim | 0:e59142cded2b | 186 | |
wim | 0:e59142cded2b | 187 | /** Read keydata block from PT6312 |
wim | 0:e59142cded2b | 188 | * @param *keydata Ptr to Array of PT6312_KEY_MEM (=3) bytes for keydata |
wim | 0:e59142cded2b | 189 | * @return bool keypress True when at least one key was pressed |
wim | 0:e59142cded2b | 190 | * |
wim | 0:e59142cded2b | 191 | * Note: Due to the hardware configuration the PT6312 key matrix scanner will detect multiple keys pressed at same time, |
wim | 0:e59142cded2b | 192 | * but this may result in some spurious keys also being set in keypress data array. |
wim | 0:e59142cded2b | 193 | * It may be best to ignore all keys in those situations. That option is implemented in this method depending on #define setting. |
wim | 0:e59142cded2b | 194 | */ |
wim | 1:c5e247159aa6 | 195 | bool getKeys(KeyData_t *keydata); |
wim | 0:e59142cded2b | 196 | |
wim | 0:e59142cded2b | 197 | |
wim | 0:e59142cded2b | 198 | /** Read switches from PT6312 |
wim | 0:e59142cded2b | 199 | * |
wim | 0:e59142cded2b | 200 | * @param none |
wim | 0:e59142cded2b | 201 | * @return char for switch data (4 least significant bits) |
wim | 0:e59142cded2b | 202 | * |
wim | 0:e59142cded2b | 203 | */ |
wim | 1:c5e247159aa6 | 204 | char getSwitches(); |
wim | 0:e59142cded2b | 205 | |
wim | 0:e59142cded2b | 206 | /** Set LEDs |
wim | 0:e59142cded2b | 207 | * |
wim | 0:e59142cded2b | 208 | * @param char leds (4 least significant bits) |
wim | 0:e59142cded2b | 209 | * @return none |
wim | 0:e59142cded2b | 210 | */ |
wim | 0:e59142cded2b | 211 | void setLED (char leds = 0); |
wim | 0:e59142cded2b | 212 | |
wim | 0:e59142cded2b | 213 | /** Set Brightness |
wim | 0:e59142cded2b | 214 | * |
wim | 0:e59142cded2b | 215 | * @param char brightness (3 significant bits, valid range 0..7 (1/16 .. 14/14 dutycycle) |
wim | 0:e59142cded2b | 216 | * @return none |
wim | 0:e59142cded2b | 217 | */ |
wim | 0:e59142cded2b | 218 | void setBrightness(char brightness = PT6312_BRT_DEF); |
wim | 0:e59142cded2b | 219 | |
wim | 0:e59142cded2b | 220 | /** Set the Display mode On/off |
wim | 0:e59142cded2b | 221 | * |
wim | 0:e59142cded2b | 222 | * @param bool display mode |
wim | 0:e59142cded2b | 223 | */ |
wim | 0:e59142cded2b | 224 | void setDisplay(bool on); |
wim | 0:e59142cded2b | 225 | |
wim | 0:e59142cded2b | 226 | private: |
wim | 0:e59142cded2b | 227 | SPI _spi; |
wim | 0:e59142cded2b | 228 | DigitalOut _cs; |
wim | 0:e59142cded2b | 229 | Mode _mode; |
wim | 0:e59142cded2b | 230 | char _display; |
wim | 0:e59142cded2b | 231 | char _bright; |
wim | 0:e59142cded2b | 232 | |
wim | 0:e59142cded2b | 233 | /** Init the SPI interface and the controller |
wim | 0:e59142cded2b | 234 | * @param none |
wim | 0:e59142cded2b | 235 | * @return none |
wim | 0:e59142cded2b | 236 | */ |
wim | 0:e59142cded2b | 237 | void _init(); |
wim | 0:e59142cded2b | 238 | |
wim | 0:e59142cded2b | 239 | /** Helper to reverse all command or databits. The PT6312 expects LSB first, whereas SPI is MSB first |
wim | 0:e59142cded2b | 240 | * @param char data |
wim | 0:e59142cded2b | 241 | * @return bitreversed data |
wim | 0:e59142cded2b | 242 | */ |
wim | 0:e59142cded2b | 243 | char _flip(char data); |
wim | 0:e59142cded2b | 244 | |
wim | 0:e59142cded2b | 245 | /** Write command and parameter to PT6312 |
wim | 0:e59142cded2b | 246 | * @param int cmd Command byte |
wim | 0:e59142cded2b | 247 | * &Param int data Parameters for command |
wim | 0:e59142cded2b | 248 | * @return none |
wim | 0:e59142cded2b | 249 | */ |
wim | 0:e59142cded2b | 250 | void _writeCmd(int cmd, int data); |
wim | 0:e59142cded2b | 251 | }; |
wim | 0:e59142cded2b | 252 | |
wim | 1:c5e247159aa6 | 253 | |
wim | 1:c5e247159aa6 | 254 | |
wim | 2:f010b7022803 | 255 | #define DVP630_NR_DIGITS 7 |
wim | 2:f010b7022803 | 256 | |
wim | 2:f010b7022803 | 257 | /** Constructor for class for driving Princeton PT6312 VFD controller as used in Philips DVP630 |
wim | 1:c5e247159aa6 | 258 | * |
wim | 1:c5e247159aa6 | 259 | * @brief Supports 7 Digits of 15 Segments. Also supports a scanned keyboard of 3 keys, 3 switches and 1 LED. |
wim | 1:c5e247159aa6 | 260 | * SPI bus interface device. |
wim | 1:c5e247159aa6 | 261 | * @param PinName mosi, miso, sclk, cs SPI bus pins |
wim | 1:c5e247159aa6 | 262 | */ |
wim | 2:f010b7022803 | 263 | class PT6312_DVP630 : public PT6312, public Stream { |
wim | 1:c5e247159aa6 | 264 | public: |
wim | 1:c5e247159aa6 | 265 | |
wim | 2:f010b7022803 | 266 | /** Constructor for class for driving Princeton PT6312 VFD controller as used in Philips DVP630 |
wim | 1:c5e247159aa6 | 267 | * |
wim | 1:c5e247159aa6 | 268 | * @brief Supports 7 Digits of 15 Segments. Also supports a scanned keyboard of 3 keys, 3 switches and 1 LED. |
wim | 1:c5e247159aa6 | 269 | * SPI bus interface device. |
wim | 1:c5e247159aa6 | 270 | * @param PinName mosi, miso, sclk, cs SPI bus pins |
wim | 1:c5e247159aa6 | 271 | */ |
wim | 2:f010b7022803 | 272 | PT6312_DVP630(PinName mosi, PinName miso, PinName sclk, PinName cs); |
wim | 1:c5e247159aa6 | 273 | |
wim | 1:c5e247159aa6 | 274 | #if DOXYGEN_ONLY |
wim | 1:c5e247159aa6 | 275 | /** Write a character to the LCD |
wim | 1:c5e247159aa6 | 276 | * |
wim | 1:c5e247159aa6 | 277 | * @param c The character to write to the display |
wim | 1:c5e247159aa6 | 278 | */ |
wim | 1:c5e247159aa6 | 279 | int putc(int c); |
wim | 1:c5e247159aa6 | 280 | |
wim | 1:c5e247159aa6 | 281 | /** Write a formatted string to the LCD |
wim | 1:c5e247159aa6 | 282 | * |
wim | 1:c5e247159aa6 | 283 | * @param format A printf-style format string, followed by the |
wim | 1:c5e247159aa6 | 284 | * variables to use in formatting the string. |
wim | 1:c5e247159aa6 | 285 | */ |
wim | 1:c5e247159aa6 | 286 | int printf(const char* format, ...); |
wim | 1:c5e247159aa6 | 287 | #endif |
wim | 1:c5e247159aa6 | 288 | |
wim | 1:c5e247159aa6 | 289 | /** Locate cursor to a screen column |
wim | 1:c5e247159aa6 | 290 | * |
wim | 1:c5e247159aa6 | 291 | * @param column The horizontal position from the left, indexed from 0 |
wim | 1:c5e247159aa6 | 292 | */ |
wim | 1:c5e247159aa6 | 293 | void locate(int column); |
wim | 1:c5e247159aa6 | 294 | |
wim | 1:c5e247159aa6 | 295 | /** Clear the screen and locate to 0 |
wim | 1:c5e247159aa6 | 296 | */ |
wim | 1:c5e247159aa6 | 297 | void cls(); |
wim | 1:c5e247159aa6 | 298 | |
wim | 1:c5e247159aa6 | 299 | /** Number of screen columns |
wim | 1:c5e247159aa6 | 300 | * |
wim | 1:c5e247159aa6 | 301 | * @param none |
wim | 1:c5e247159aa6 | 302 | * @return columns |
wim | 1:c5e247159aa6 | 303 | */ |
wim | 1:c5e247159aa6 | 304 | int columns(); |
wim | 1:c5e247159aa6 | 305 | |
wim | 2:f010b7022803 | 306 | /** Write Display datablock to PT6312 |
wim | 2:f010b7022803 | 307 | * @param DisplayData_t data Array of PT6312_DISPLAY_MEM (=16) bytes for displaydata (starting at address 0) |
wim | 2:f010b7022803 | 308 | * @param length number bytes to write (valide range 0..DVP630_NR_DIGITS*2 (=14), starting at address 0) |
wim | 2:f010b7022803 | 309 | * @return none |
wim | 2:f010b7022803 | 310 | */ |
wim | 2:f010b7022803 | 311 | void writeData(DisplayData_t data, int length = (DVP630_NR_DIGITS*2)) { |
wim | 2:f010b7022803 | 312 | PT6312::writeData(data, length); |
wim | 2:f010b7022803 | 313 | } |
wim | 2:f010b7022803 | 314 | |
wim | 2:f010b7022803 | 315 | |
wim | 1:c5e247159aa6 | 316 | protected: |
wim | 1:c5e247159aa6 | 317 | // Stream implementation functions |
wim | 1:c5e247159aa6 | 318 | virtual int _putc(int value); |
wim | 1:c5e247159aa6 | 319 | virtual int _getc(); |
wim | 1:c5e247159aa6 | 320 | |
wim | 1:c5e247159aa6 | 321 | private: |
wim | 1:c5e247159aa6 | 322 | int _column; |
wim | 2:f010b7022803 | 323 | int _columns; |
wim | 2:f010b7022803 | 324 | |
wim | 2:f010b7022803 | 325 | DisplayData_t _displaybuffer; |
wim | 1:c5e247159aa6 | 326 | }; |
wim | 1:c5e247159aa6 | 327 | |
wim | 0:e59142cded2b | 328 | #endif |