Library for Princeton PT6301 VFD controller. Used in Futaba CIG VFD tubes.
PT6301_SMTC7140 Class Reference
Constructor for class for driving Princeton PT6301 VFD controller as used in SMTC7140. More...
#include <PT6301.h>
Inherits PT6301.
Public Types | |
| enum | Mode |
Enums for display mode. More... | |
| typedef char | DisplayData_t [PT6301_MAX_NR_ROWS][PT6301_DSP_MEM] |
| Datatypes for display data. | |
Public Member Functions | |
| PT6301_SMTC7140 (PinName mosi, PinName sclk, PinName cs, PinName rst) | |
| Constructor for class for driving Princeton PT6301 VFD controller as used in SMTC7140. | |
| void | setVGen (bool on=true) |
| Set VFD VGen. | |
| void | setIconGrid13 (int icon) |
| Set IconGrid13 Icons are shown on Grid13 using the UDC at index=0. | |
| void | clrIconGrid13 (int icon) |
| Clr IconGrid13 Icons are shown on Grid13 using the UDC at index=0. | |
| void | setBrightness (char brightness=PT6301_BRT_DEF) |
| Set Brightness. | |
| void | setDisplay (bool on) |
| Set the Display mode On/off. | |
| void | setDisplayTest (bool on) |
| Set the Display test mode On/off. | |
| void | setUDC (unsigned char udc_idx, UDCData_t udc_data) |
| Set User Defined Characters (UDC) for A and B row. | |
| void | setIcon (int row, int column) |
| Set Icon. | |
| void | clrIcon (int row, int column) |
| Clr Icon. | |
| void | locate (int row, int column) |
| Locate cursor to a screen row, column. | |
| void | cls (bool clrAll=true) |
| Clear the screen and locate to (0,0) | |
| void | refresh (bool copyAll=true) |
| Refresh screen and show data in local mirrors on the display. | |
| int | columns () |
| Number of screen columns. | |
| int | rows () |
| Number of screen rows. | |
| void | setData (char data, int row, int column) |
| Write Data to local mirror. | |
| char | getData (int row, int column) |
| Read Data from local mirror. | |
| void | setAData (char data, int row, int column) |
| Write AData to local mirror. | |
| char | getAData (int row, int column) |
| Read AData from local mirror. | |
Protected Member Functions | |
| void | _writeCmd (char cmd) |
| Write Command byte to PT6301. | |
| void | _writeCmd (char cmd, char data) |
| Write Command and Data byte to PT6301. | |
| char | _flip (char data) |
| Helper to reverse all command or databits. | |
| int | _row_flip (int row_idx) |
| Helper to reverse row idx depending on VFD layout. | |
| int | putc (int c) |
| Write a character to the Display. | |
| int | printf (const char *format,...) |
| Write a formatted string to the Display. | |
| virtual int | _putc (int value) |
| Write a single character (Stream implementation) | |
| virtual int | _getc () |
| Get a single character (Stream implementation) | |
Detailed Description
Constructor for class for driving Princeton PT6301 VFD controller as used in SMTC7140.
Supports 12 Grids of 5x7 Segments without additional Icon Segments, for 2 Rows. Grid13 is used for icons displayed by a UDC symbol.
- Parameters:
-
PinName mosi, sclk, cs SPI bus pins PinName rst reset pin
Definition at line 616 of file PT6301.h.
Member Typedef Documentation
typedef char DisplayData_t[PT6301_MAX_NR_ROWS][PT6301_DSP_MEM] [inherited] |
Member Enumeration Documentation
Constructor & Destructor Documentation
| PT6301_SMTC7140 | ( | PinName | mosi, |
| PinName | sclk, | ||
| PinName | cs, | ||
| PinName | rst | ||
| ) |
Constructor for class for driving Princeton PT6301 VFD controller as used in SMTC7140.
Constructor for class for Princeton PT6301 VFD controller as used in SMTC7140.
Supports 12 Grids with 2 rows of 12 matrix characters (35 Segments), without additional Segments. Grid 13 is used for icons displayed by a UDC symbol.
- Parameters:
-
PinName mosi, sclk, cs SPI bus pins PinName rst reset pin
Supports 12 Grids of 5x7 Segments without additional Icon Segments, for 2 Rows. Grid13 is used for icons displayed by a UDC symbol.
- Parameters:
-
PinName mosi, miso, sclk, cs SPI bus pins PinName rst Reset pin
Definition at line 610 of file PT6301.cpp.
Member Function Documentation
| char _flip | ( | char | data ) | [protected, inherited] |
Helper to reverse all command or databits.
The PT6301 expects LSB first, whereas SPI is MSB first
- Parameters:
-
char data
- Returns:
- bitreversed data
Definition at line 479 of file PT6301.cpp.
| int _getc | ( | ) | [protected, virtual, inherited] |
Get a single character (Stream implementation)
- Parameters:
-
none
- Returns:
- -1
Definition at line 560 of file PT6301.cpp.
| int _putc | ( | int | value ) | [protected, virtual, inherited] |
Write a single character (Stream implementation)
- Parameters:
-
value char to print
- Returns:
- value;
Definition at line 518 of file PT6301.cpp.
| int _row_flip | ( | int | row_idx ) | [protected, inherited] |
Helper to reverse row idx depending on VFD layout.
- Parameters:
-
int row_idx
- Returns:
- adjusted row_idx
Definition at line 499 of file PT6301.cpp.
| void _writeCmd | ( | char | cmd ) | [protected, inherited] |
Write Command byte to PT6301.
Write command to PT6301.
- Parameters:
-
char cmd Command byte
- Returns:
- none
Definition at line 360 of file PT6301.cpp.
| void _writeCmd | ( | char | cmd, |
| char | data | ||
| ) | [protected, inherited] |
Write Command and Data byte to PT6301.
Write command and data to PT6301.
- Parameters:
-
char cmd Command byte char data Parameter for Command byte
- Returns:
- none
- Parameters:
-
char cmd Command byte char data Parameter for command
- Returns:
- none
Definition at line 380 of file PT6301.cpp.
| void clrIcon | ( | int | row, |
| int | column | ||
| ) | [inherited] |
Clr Icon.
- Parameters:
-
int row The row of the icon (0..(rows-1)) int column The column of the icon (0..(cols-1))
- Returns:
- none
Definition at line 343 of file PT6301.cpp.
| void clrIconGrid13 | ( | int | icon ) |
Clr IconGrid13 Icons are shown on Grid13 using the UDC at index=0.
The UDC char=0 is stored in _displaybuffer[0][12] at reset. This method will clr the correct segment in the UDC for each icon.
- Parameters:
-
int icon The icon ID
- Returns:
- none
Definition at line 665 of file PT6301.cpp.
| void cls | ( | bool | clrAll = true ) |
[inherited] |
Clear the screen and locate to (0,0)
- Parameters:
-
bool clrAll Clear Icons also (default = true) bool clrAll Clear Icons also (default = false)
- Returns:
- none
Definition at line 97 of file PT6301.cpp.
| int columns | ( | ) | [inherited] |
Number of screen columns.
- Parameters:
-
none
- Returns:
- columns
Definition at line 137 of file PT6301.cpp.
| char getAData | ( | int | row, |
| int | column | ||
| ) | [inherited] |
Read AData from local mirror.
- Parameters:
-
row The vertical position from the top, indexed from 0 column The horizontal position from the left, indexed from 0
- Returns:
- char The symbol databyte
Definition at line 459 of file PT6301.cpp.
| char getData | ( | int | row, |
| int | column | ||
| ) | [inherited] |
Read Data from local mirror.
- Parameters:
-
row The vertical position from the top, indexed from 0 column The horizontal position from the left, indexed from 0
- Returns:
- char The databyte
Definition at line 422 of file PT6301.cpp.
| void locate | ( | int | row, |
| int | column | ||
| ) | [inherited] |
Locate cursor to a screen row, column.
- Parameters:
-
row The vertical position from the top, indexed from 0 column The horizontal position from the left, indexed from 0
- Returns:
- none
Definition at line 120 of file PT6301.cpp.
| int printf | ( | const char * | format, |
| ... | |||
| ) | [protected, inherited] |
Write a formatted string to the Display.
- Parameters:
-
format A printf-style format string, followed by the variables to use in formatting the string.
| int putc | ( | int | c ) | [protected, inherited] |
Write a character to the Display.
- Parameters:
-
c The character to write to the display RAM
- Returns:
- char written
| void refresh | ( | bool | copyAll = true ) |
[inherited] |
Refresh screen and show data in local mirrors on the display.
- Parameters:
-
bool copyAll Copy Icons in Adat local mirror also (default = true)
- Returns:
- none
Definition at line 157 of file PT6301.cpp.
| int rows | ( | ) | [inherited] |
| void setAData | ( | char | data, |
| int | row, | ||
| int | column | ||
| ) | [inherited] |
Write AData to local mirror.
- Parameters:
-
char data The symbol databyte row The vertical position from the top, indexed from 0 column The horizontal position from the left, indexed from 0
- Returns:
- none
Definition at line 441 of file PT6301.cpp.
| void setBrightness | ( | char | brightness = PT6301_BRT_DEF ) |
[inherited] |
Set Brightness.
- Parameters:
-
char brightness (3 significant bits, valid range 0..7 (dutycycle linked to number of grids)
- Returns:
- none
- Parameters:
-
char brightness (valid range 0..255)
- Returns:
- none
Definition at line 227 of file PT6301.cpp.
| void setData | ( | char | data, |
| int | row, | ||
| int | column | ||
| ) | [inherited] |
Write Data to local mirror.
- Parameters:
-
char data The databyte row The vertical position from the top, indexed from 0 column The horizontal position from the left, indexed from 0
- Returns:
- none
Definition at line 404 of file PT6301.cpp.
| void setDisplay | ( | bool | on ) | [inherited] |
Set the Display mode On/off.
- Parameters:
-
bool display mode
- Returns:
- none
Definition at line 241 of file PT6301.cpp.
| void setDisplayTest | ( | bool | on ) | [inherited] |
Set the Display test mode On/off.
- Parameters:
-
bool display test mode
- Returns:
- none
Definition at line 260 of file PT6301.cpp.
| void setIcon | ( | int | row, |
| int | column | ||
| ) | [inherited] |
Set Icon.
- Parameters:
-
int row The row of the icon (0..(rows-1)) int column The column of the icon (0..(cols-1))
- Returns:
- none
Definition at line 326 of file PT6301.cpp.
| void setIconGrid13 | ( | int | icon ) |
Set IconGrid13 Icons are shown on Grid13 using the UDC at index=0.
The UDC char=0 is stored in _displaybuffer[0][12] at reset. This method will set the correct segment in the UDC for each icon.
- Parameters:
-
int icon The icon ID
- Returns:
- none
Definition at line 635 of file PT6301.cpp.
| void setUDC | ( | unsigned char | udc_idx, |
| UDCData_t | udc_data | ||
| ) | [inherited] |
Set User Defined Characters (UDC) for A and B row.
Set User Defined Characters (UDC) for A and B.
- Parameters:
-
unsigned char udc_idx The Index of the UDC (0..15) UDCData_t udc_data The bitpattern for the UDC (5 bytes)
- Returns:
- none
Definition at line 280 of file PT6301.cpp.
| void setVGen | ( | bool | on = true ) |
Generated on Thu Jul 14 2022 03:31:40 by
1.7.2