C++ file for display control

Dependencies:   4DGL mbed ConfigFile

Fork of 4DGLtest by Stephane ROCHON

Files at this revision

API Documentation at this revision

Comitter:
WillemBraat
Date:
Wed Jul 16 08:05:54 2014 +0000
Parent:
9:311b6676272d
Child:
11:a5b0d98794c0
Commit message:
display.cpp aangepast met CDU_InitDisplay()
; display.h aangepast met variabelen

Changed in this revision

display.cpp Show annotated file Show diff for this revision Revisions of this file
display.h Show annotated file Show diff for this revision Revisions of this file
keyboard.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/display.cpp	Fri Jul 11 11:08:02 2014 +0000
+++ b/display.cpp	Wed Jul 16 08:05:54 2014 +0000
@@ -6,6 +6,9 @@
 #include <string> 
 using namespace std;
 
+DigitalOut VGA_SOURCE( p7 ); //control line for video switch between INT and EXT video
+DigitalOut VGA_SELECT( p8 ); //control line to select/deselect video switch
+
 /*
 =====================================================
 SGC (Serial Graphics Controller) PLATFORM OUTPUT FILE
@@ -297,6 +300,18 @@
     return ( nPixel ) ;
 }
 
+void VGA_SIGNAL( int Source, int On_Off)
+{
+    VGA_SOURCE = Source;
+    VGA_SELECT = On_Off;
+}
+
+void CDU_InitDisplay()
+{
+    display.baudrate( 9600 );       //init uVGAIII card
+    VGA_SIGNAL( VGA_INT, VGA_ON );  //select INTERNTAL video and set VGA switch ON
+}
+
 void CDU_StartScreen()
  {
     string cTitle1="ENGRAVITY";
--- a/display.h	Fri Jul 11 11:08:02 2014 +0000
+++ b/display.h	Wed Jul 16 08:05:54 2014 +0000
@@ -3,6 +3,8 @@
 //VGA selector lines
 #define VGA_INT 0   //use internal VGA screen
 #define VGA_EXT 1   //loop through external VGA screen from DB9 connector to display
+#define VGA_ON  0   //wwitch VGA on
+#define VGA_OFF 1   //switch VGA off
 
 //LINE and pixel definitions
 #define LINE1 0
--- a/keyboard.cpp	Fri Jul 11 11:08:02 2014 +0000
+++ b/keyboard.cpp	Wed Jul 16 08:05:54 2014 +0000
@@ -3,8 +3,8 @@
 #include "keyboard.h"
 
 const int CDU_KB_ADRS  = 0x68;  //Base addrees TCA8418 keypad scanner
-const int ACK  = 0x00;
-const int NACK = 0x01;
+const int I2C_ACK  = 0x00;
+//const int I2C_ NACK = 0x01;
 
 extern int key_hit_ID;
 //extern mbos CDU_OS;
@@ -29,7 +29,7 @@
     char cmd[2];
     cmd[0] = REG_CFG; //pointer byte to CFG register
     cmd[1] = 0x01; //data for CFG register KE_IEN set to 1
-    if ( CDU_I2C.write(CDU_KB_ADRS,cmd, 2) == ACK ) //initiate write cycle and check for ACK
+    if ( CDU_I2C.write(CDU_KB_ADRS,cmd, 2) == I2C_ACK ) //initiate write cycle and check for ACK
     {
         //intialize all registers from TCA8418 here
         cmd[0] = REG_INT_STAT; //pointer byte to Interrupt Status Register