Library for Princeton PT6318 VFD controller Initial version for KUH8300.

Files at this revision

API Documentation at this revision

Comitter:
wim
Date:
Sun Jun 19 13:27:07 2016 +0000
Parent:
0:e5741b4e6a1a
Commit message:
Library for Princeton PT6318 VFD controller; Initial version for KUH8300.

Changed in this revision

Font_7Seg.cpp Show annotated file Show diff for this revision Revisions of this file
Font_7Seg.h Show annotated file Show diff for this revision Revisions of this file
PT6318.cpp Show annotated file Show diff for this revision Revisions of this file
PT6318.h Show annotated file Show diff for this revision Revisions of this file
--- a/Font_7Seg.cpp	Mon Feb 01 20:18:04 2016 +0000
+++ b/Font_7Seg.cpp	Sun Jun 19 13:27:07 2016 +0000
@@ -42,7 +42,7 @@
 
 #if (SHOW_ASCII == 1)
 //display all ASCII characters
-const short FONT_7S[]  = { 
+const char FONT_7S[]  = { 
                              C7_SPC, //32 0x20, Space
                              C7_EXC,
                              C7_QTE,
@@ -143,7 +143,7 @@
  
 #else
 //display only digits and hex characters
-const short FONT_7S[] = { 
+const char FONT_7S[] = { 
                            C7_0, //48 0x30
                            C7_1,
                            C7_2,
--- a/Font_7Seg.h	Mon Feb 01 20:18:04 2016 +0000
+++ b/Font_7Seg.h	Sun Jun 19 13:27:07 2016 +0000
@@ -264,6 +264,6 @@
 #define FONT_7S_START     0x20
 #define FONT_7S_END       0x7F
 //#define FONT_7S_NR_CHARS (FONT_7S_END - FONT_7S_START + 1)
-extern const short FONT_7S[]; 
+extern const char FONT_7S[]; 
 
 #endif    
\ No newline at end of file
--- 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++;
--- a/PT6318.h	Mon Feb 01 20:18:04 2016 +0000
+++ b/PT6318.h	Sun Jun 19 13:27:07 2016 +0000
@@ -58,9 +58,9 @@
  *   while (1) {
  *    // Check and read keydata
  *    if (PT6318.getKeys(&keydata)) {
- *      pc.printf("Keydata 0..5 = 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\r\n", keydata[0], keydata[1], keydata[2], keydata[3], keydata[4], keydata[5]);
+ *      pc.printf("Keydata 0..5 = 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\r\n", keydata[0], keydata[1], keydata[2], keydata[3], keydata[4], keydata[5]);
  *
- *      if (keydata[0] == 0x10) { //sw2   
+ *      if (keydata[0] == 0x01) { //sw1   
  *        PT6318.cls(); 
  *        wait(1);
  *        PT6318.writeData(all_str);
@@ -148,7 +148,7 @@
 
 /** A 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. 
  */
 class PT6318 {
@@ -335,7 +335,7 @@
     S    = (6<<24) | S7_S
   };
   
-  typedef short UDCData_t[KUH8300_NR_UDC];
+  typedef char UDCData_t[KUH8300_NR_UDC];
 
 
 /** Constructor for class for driving Princeton PT6318 VFD controller as used in KUH8300
@@ -431,8 +431,8 @@
     int _columns;                    // Max number of columns
     
     DisplayData_t _displaybuffer;    // Local mirror for all chars and icons
-    UDCData_t _UDC_16S;              // User Defined Character pattterns (UDC)    
-};
+    UDCData_t _UDC_7S;               // User Defined Character pattterns (UDC)    
+}; 
 #endif
 
 #endif