Library for Princeton PT6318 VFD controller Initial version for KUH8300.
Diff: PT6318.cpp
- Revision:
- 1:a7a518dbca96
- Parent:
- 0:e5741b4e6a1a
diff -r e5741b4e6a1a -r a7a518dbca96 PT6318.cpp
--- a/PT6318.cpp Mon Feb 01 20:18:04 2016 +0000
+++ b/PT6318.cpp Sun Jun 19 13:27:07 2016 +0000
@@ -24,7 +24,7 @@
/** Constructor for class for driving Princeton PT6318 VFD controller
*
- * @brief 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.
+ * @brief 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.
*
* @param PinName mosi, miso, sclk, cs SPI bus pins
@@ -420,7 +420,7 @@
}
// Mask out Icon bits?
- _UDC_16S[udc_idx] = udc_data & 0xFFFF;
+ _UDC_7S[udc_idx] = udc_data & 0xFF;
}
/** Write a single character (Stream implementation)
@@ -428,7 +428,7 @@
int PT6318_KUH8300::_putc(int value) {
bool validChar = false;
bool even = false;
- short pattern = 0x0000;
+ char pattern = 0x00;
int addr;
if ((value == '\n') || (value == '\r')) {
@@ -441,7 +441,7 @@
else if ((value >= 0) && (value < KUH8300_NR_UDC)) {
//Character to write
validChar = true;
- pattern = _UDC_16S[value];
+ pattern = _UDC_7S[value];
}
#if (SHOW_ASCII == 1)
//display all ASCII characters
@@ -626,7 +626,8 @@
// _displaybuffer[addr+1] = (_displaybuffer[addr+1] & MASK_ICON_GRID[_column][1]) | MD(pattern);
// _displaybuffer[addr+2] = (_displaybuffer[addr+2] & MASK_ICON_GRID[_column][2]) | HI(pattern);
- writeData(_displaybuffer, (KUH8300_NR_GRIDS * PT6318_BYTES_PER_GRID));
+// writeData(_displaybuffer, (KUH8300_NR_GRIDS * PT6318_BYTES_PER_GRID));
+ writeData(_displaybuffer, PT6318_BYTES_PER_GRID, addr);
//Update Cursor
_column++;
PT6318 VFD driver (192 segm max), Keyboard scan (48 max).