Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
PT6301 Class Reference
A class for driving Princeton PT6301 VFD controller. More...
#include <PT6301.h>
Inherited by PT6301_SMTC7140, and PT6301_SMTG7400.
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 (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) | |
| Constructor for class for driving Princeton PT6301 VFD controller. | |
| 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
A class for driving Princeton PT6301 VFD controller.
Supports upto 20 Grids of 5x7 matrix segments for 2 rows of characters (A and B). Also supports 1 additional segment for 2 rows (A and B). SPI bus interface device (LSB first).
Definition at line 279 of file PT6301.h.
Member Typedef Documentation
| typedef char DisplayData_t[PT6301_MAX_NR_ROWS][PT6301_DSP_MEM] |
Member Enumeration Documentation
Constructor & Destructor Documentation
| 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 |
||
| ) |
Constructor for class for driving Princeton PT6301 VFD controller.
Supports upto 20 Grids of 5x7 matrix segments for 2 rows of characters (row A and B). Also supports 1 additional segment for 2 rows of characters (row A and B). SPI bus interface device.
- Parameters:
-
PinName mosi, sclk, cs SPI bus pins PinName rst reset pin Mode selects number of Grids and Segments (default 20 Grids, 5x7 matrix segments + 1 additional segment for 2 rows) bool inverted_rows selects mapping of Data onto Display layout (default false) Columns selects number of characters per row (default 20, same as Grids) Rows selects number of rows (default 2)
Supports upto 20 Grids of 5x7 matrix segments for 2 rows of characters (row A and B). also supports 2 additional segments for 2 rows of characters (row A and B). SPI bus interface device.
- Parameters:
-
PinName mosi, sclk, cs SPI bus pins Mode selects number of Grids and Rows (default 20 Grids, 2 rows) bool inverted_rows selects mapping of Data onto Display layout (default false) Columns selects number of characters per row (default 20, same as Mode Grids) Rows selects number of rows (default 2, same as Mode Rows)
Definition at line 41 of file PT6301.cpp.
Member Function Documentation
| char _flip | ( | char | data ) | [protected] |
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] |
Get a single character (Stream implementation)
- Parameters:
-
none
- Returns:
- -1
Definition at line 560 of file PT6301.cpp.
| int _putc | ( | int | value ) | [protected, virtual] |
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] |
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] |
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] |
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 | ||
| ) |
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 cls | ( | bool | clrAll = true ) |
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 | ( | ) |
Number of screen columns.
- Parameters:
-
none
- Returns:
- columns
Definition at line 137 of file PT6301.cpp.
| char getAData | ( | int | row, |
| int | column | ||
| ) |
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 | ||
| ) |
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 | ||
| ) |
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] |
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] |
Write a character to the Display.
- Parameters:
-
c The character to write to the display RAM
- Returns:
- char written
| void refresh | ( | bool | copyAll = true ) |
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 | ( | ) |
| void setAData | ( | char | data, |
| int | row, | ||
| int | column | ||
| ) |
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 ) |
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 | ||
| ) |
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 ) |
Set the Display mode On/off.
- Parameters:
-
bool display mode
- Returns:
- none
Definition at line 241 of file PT6301.cpp.
| void setDisplayTest | ( | bool | on ) |
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 | ||
| ) |
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 setUDC | ( | unsigned char | udc_idx, |
| UDCData_t | udc_data | ||
| ) |
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.
Generated on Thu Jul 14 2022 03:31:40 by
1.7.2