Ejemplo n.º 1
0
/************************************************************************
* Function: void GfxTconSetIO(BYTE mask, BYTE level)                                           
*                                                                       
* Overview: This sets the IO specified by mask to the value set by 
*           level.
*                                                                       
* Input: mask - specifies the IO to be toggles.
*		 level - specifies the logic where the IO will be set.
*                                                                       
* Output: none                                 
*                                                                       
************************************************************************/
void GfxTconSetIO(BYTE mask, BYTE level)
{

 #if defined (GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210) || defined (GFX_USE_DISPLAY_CONTROLLER_DMA)

    switch(mask)
    {
        case BB_CS:    (level == 1 ? TCON_CSHigh() : TCON_CSLow());
                    break;

        case BB_SCL:   (level == 1 ? TCON_CLKHigh() : TCON_CLKLow());
                    break;

        case BB_SDO:   (level == 1 ? TCON_DataHigh() : TCON_DataLow());
                    break;

        case BB_DC:    (level == 1 ? TCON_SetData() : TCON_SetCommand());
                    break;
        default:
                    break;            
    }
    
    Nop();
    
 #elif defined (GFX_USE_DISPLAY_CONTROLLER_SSD1926)

    static BYTE value = 0xFF;

    if(level == 0)
    {
        value &= ~mask;
    }
    else
    {
        value |= mask;
    }

    SetCtrlBitBangedIO(0xAC, value);

#endif    

}
Ejemplo n.º 2
0
/************************************************************************
* Function: void GfxTconSetIO(BYTE mask, BYTE level)                                           
*                                                                       
* Overview: This sets the IO specified by mask to the value set by 
*           level.
*                                                                       
* Input: mask - specifies the IO to be toggles.
*		 level - specifies the logic where the IO will be set.
*                                                                       
* Output: none                                 
*                                                                       
************************************************************************/
void GfxTconSetIO(BYTE mask, BYTE level)
{
  #if defined (GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210) || defined (GFX_USE_DISPLAY_CONTROLLER_DMA)

    switch(mask)
    {
        case BB_CS:    (level == 1 ? TCON_CSHigh() : TCON_CSLow());
                    break;

        case BB_SCL:   (level == 1 ? TCON_CLKHigh() : TCON_CLKLow());
                    break;

        case BB_SDO:   (level == 1 ? TCON_DataHigh() : TCON_DataLow());
                    break;

        case BB_DC:    (level == 1 ? TCON_SetData() : TCON_SetCommand());
                    break;
        default:
                    break;            
    }
    
    Nop();
    
  #elif defined (GFX_USE_DISPLAY_CONTROLLER_SSD1926)

    static BYTE value = 0xFF;

    if(level == 0)
    {
        value &= ~mask;
    }
    else
    {
        value |= mask;
    }

    SetCtrlBitBangedIO(0xAC, value);

#elif defined (GFX_USE_DISPLAY_CONTROLLER_S1D13517)  

    static BYTE temp = 0;

    switch(mask)
    {
        case BB_CS:      
                    temp = GetReg(REG6E_GPO_1);
                    if(level == 1)  temp  |= 0x02;
                    else            temp  &= 0xFD;       
                    SetReg(REG6E_GPO_1,temp);
                    break;

        case BB_SCL:   TCON_SCL_PORT = level;
                    break;

        case BB_SDO:   TCON_SDO_PORT = level;
                    break;

        case BB_DC:    
                    temp = GetReg(REG6E_GPO_1);
                    if(level == 1)  temp  |= 0x04;
                    else            temp  &= 0xFB;       
                    SetReg(REG6E_GPO_1,temp);
                    break;
    }
    
    Nop();

#else

    #error "This TCON_SSD1289 is written for SSD1926, S1D13517 and Microchip Graphics Module driver. If you are not using those drivers you may need to re-write this driver and remove this error message."


#endif    

}