Wim Huiskamp / PT6318
Embed: (wiki syntax)

« Back to documentation index

PT6318_KUH8300 Class Reference

Constructor for class for driving Princeton PT6318 VFD controller as used in KUH8300. More...

#include <PT6318.h>

Inherits PT6318.

Public Types

enum  Icon
 

Enums for Icons.

More...
enum  Mode {
  Grid8_Seg20 = PT6318_GR8_SEG20, Grid9_Seg19 = PT6318_GR9_SEG19, Grid10_Seg18 = PT6318_GR10_SEG18, Grid11_Seg17 = PT6318_GR11_SEG17,
  Grid12_Seg16 = PT6318_GR12_SEG16, Grid13_Seg15 = PT6318_GR13_SEG15, Grid14_Seg14 = PT6318_GR14_SEG14, Grid15_Seg13 = PT6318_GR15_SEG13,
  Grid16_Seg12 = PT6318_GR16_SEG12
}
 

Enums for display mode.

More...
typedef char DisplayData_t [PT6318_DISPLAY_MEM]
 Datatypes for display and keymatrix data.

Public Member Functions

 PT6318_KUH8300 (PinName mosi, PinName miso, PinName sclk, PinName cs)
 Constructor for class for driving Princeton PT6318 VFD controller as used in KUH8300.
int putc (int c)
 Write a character to the Display.
int printf (const char *format,...)
 Write a formatted string to the Display.
void locate (int column)
 Locate cursor to a screen column.
void cls (bool clrAll=false)
 Clear the screen and locate to 0.
void setIcon (Icon icon)
 Set Icon.
void clrIcon (Icon icon)
 Clr Icon.
void setUDC (unsigned char udc_idx, int udc_data)
 Set User Defined Characters (UDC)
int columns ()
 Number of screen columns.
void writeData (int address, char data)
 Write databyte to PT6318.
void writeData (DisplayData_t data, int length=(KUH8300_NR_GRIDS *PT6318_BYTES_PER_GRID), int address=0)
 Write Display datablock to PT6318.
void cls ()
 Clear the screen and locate to 0.
void writeData (char data, int address)
 Write databyte to PT6318.
bool getKeys (KeyData_t *keydata)
 Read keydata block from PT6318.
char getSwitches ()
 Read switches from PT6318.
void setLED (char leds=0)
 Set LEDs.
void setBrightness (char brightness=PT6318_BRT_DEF)
 Set Brightness.
void setDisplay (bool on)
 Set the Display mode On/off.

Protected Member Functions

virtual int _putc (int value)
 Write a single character (Stream implementation)

Detailed Description

Constructor for class for driving Princeton PT6318 VFD controller as used in KUH8300.

Supports 8 Grids of 20 Segments and Icons (8 1/2 digits of 14 segments plus some icons). Also supports a scanned keyboard of 12 keys and 1 LED.

Parameters:
PinNamemosi, miso, sclk, cs SPI bus pins

Definition at line 294 of file PT6318.h.


Member Typedef Documentation

typedef char DisplayData_t[PT6318_DISPLAY_MEM] [inherited]

Datatypes for display and keymatrix data.

Definition at line 171 of file PT6318.h.


Member Enumeration Documentation

enum Icon

Enums for Icons.

Definition at line 299 of file PT6318.h.

enum Mode [inherited]

Enums for display mode.

Enumerator:
Grid8_Seg20 

8 Grids, 20 Segments

Grid9_Seg19 

9 Grids, 19 Segments

Grid10_Seg18 

10 Grids, 18 Segments

Grid11_Seg17 

11 Grids, 17 Segments

Grid12_Seg16 

12 Grids, 16 Segments

Grid13_Seg15 

13 Grids, 15 Segments

Grid14_Seg14 

14 Grids, 14 Segments

Grid15_Seg13 

15 Grids, 13 Segments

Grid16_Seg12 

16 Grids, 12 Segments

Definition at line 158 of file PT6318.h.


Constructor & Destructor Documentation

PT6318_KUH8300 ( PinName  mosi,
PinName  miso,
PinName  sclk,
PinName  cs 
)

Constructor for class for driving Princeton PT6318 VFD controller as used in KUH8300.

Supports 8 Grids of 20 Segments and Icons (8 1/2 digits of 14 Segments plus some icons). Also supports a scanned keyboard of 12 keys and 1 LED.

Parameters:
PinNamemosi, miso, sclk, cs SPI bus pins

Definition at line 299 of file PT6318.cpp.


Member Function Documentation

int _putc ( int  value ) [protected, virtual]

