Esempio n. 1
0
// Function to write unsigned char to LCD
void writeChar(unsigned int row, unsigned char outchar)
{
    LCDGoto(0,row);
    sprintf(dispStr,"%02d", outchar);
    LCDPutChar(dispStr[0]);
    LCDPutChar(dispStr[1]);
}
// Configure display controller to write to defined display area
void LCDAddressWindow(const tRectangle *pRect)
{
#ifdef PORTRAIT
	LCDWriteCommand(ILI_HOR_START_AD);
	LCDWriteData(pRect->sXMin);
	LCDWriteCommand(ILI_HOR_END_AD);
	LCDWriteData(pRect->sXMax);
	LCDWriteCommand(ILI_VER_START_AD);
	LCDWriteData(pRect->sYMin);
	LCDWriteCommand(ILI_VER_END_AD);
	LCDWriteData(pRect->sYMax);
#else
	LCDWriteCommand(ILI_HOR_START_AD);
	LCDWriteData(LCD_X - pRect->sYMax);
	LCDWriteCommand(ILI_HOR_END_AD);
	LCDWriteData(LCD_X - pRect->sYMin);
	LCDWriteCommand(ILI_VER_START_AD);
	LCDWriteData(pRect->sXMin);
	LCDWriteCommand(ILI_VER_END_AD);
	LCDWriteData(pRect->sXMax);
#endif

	// Set pointer to first address in that window
	LCDGoto(pRect->sXMin, pRect->sYMin);
}
Esempio n. 3
0
// Function to write a bit value to LCD
void writeBin(unsigned int row, unsigned char outbin)
{
    LCDGoto(0,row);
    if (outbin==1)
        LCDWriteStr("1");
    else
        LCDWriteStr("0");
}
Esempio n. 4
0
// Function to write analog voltage to LCD using 10-bit to 5V conversion
void writeVolt(unsigned int row, unsigned int volt) {
    LCDGoto(0,row);
    sprintf(dispStr,"%04d",volt*49/10); //Approximate conversion to 0-5V
    LCDPutChar(dispStr[0]);
    LCDPutChar('.');
    LCDPutChar(dispStr[1]);
    LCDPutChar(dispStr[2]);
    LCDPutChar(dispStr[3]);
    LCDPutChar('V');
}
// Clear display
void LCDClear(void)
{
	LCDGoto(0, 0);
	int i = 0;
	while(i < LCD_WIDTH * LCD_HEIGHT)
	{
		LCDWriteData(0);	// Write black pixel
		i++;
	}
}
Esempio n. 6
0
// Function to write unsigned int to LCD
void writeUInt(unsigned int row, unsigned int Tick)
{
    LCDGoto(0,row);
    sprintf(dispStr,"%06d", Tick);
    LCDPutChar(dispStr[0]);
    LCDPutChar(dispStr[1]);
    LCDPutChar(dispStr[2]);
    LCDPutChar(dispStr[3]);
    LCDPutChar(dispStr[4]);
    LCDPutChar(dispStr[5]);
}
void Adafruit320x240x16_ILI9325PixelDraw(void *pvDisplayData, long lX, long lY, unsigned long ulValue)
{
	// Start talking to LCD
	LCD_CS_ACTIVE

	LCDGoto(lX, lY);
	LCDWriteData(ulValue);

	// Done talking to LCD
	LCD_CS_IDLE
}
Esempio n. 8
0
// Debug function to right States to LCD
void writeStates(unsigned int row, unsigned int ECGState, unsigned int GateState, unsigned int SettState) {
    LCDGoto(0,row);
    if (ECGState==1)
        LCDWriteStr("1");
    else
        LCDWriteStr("0");
    
    if (GateState==1)
        LCDWriteStr("1");
    else
        LCDWriteStr("0");
    
    if (SettState==1)
        LCDWriteStr("1");
    else
        LCDWriteStr("0");
}
void Adafruit320x240x16_ILI9325PixelDrawMultiple(void *pvDisplayData,
												 long lX, long lY, long lX0, long lCount, long lBPP,
												 const unsigned char *pucData,
												 const unsigned char *pucPalette)
{
	// Start talking to LCD
	LCD_CS_ACTIVE

#ifdef LANDSCAPE
	// Configure write direction to horizontal
	LCDWriteCommand(ILI_ENTRY_MOD);
	LCDWriteData(0x1038);
#endif

	LCDGoto(lX,lY);

	unsigned long ulPixel = 0;
	unsigned long ulColor = 0;

    if(lBPP == 1)
    {
    	// 1 bit per pixel in pucData
    	// lX0 is the index of the bit processed within a byte
    	// pucPalette holds the pre-translated 32bit display color
    	while(lCount)
    	{
    		ulPixel = *pucData++;

    		while(lCount && lX0 < 8)	// while there are pixels in this byte
    		{
    			ulColor = ((unsigned long *)pucPalette)[ulPixel & 1];	// retrieve already translated color
    			LCDWriteData(ulColor);

    			lCount--;		// processed another pixel
    			lX0++;			// done with this bit
    			ulPixel >>= 1;	// prepare next bit
    		}

    		lX0 = 0;	// process next byte, reset bit counter
    	}
    }
    else if(lBPP == 4)