Library for Princeton PT6301 VFD controller. Used in Futaba CIG VFD tubes.

This is a library for the Princeton PT6301 VFD controller. The controller is used by Futaba 'Chip In Glass' (CIG) VFD tubes. The device supports upto 20 Grids of 5x7 matrix segments for 2 rows of characters (A and B). It also supports 1 additional segment for 2 rows (A and B). In addition to the internal ROM character set, the PT6301 also supports 16 User Defined Characters.

The PT6301 has an SPI Serial interface. Control data consists of an 8-bit command and one or more data bytes. Command and data are sent LSB first and latched on rising edge of CLK. Idle CLK is high. Data address is auto incremented. Same for Icon and UDC addresses. The commands and data are transmitted during CE low and latched on rising CE edge.

The PT6301 has internal memory for all characters and icons. The content is automatically displayed on the tube. The memory consists of two banks (row A and row B) for character memory and two banks (row A and row B) for icon memory. Each of those banks is accessed by separate commands. However, these command do not support addressing individual locations in the memory. Memory updates always start at address 0 in the selected row A or B. Consequently, the whole displaymemory needs to be rewritten when any location (except for 0) is to be updated. The library therefor uses a local mirror memory to store the display content, update one or more characters in the mirror-memory as needed, and rewrite the whole display memory from the mirror-content. The write-back is performed by calling the 'refresh' method. Additional advantage of the mirror-memory is that we can also implement wrap-around and scrolling from row A to B for multi-line displays.

The lib was tested on displays salvaged from two Samsung cable TV receivers (e.g. Samsung SMT-C7140 and Samsung SMT-G7400). The examples don't use all features as this depends on how the controller has been applied inside the tube. The SMT-C7140 for example does not use the icon segments, but uses a separate grid to display a User Defined Character. The segments in the UDC light up specific icons (eg mail, clock). See picture below.

https://os.mbed.com/media/uploads/wim/img_4409.jpg

The example code is

Import programmbed_PT6301

Test for PT6301 VFD. First release.

I stumbled on the SMT-C7140 display and found some useful reverse engineering info by Codebeat here that helped to identify the controller. The pinout for the VFD tube connector (starting from the left side in the picture above) is: GND1, GND2, +35V DC (switched), 5V DC supply (switched), OSC pin (RC network between 5V and GND), /RST, /CS, CLK, DAT, NC, NC

The 35V DC is generated on the PCB by a DC/DC converter. The 35V generator, the 5V supply and the filament supply are all enabled by a pin on the connector at the bottom of the PCB.

The SMT-G7400 had a similar schematic for the tube connection as the SMT-C7140, but used a dedicated processor on the display PCB. The processor was removed and replaced by flying wires to an mbed LPC1768 for testing with the lib.

General explanation of VFD is here

