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

Embed: (wiki syntax)

« Back to documentation index

PT6301_SMTG7400 Class Reference

Constructor for class for driving Princeton PT6301 VFD controller as used in SMTG7400. 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_SMTG7400 (PinName mosi, PinName sclk, PinName cs, PinName rst)
 Constructor for class for driving Princeton PT6301 VFD controller as used in SMTG7400.
void setIcon (int icon)
 Set Icon.
void clrIcon (int icon)
 Clr Icon.
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 SMTG7400.

Supports 16 Grids of 5x7 Segments with 4 additional Segments in use.

Parameters:
PinNamemosi, sclk, cs SPI bus pins
PinNamerst reset pin

Definition at line 546 of file PT6301.h.


Member Typedef Documentation

typedef char DisplayData_t[PT6301_MAX_NR_ROWS][PT6301_DSP_MEM] [inherited]

Datatypes for display data.

Definition at line 303 of file PT6301.h.


Member Enumeration Documentation

enum Mode [inherited]

Enums for display mode.

Definition at line 283 of file PT6301.h.


Constructor & Destructor Documentation

PT6301_SMTG7400 ( PinName  mosi,
PinName  sclk,
PinName  cs,
PinName  rst 
)

Constructor for class for driving Princeton PT6301 VFD controller as used in SMTG7400.

Constructor for class for Princeton PT6301 VFD controller as used in SMTG7400.

Supports 16 Grids of 5x7 Segments with 4 additional Segments in use.

Parameters:
PinNamemosi, sclk, cs SPI bus pins
PinNamerst reset pin

Supports 16 Grids of 5x7 Segments with 4 additional Segments in use.

Parameters:
PinNamemosi, miso, sclk, cs SPI bus pins
PinNamerst Reset pin

Definition at line 575 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:
chardata
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:
valuechar 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:
introw_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:
charcmd 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:
charcmd Command byte
chardata Parameter for Command byte
Returns:
none
Parameters:
charcmd Command byte
chardata Parameter for command
Returns:
none

Definition at line 380 of file PT6301.cpp.

void clrIcon ( int  icon )

Clr Icon.

Parameters:
inticon The icon ID
Returns:
none

Definition at line 593 of file PT6301.cpp.

void clrIcon ( int  row,
int  column 
) [inherited]

Clr Icon.

Parameters:
introw The row of the icon (0..(rows-1))
intcolumn The column of the icon (0..(cols-1))
Returns:
none

Definition at line 343 of file PT6301.cpp.

void cls ( bool  clrAll = true ) [inherited]

Clear the screen and locate to (0,0)

Parameters:
boolclrAll Clear Icons also (default = true)
boolclrAll 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:
rowThe vertical position from the top, indexed from 0
columnThe 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:
rowThe vertical position from the top, indexed from 0
columnThe 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:
rowThe vertical position from the top, indexed from 0
columnThe 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:
formatA 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:
cThe 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:
boolcopyAll Copy Icons in Adat local mirror also (default = true)
Returns:
none

Definition at line 157 of file PT6301.cpp.

int rows (  ) [inherited]

Number of screen rows.

Parameters:
none
Returns:
rows

Definition at line 147 of file PT6301.cpp.

void setAData ( char  data,
int  row,
int  column 
) [inherited]

Write AData to local mirror.

Parameters:
chardata The symbol databyte
rowThe vertical position from the top, indexed from 0
columnThe 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:
charbrightness (3 significant bits, valid range 0..7 (dutycycle linked to number of grids)
Returns:
none
Parameters:
charbrightness (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:
chardata The databyte
rowThe vertical position from the top, indexed from 0
columnThe 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:
booldisplay mode
Returns:
none

Definition at line 241 of file PT6301.cpp.

void setDisplayTest ( bool  on ) [inherited]

Set the Display test mode On/off.

Parameters:
booldisplay test mode
Returns:
none

Definition at line 260 of file PT6301.cpp.

void setIcon ( int  icon )

Set Icon.

Parameters:
inticon The icon ID
Returns:
none

Definition at line 584 of file PT6301.cpp.

void setIcon ( int  row,
int  column 
) [inherited]

Set Icon.

Parameters:
introw The row of the icon (0..(rows-1))
intcolumn 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 
) [inherited]

Set User Defined Characters (UDC) for A and B row.

Set User Defined Characters (UDC) for A and B.

Parameters:
unsignedchar udc_idx The Index of the UDC (0..15)
UDCData_tudc_data The bitpattern for the UDC (5 bytes)
Returns:
none

Definition at line 280 of file PT6301.cpp.