Modifications in 4DGL library. Added CDU_hw_sw.h for version info. Added pins.h for hardware pin remapping

Dependencies:   4DGL-UC MODSERIAL mbed mbos

Fork of CDU_Mbed_30 by Engravity-CDU

pins.h

Committer:
WillemBraat
Date:
2014-10-10
Revision:
21:f348e6f0f7d4
Parent:
20:150afde94910

File content as of revision 21:f348e6f0f7d4:

#include "CDU_hw_sw.h"

#ifdef HW_VERSION_MAJOR
    #if HW_VERSION_MAJOR == 1
    //NOTE: THESE PIN DEFINITIONS ARE FOR HARDWARE VERSION 1.X
    //
    //*********************************
    //pins in main.cpp
    //*********************************
    //MODSERIAL SERIAL_DEBUG(p9, p10, 512, 64);  //: tx, rx
    #define MODSERIAL_TX        p9
    #define MODSERIAL_RX        p10
    //DigitalOut alive_led(LED1); // : LED 1 on Mbed board toggles when CDU is alive
    #define HEARTBEAT           LED1

    //*********************************
    //pins in display.cpp
    //*********************************
    //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
    #define VGA_SOURCE_SELECT   p7
    #define VGA_ON_OFF          p8 

    //Control lines for VGA driver board
    //TFT_4DGL display(p13,p14,p15); // serial tx, serial rx, reset pin
    #define VGA_TX              p13
    #define VGA_RX              p14
    #define VGA_RESET           p15

    //*********************************
    //pins in keyboard2.cpp
    //*********************************
    //CDU Keyboard communications KEYBOARD_INT
    //InterruptIn CDU_KB_INT( p5 );  //Set CDU keyboard interrupt line
    //I2C CDU_I2C(p28, p27);         //I2C bus for keyboard/temp chip.
    #define KBD_INT             p5
    #define I2C_SDA             p28
    #define I2C_SCL             p27

    //CDU Keyboard LEDS
    #define LED_EXEC            p12
    #define LED_FAIL            p17
    #define LED_DSPY            p18
    #define LED_MSG             p19
    #define LED_OFST            p20

    //CDU background lighting
    //AnalogIn BGL_POT( p16 ); //background light control potmeter
    //PwmOut BGL_LED( p21 );   //PWM output background lighting
    #define BACKLIGHT_SET       p16
    #define BACKLIGHT_DRIVE     p21

    //DigitalOut Key_led(LED2); // : LED 2 on Mbed board toggles when CDU key is pressed
    #define KEY_PRESSED         LED2

    #define PWR_IN              p6   //This pin is connected to the +5V and is 1 when external power is applied
                                     //Level transition from 1->0 indicates an external power failure
    #define PWR_ON              LED4 //monitor of external power and reboot CDU after 1-0-1 state change
        
    #endif


    #if HW_VERSION_MAJOR == 2
    //NOTE: THESE PIN DEFINITIONS ARE FOR HARDWARE VERSION 2.X
    //
    //*********************************
    //pins in main.cpp
    //*********************************
    //MODSERIAL SERIAL_DEBUG(p9, p10, 512, 64);  //: tx, rx
    #define MODSERIAL_TX        p9
    #define MODESERIAL_RX       p10
    //DigitalOut alive_led(LED1); // : LED 1 on Mbed board toggles when CDU is alive
    #define HEARTBEAT           LED1

    //*********************************
    //pins in display.cpp
    //*********************************
    //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
    #define VGA_SOURCE_SELECT   p7
    #define VGA_ON_OFF          p8 

    //Control lines for VGA driver board
    //TFT_4DGL display(p14,p13,p12); // serial tx, serial rx, reset pin
    #define VGA_RESET           p12
    #define VGA_RX              p13
    #define VGA_TX              p14
    
    //*********************************
    //pins in keyboard2.cpp
    //*********************************
    //CDU Keyboard communications KEYBOARD_INT
    //InterruptIn CDU_KB_INT( p5 );  //Set CDU keyboard interrupt line
    //I2C CDU_I2C(p28, p27);         //I2C bus for keyboard/temp chip.
    #define KBD_INT             p5
    #define KBD_TMP_SDA         p28
    #define KBD_TMP_SCL         p27

    //CDU Keyboard LEDS
    #define LED_EXEC            p25
    #define LED_FAIL            p24
    #define LED_DSPY            p23
    #define LED_MSG             p22
    #define LED_OFST            p21

    //CDU background lighting
    //AnalogIn BGL_POT( p15 ); //background light control potmeter
    //PwmOut BGL_LED( p26 );   //PWM output background lighting
    #define BACKLIGHT_SET       p15
    #define BACKLIGHT_DRIVE     p26

    //DigitalOut Key_led(LED2); // : LED 2 on Mbed board toggles when CDU key is pressed
    #define KEY_PRESSED         LED2

    #define PWR_IN              p6   //This pin is connected to the +5V and is 1 when external power is applied
                                     //Level transition from 1->0 indicates an external power failure
    #define PWR_ON              LED4 //monitor of external power and reboot CDU after 1-0-1 state change
        
    #endif

#endif