Committer:
wim
Date:
Sun Jun 13 13:14:12 2021 +0000
Revision:
1:aa0195b0f83c
Parent:
PT6302.h@0:ecc29c13a997
First release.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wim 1:aa0195b0f83c 1 /* mbed PT6301 Library, for Princeton PT6301 VFD controller
wim 1:aa0195b0f83c 2 * The controller is used by Futaba 'Chip In Glass' (CIG) VFD tubes.
wim 0:ecc29c13a997 3 *
wim 1:aa0195b0f83c 4 * Copyright (c) 2021, v01: WH, Initial version
wim 0:ecc29c13a997 5 *
wim 0:ecc29c13a997 6 * Permission is hereby granted, free of charge, to any person obtaining a copy
wim 0:ecc29c13a997 7 * of this software and associated documentation files (the "Software"), to deal
wim 0:ecc29c13a997 8 * in the Software without restriction, including without limitation the rights
wim 0:ecc29c13a997 9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
wim 0:ecc29c13a997 10 * copies of the Software, and to permit persons to whom the Software is
wim 0:ecc29c13a997 11 * furnished to do so, subject to the following conditions:
wim 0:ecc29c13a997 12 *
wim 0:ecc29c13a997 13 * The above copyright notice and this permission notice shall be included in
wim 0:ecc29c13a997 14 * all copies or substantial portions of the Software.
wim 0:ecc29c13a997 15 *
wim 0:ecc29c13a997 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
wim 0:ecc29c13a997 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
wim 0:ecc29c13a997 18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
wim 0:ecc29c13a997 19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
wim 0:ecc29c13a997 20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
wim 0:ecc29c13a997 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
wim 0:ecc29c13a997 22 * THE SOFTWARE.
wim 0:ecc29c13a997 23 */
wim 0:ecc29c13a997 24
wim 1:aa0195b0f83c 25 #ifndef PT6301_H
wim 1:aa0195b0f83c 26 #define PT6301_H
wim 0:ecc29c13a997 27
wim 1:aa0195b0f83c 28 // Select one of the testboards for Princeton PT6301 VFD controller
wim 1:aa0195b0f83c 29 #include "PT6301_Config.h"
wim 1:aa0195b0f83c 30 #include "PT6301_UDC.h"
wim 0:ecc29c13a997 31
wim 1:aa0195b0f83c 32 /** An interface for driving Princeton PT6301 VFD controller
wim 0:ecc29c13a997 33 *
wim 0:ecc29c13a997 34 * @code
wim 0:ecc29c13a997 35 *
wim 1:aa0195b0f83c 36 * #if (PT6301_TEST == 1)
wim 1:aa0195b0f83c 37 * // Direct driving of PT6301 Test
wim 0:ecc29c13a997 38 *
wim 0:ecc29c13a997 39 * #include "mbed.h"
wim 1:aa0195b0f83c 40 * #include "PT6301.h"
wim 0:ecc29c13a997 41 *
wim 0:ecc29c13a997 42 * DigitalOut myled(LED1);
wim 0:ecc29c13a997 43 * Serial pc(USBTX, USBRX);
wim 0:ecc29c13a997 44 *
wim 1:aa0195b0f83c 45 * // PT6301 declaration, Default setting 2x20 Grids @ 5x7 Segments, 2 Icon segments for each Grid
wim 1:aa0195b0f83c 46 * PT6301 PT6301(p5, p7, p8, p9); // DI, CLK, CS, RST
wim 0:ecc29c13a997 47 *
wim 0:ecc29c13a997 48 * int main() {
wim 1:aa0195b0f83c 49 * pc.printf("Hello World: PT6301 test\n\r");
wim 0:ecc29c13a997 50 *
wim 1:aa0195b0f83c 51 * PT6301.cls();
wim 0:ecc29c13a997 52 *
wim 1:aa0195b0f83c 53 * // PT6301.writeData((char)'H',0,0);
wim 1:aa0195b0f83c 54 * // PT6301.writeData((char)'e',0,1);
wim 1:aa0195b0f83c 55 * // PT6301.writeData((char)'l',0,2);
wim 1:aa0195b0f83c 56 * // PT6301.writeData((char)'l',0,3);
wim 1:aa0195b0f83c 57 * // PT6301.writeData((char)'o',0,4);
wim 1:aa0195b0f83c 58 * PT6301.printf("Hello World");
wim 1:aa0195b0f83c 59 * PT6301.refresh();
wim 0:ecc29c13a997 60 * wait(2);
wim 1:aa0195b0f83c 61 *
wim 1:aa0195b0f83c 62 * PT6301.setBrightness(PT6301_BRT0);
wim 0:ecc29c13a997 63 * wait(2);
wim 1:aa0195b0f83c 64 * PT6301.setBrightness(PT6301_BRT3);
wim 0:ecc29c13a997 65 *
wim 0:ecc29c13a997 66 * while(1) {
wim 0:ecc29c13a997 67 * myled = !myled;
wim 0:ecc29c13a997 68 * wait(1);
wim 0:ecc29c13a997 69 * }
wim 0:ecc29c13a997 70 * }
wim 0:ecc29c13a997 71 * #endif
wim 0:ecc29c13a997 72 *
wim 0:ecc29c13a997 73 * @endcode
wim 0:ecc29c13a997 74 */
wim 0:ecc29c13a997 75
wim 0:ecc29c13a997 76
wim 1:aa0195b0f83c 77 //PT6301 Display and Annunciator data
wim 1:aa0195b0f83c 78 #define PT6301_MAX_NR_GRIDS 20
wim 1:aa0195b0f83c 79 #define PT6301_MAX_NR_ROWS 2
wim 1:aa0195b0f83c 80 #define PT6301_BYTES_PER_GRID 1
wim 1:aa0195b0f83c 81
wim 0:ecc29c13a997 82
wim 1:aa0195b0f83c 83 //The PT6301 has internal memory for all characters and icons. The content is automatically displayed on the tube.
wim 1:aa0195b0f83c 84 //The memory consists of two banks (row A and row B) for character memory and two banks (row A and row B) for icon memory.
wim 1:aa0195b0f83c 85 //Each of those banks is accessed by separate commands.
wim 1:aa0195b0f83c 86 //However, these command do not support addressing individual locations in the memory. Memory updates always start at
wim 1:aa0195b0f83c 87 //address 0 in the selected row A or B. Consequently, the whole displaymemory needs to be rewritten when any
wim 1:aa0195b0f83c 88 //location (except for 0) is to be updated.
wim 1:aa0195b0f83c 89 //The library therefor uses a local mirror memory to store the display content, update one or more characters in
wim 1:aa0195b0f83c 90 //the mirrormemory as needed, and rewrite the whole displaymemory from the mirrorcontent.
wim 1:aa0195b0f83c 91 //The write-back is performed by calling the 'refresh' method.
wim 1:aa0195b0f83c 92 //Additional advantage of the mirror-memory is that we can also implement wrap-around and scrolling from row A to B for multi-line displays.
wim 1:aa0195b0f83c 93
wim 1:aa0195b0f83c 94 //Memory size in bytes for Display and Annunciators in total
wim 1:aa0195b0f83c 95 //#define PT6301_DSP_MEM (PT6301_MAX_NR_ROWS * PT6301_MAX_NR_GRIDS * PT6301_BYTES_PER_GRID)
wim 1:aa0195b0f83c 96 //#define PT6301_ADD_MEM (PT6301_MAX_NR_ROWS * PT6301_MAX_NR_GRIDS)
wim 1:aa0195b0f83c 97 //Memory size in bytes for Display and Annunciators per Row
wim 1:aa0195b0f83c 98 #define PT6301_DSP_MEM (PT6301_MAX_NR_GRIDS * PT6301_BYTES_PER_GRID)
wim 1:aa0195b0f83c 99 #define PT6301_ADD_MEM (PT6301_MAX_NR_GRIDS * PT6301_BYTES_PER_GRID)
wim 1:aa0195b0f83c 100
wim 1:aa0195b0f83c 101 //User Defined Characters
wim 1:aa0195b0f83c 102 //Note that the PT6301 actually has two separate UDC banks for row A and B.
wim 1:aa0195b0f83c 103 //In this lib both UDC memories are always identical.
wim 1:aa0195b0f83c 104 #define PT6301_UDC_MEM 16
wim 0:ecc29c13a997 105
wim 0:ecc29c13a997 106 //SPI Serial control data consists of an 8-bit command and one or more data bytes.
wim 0:ecc29c13a997 107 //Command and data are sent LSB first and latched on rising edge of CLK. Idle CLK is high.
wim 0:ecc29c13a997 108 //Data address is auto incremented.
wim 0:ecc29c13a997 109 //The commands and data are transmitted during CE low and latched on rising CE edge.
wim 1:aa0195b0f83c 110 //Multiple PT6301 devices on the same bus can only be distinguised by the CE control.
wim 1:aa0195b0f83c 111 //Normal SPI methods send data MSB first. This lib uses a helper method to flip the bits before transmission.
wim 0:ecc29c13a997 112
wim 1:aa0195b0f83c 113 //Command delay in us
wim 1:aa0195b0f83c 114 #define PT6301_CMD_DLY 8
wim 1:aa0195b0f83c 115 #define PT6301_CS_DLY 16
wim 1:aa0195b0f83c 116 //Reset delay in ms
wim 1:aa0195b0f83c 117 #define PT6301_RST_DLY 10
wim 0:ecc29c13a997 118
wim 0:ecc29c13a997 119 //
wim 1:aa0195b0f83c 120 //Set Char data command (DCRAM_A)
wim 1:aa0195b0f83c 121 // 0 0 0 1 x x x x
wim 1:aa0195b0f83c 122 #define PT6301_DATA_A_REG 0x10
wim 1:aa0195b0f83c 123 //Set Char data command (DCRAM_B)
wim 1:aa0195b0f83c 124 // 1 0 0 1 x x x x
wim 1:aa0195b0f83c 125 #define PT6301_DATA_B_REG 0x90
wim 1:aa0195b0f83c 126
wim 0:ecc29c13a997 127
wim 1:aa0195b0f83c 128 //Note: The PT6301 does not support address selection. The commandformat allows
wim 1:aa0195b0f83c 129 //only 4bits for the address anyhow and this would be insufficient for a display
wim 1:aa0195b0f83c 130 //controller that can support upto 20 Grids.
wim 1:aa0195b0f83c 131 //Some other controllers with very similar commandsets and a max of 16 Grids do use the available 4 addressbits.
wim 1:aa0195b0f83c 132 //
wim 1:aa0195b0f83c 133 //No DCRAM Address Support, Always starts at address 0x00
wim 1:aa0195b0f83c 134 #define PT6301_DADR_MSK 0x0F
wim 0:ecc29c13a997 135
wim 0:ecc29c13a997 136 //Char data (2nd byte, 3rd byte ...)
wim 0:ecc29c13a997 137 //DA7..DA0 Character Data
wim 1:aa0195b0f83c 138 #define PT6301_DATA_MSK 0xFF
wim 0:ecc29c13a997 139
wim 1:aa0195b0f83c 140 //Note: The PT6301 supports separate UDCs banks for both rows A and B.
wim 1:aa0195b0f83c 141 //However, this lib always keeps both UDC banks identical.
wim 0:ecc29c13a997 142
wim 1:aa0195b0f83c 143 //Set UDC data command (CGRAM_A)
wim 1:aa0195b0f83c 144 // 0 0 1 0 UA3 UA2 UA1 UA0
wim 1:aa0195b0f83c 145 #define PT6301_UDC_A_REG 0x20
wim 1:aa0195b0f83c 146 //Set UDC data command (CGRAM_B)
wim 1:aa0195b0f83c 147 // 1 0 1 0 UA3 UA2 UA1 UA0
wim 1:aa0195b0f83c 148 #define PT6301_UDC_B_REG 0xA0
wim 0:ecc29c13a997 149
wim 1:aa0195b0f83c 150 //UA3..UA0 CGRAM Address (UDC RAM address)
wim 1:aa0195b0f83c 151 #define PT6301_UADR_MSK 0x0F
wim 1:aa0195b0f83c 152 #define PT6301_NR_UDC 16
wim 0:ecc29c13a997 153
wim 0:ecc29c13a997 154 //User Defined Characters (UDCs) consist of 5x7 dots and are defined by a 5 byte bitpattern.
wim 0:ecc29c13a997 155 //UDC data (2nd byte .. 6th byte)
wim 0:ecc29c13a997 156 // D7 D6 D5 D4.. D1 D0
wim 0:ecc29c13a997 157 // 0 * CD30 CD25 ...... CD0
wim 0:ecc29c13a997 158 // 1 * CD31 CD26 ...... CD1
wim 0:ecc29c13a997 159 // 2 * CD32 CD27 ...... CD2
wim 0:ecc29c13a997 160 // 3 * CD33 CD28 ...... CD3
wim 0:ecc29c13a997 161 // 4 * CD34 CD29 ...... CD4
wim 0:ecc29c13a997 162 //
wim 1:aa0195b0f83c 163 #define PT6301_UDC_MSK 0x7F
wim 0:ecc29c13a997 164
wim 0:ecc29c13a997 165 //CD34..CD0 UDC Data
wim 0:ecc29c13a997 166 //UDC is a 5x7 Matrix pattern that will show on the VFD as
wim 0:ecc29c13a997 167 // 0 C0 C1 C2 C3 C4
wim 1:aa0195b0f83c 168 // 1 C5 C6 ....... C9
wim 0:ecc29c13a997 169 // . .............
wim 0:ecc29c13a997 170 // . .............
wim 0:ecc29c13a997 171 // . .............
wim 0:ecc29c13a997 172 // 6 C30 C31 ... C34
wim 0:ecc29c13a997 173 //
wim 0:ecc29c13a997 174
wim 0:ecc29c13a997 175 //UDCs are defined by a 5x7 matrix and stored as 5 bytes
wim 0:ecc29c13a997 176 typedef char UDCData_t[5];
wim 0:ecc29c13a997 177
wim 0:ecc29c13a997 178
wim 1:aa0195b0f83c 179 //Set Additional data command (ADRAM_A), Used for annunciators etc
wim 1:aa0195b0f83c 180 // 0 0 1 1 x x x x
wim 1:aa0195b0f83c 181 #define PT6301_ADAT_A_REG 0x30
wim 1:aa0195b0f83c 182 //Set Additional data command (ADRAM_B), Used for annunciators etc
wim 1:aa0195b0f83c 183 // 1 0 1 1 x x x x
wim 1:aa0195b0f83c 184 #define PT6301_ADAT_B_REG 0xB0
wim 0:ecc29c13a997 185
wim 1:aa0195b0f83c 186 //Note: The PT6301 does not support address selection for icons. The commandformat allows
wim 1:aa0195b0f83c 187 //only 4bits for the address anyhow and this would be insufficient for a display with upto 20 Grids
wim 0:ecc29c13a997 188 //
wim 1:aa0195b0f83c 189 //No ADRAM Address (Additional data), always starts at 0x00
wim 1:aa0195b0f83c 190 #define PT6301_AADR_MSK 0x0F
wim 0:ecc29c13a997 191
wim 1:aa0195b0f83c 192 //* * * * * * * AD0 Additional Data (2nd byte, 3rd byte, ..)
wim 1:aa0195b0f83c 193 #define PT6301_ADAT_MSK 0x01
wim 0:ecc29c13a997 194
wim 0:ecc29c13a997 195 //
wim 0:ecc29c13a997 196 //Set Brightness command
wim 1:aa0195b0f83c 197 // 0 1 0 1 * * DC1 DC0
wim 1:aa0195b0f83c 198 #define PT6301_BRT_REG 0x50
wim 1:aa0195b0f83c 199 #define PT6301_BRT_MSK 0x03
wim 0:ecc29c13a997 200
wim 1:aa0195b0f83c 201 //Set Brightness command (2nd Byte)
wim 1:aa0195b0f83c 202 // DC9 DC8 DC7 DC6 DC5 DC4 DC3 DC2
wim 1:aa0195b0f83c 203
wim 1:aa0195b0f83c 204
wim 1:aa0195b0f83c 205 //Brightness Level (0..7), mapped onto Brightness command 2nd databyte
wim 0:ecc29c13a997 206 //Note Brightness relationship between the number of active Grids (period) and the BRT value (duty cycle)
wim 1:aa0195b0f83c 207 #define PT6301_BRT_0 0x00 //Duty 0/1024 (Default)
wim 1:aa0195b0f83c 208 #define PT6301_BRT_1 0x20
wim 1:aa0195b0f83c 209 #define PT6301_BRT_2 0x40
wim 1:aa0195b0f83c 210 #define PT6301_BRT_3 0x80
wim 1:aa0195b0f83c 211 #define PT6301_BRT_4 0xA0
wim 1:aa0195b0f83c 212 #define PT6301_BRT_5 0xB0
wim 1:aa0195b0f83c 213 #define PT6301_BRT_6 0xD0
wim 1:aa0195b0f83c 214 #define PT6301_BRT_7 0xFF //Duty 960/1024
wim 0:ecc29c13a997 215
wim 1:aa0195b0f83c 216 #define PT6301_BRT_DEF (PT6301_BRT_2)
wim 0:ecc29c13a997 217
wim 0:ecc29c13a997 218
wim 0:ecc29c13a997 219 //
wim 0:ecc29c13a997 220 //Grid control command
wim 1:aa0195b0f83c 221 // 0 1 1 0 GN3 GN2 GN1 GN0
wim 1:aa0195b0f83c 222 #define PT6301_GRID_REG 0x60
wim 1:aa0195b0f83c 223 #define PT6301_GRID_MSK 0x0F
wim 0:ecc29c13a997 224
wim 1:aa0195b0f83c 225 //Grids. Each Grid controls 2 characters (A and B) and 2 icons (A and B)
wim 0:ecc29c13a997 226 //
wim 1:aa0195b0f83c 227 // GN3 GN2 GN1 GN0
wim 1:aa0195b0f83c 228 // 0 0 0 0 G1 to G20 // Default
wim 1:aa0195b0f83c 229 // 0 0 0 1 G1 to G5
wim 1:aa0195b0f83c 230 // 0 0 1 0 G1 to G6
wim 1:aa0195b0f83c 231 // 0 0 1 1 G1 to G7
wim 1:aa0195b0f83c 232 //...
wim 1:aa0195b0f83c 233 // 1 0 0 0 G1 to G12
wim 1:aa0195b0f83c 234 // 1 0 0 1 G1 to G13
wim 1:aa0195b0f83c 235 // 1 0 1 0 G1 to G14
wim 1:aa0195b0f83c 236 //...
wim 1:aa0195b0f83c 237 // 1 1 1 1 G1 to G19
wim 1:aa0195b0f83c 238 //
wim 1:aa0195b0f83c 239 #define PT6301_GR1_GR5 0x01
wim 1:aa0195b0f83c 240 #define PT6301_GR1_GR6 0x02
wim 1:aa0195b0f83c 241 #define PT6301_GR1_GR7 0x03
wim 1:aa0195b0f83c 242 #define PT6301_GR1_GR8 0x04
wim 1:aa0195b0f83c 243 #define PT6301_GR1_GR9 0x05
wim 1:aa0195b0f83c 244 #define PT6301_GR1_GR10 0x06
wim 1:aa0195b0f83c 245 #define PT6301_GR1_GR11 0x07
wim 1:aa0195b0f83c 246 #define PT6301_GR1_GR12 0x08
wim 1:aa0195b0f83c 247 #define PT6301_GR1_GR13 0x09
wim 1:aa0195b0f83c 248 #define PT6301_GR1_GR14 0x0A
wim 1:aa0195b0f83c 249 #define PT6301_GR1_GR15 0x0B
wim 1:aa0195b0f83c 250 #define PT6301_GR1_GR16 0x0C
wim 1:aa0195b0f83c 251 #define PT6301_GR1_GR17 0x0D
wim 1:aa0195b0f83c 252 #define PT6301_GR1_GR18 0x0E
wim 1:aa0195b0f83c 253 #define PT6301_GR1_GR19 0x0F
wim 1:aa0195b0f83c 254 #define PT6301_GR1_GR20 0x00
wim 0:ecc29c13a997 255
wim 0:ecc29c13a997 256 //
wim 0:ecc29c13a997 257 //Display On/Off command
wim 0:ecc29c13a997 258 // 0 1 1 1 * * H L
wim 1:aa0195b0f83c 259 #define PT6301_DSPL_REG 0x70
wim 1:aa0195b0f83c 260 #define PT6301_DSPL_MSK 0x03
wim 0:ecc29c13a997 261
wim 0:ecc29c13a997 262 //Display Mode
wim 0:ecc29c13a997 263 // H L Display operating state
wim 1:aa0195b0f83c 264 // 0 0 Normal display (default)
wim 0:ecc29c13a997 265 // 0 1 Off
wim 0:ecc29c13a997 266 // 1 0 All Segments and Additional Segments On
wim 0:ecc29c13a997 267 // 1 1 All Segments and Additional Segments On
wim 1:aa0195b0f83c 268 #define PT6301_DSPL_NRM 0x00
wim 1:aa0195b0f83c 269 #define PT6301_DSPL_OFF 0x01
wim 1:aa0195b0f83c 270 #define PT6301_DSPL_ON 0x02
wim 0:ecc29c13a997 271
wim 0:ecc29c13a997 272
wim 1:aa0195b0f83c 273 /** A class for driving Princeton PT6301 VFD controller
wim 0:ecc29c13a997 274 *
wim 1:aa0195b0f83c 275 * @brief Supports upto 20 Grids of 5x7 matrix segments for 2 rows of characters (A and B).
wim 1:aa0195b0f83c 276 * Also supports 1 additional segment for 2 rows (A and B).
wim 1:aa0195b0f83c 277 * SPI bus interface device (LSB first).
wim 0:ecc29c13a997 278 */
wim 1:aa0195b0f83c 279 class PT6301 : public Stream {
wim 0:ecc29c13a997 280 public:
wim 0:ecc29c13a997 281
wim 0:ecc29c13a997 282 /** Enums for display mode */
wim 0:ecc29c13a997 283 enum Mode {
wim 1:aa0195b0f83c 284 Grid5 = PT6301_GR1_GR5,
wim 1:aa0195b0f83c 285 Grid6 = PT6301_GR1_GR6,
wim 1:aa0195b0f83c 286 Grid7 = PT6301_GR1_GR7,
wim 1:aa0195b0f83c 287 Grid8 = PT6301_GR1_GR8,
wim 1:aa0195b0f83c 288 Grid9 = PT6301_GR1_GR9,
wim 1:aa0195b0f83c 289 Grid10 = PT6301_GR1_GR10,
wim 1:aa0195b0f83c 290 Grid11 = PT6301_GR1_GR11,
wim 1:aa0195b0f83c 291 Grid12 = PT6301_GR1_GR12,
wim 1:aa0195b0f83c 292 Grid13 = PT6301_GR1_GR13,
wim 1:aa0195b0f83c 293 Grid14 = PT6301_GR1_GR14,
wim 1:aa0195b0f83c 294 Grid15 = PT6301_GR1_GR15,
wim 1:aa0195b0f83c 295 Grid16 = PT6301_GR1_GR16,
wim 1:aa0195b0f83c 296 Grid17 = PT6301_GR1_GR17,
wim 1:aa0195b0f83c 297 Grid18 = PT6301_GR1_GR18,
wim 1:aa0195b0f83c 298 Grid19 = PT6301_GR1_GR19,
wim 1:aa0195b0f83c 299 Grid20 = PT6301_GR1_GR20
wim 0:ecc29c13a997 300 };
wim 0:ecc29c13a997 301
wim 0:ecc29c13a997 302 /** Datatypes for display data */
wim 1:aa0195b0f83c 303 typedef char DisplayData_t[PT6301_MAX_NR_ROWS][PT6301_DSP_MEM];
wim 1:aa0195b0f83c 304 typedef char DisplayAdd_t[PT6301_MAX_NR_ROWS][PT6301_ADD_MEM];
wim 0:ecc29c13a997 305
wim 1:aa0195b0f83c 306 /** Constructor for class for driving Princeton PT6301 VFD controller
wim 0:ecc29c13a997 307 *
wim 1:aa0195b0f83c 308 * @brief Supports upto 20 Grids of 5x7 matrix segments for 2 rows of characters (row A and B).
wim 1:aa0195b0f83c 309 * Also supports 1 additional segment for 2 rows of characters (row A and B).
wim 0:ecc29c13a997 310 * SPI bus interface device.
wim 0:ecc29c13a997 311 * @param PinName mosi, sclk, cs SPI bus pins
wim 1:aa0195b0f83c 312 * @param PinName rst reset pin
wim 1:aa0195b0f83c 313 * @param Mode selects number of Grids and Segments (default 20 Grids, 5x7 matrix segments + 1 additional segment for 2 rows)
wim 1:aa0195b0f83c 314 * @param bool inverted_rows selects mapping of Data onto Display layout (default false)
wim 1:aa0195b0f83c 315 * @param Columns selects number of characters per row (default 20, same as Grids)
wim 1:aa0195b0f83c 316 * @param Rows selects number of rows (default 2)
wim 0:ecc29c13a997 317 */
wim 1:aa0195b0f83c 318 PT6301(PinName mosi, PinName sclk, PinName cs, PinName rst, Mode mode = Grid20, bool inverted_rows = false, int columns = PT6301_MAX_NR_GRIDS, int rows = PT6301_MAX_NR_ROWS);
wim 0:ecc29c13a997 319
wim 0:ecc29c13a997 320 /** Set Brightness
wim 0:ecc29c13a997 321 *
wim 0:ecc29c13a997 322 * @param char brightness (3 significant bits, valid range 0..7 (dutycycle linked to number of grids)
wim 0:ecc29c13a997 323 * @return none
wim 0:ecc29c13a997 324 */
wim 1:aa0195b0f83c 325 void setBrightness(char brightness = PT6301_BRT_DEF);
wim 0:ecc29c13a997 326
wim 0:ecc29c13a997 327 /** Set the Display mode On/off
wim 0:ecc29c13a997 328 *
wim 0:ecc29c13a997 329 * @param bool display mode
wim 0:ecc29c13a997 330 * @return none
wim 0:ecc29c13a997 331 */
wim 0:ecc29c13a997 332 void setDisplay(bool on);
wim 0:ecc29c13a997 333
wim 1:aa0195b0f83c 334 /** Set the Display test mode On/off
wim 0:ecc29c13a997 335 *
wim 1:aa0195b0f83c 336 * @param bool display test mode
wim 1:aa0195b0f83c 337 * @return none
wim 0:ecc29c13a997 338 */
wim 1:aa0195b0f83c 339 void setDisplayTest(bool on);
wim 0:ecc29c13a997 340
wim 1:aa0195b0f83c 341 /** Set User Defined Characters (UDC) for A and B row
wim 0:ecc29c13a997 342 *
wim 1:aa0195b0f83c 343 * @param unsigned char udc_idx The Index of the UDC (0..15)
wim 0:ecc29c13a997 344 * @param UDCData_t udc_data The bitpattern for the UDC (5 bytes)
wim 0:ecc29c13a997 345 * @return none
wim 0:ecc29c13a997 346 */
wim 0:ecc29c13a997 347 void setUDC(unsigned char udc_idx, UDCData_t udc_data);
wim 0:ecc29c13a997 348
wim 1:aa0195b0f83c 349 /** Set Icon
wim 1:aa0195b0f83c 350 *
wim 1:aa0195b0f83c 351 * @param int row The row of the icon (0..(rows-1))
wim 1:aa0195b0f83c 352 * @param int column The column of the icon (0..(cols-1))
wim 1:aa0195b0f83c 353 * @return none
wim 1:aa0195b0f83c 354 */
wim 1:aa0195b0f83c 355 void setIcon(int row, int column);
wim 1:aa0195b0f83c 356
wim 1:aa0195b0f83c 357 /** Clr Icon
wim 1:aa0195b0f83c 358 *
wim 1:aa0195b0f83c 359 * @param int row The row of the icon (0..(rows-1))
wim 1:aa0195b0f83c 360 * @param int column The column of the icon (0..(cols-1))
wim 1:aa0195b0f83c 361 * @return none
wim 1:aa0195b0f83c 362 */
wim 1:aa0195b0f83c 363 void clrIcon(int row, int column);
wim 1:aa0195b0f83c 364
wim 1:aa0195b0f83c 365 /** Locate cursor to a screen row, column
wim 0:ecc29c13a997 366 *
wim 1:aa0195b0f83c 367 * @param row The vertical position from the top, indexed from 0
wim 1:aa0195b0f83c 368 * @param column The horizontal position from the left, indexed from 0
wim 1:aa0195b0f83c 369 * @return none
wim 1:aa0195b0f83c 370 */
wim 1:aa0195b0f83c 371 void locate(int row, int column);
wim 1:aa0195b0f83c 372
wim 1:aa0195b0f83c 373 /** Clear the screen and locate to (0,0)
wim 1:aa0195b0f83c 374 *
wim 1:aa0195b0f83c 375 * @param bool clrAll Clear Icons also (default = true)
wim 1:aa0195b0f83c 376 */
wim 1:aa0195b0f83c 377 void cls(bool clrAll = true);
wim 1:aa0195b0f83c 378
wim 1:aa0195b0f83c 379 /** Refresh screen and show data in local mirrors on the display
wim 1:aa0195b0f83c 380 *
wim 1:aa0195b0f83c 381 * @param bool copyAll Copy Icons in Adat local mirror also (default = true)
wim 1:aa0195b0f83c 382 * @return none
wim 1:aa0195b0f83c 383 */
wim 1:aa0195b0f83c 384 void refresh(bool copyAll = true);
wim 1:aa0195b0f83c 385
wim 0:ecc29c13a997 386
wim 1:aa0195b0f83c 387 /** Number of screen columns
wim 0:ecc29c13a997 388 *
wim 1:aa0195b0f83c 389 * @param none
wim 1:aa0195b0f83c 390 * @return columns
wim 1:aa0195b0f83c 391 */
wim 1:aa0195b0f83c 392 int columns();
wim 1:aa0195b0f83c 393
wim 1:aa0195b0f83c 394 /** Number of screen rows
wim 1:aa0195b0f83c 395 *
wim 1:aa0195b0f83c 396 * @param none
wim 1:aa0195b0f83c 397 * @return rows
wim 1:aa0195b0f83c 398 */
wim 1:aa0195b0f83c 399 int rows();
wim 1:aa0195b0f83c 400
wim 1:aa0195b0f83c 401 /** Write Data to local mirror
wim 1:aa0195b0f83c 402 *
wim 1:aa0195b0f83c 403 * @param char data The databyte
wim 1:aa0195b0f83c 404 * @param row The vertical position from the top, indexed from 0
wim 1:aa0195b0f83c 405 * @param column The horizontal position from the left, indexed from 0
wim 1:aa0195b0f83c 406 * @return none
wim 1:aa0195b0f83c 407 */
wim 1:aa0195b0f83c 408 void setData(char data, int row, int column);
wim 1:aa0195b0f83c 409
wim 1:aa0195b0f83c 410 /** Read Data from local mirror
wim 1:aa0195b0f83c 411 *
wim 1:aa0195b0f83c 412 * @param row The vertical position from the top, indexed from 0
wim 1:aa0195b0f83c 413 * @param column The horizontal position from the left, indexed from 0
wim 1:aa0195b0f83c 414 * @return char The databyte
wim 1:aa0195b0f83c 415 */
wim 1:aa0195b0f83c 416 char getData(int row, int column);
wim 1:aa0195b0f83c 417
wim 1:aa0195b0f83c 418 /** Write AData to local mirror
wim 1:aa0195b0f83c 419 *
wim 1:aa0195b0f83c 420 * @param char data The symbol databyte
wim 1:aa0195b0f83c 421 * @param row The vertical position from the top, indexed from 0
wim 1:aa0195b0f83c 422 * @param column The horizontal position from the left, indexed from 0
wim 1:aa0195b0f83c 423 * @return none
wim 1:aa0195b0f83c 424 */
wim 1:aa0195b0f83c 425 void setAData(char data, int row, int column);
wim 1:aa0195b0f83c 426
wim 1:aa0195b0f83c 427 /** Read AData from local mirror
wim 1:aa0195b0f83c 428 *
wim 1:aa0195b0f83c 429 * @param row The vertical position from the top, indexed from 0
wim 1:aa0195b0f83c 430 * @param column The horizontal position from the left, indexed from 0
wim 1:aa0195b0f83c 431 * @return char The symbol databyte
wim 1:aa0195b0f83c 432 */
wim 1:aa0195b0f83c 433 char getAData(int row, int column);
wim 1:aa0195b0f83c 434
wim 1:aa0195b0f83c 435
wim 0:ecc29c13a997 436 protected:
wim 1:aa0195b0f83c 437
wim 1:aa0195b0f83c 438 /** Write Command byte to PT6301
wim 0:ecc29c13a997 439 *
wim 0:ecc29c13a997 440 * @param char cmd Command byte
wim 0:ecc29c13a997 441 * @return none
wim 0:ecc29c13a997 442 */
wim 0:ecc29c13a997 443 void _writeCmd(char cmd);
wim 0:ecc29c13a997 444
wim 1:aa0195b0f83c 445 /** Write Command and Data byte to PT6301
wim 1:aa0195b0f83c 446 *
wim 1:aa0195b0f83c 447 * @param char cmd Command byte
wim 1:aa0195b0f83c 448 * @param char data Parameter for Command byte
wim 1:aa0195b0f83c 449 * @return none
wim 1:aa0195b0f83c 450 */
wim 1:aa0195b0f83c 451 void _writeCmd(char cmd, char data);
wim 0:ecc29c13a997 452
wim 0:ecc29c13a997 453
wim 1:aa0195b0f83c 454 /** Helper to reverse all command or databits. The PT6301 expects LSB first, whereas SPI is MSB first
wim 0:ecc29c13a997 455 *
wim 0:ecc29c13a997 456 * @param char data
wim 0:ecc29c13a997 457 * @return bitreversed data
wim 0:ecc29c13a997 458 */
wim 0:ecc29c13a997 459 char _flip(char data);
wim 0:ecc29c13a997 460
wim 1:aa0195b0f83c 461 /** Helper to reverse row idx depending on VFD layout
wim 1:aa0195b0f83c 462 *
wim 1:aa0195b0f83c 463 * @param int row_idx
wim 1:aa0195b0f83c 464 * @return adjusted row_idx
wim 1:aa0195b0f83c 465 */
wim 1:aa0195b0f83c 466 int _row_flip(int row_idx);
wim 0:ecc29c13a997 467
wim 0:ecc29c13a997 468
wim 0:ecc29c13a997 469 #if DOXYGEN_ONLY
wim 0:ecc29c13a997 470 /** Write a character to the Display
wim 0:ecc29c13a997 471 *
wim 1:aa0195b0f83c 472 * @param c The character to write to the display RAM
wim 0:ecc29c13a997 473 * @return char written
wim 0:ecc29c13a997 474 */
wim 0:ecc29c13a997 475 int putc(int c);
wim 0:ecc29c13a997 476
wim 0:ecc29c13a997 477 /** Write a formatted string to the Display
wim 0:ecc29c13a997 478 *
wim 0:ecc29c13a997 479 * @param format A printf-style format string, followed by the
wim 0:ecc29c13a997 480 * variables to use in formatting the string.
wim 0:ecc29c13a997 481 */
wim 0:ecc29c13a997 482 int printf(const char* format, ...);
wim 0:ecc29c13a997 483 #endif
wim 0:ecc29c13a997 484
wim 0:ecc29c13a997 485 // Stream implementation functions
wim 0:ecc29c13a997 486 virtual int _putc(int value);
wim 0:ecc29c13a997 487 virtual int _getc();
wim 0:ecc29c13a997 488
wim 1:aa0195b0f83c 489
wim 1:aa0195b0f83c 490 private:
wim 1:aa0195b0f83c 491 SPI _spi;
wim 1:aa0195b0f83c 492 DigitalOut _cs;
wim 1:aa0195b0f83c 493 DigitalOut _rst;
wim 1:aa0195b0f83c 494 Mode _mode; // Number of Grids
wim 1:aa0195b0f83c 495 bool _inverted_rows; // Mapping of Rows to VFD layout
wim 1:aa0195b0f83c 496
wim 1:aa0195b0f83c 497 int _column; // Current cursor location
wim 1:aa0195b0f83c 498 int _columns; // Max number of columns
wim 1:aa0195b0f83c 499 int _row; // Current cursor location
wim 1:aa0195b0f83c 500 int _rows; // Max number of rows
wim 1:aa0195b0f83c 501
wim 1:aa0195b0f83c 502 DisplayData_t _displaybuffer; // Local mirror for all chars
wim 1:aa0195b0f83c 503 DisplayAdd_t _addbuffer; // Local mirror for all icons
wim 1:aa0195b0f83c 504
wim 1:aa0195b0f83c 505 /** Init the SPI interface and the controller
wim 1:aa0195b0f83c 506 *
wim 1:aa0195b0f83c 507 * @param none
wim 1:aa0195b0f83c 508 * @return none
wim 1:aa0195b0f83c 509 */
wim 1:aa0195b0f83c 510 void _init();
wim 1:aa0195b0f83c 511
wim 1:aa0195b0f83c 512 };
wim 1:aa0195b0f83c 513
wim 1:aa0195b0f83c 514
wim 1:aa0195b0f83c 515 #if (SMTG7400_TEST == 1)
wim 1:aa0195b0f83c 516 // Derived class for SMTG7400 display unit
wim 1:aa0195b0f83c 517 // Grids 1-16, 1 row of 16 matrix characters (5x7 segments), 4 Additional segments in use.
wim 1:aa0195b0f83c 518 //
wim 1:aa0195b0f83c 519
wim 1:aa0195b0f83c 520 //SMTG7400 Display data
wim 1:aa0195b0f83c 521 #define SMTG7400_NR_GRIDS 16
wim 1:aa0195b0f83c 522 #define SMTG7400_NR_COLS 16
wim 1:aa0195b0f83c 523 #define SMTG7400_NR_ROWS 1
wim 1:aa0195b0f83c 524
wim 1:aa0195b0f83c 525 //#define SMTG7400_NR_UDC 16
wim 1:aa0195b0f83c 526
wim 1:aa0195b0f83c 527 //SMTG7400 Icon data,
wim 1:aa0195b0f83c 528 //#defines encode the row and position in the row for each icon
wim 1:aa0195b0f83c 529 #define SMTG7400_ICON_ROW_SHFT 8
wim 1:aa0195b0f83c 530 #define SMTG7400_ICON_ROW_0 (0x00 << SMTG7400_ICON_ROW_SHFT)
wim 1:aa0195b0f83c 531 #define SMTG7400_ICON_ROW_1 (0x01 << SMTG7400_ICON_ROW_SHFT)
wim 1:aa0195b0f83c 532 #define SMTG7400_ICON_COL_MSK (0x00FF)
wim 1:aa0195b0f83c 533 //
wim 1:aa0195b0f83c 534 #define SMTG7400_ICON_OFFLINE (SMTG7400_ICON_ROW_0 | 1)
wim 1:aa0195b0f83c 535 #define SMTG7400_ICON_WIFI (SMTG7400_ICON_ROW_0 | 2)
wim 1:aa0195b0f83c 536 #define SMTG7400_ICON_PHONE (SMTG7400_ICON_ROW_0 | 3)
wim 1:aa0195b0f83c 537 #define SMTG7400_ICON_REC (SMTG7400_ICON_ROW_0 | 8)
wim 1:aa0195b0f83c 538
wim 1:aa0195b0f83c 539 /** Constructor for class for driving Princeton PT6301 VFD controller as used in SMTG7400
wim 1:aa0195b0f83c 540 *
wim 1:aa0195b0f83c 541 * @brief Supports 16 Grids of 5x7 Segments with 4 additional Segments in use.
wim 1:aa0195b0f83c 542 *
wim 1:aa0195b0f83c 543 * @param PinName mosi, sclk, cs SPI bus pins
wim 1:aa0195b0f83c 544 * @param PinName rst reset pin
wim 1:aa0195b0f83c 545 */
wim 1:aa0195b0f83c 546 class PT6301_SMTG7400 : public PT6301{
wim 1:aa0195b0f83c 547 public:
wim 1:aa0195b0f83c 548
wim 1:aa0195b0f83c 549 /** Constructor for class for driving Princeton PT6301 VFD controller as used in SMTG7400
wim 1:aa0195b0f83c 550 *
wim 1:aa0195b0f83c 551 * @brief Supports 16 Grids of 5x7 Segments with 4 additional Segments in use.
wim 1:aa0195b0f83c 552 *
wim 1:aa0195b0f83c 553 * @param PinName mosi, sclk, cs SPI bus pins
wim 1:aa0195b0f83c 554 * @param PinName rst reset pin
wim 1:aa0195b0f83c 555 */
wim 1:aa0195b0f83c 556 PT6301_SMTG7400(PinName mosi, PinName sclk, PinName cs, PinName rst);
wim 1:aa0195b0f83c 557
wim 1:aa0195b0f83c 558 /** Set Icon
wim 1:aa0195b0f83c 559 *
wim 1:aa0195b0f83c 560 * @param int icon The icon ID
wim 1:aa0195b0f83c 561 * @return none
wim 1:aa0195b0f83c 562 */
wim 1:aa0195b0f83c 563 void setIcon(int icon);
wim 1:aa0195b0f83c 564
wim 1:aa0195b0f83c 565 /** Clr Icon
wim 1:aa0195b0f83c 566 *
wim 1:aa0195b0f83c 567 * @param int icon The icon ID
wim 1:aa0195b0f83c 568 * @return none
wim 1:aa0195b0f83c 569 */
wim 1:aa0195b0f83c 570 void clrIcon(int icon);
wim 1:aa0195b0f83c 571
wim 1:aa0195b0f83c 572 protected:
wim 1:aa0195b0f83c 573
wim 0:ecc29c13a997 574 private:
wim 1:aa0195b0f83c 575
wim 1:aa0195b0f83c 576 };
wim 1:aa0195b0f83c 577 #endif
wim 1:aa0195b0f83c 578
wim 1:aa0195b0f83c 579 #if (SMTC7140_TEST == 1)
wim 1:aa0195b0f83c 580 // Derived class for SMTC7140 display unit
wim 1:aa0195b0f83c 581 // Grids 1-12, with 2 rows of 12 matrix characters (35 segments), no Additional segments.
wim 1:aa0195b0f83c 582 // Grid 13 is used for icons displayed as a UDC symbol.
wim 1:aa0195b0f83c 583 //
wim 1:aa0195b0f83c 584
wim 1:aa0195b0f83c 585 //SMTC7140 Display data
wim 1:aa0195b0f83c 586 #define SMTC7140_NR_GRIDS 13
wim 1:aa0195b0f83c 587 #define SMTC7140_NR_COLS 12
wim 1:aa0195b0f83c 588 #define SMTC7140_NR_ROWS 2
wim 1:aa0195b0f83c 589
wim 1:aa0195b0f83c 590 //#define SMTC7140_NR_UDC 16
wim 1:aa0195b0f83c 591 #define SMTC7140_ICON_DOLBY (1)
wim 1:aa0195b0f83c 592 #define SMTC7140_ICON_PLUS (2)
wim 1:aa0195b0f83c 593 #define SMTC7140_ICON_HD (3)
wim 1:aa0195b0f83c 594 #define SMTC7140_ICON_CLOCK (4)
wim 1:aa0195b0f83c 595 #define SMTC7140_ICON_REC (5)
wim 1:aa0195b0f83c 596 #define SMTC7140_ICON_MAIL (6)
wim 1:aa0195b0f83c 597
wim 1:aa0195b0f83c 598 const char SMTC7140_ICONS[][5] = {{0x7F, 0x7F, 0x7F, 0x7F, 0x7F}, // All On
wim 1:aa0195b0f83c 599 {0x00, 0x00, 0x08, 0x00, 0x00}, // Dolby
wim 1:aa0195b0f83c 600 {0x00, 0x04, 0x00, 0x00, 0x00}, // +
wim 1:aa0195b0f83c 601 {0x00, 0x00, 0x00, 0x08, 0x00}, // HD
wim 1:aa0195b0f83c 602 {0x00, 0x00, 0x00, 0x00, 0x10}, // Clock
wim 1:aa0195b0f83c 603 {0x20, 0x00, 0x00, 0x00, 0x00}, // Rec
wim 1:aa0195b0f83c 604 {0x00, 0x00, 0x00, 0x00, 0x40}, // Mail
wim 1:aa0195b0f83c 605 {0x00, 0x00, 0x00, 0x00, 0x00}, //
wim 1:aa0195b0f83c 606 };
wim 1:aa0195b0f83c 607
wim 1:aa0195b0f83c 608 /** Constructor for class for driving Princeton PT6301 VFD controller as used in SMTC7140
wim 1:aa0195b0f83c 609 *
wim 1:aa0195b0f83c 610 * @brief Supports 12 Grids of 5x7 Segments without additional Icon Segments, for 2 Rows.
wim 1:aa0195b0f83c 611 * Grid13 is used for icons displayed by a UDC symbol.
wim 1:aa0195b0f83c 612 *
wim 1:aa0195b0f83c 613 * @param PinName mosi, sclk, cs SPI bus pins
wim 1:aa0195b0f83c 614 * @param PinName rst reset pin
wim 1:aa0195b0f83c 615 */
wim 1:aa0195b0f83c 616 class PT6301_SMTC7140 : public PT6301 {
wim 1:aa0195b0f83c 617 public:
wim 1:aa0195b0f83c 618
wim 1:aa0195b0f83c 619 /** Constructor for class for driving Princeton PT6301 VFD controller as used in SMTC7140
wim 1:aa0195b0f83c 620 *
wim 1:aa0195b0f83c 621 * @brief Supports 12 Grids with 2 rows of 12 matrix characters (35 Segments), without additional Segments.
wim 1:aa0195b0f83c 622 * Grid 13 is used for icons displayed by a UDC symbol.
wim 1:aa0195b0f83c 623 *
wim 1:aa0195b0f83c 624 * @param PinName mosi, sclk, cs SPI bus pins
wim 1:aa0195b0f83c 625 * @param PinName rst reset pin
wim 1:aa0195b0f83c 626 */
wim 1:aa0195b0f83c 627 PT6301_SMTC7140(PinName mosi, PinName sclk, PinName cs, PinName rst);
wim 1:aa0195b0f83c 628
wim 1:aa0195b0f83c 629
wim 1:aa0195b0f83c 630 /** Set VFD VGen
wim 1:aa0195b0f83c 631 *
wim 1:aa0195b0f83c 632 * @param bool on
wim 1:aa0195b0f83c 633 * @return none
wim 1:aa0195b0f83c 634 */
wim 1:aa0195b0f83c 635 void setVGen (bool on = true);
wim 1:aa0195b0f83c 636
wim 1:aa0195b0f83c 637 /** Set IconGrid13
wim 1:aa0195b0f83c 638 * Icons are shown on Grid13 using the UDC at index=0. The UDC char=0 is stored in _displaybuffer[0][12] at reset.
wim 1:aa0195b0f83c 639 * This method will set the correct segment in the UDC for each icon.
wim 1:aa0195b0f83c 640 *
wim 1:aa0195b0f83c 641 * @param int icon The icon ID
wim 1:aa0195b0f83c 642 * @return none
wim 1:aa0195b0f83c 643 */
wim 1:aa0195b0f83c 644 void setIconGrid13(int icon);
wim 1:aa0195b0f83c 645
wim 1:aa0195b0f83c 646 /** Clr IconGrid13
wim 1:aa0195b0f83c 647 * Icons are shown on Grid13 using the UDC at index=0. The UDC char=0 is stored in _displaybuffer[0][12] at reset.
wim 1:aa0195b0f83c 648 * This method will clr the correct segment in the UDC for each icon.
wim 1:aa0195b0f83c 649 *
wim 1:aa0195b0f83c 650 * @param int icon The icon ID
wim 1:aa0195b0f83c 651 * @return none
wim 1:aa0195b0f83c 652 */
wim 1:aa0195b0f83c 653 void clrIconGrid13(int icon);
wim 1:aa0195b0f83c 654
wim 1:aa0195b0f83c 655 protected:
wim 1:aa0195b0f83c 656
wim 1:aa0195b0f83c 657 private:
wim 1:aa0195b0f83c 658 UDCData_t _icon_data; // Icon data is stored as UDC_idx=0 and displayed on position (0, 12)
wim 1:aa0195b0f83c 659
wim 0:ecc29c13a997 660 };
wim 0:ecc29c13a997 661 #endif
wim 0:ecc29c13a997 662
wim 0:ecc29c13a997 663 #endif