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.
PT6318 Class Reference
A class for driving Princeton PT6318 VFD controller. More...
#include <PT6318.h>
Inherited by PT6318_KUH8300.
Public Types | |
| 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 (PinName mosi, PinName miso, PinName sclk, PinName cs, Mode mode=Grid16_Seg12) | |
| Constructor for class for driving Princeton PT6318 VFD controller. | |
| void | cls () |
| Clear the screen and locate to 0. | |
| void | writeData (char data, int address) |
| Write databyte to PT6318. | |
| void | writeData (DisplayData_t data, int length=PT6318_DISPLAY_MEM, int address=0) |
| Write Display datablock 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. | |
Detailed Description
A class for driving Princeton PT6318 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 PT6318.h.
Member Typedef Documentation
| typedef char DisplayData_t[PT6318_DISPLAY_MEM] |
Member Enumeration Documentation
| enum Mode |
Enums for display mode.
- Enumerator:
Constructor & Destructor Documentation
Constructor for class for driving Princeton PT6318 VFD controller.
Supports 8 Grids of 20 Segments upto 16 Grids of 12 Segments. Also supports a scanned keyboard of upto 32 keys, 4 switches and 5 LEDs. SPI bus interface device.
- Parameters:
-
PinName mosi, miso, sclk, cs SPI bus pins Mode selects 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:
-
PinName mosi, miso, sclk, cs SPI bus pins Mode selects either number of Digits and Segments
Definition at line 33 of file PT6318.cpp.
Member Function Documentation
| void cls | ( | ) |
Clear the screen and locate to 0.
Definition at line 63 of file PT6318.cpp.
| bool getKeys | ( | KeyData_t * | keydata ) |
Read keydata block from PT6318.
- Parameters:
-
*keydata Ptr 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:
-
*keydata Ptr 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 | ( | ) |
Read switches from PT6318.
- Parameters:
-
none
- Returns:
- char for switch data (4 least significant bits)
Definition at line 206 of file PT6318.cpp.
| void setBrightness | ( | char | brightness = PT6318_BRT_DEF ) |
Set Brightness.
- Parameters:
-
char brightness (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 ) |
| void setLED | ( | char | leds = 0 ) |
Set LEDs.
- Parameters:
-
char leds (5 least significant bits)
- Returns:
- none
- Parameters:
-
char leds (4 least significant bits)
- Returns:
- none
Definition at line 233 of file PT6318.cpp.
| void writeData | ( | DisplayData_t | data, |
| int | length = PT6318_DISPLAY_MEM, |
||
| int | address = 0 |
||
| ) |
Write Display datablock to PT6318.
- Parameters:
-
DisplayData_t data Array of PT6318_DISPLAY_MEM (=48) bytes for displaydata (starting at address) length number bytes to write (valid range 0..PT6318_DISPLAY_MEM (=48), starting at address) int address display memory location to write byte (default = 0)
- Returns:
- none
- Parameters:
-
DisplayData_t data Array of PT6318_DISPLAY_MEM (=48) bytes for displaydata (starting at address) length number bytes to write (valid range 0..PT6318_DISPLAY_MEM (=48), starting at address) int address display memory location to write byte
- Returns:
- none
Reimplemented in PT6318_KUH8300.
Definition at line 130 of file PT6318.cpp.
| void writeData | ( | char | data, |
| int | address | ||
| ) |
Write databyte to PT6318.
- Parameters:
-
char data byte written at given address int address display memory location to write byte
- Returns:
- none
Definition at line 112 of file PT6318.cpp.
Generated on Tue Jul 12 2022 18:26:03 by
1.7.2
PT6318 VFD driver (192 segm max), Keyboard scan (48 max).