Write a single character (Stream implementation)

Definition at line 428 of file PT6318.cpp.

void clrIcon ( Icon  icon )

Clr Icon.

Parameters:
Iconicon Enums Icon has Grid position encoded in 8 MSBs, Icon pattern encoded in 24 LSBs
Returns:
none

Definition at line 395 of file PT6318.cpp.

void cls ( bool  clrAll = false )

Clear the screen and locate to 0.

Parameters:
boolclrAll Clear Icons also (default = false)

Definition at line 347 of file PT6318.cpp.

void cls (  ) [inherited]

Clear the screen and locate to 0.

Definition at line 63 of file PT6318.cpp.

int columns (  )

Number of screen columns.

Parameters:
none
Returns:
columns

Definition at line 339 of file PT6318.cpp.

bool getKeys ( KeyData_t *  keydata ) [inherited]

Read keydata block from PT6318.

Parameters:
*keydataPtr to Array of PT6318_KEY_MEM (=6) bytes for keydata
Returns:
bool keypress True when at least one key was pressed

Note: Due to the hardware configuration the PT6318 key matrix scanner will detect multiple keys pressed at same time, but this may result in some spurious keys also being set in keypress data array. It may be best to ignore all keys in those situations. That option is implemented in this method depending on define setting.

Parameters:
*keydataPtr to Array of PT6318_KEY_MEM (=6) bytes for keydata
Returns:
bool keypress True when at least one key was pressed

Note: Due to the hardware configuration the PT6318 key matrix scanner will detect multiple keys pressed at same time, but this may also result in some spurious keys being set in keypress data array. It may be best to ignore all keys in those situations. That option is implemented in this method depending on define setting.

Definition at line 161 of file PT6318.cpp.

char getSwitches (  ) [inherited]

Read switches from PT6318.

Parameters:
none
Returns:
char for switch data (4 least significant bits)

Definition at line 206 of file PT6318.cpp.

void locate ( int  column )

Locate cursor to a screen column.

Parameters:
columnThe horizontal position from the left, indexed from 0

Definition at line 325 of file PT6318.cpp.

int printf ( const char *  format,
  ... 
)

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 )

Write a character to the Display.

Parameters:
cThe character to write to the display
void setBrightness ( char  brightness = PT6318_BRT_DEF ) [inherited]

Set Brightness.

Parameters:
charbrightness (3 significant bits, valid range 0..7 (1/16 .. 14/16 dutycycle)
Returns:
none

Definition at line 83 of file PT6318.cpp.

void setDisplay ( bool  on ) [inherited]

Set the Display mode On/off.

Parameters:
booldisplay mode

Definition at line 95 of file PT6318.cpp.

void setIcon ( Icon  icon )

Set Icon.

Parameters:
Iconicon Enums Icon has Grid position encoded in 8 MSBs, Icon pattern encoded in 24 LSBs
Returns:
none

Definition at line 376 of file PT6318.cpp.

void setLED ( char  leds = 0 ) [inherited]

Set LEDs.

Parameters:
charleds (5 least significant bits)
Returns:
none
Parameters:
charleds (4 least significant bits)
Returns:
none

Definition at line 233 of file PT6318.cpp.

void setUDC ( unsigned char  udc_idx,
int  udc_data 
)

Set User Defined Characters (UDC)

Parameters:
unsignedchar udc_idx The Index of the UDC (0..7)
intudc_data The bitpattern for the UDC (16 bits)

Definition at line 415 of file PT6318.cpp.

void writeData ( int  address,
char  data 
)

Write databyte to PT6318.

Parameters:
chardata byte written at given address
intaddress display memory location to write byte
Returns:
none

Definition at line 410 of file PT6318.h.

void writeData ( char  data,
int  address 
) [inherited]

Write databyte to PT6318.

Parameters:
chardata byte written at given address
intaddress display memory location to write byte
Returns:
none

Definition at line 112 of file PT6318.cpp.

void writeData ( DisplayData_t  data,
int  length = (KUH8300_NR_GRIDS * PT6318_BYTES_PER_GRID),
int  address = 0 
)

Write Display datablock to PT6318.

Parameters:
DisplayData_tdata Array of PT6318_DISPLAY_MEM (=36) bytes for displaydata (starting at address)
lengthnumber bytes to write (valid range 0..(KUH8300_NR_GRIDS * PT6318_BYTES_PER_GRID) == 24, starting at address)
intaddress display memory location to write byte (default = 0)
Returns:
none

Reimplemented from PT6318.

Definition at line 420 of file PT6318.h.