/* With ARM and GHS toolsets, the entry point is main() - this will allow the linker to generate wrapper code to setup stacks, allocate heap area, and initialize and copy code and data segments. For GNU toolsets, the entry point is through __start() in the crt0_gnu.asm file, and that startup code will setup stacks and data */ int main(void) { System_Init(); // Initialize System GLCD_Clear(White); GLCD_Circle (80,80,30,YES,Blue,Green); // Draw Green Circle with Blue boundary while(1); return 1; }
void main (void) { CMCON |= 7; ADCON1=0x0F; GLCD_Initialize(); GLCD_ClearScreen(); while(1) { GLCD_WriteString("ETIQ TECHNOLOGIES"); Delay_s(2); GLCD_Circle(64, 32, 28); Delay_s(2); GLCD_ClearScreen(); GLCD_Rectangle(30, 12, 70,40); Delay_s(2); GLCD_ClearScreen(); } }
int main(void) { BL_OUTPUT; // DS_OUTPUT; BL_ON; GLCD_Initalize(); // Initalize LCD GLCD_ClearText(); // Clear text area GLCD_ClearCG(); // Clear character generator area GLCD_ClearGraphic(); // Clear graphic area GLCD_TextGoTo(0,0);// set text coordinates GLCD_WriteString("Hello"); // write text GLCD_Circle(32,32,20); // draw circle GLCD_Rectangle(8,8,24, 48); // draw rectangle // GLCD_FillRectangle(0, 0, 96, 8); USART_Init(MYUBRR); USART_Transmit_string("Hi\n"); LED_OUTPUT; BLINK3; GLCD_ClearText(); GLCD_TextGoTo(0,0);// set text coordinates ADCSRA = 0b10000111; data_flag=0; sei(); uint16_t T = 0; uint8_t i; while(1) { if (data_flag == 1) { //BLINK00; // Heh nasty error when it is here, if 'g' followed by newline comes, because it rewrites data here :D if (data == 't') { T = DS_get(6); GLCD_TextGoTo(0,0); i = (uint8_t)(T>>8); USART_Transmit_num(i); GLCD_WriteChar(i/10 + '0'); GLCD_WriteChar(i%10 + '0'); USART_Transmit('.'); GLCD_WriteChar('.'); i = (uint8_t)(T); USART_Transmit_num(i); GLCD_WriteChar(i/10 + '0'); GLCD_WriteChar(i%10 + '0'); USART_Transmit('C'); GLCD_WriteChar('C'); USART_Transmit('\n'); } if (data == 'g') { ADMUX = 0x00; sbi(ADCSRA, ADSC); while (qbi(ADCSRA, ADSC)) ; uint16_t val = ADC; GLCD_TextGoTo(0,0); } data_flag=0; } }
/** @addtogroup GLCD_CAL_Public_Functions * @{ */ void TSC2004_Cal_Init(MATRIX_Type *matrixPtr) { int n; COLORCFG_Type ClrCfg; MATRIX_Type matrix[4],avgmatrix; ts_event RTouch; ts_eventCal screenSample[5]; ts_eventCal displaySample[5] = { { 20, 20 }, { 300, 20 }, { 300, 220 }, { 20, 220 }, { 160, 120 }, }; ts_eventCal displaytriangle1[3] = {displaySample[0],displaySample[4],displaySample[1]}; ts_eventCal displaytriangle2[3] = {displaySample[1],displaySample[4],displaySample[2]}; ts_eventCal displaytriangle3[3] = {displaySample[2],displaySample[4],displaySample[3]}; ts_eventCal displaytriangle4[3] = {displaySample[3],displaySample[4],displaySample[0]}; GLCD_Clear(White); for(n=0; n<5; n++) { switch (n) { case 0: ClrCfg.bcolor = Red; ClrCfg.bndry = FALSE; ClrCfg.fill = TRUE; ClrCfg.fill_color = Red; GLCD_Circle(20,20,3,&ClrCfg); break; case 1: ClrCfg.bcolor = Red; ClrCfg.bndry = FALSE; ClrCfg.fill = TRUE; ClrCfg.fill_color = Red; GLCD_Circle(300,20,3,&ClrCfg); break; case 2: ClrCfg.bcolor = Red; ClrCfg.bndry = FALSE; ClrCfg.fill = TRUE; ClrCfg.fill_color = Red; GLCD_Circle(300,220,3,&ClrCfg); break; case 3: ClrCfg.bcolor = Red; ClrCfg.bndry = FALSE; ClrCfg.fill = TRUE; ClrCfg.fill_color = Red; GLCD_Circle(20,220,3,&ClrCfg); break; case 4: ClrCfg.bcolor = Red; ClrCfg.bndry = FALSE; ClrCfg.fill = TRUE; ClrCfg.fill_color = Red; GLCD_Circle(160,120,3,&ClrCfg); break; default: break; } //printf(LPC_UART0, "Touch point\n\r"); while(TReady == FALSE); // printf(LPC_UART0,"\x1b[8;1After While\n\r"); delay_ms(2000); screenSample[n].x = gTouch.x; screenSample[n].y = gTouch.y; // printf(LPC_UART0,"\x1b[3;1H gTouchx = %d08",gTouch.x); // printf(LPC_UART0,"\x1b[4;1H gTouchy = %d08",gTouch.y); TReady = FALSE; } CalTouch=FALSE; // printf(LPC_UART0,"line reached"); ts_eventCal screentriangle1[3] = {screenSample[0],screenSample[4],screenSample[1]}; ts_eventCal screentriangle2[3] = {screenSample[1],screenSample[4],screenSample[2]}; ts_eventCal screentriangle3[3] = {screenSample[2],screenSample[4],screenSample[3]}; ts_eventCal screentriangle4[3] = {screenSample[3],screenSample[4],screenSample[0]}; SetCalibrationMatrix(displaytriangle1, screentriangle1, &matrix[0]); SetCalibrationMatrix(displaytriangle2, screentriangle2, &matrix[1]); SetCalibrationMatrix(displaytriangle3, screentriangle3, &matrix[2]); SetCalibrationMatrix(displaytriangle4, screentriangle4, &matrix[3]); matrixPtr->An = ( matrix[0].An + matrix[1].An + matrix[2].An + matrix[3].An ) / 4; matrixPtr->Bn = ( matrix[0].Bn + matrix[1].Bn + matrix[2].Bn + matrix[3].Bn ) / 4; matrixPtr->Cn = ( matrix[0].Cn + matrix[1].Cn + matrix[2].Cn + matrix[3].Cn ) / 4; matrixPtr->Dn = ( matrix[0].Dn + matrix[1].Dn + matrix[2].Dn + matrix[3].Dn ) / 4; matrixPtr->En = ( matrix[0].En + matrix[1].En + matrix[2].En + matrix[3].En ) / 4; matrixPtr->Fn = ( matrix[0].Fn + matrix[1].Fn + matrix[2].Fn + matrix[3].Fn ) / 4; matrixPtr->Divider = ( matrix[0].Divider + matrix[1].Divider + matrix[2].Divider + matrix[3].Divider ) / 4; GLCD_Clear(White); }