This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TFT Library...

Other Parts Discussed in Thread: TMS320F28335

Hi,

I am using a TMS320F28335 which is controlling a TFT LCD screen through the SSD1961. But I have a probleme to find a library or just a function which can put a text or a char on the scrren...In fact To draw a circle, a rectangle and other things it would be good but I have  found a function on arduino I can't find on TI DSP lib and I wanted to know if there is an equivalent or an idea to do the same things as this function but in C...

#define pgm_read_byte(address_short) pgm_read_byte_near(address_short) 
#define pgm_read_byte_near(address_short) __LPM((uint16_t)(address_short))
#define __LPM(addr) __LPM_enhanced__(addr)
#define
__LPM_enhanced__(addr) \ (
__extension__({ \
 
uint16_t __addr16 = (uint16_t)(addr); \
 
uint8_t __result; \
 __asm__ \
 
( \
 
"lpm %0, Z" "\n\t" \
 
: "=r" (__result) \
 
: "z" (__addr16) \
 
); \
 __result
; \
 
}))
void ITDB02::printChar(byte c, int x, int y)
{
	byte i,j,ch;
	word temp; 

	*P_CS &= ~B_CS;
  
	if (orient==PORTRAIT)
	{
		setXY(x,y,x+cfont.x_size-1,y+cfont.y_size-1);
	  
		temp=((c-cfont.offset)*((cfont.x_size/8)*cfont.y_size))+4;
		for(j=0;j<((cfont.x_size/8)*cfont.y_size);j++)
		{
			ch=pgm_read_byte(&cfont.font[temp]);
			for(i=0;i<8;i++)
			{   
				if((ch&(1<<(7-i)))!=0)   
				{
					setPixel(fcolorr, fcolorg, fcolorb);
				} 
				else
				{
					setPixel(bcolorr, bcolorg, bcolorb);
				}   
			}
			temp++;
		}
	}
	else
	{
		temp=((c-cfont.offset)*((cfont.x_size/8)*cfont.y_size))+4;

		for(j=0;j<((cfont.x_size/8)*cfont.y_size);j+=(cfont.x_size/8))
		{
			setXY(x,y+(j/(cfont.x_size/8)),x+cfont.x_size-1,y+(j/(cfont.x_size/8)));
			for (int zz=(cfont.x_size/8)-1; zz>=0; zz--)
			{
				ch=pgm_read_byte(&cfont.font[temp+zz]);
				for(i=0;i<8;i++)
				{   
					if((ch&(1<<i))!=0)   
					{
						setPixel(fcolorr, fcolorg, fcolorb); 
					} 
					else
					{
						setPixel(bcolorr, bcolorg, bcolorb);
					}   
				}
			}
			temp+=(cfont.x_size/8);
		}
	}
	*P_CS |= B_CS;
}

It is from (http://henningkarlsen.com/electronics/library.php?id=52) and utft library. I think it would be possible to reprogram this but I have a problem with pgm_read_byte function which I don't understand...If someone have already worked with a TMS and a TFT and if He has any idea...Thank you very much