Wim Huiskamp / PT6311

Dependents:   mbed_PT6311

Embed: (wiki syntax)

« Back to documentation index

PT6311 Class Reference

PT6311 Class Reference

A class for driving Princeton PT6311 VFD controller. More...

#include <PT6311.h>

Inherited by PT6311_VFDEM2.

Public Types

enum  Mode
 

Enums for display mode.

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

Public Member Functions

 PT6311 (PinName mosi, PinName miso, PinName sclk, PinName cs, Mode mode=Grid16_Seg12)
 Constructor for class for driving Princeton PT6311 VFD controller.
void cls ()
 Clear the screen and locate to 0.
void writeData (int address, char data)
 Write databyte to PT6311.
void writeData (DisplayData_t data, int length=PT6311_DISPLAY_MEM)
 Write Display datablock to PT6311.
bool getKeys (KeyData_t *keydata)
 Read keydata block from PT6311.
char getSwitches ()
 Read switches from PT6311.
void setLED (char leds=0)
 Set LEDs.
void setBrightness (char brightness=PT6311_BRT_DEF)
 Set Brightness.
void setDisplay (bool on)
 Set the Display mode On/off.

Detailed Description

A class for driving Princeton PT6311 VFD controller.

Supports 8 Grids of 20 Segments upto 16 Grids of 12 Segments. Also supports a scanned keyboard of upto 48 keys, 4 switches and 5 LEDs. SPI bus interface device.

Definition at line 154 of file PT6311.h.


Member Typedef Documentation

typedef char DisplayData_t[PT6311_DISPLAY_MEM]

Datatypes for display and keymatrix data.

Definition at line 171 of file PT6311.h.


Member Enumeration Documentation

enum Mode

Enums for display mode.

Definition at line 158 of file PT6311.h.


Constructor & Destructor Documentation

PT6311 ( PinName  mosi,
PinName  miso,
PinName  sclk,
PinName  cs,
Mode  mode = Grid16_Seg12 
)

Constructor for class for driving Princeton PT6311 VFD controller.

Supports 8 Grids of 20 Segments upto 16 Grids of 12 Segments. Also supports a scanned keyboard of upto 48 keys, 4 switches and 5 LEDs. SPI bus interface device.

Parameters:
PinNamemosi, miso, sclk, cs SPI bus pins
Modeselects either number of Grids and Segments (default 16 Grids, 12 Segments)

Supports 8 Grids of 20 Segments upto 16 Grids of 12 Segments. Also supports a scanned keyboard of upto 48 keys, 4 switches and 5 LEDs. SPI bus interface device.

Parameters:
PinNamemosi, miso, sclk, cs SPI bus pins
Modeselects either number of Digits and Segments

Definition at line 33 of file PT6311.cpp.


Member Function Documentation

void cls (  )

Clear the screen and locate to 0.

Definition at line 63 of file PT6311.cpp.

bool getKeys ( KeyData_t *  keydata )

Read keydata block from PT6311.

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

Note: Due to the hardware configuration the PT6311 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 PT6311_KEY_MEM (=6) bytes for keydata
Returns:
bool keypress True when at least one key was pressed

Note: Due to the hardware configuration the PT6311 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 156 of file PT6311.cpp.

char getSwitches (  )

Read switches from PT6311.

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

Definition at line 202 of file PT6311.cpp.

void setBrightness ( char  brightness = PT6311_BRT_DEF )

Set Brightness.

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

Definition at line 83 of file PT6311.cpp.

void setDisplay ( bool  on )

Set the Display mode On/off.

Parameters:
booldisplay mode

Definition at line 95 of file PT6311.cpp.

void setLED ( char  leds = 0 )

Set LEDs.

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

Definition at line 229 of file PT6311.cpp.

void writeData ( DisplayData_t  data,
int  length = PT6311_DISPLAY_MEM 
)

Write Display datablock to PT6311.

Parameters:
DisplayData_tdata Array of PT6311_DISPLAY_MEM (=48) bytes for displaydata (starting at address 0)
lengthnumber bytes to write (valid range 0..PT6311_DISPLAY_MEM (=48), starting at address 0)
Returns:
none

Reimplemented in PT6311_VFDEM2.

Definition at line 129 of file PT6311.cpp.

void writeData ( int  address,
char  data 
)

Write databyte to PT6311.

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

Reimplemented in PT6311_VFDEM2.

Definition at line 112 of file PT6311.cpp.